import type { NdmDeviceAlarmLogResultVO } from '@/apis/model';
import { DEVICE_TYPE_LITERALS } from '@/enums';
import type { Station } from './station';

export interface StationAlarms {
  [DEVICE_TYPE_LITERALS.ndmAlarmHost]: NdmDeviceAlarmLogResultVO[];
  [DEVICE_TYPE_LITERALS.ndmCamera]: NdmDeviceAlarmLogResultVO[];
  [DEVICE_TYPE_LITERALS.ndmDecoder]: NdmDeviceAlarmLogResultVO[];
  [DEVICE_TYPE_LITERALS.ndmKeyboard]: NdmDeviceAlarmLogResultVO[];
  [DEVICE_TYPE_LITERALS.ndmMediaServer]: NdmDeviceAlarmLogResultVO[];
  [DEVICE_TYPE_LITERALS.ndmNvr]: NdmDeviceAlarmLogResultVO[];
  [DEVICE_TYPE_LITERALS.ndmSecurityBox]: NdmDeviceAlarmLogResultVO[];
  [DEVICE_TYPE_LITERALS.ndmSwitch]: NdmDeviceAlarmLogResultVO[];
  [DEVICE_TYPE_LITERALS.ndmVideoServer]: NdmDeviceAlarmLogResultVO[];
  unclassified: NdmDeviceAlarmLogResultVO[];
}

export interface LineAlarms {
  [stationCode: Station['code']]: StationAlarms;
}

export const initStationAlarms = (): StationAlarms => {
  return {
    [DEVICE_TYPE_LITERALS.ndmAlarmHost]: [],
    [DEVICE_TYPE_LITERALS.ndmCamera]: [],
    [DEVICE_TYPE_LITERALS.ndmDecoder]: [],
    [DEVICE_TYPE_LITERALS.ndmKeyboard]: [],
    [DEVICE_TYPE_LITERALS.ndmMediaServer]: [],
    [DEVICE_TYPE_LITERALS.ndmNvr]: [],
    [DEVICE_TYPE_LITERALS.ndmSecurityBox]: [],
    [DEVICE_TYPE_LITERALS.ndmSwitch]: [],
    [DEVICE_TYPE_LITERALS.ndmVideoServer]: [],
    unclassified: [],
  };
};
