import { IncidentFilterKind, ShareIncidentRuleKind, } from "../constants"; export interface CADPersonSchemaType { PersonnelID: string, PersonnelName: string, PersonnelRank: string, PersonnelWorkCode: string, PersonnelNote: string, } // Data possibly sent by CAD, // using same Capitalization export interface CallerType { CallerId: string, Latitude: number, Longitude: number, Altitude: number, // meters Application: string, Source: string, LocationUpdatedAt: Date, // UTC Address: string, UncertaintyRadius: number, // meters } export interface RadioChannelSchemaType extends Record { name: string, channel: string, url: string, channelDescription: string, tone: string, } export interface RecordSchemaType { name: string, value: string, } export interface ReportNumberSchemaType { name: string, number: string, } export interface ShareReasonSchemaType { name: string, date: Date, ruleType: ShareIncidentRuleKind, // assignedUnit, incidentType, always, code // History of what was processed when sharing kNegative: ShareIncidentRuleKind[], kPositive: ShareIncidentRuleKind[], } export interface SharedToSchemaType extends Record { departmentId: string, userId: string, name: string, startAt: Date, expireAt: Date, active: boolean, // Set to false when disabled by user reasons: ShareReasonSchemaType[], sendNotification: boolean, // Propagated from the rule, to be used with .active and .expired } export interface SharedSourceSchemaType extends Record { name: string, isExternal: boolean, startAt?: Date, expireAt?: Date, reasons: ShareReasonSchemaType[] } // Slightly different from incident/managed incident. For each instance of this, updatedAt would be changed // when a change in the corresponding incident.sharedTo is made. When sync-querying for share events, // use (modified > now or updatedAt.departmentId > now). // This is to avoid updating event.modified on share state change, // which would trigger sending all the items to all the clients again export interface SharedToEventSchemaType extends Record { departmentId: string, userId: string, expireAt: Date, updatedAt: Date, active: boolean, } // export type IncidentFilterKindA = // IncidentFilterKind.AreaCalOES | // IncidentFilterKind.AreaUnit | // IncidentFilterKind.County | // IncidentFilterKind.AgencyId | // IncidentFilterKind.City | // IncidentFilterKind.RadioName; // export type IncidentFilterKindB = IncidentFilterKind.ShowNoUnits; // On each incident update, update any pre-labelled filters // This should be split in allow string[] for most options // and allow boolean only for IncidentFilterKind.ShowNoUnits; // Using a union type here (|) creates problems when using this type in code // Property 'length' does not exist on type 'boolean'. export type IncidentFilterLabelType = { [key in IncidentFilterKind]: unknown[] };