All files / types/backend department.ts

100% Statements 84/84
100% Branches 0/0
100% Functions 0/0
100% Lines 84/84

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113        1x 1x 1x 1x 1x 1x               1x                 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x   1x                 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x  
import {
  PagingTalkgroup, UserDepartment
} from '@/types/api/users';
 
export const validPhoneNumberAccounts = [
  'Baca',
  'NSCAD',
  'Crestone',
  'Saguache',
] as const;
export type PhoneNumberAccount = typeof validPhoneNumberAccounts[number];
 
export type TwilioAccounts = '' | PhoneNumberAccount;
export type TwilioNumberTypes = 'page' | 'alert' | 'chat';
 
export type PhoneNumberTypes = `${TwilioNumberTypes}${TwilioAccounts}`;
 
export const departmentConfig: {
  [key in UserDepartment]: {
    name: string;
    shortName: string;
    defaultTalkgroups: PagingTalkgroup[];
    type: 'text' | 'page';
    pagePhone: PhoneNumberTypes;
    textPhone?: PhoneNumberTypes;
  };
} = {
  Crestone: {
    name: 'Crestone Volunteer Fire Department',
    shortName: 'Crestone',
    type: 'text',
    defaultTalkgroups: [ 8332, ],
    pagePhone: 'page',
    textPhone: 'chatCrestone',
  },
  Baca: {
    name: 'Baca Emergency Services',
    shortName: 'Baca',
    type: 'page',
    defaultTalkgroups: [ 18331, ],
    pagePhone: 'pageBaca',
  },
  NSCAD: {
    name: 'NSCAD',
    shortName: 'NSCAD',
    type: 'text',
    defaultTalkgroups: [ 8198, ],
    pagePhone: 'page',
    textPhone: 'chatNSCAD',
  },
  PageOnly: {
    name: 'Page Only',
    shortName: 'Page Only',
    type: 'page',
    pagePhone: 'page',
    defaultTalkgroups: [],
  },
  Saguache: {
    name: 'Saguache Fire Department',
    shortName: 'Saguache',
    type: 'page',
    pagePhone: 'page',
    defaultTalkgroups: [ 8332, ],
  },
};
 
export const pagingTalkgroupConfig: {
  [key in PagingTalkgroup]: {
    linkPreset: string;
    partyBeingPaged: string;
 
    // Used to determine callsigns for on-call persons
    aladtecDepartment?: string[];
    department?: UserDepartment;
  };
} = {
  8198: {
    linkPreset: 'pNSCAD',
    partyBeingPaged: 'NSCAD',
    aladtecDepartment: [ 'NSCAD', ],
    department: 'NSCAD',
  },
  8332: {
    linkPreset: 'pNSCFPD',
    partyBeingPaged: 'NSCFPD',
  },
  18332: {
    linkPreset: 'pNSCFPD',
    partyBeingPaged: 'NSCFPD VHF',
  },
  18331: {
    linkPreset: 'pBGFD%2FBGEMS',
    partyBeingPaged: 'BGES',
    aladtecDepartment: [
      'Baca Fire',
      'Baca Grande-Crestone Ambulance',
    ],
    department: 'Baca',
  },
  8334: {
    linkPreset: 'tg8334',
    partyBeingPaged: 'Center EMS/Fire',
  },
  8281: {
    linkPreset: 'tg8281',
    partyBeingPaged: 'Mineral EMS/Fire',
  },
  8181: {
    linkPreset: 'pACFE',
    partyBeingPaged: 'Alamosa EMS',
  },
};