tabletcommand-backend-models 5.17.27 → 5.17.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/.eslintrc.js +1 -3
  2. package/build/models/arcgis-group.js +0 -5
  3. package/build/models/arcgis-group.js.map +1 -1
  4. package/build/models/department.js +4 -0
  5. package/build/models/department.js.map +1 -1
  6. package/build/models/esri.js +3 -3
  7. package/build/models/esri.js.map +1 -1
  8. package/build/models/location.js +6 -1
  9. package/build/models/location.js.map +1 -1
  10. package/build/test/arcgis-group.js +95 -0
  11. package/build/test/arcgis-group.js.map +1 -0
  12. package/build/test/config.js +12 -0
  13. package/build/test/config.js.map +1 -0
  14. package/build/test/mock.js +974 -0
  15. package/build/test/mock.js.map +1 -0
  16. package/build.sh +3 -0
  17. package/definitions/models/arcgis-group.d.ts +0 -46
  18. package/definitions/models/arcgis-group.d.ts.map +1 -1
  19. package/definitions/models/department.d.ts +1 -0
  20. package/definitions/models/department.d.ts.map +1 -1
  21. package/definitions/models/esri.d.ts +4 -4
  22. package/definitions/models/location.d.ts.map +1 -1
  23. package/definitions/test/arcgis-group.d.ts +2 -0
  24. package/definitions/test/arcgis-group.d.ts.map +1 -0
  25. package/definitions/test/config.d.ts +3 -0
  26. package/definitions/test/config.d.ts.map +1 -0
  27. package/definitions/test/mock.d.ts +39 -0
  28. package/definitions/test/mock.d.ts.map +1 -0
  29. package/package.json +17 -8
  30. package/src/models/arcgis-group.ts +0 -5
  31. package/src/models/department.ts +4 -0
  32. package/src/models/esri.ts +3 -3
  33. package/src/models/location.ts +10 -4
  34. package/src/test/arcgis-group.ts +107 -0
  35. package/src/test/config.ts +10 -0
  36. package/src/test/mock.ts +982 -0
  37. package/src/tsconfig.json +5 -0
  38. package/test/arcgis-group.js +2 -2
  39. package/test/mock.js +1 -1
@@ -0,0 +1,974 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const config_1 = require("./config");
4
+ (0, config_1.checkIfTestDatabase)();
5
+ function MockModule(dependecies) {
6
+ async function cleanup() {
7
+ return "";
8
+ }
9
+ const arcGISGroup = {
10
+ access: "private",
11
+ linkedDepartments: [
12
+ {
13
+ department: "Demo RTS Fire Department",
14
+ departmentId: "558365a198b2fa4278000053",
15
+ authUsername: "tabletcmd",
16
+ authError: null,
17
+ tokenUsername: "tc_ContraCostaCountyFire",
18
+ tokenError: null,
19
+ users: [
20
+ //
21
+ {
22
+ username: "tc_someone",
23
+ email: "hello@tc.com",
24
+ userId: "558365a198a2aa42780000aa",
25
+ }
26
+ ]
27
+ }
28
+ ],
29
+ externalOrgIds: [
30
+ "MyTOuXKXZoizaaa"
31
+ ],
32
+ groupId: "c5d013e197244577a583c49984d319d9",
33
+ outsiders: [
34
+ {
35
+ fullName: "Michael Kallum",
36
+ memberType: "member",
37
+ orgId: "MyTOuXKXZoizaaa",
38
+ username: "Michael_Kallum"
39
+ }
40
+ ],
41
+ owner: "jane_tabletcommand",
42
+ protected: true,
43
+ title: "TC - City of Fire Department",
44
+ users: [
45
+ {
46
+ fullName: "Jane Serrano",
47
+ memberType: "admin",
48
+ orgId: "zGXMcUaDlMGoAAAg",
49
+ username: "jane_tabletcommand"
50
+ },
51
+ ]
52
+ };
53
+ return {
54
+ cleanup,
55
+ arcGISGroup,
56
+ };
57
+ }
58
+ exports.default = MockModule;
59
+ /*
60
+ module.exports = function(dependencies) {
61
+ "use strict";
62
+
63
+ const {
64
+ models,
65
+ mongoose
66
+ } = dependencies;
67
+
68
+ const actionLog = {
69
+ departmentId: "d1234",
70
+ email: "hello@example.com",
71
+ action: "someAction",
72
+ userId: "1234",
73
+ object: {
74
+ vehicleId: "v1171",
75
+ radioName: "E10"
76
+ },
77
+ before: {
78
+ test: "test1"
79
+ },
80
+ after: {
81
+ test: "test2"
82
+ },
83
+ delta: {
84
+ test: "test2"
85
+ }
86
+ };
87
+
88
+ const agency = {
89
+ _id: mongoose.Types.ObjectId(),
90
+ departmentId: new mongoose.Types.ObjectId("56131f724143487a10000001"),
91
+ code: "TC",
92
+ name: "Tablet Command",
93
+ active: true,
94
+ administrators: [
95
+ new mongoose.Types.ObjectId()
96
+ ],
97
+ personnelIntegration: true,
98
+ personnelMonitorHours: 24,
99
+ crossStaffing: [
100
+ {
101
+ radioName: "E1",
102
+ crossStaffedUnits: ["E2", "E3"],
103
+ alwaysCrossStaff: true
104
+ }
105
+ ]
106
+ };
107
+
108
+ const arcGISGroup = {
109
+ access: "private",
110
+ linkedDepartments: [
111
+ {
112
+ department: "Demo RTS Fire Department",
113
+ departmentId: "558365a198b2fa4278000053",
114
+ authUsername: "tabletcmd",
115
+ authError: null,
116
+ tokenUsername: "tc_ContraCostaCountyFire",
117
+ tokenError: null,
118
+ users: [
119
+ //
120
+ {
121
+ username: "tc_someone",
122
+ email: "hello@tc.com",
123
+ userId: "558365a198a2aa42780000aa",
124
+ }
125
+ ]
126
+ }
127
+ ],
128
+ externalOrgIds: [
129
+ "MyTOuXKXZoizaaa"
130
+ ],
131
+ groupId: "c5d013e197244577a583c49984d319d9",
132
+ outsiders: [
133
+ {
134
+ fullName: "Michael Kallum",
135
+ memberType: "member",
136
+ orgId: "MyTOuXKXZoizaaa",
137
+ username: "Michael_Kallum"
138
+ }
139
+ ],
140
+ owner: "jane_tabletcommand",
141
+ protected: true,
142
+ title: "TC - City of Fire Department",
143
+ users: [
144
+ {
145
+ fullName: "Jane Serrano",
146
+ memberType: "admin",
147
+ orgId: "zGXMcUaDlMGoAAAg",
148
+ username: "jane_tabletcommand"
149
+ },
150
+ ]
151
+ };
152
+
153
+ const assignment = {
154
+ position: 1,
155
+ active: true,
156
+ name: "Vertical Test",
157
+ userId: "1234",
158
+ departmentId: "4321",
159
+ description: "testing",
160
+ isMandatory: false,
161
+ };
162
+
163
+ const battalionUnit = {
164
+ name: "BattalionUnit Test",
165
+ friendly_id: "B1",
166
+ local_id: 321,
167
+ personnel: 4,
168
+ position: 1,
169
+ active: true,
170
+ isMandatory: false,
171
+ departmentId: "123",
172
+ userId: "123",
173
+ api_battalion_id: "123",
174
+ battalion_uuid: "",
175
+ battalion_name: "",
176
+ };
177
+
178
+ const battalion = {
179
+ name: "Battalion Test",
180
+ active: true,
181
+ isMandatory: false,
182
+ userId: "123",
183
+ departmentId: 123,
184
+ AgencyId: new mongoose.Types.ObjectId(agency._id),
185
+ position: 1,
186
+ units: [battalionUnit]
187
+ };
188
+
189
+ const checklistId = mongoose.Types.ObjectId();
190
+ const checklistUUID = "150cf1ca-ffbb-42c9-bd4c-fd64be45d888";
191
+
192
+ const checklistItem = {
193
+ _id: mongoose.Types.ObjectId(),
194
+ uuid: "150cf1ca-ffbb-42c9-bd4c-fd64be45d887",
195
+ checklist_uuid: checklistUUID,
196
+ position: 1,
197
+ active: true,
198
+ name: "TC Test Item",
199
+ checked: 0,
200
+ api_checklist_id: checklistId,
201
+ userId: "1234",
202
+ departmentId: "4321",
203
+ local_id: 1,
204
+ isMandatory: true,
205
+ agencyId: new mongoose.Types.ObjectId(agency._id),
206
+ description: "Testing Description"
207
+ };
208
+
209
+ const checklist = {
210
+ _id: checklistId,
211
+ uuid: checklistUUID,
212
+ position: 1,
213
+ active: true,
214
+ name: "TC Test",
215
+ userId: "1234",
216
+ departmentId: "4321",
217
+ local_id: 1,
218
+ isMandatory: true,
219
+ agencyId: new mongoose.Types.ObjectId(agency._id),
220
+ items: [checklistItem]
221
+ };
222
+
223
+ const mailLog = {
224
+ mailId: "1234",
225
+ event: "delivery",
226
+ timestamp: 1553199671,
227
+ recipient: "test@tabletcommand.com",
228
+ recipientDomain: "tabletcommand.com",
229
+ tags: ["create account"],
230
+ deliveryStatus: {},
231
+ message: {},
232
+ flags: {},
233
+ envelope: {},
234
+ logLevel: "info",
235
+ reason: "Message Sent",
236
+ severity: "Mild"
237
+ };
238
+
239
+ const message = {
240
+ departmentId: "d1234",
241
+ "active" : false,
242
+ "title" : "Upgrade App",
243
+ "body" : "Application out of date.",
244
+ "actionTitle" : "Upgrade App",
245
+ "color" : null,
246
+ "url" : "",
247
+ "priority" : 4,
248
+ "type" : {
249
+ "type" : "upgradeApp",
250
+ "typeOpts" : {
251
+ "major" : 3,
252
+ "minor" : 0,
253
+ "patch" : 1
254
+ }
255
+ },
256
+ "created" : new Date().toISOString(),
257
+ "uuid" : "138acffd-a94f-402d-87b3-ff6ed31a19dc",
258
+ "requestId" : "138acffd-a94f-402d-87b3-ff6ed31a19db",
259
+ };
260
+
261
+ const cadIncident = {
262
+ _id: mongoose.Types.ObjectId(),
263
+ uuid: "150cf1ca-ffbb-42c9-bd4c-fd64be45d679",
264
+ departmentId: "56131f724143487a10000001",
265
+ AgencyID: "BDC",
266
+ IncidentNumber: "19-058314",
267
+ TransactionID: "15532010710000",
268
+ AgencyIncidentCallTypeDescription: "AT - Ambulance Transport",
269
+ StreetName: "College",
270
+ StreetSuffix: "Court",
271
+ Predirectional: "North",
272
+ Postdirectional: "Late",
273
+ CityOrLocality: "San Francisco",
274
+ Floor: "2",
275
+ Suite: "AA",
276
+ City: "San Francisco",
277
+ Building: "E",
278
+ StateOrProvince: "CA",
279
+ CommonPlaceName: "VALLEY VIEW MEDICAL CENTER",
280
+ LocationComment: "VALLEY VIEW MEDICAL CENTER",
281
+ CrossStreet1: "FIVE MILE RD",
282
+ CrossStreet2: "No X-Street",
283
+ cross_streets: "FIVE MILE RD/No X-Street",
284
+ PostalCode: "29191",
285
+ CallerNumber: "0192-122-299",
286
+ PriorIncidentChanged: true,
287
+ PriorIncident: [
288
+ //
289
+ {
290
+ IncidentNumber: "19-042678",
291
+ IncidentDateTime: "2019-03-01T01:56:54-08:00",
292
+ Problem: "Problem Abcd",
293
+ Address: "5330 Us 95 Hwy S",
294
+ Suite: "83",
295
+ Jurisdiction: "San Bernardino County",
296
+ Comment: [
297
+ //
298
+ {
299
+ Comment: "[1] Call Appended to Incident number 19-042593",
300
+ CommentSource: "G8724",
301
+ CommentDateTime: "2019-03-01T01:59:57-08:00"
302
+ }
303
+ ]
304
+ }
305
+ ],
306
+ Latitude: "34.788611",
307
+ Longitude: "-114.549444",
308
+ Comment: [
309
+ //
310
+ {
311
+ Comment: "(1) VALLEY VIEW ICU TO SUNRISE ICU",
312
+ CommentSource: "H6577",
313
+ CommentDateTime: "2019-03-21T13:21:08-07:00"
314
+ }
315
+ ],
316
+ units: [
317
+ //
318
+ {
319
+ UnitDispatchNumber: 4067677,
320
+ UnitID: "MA31",
321
+ TimeDispatched: "2019-03-21T13:21:22-07:00"
322
+ }
323
+ ],
324
+ preference_location: "address",
325
+ EntryDateTime: "2019-03-21T13:21:11-07:00",
326
+ ClosedDateTime: "",
327
+ closed_unix_date: 0,
328
+ start_unix_date: 1553199671,
329
+ modified_unix_date: 1553201071.636
330
+ };
331
+
332
+ const cadStatus = {
333
+ _id: mongoose.Types.ObjectId(),
334
+ code: "AV",
335
+ codeDisplay: "RS",
336
+ color: {
337
+ background: "#7b7d7d",
338
+ text: "#F8F9F9"
339
+ },
340
+ departmentId: "51a2529293e11b3569000057",
341
+ modifiedDate: 1544771122.997,
342
+ name: "In Service",
343
+ normalized: "inService",
344
+ options: [
345
+ //
346
+ {
347
+ cadKey: "oosCode",
348
+ cadValues: [
349
+ //
350
+ {
351
+ favorite: false,
352
+ name: "ADM - Admin",
353
+ position: 20,
354
+ type: "string",
355
+ value: "ADM",
356
+ visible: true
357
+ }
358
+ ],
359
+ name: "oosCode",
360
+ position: 2,
361
+ visible: true
362
+ }
363
+ ],
364
+ roaming: false,
365
+ selfAssignable: true,
366
+ status: "OR",
367
+ statusId: 1,
368
+ uuid: "8086956b-43af-4300-aa30-5efbd10b2c98"
369
+ };
370
+
371
+ const cadStatusMap = {
372
+ "departmentId": "51a2529293e11b3569000057",
373
+ "fromStatusId": 0,
374
+ "modifiedDate": 1544143059.729,
375
+ "toStatusIds": [
376
+ //
377
+ {
378
+ "statusId": 1,
379
+ "userEnabled": true
380
+ }
381
+ ]
382
+ };
383
+
384
+ const cadVehicle = {
385
+ _id: mongoose.Types.ObjectId(),
386
+ uuid: "30f8d7c7-20a3-4a12-b911-a424f5037003",
387
+ radioName: "T01",
388
+ vehicleId: "7705",
389
+ modifiedDate: 1541569088.909,
390
+ departmentId: "5195426cc4e016a988000965",
391
+ station: {
392
+ code: "S01",
393
+ name: "Station 01"
394
+ },
395
+ capability: ""
396
+ };
397
+
398
+ const cadVehicleStatus = {
399
+ uuid: "5a324923-2622-48f2-abaa-8a855e7cebdf",
400
+ departmentId: "d1234",
401
+ vehicleId: "v1171",
402
+ radioName: "E10",
403
+ requestTime: 1516557000,
404
+ responseTime: 1516567096,
405
+ status: "Dispatched",
406
+ statusCode: "DISP",
407
+ modifiedDate: 1516577096,
408
+ requestStatus: 0,
409
+ incidentNumber: "INC19991",
410
+ capability: "",
411
+ owner: "user",
412
+ ownerId: "M1"
413
+ };
414
+
415
+ const cadVehicleStatusHistory = {
416
+ departmentId: "d1234",
417
+ vehicleId: "v1171",
418
+ radioName: "E10",
419
+ status: "Dispatched",
420
+ statusCode: "DISP",
421
+ requestedAt: 1516557000,
422
+ requestedBy: "user",
423
+ modifiedDate: 1516577096,
424
+ incidentNumber: "INC19991"
425
+ };
426
+
427
+ const department = {
428
+ _id: mongoose.Types.ObjectId(),
429
+ department: "Test Department",
430
+ city: "San Francisco",
431
+ active: true,
432
+ apikey: "abcd",
433
+ partialApiKey: "ab",
434
+ personnelStaffingEnabled: true,
435
+ rtsEnabled: true,
436
+ rtsChannelPrefix: "CH_TEST",
437
+ pubNubV3: {
438
+ token: "CH_AUTH_TOKEN",
439
+ expireAt: "2021-09-10T23:25:02.196Z",
440
+ runAt: "2021-09-10T08:25:02.196Z",
441
+ },
442
+ agencyIds: [
443
+ new mongoose.Types.ObjectId(agency._id)
444
+ ],
445
+ signupKey: "A1B2",
446
+ incidentTypes: [{
447
+ name: "Type",
448
+ value: "type"
449
+ }],
450
+ shareLocationPhones: false,
451
+ shareLocationTablets: true,
452
+ cadOneWayVehiclesEnabled: false,
453
+ mowsEnabled: true,
454
+ shareAVL: {
455
+ enabled: true,
456
+ opAreaCode: "DAL",
457
+ opAreaName: "Delta Operations"
458
+ },
459
+ accountType: "production",
460
+ timeZone: "America/Los_Angeles",
461
+ firstArrivingEnabled: true,
462
+ simpleSenseEnabled: true,
463
+ licensing: {
464
+ tcPro2Way: 0,
465
+ tcPro1Way: 0,
466
+ tcMobile: 0,
467
+ tcWeb: 0,
468
+ fireMapperPro: 0,
469
+ sendToCAD: 0
470
+ },
471
+ webDisclaimer: {
472
+ message: "test",
473
+ enabled: true
474
+ },
475
+ notificationEmails: ["test@test.com"],
476
+ externalNotificationsEnabled: true
477
+ };
478
+
479
+ const esriMap = {
480
+ mapLayers: [
481
+ //
482
+ {
483
+ "url": "https://services.arcgis.com/aA3snZwJfFkVyDuP/arcgis/rest/services/XBO_Branches_Updated/FeatureServer/0",
484
+ "itemId": "XBO_Branches_Updated_3067",
485
+ "layerType": "ArcGISFeatureLayer",
486
+ "title": "XBO Branches_Updated"
487
+ },
488
+ {
489
+ "itemId": "city_limits_092019_4185",
490
+ "layerType": "ArcGISFeatureLayer",
491
+ "title": "City Limits",
492
+ "url": "https://services.arcgis.com/aA3snZwJfFkVyDuP/arcgis/rest/services/city_limits_092019/FeatureServer/0"
493
+ },
494
+ {
495
+ "itemId": "unvdpdod57lext9eck9nxipcov2dgjqs_8576",
496
+ "layerType": "ArcGISFeatureLayer",
497
+ "title": "Tablet Command",
498
+ "url": "https://api.tabletcommand.com/esri/tc-file/unvdpdod57lext9eck9nxipcov2dgjqs/FeatureServer/0"
499
+ }
500
+ ],
501
+ "owner": "john_tabletcommand",
502
+ "title": "Location (MM Filters)",
503
+ "url": null,
504
+ "access": "shared",
505
+ "baseMap": {
506
+ "baseMapLayers": [
507
+ //
508
+ {
509
+ "opacity": 1,
510
+ "id": "VectorTile_1188",
511
+ "type": "VectorTileLayer",
512
+ "layerType": "VectorTileLayer",
513
+ "title": "World Street Map (Night)",
514
+ "styleUrl": "https://cdn.arcgis.com/sharing/rest/content/items/86f556a2d1fd468181855a35e344567f/resources/styles/root.json",
515
+ "visibility": true
516
+ }
517
+ ],
518
+ "title": "Streets (Night)"
519
+ },
520
+ "itemId": "01cebf7aede94ed3a9f4c260e18a7d7e",
521
+ "type": "Web Map",
522
+ "tags": [
523
+ "XBO",
524
+ "Tabletcommand"
525
+ ],
526
+ "development": true,
527
+ };
528
+
529
+ const deviceMapping = {
530
+ _id: mongoose.Types.ObjectId(),
531
+ nick: "Test",
532
+ departmentId: "d123",
533
+ deviceType: "hello",
534
+ mapId: "map123",
535
+ deviceId: "deviceType121",
536
+ modified_unix_date: 1432230780,
537
+ active: false,
538
+ remoteAddress: "1.2.3.4",
539
+ note: "don't feed after dark",
540
+ mapHidden: false
541
+ };
542
+
543
+ const esri = {
544
+ _id: mongoose.Types.ObjectId(),
545
+ departmentId: new mongoose.Types.ObjectId("56131f724143487a10000001"),
546
+ modified_unix_date: 1432230780,
547
+ token: {
548
+ access_token: "abc_PccBHQYuj",
549
+ expires_in: 2800,
550
+ username: "hello_tc",
551
+ ssl: true,
552
+ refresh_token: "def_IZ99D6eS"
553
+ },
554
+ tokenDateExpiry: 1544475888,
555
+ tokenError: {
556
+ code: 498,
557
+ error: "invalid_request",
558
+ error_description: "refresh_token expired",
559
+ message: "refresh_token expired"
560
+ },
561
+ auth: {
562
+ username: "fire_maps",
563
+ encrypted: {
564
+ iv: "18f17",
565
+ encryptedData: "dee54"
566
+ }
567
+ },
568
+ fireMapperAuth: {
569
+ username: "fire_mapper",
570
+ encrypted: {
571
+ iv: "28f10",
572
+ encryptedData: "dee99"
573
+ },
574
+ encryptedAccessCode: {
575
+ iv: "99f1341",
576
+ encryptedData: "zoom123"
577
+ }
578
+ },
579
+ maps: [
580
+ esriMap
581
+ ],
582
+ mapsProperties: [
583
+ //
584
+ {
585
+ itemId: "01cebf7aede94ed3a9f4c260e18a7d7e",
586
+ download: true,
587
+ }
588
+ ]
589
+ };
590
+
591
+ const gstMapping = {
592
+ _id: mongoose.Types.ObjectId(),
593
+ departmentId: "d123",
594
+ unitId: "E123",
595
+ modified_unix_date: 1432230780,
596
+ active: false,
597
+ remoteAddress: "1.2.3.4",
598
+ note: "don't feed after dark",
599
+ mapHidden: false,
600
+ gstAgency: "LAX",
601
+ deviceType: "gst",
602
+ note: ""
603
+ };
604
+
605
+ const incidentEvent = {
606
+ IncidentNumber: "TC1212121",
607
+ departmentId: "d123",
608
+ modified_unix_date: 1432230780,
609
+ message: "Hello from the other side",
610
+ location: {
611
+ longitude: -29.90129,
612
+ latitude: 121.223131
613
+ },
614
+ userTime: 1437121647,
615
+ type: "contribution",
616
+ user: {
617
+ email: "marius+cc@tabletcommand.com",
618
+ username: "ztc-marcc",
619
+ radioName: "E12",
620
+ userId: "51c2dcca0c599704e400001f"
621
+ },
622
+ uuid: "ABCDEF"
623
+ };
624
+
625
+ const incidentTakeover = {
626
+ _id: mongoose.Types.ObjectId(),
627
+ incident_id: "i1234",
628
+ incident_name: "Test Incident",
629
+ incident_number: "TC-12345",
630
+ departmentId: "d123",
631
+ old_owner: "user1",
632
+ new_owner: "user2",
633
+ owner: "",
634
+ status: "request",
635
+ request_time: 1442888560
636
+ };
637
+
638
+ const incidentNotified = {
639
+ _id: mongoose.Types.ObjectId(),
640
+ departmentId: "d123",
641
+ IncidentNumber: "T-1536603902",
642
+ incidentTypes: [
643
+ "any"
644
+ ],
645
+ units: [
646
+ "E31"
647
+ ],
648
+ sent: [
649
+ ],
650
+ updated: "2018-09-10T18:25:02.196Z"
651
+ };
652
+
653
+ const location = {
654
+ _id: mongoose.Types.ObjectId(),
655
+ departmentId: "d123",
656
+ userId: "542a40db20783c000000153d",
657
+ uuid: "92c8f732-52b7-46cc-855a-d54fddfe3172",
658
+ username: "E23",
659
+ device_type: "iPad",
660
+ active: true,
661
+ heading: 43,
662
+ locationGeoJSON: {
663
+ type: "Point",
664
+ coordinates: [-120.001, 37.001],
665
+ },
666
+ session: "abcd",
667
+ opAreaCode: "DAL",
668
+ opAreaName: "Delta Operations",
669
+ shared: true,
670
+ state: "CA",
671
+ sendToCAD: false,
672
+ color: {
673
+ text: "#00AA00",
674
+ background: "#FFAAFF"
675
+ },
676
+ modified: new Date().toISOString()
677
+ };
678
+
679
+ const managedIncident = {
680
+ _id: mongoose.Types.ObjectId(),
681
+ CallerNumber: "(720) 275-6765",
682
+ CommandChannel: "ACPRI",
683
+ TacticalAltChannel: "ACOPSB",
684
+ TacticalChannel: "ACOPSA",
685
+ active: 1,
686
+ address: "Interstate 76 Eb / Federal To I 76 Eb, UNINCORPORATED ADAMS COUNTY CO",
687
+ api_incident_number: "ACFR040719-0002506",
688
+ channel: "ADAMSCOUNTYFIRERESCUEN1C-MANAGED-ACFR040719-0002506",
689
+ channel_owner: "e12@acfpd.org",
690
+ departmentId: "5b17f315f877ee16f3d019b7",
691
+ end_time: "2019-04-08T00:16:30+0000",
692
+ end_unix_time: 1554682590.44313,
693
+ esri_map: {
694
+ json: "YnBsaXN0MDDUAQIDBAUGCAlYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoKEHVSRudWxsXxAPTlNLZXllZEFyY2hpdmVy0QoLVHJvb3SAAAgRGiMtMjc5P1FUWQAAAAAAAAEBAAAAAAAAAAwAAAAAAAAAAAAAAAAAAABb",
695
+ map_type: "Generic",
696
+ name: "Street",
697
+ url: "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",
698
+ uuid: "00FCA57A-6F1B-4F74-84BD-E7A8B8BFF8FB"
699
+ },
700
+ history: [
701
+ //
702
+ {
703
+ entity_id: 9207,
704
+ entity_type: 14,
705
+ message: "(43) 2a72 start medical (Shared)",
706
+ time: 1554681941
707
+ }
708
+ ],
709
+ is_closed: 1,
710
+ location: "39.802526,-105.019773",
711
+ managed: "1",
712
+ modified_date: "2019-04-08T00:16:30.473", // Same as the modified_unix_date
713
+ modified_unix_date: 1554682590.47396,
714
+ name: "INJURED PARTY",
715
+ preference_location: "location",
716
+ slave_map_changed: false,
717
+ source: "cad",
718
+ start_time: "2019-04-08T00:05:41+0000",
719
+ start_unix_time: 1554681941,
720
+ units: [
721
+ //
722
+ {
723
+ UnitID: "M12",
724
+ active: 1,
725
+ air_time: "",
726
+ api_unit_dispatch_number: "5163322",
727
+ checked: 0,
728
+ column_position: 0,
729
+ group_position: 0,
730
+ incident_position: 0,
731
+ isSupervisor: false,
732
+ is_part_of_group: false,
733
+ location_on_image: "",
734
+ location_on_map: "",
735
+ modified_date: "2019-04-08T00:16:30+0000",
736
+ modified_unix_date: 1554682590.51667,
737
+ note: "",
738
+ personnelOnScene: 2,
739
+ status: "Arrived",
740
+ status_unix_date: 1554682217,
741
+ time: "",
742
+ warning: 0
743
+ }
744
+ ],
745
+ userId: "5b3e78cc944e2a18d5222424",
746
+ uuid: "579E2F47-7F63-4351-B41F-4A345D680B8F"
747
+ };
748
+
749
+ const monitor = {
750
+ _id: mongoose.Types.ObjectId(),
751
+ departmentId: "546ace2b3cd8d60d1d00256a",
752
+ agencyId: "123",
753
+ notificationType: "maps-token-error",
754
+ status: "active",
755
+ sentUnixDate: 1603263604
756
+ };
757
+
758
+ const rateLimit = {
759
+ _id: mongoose.Types.ObjectId(),
760
+ username: "test123",
761
+ modified_unix_date: 1426983552.49945,
762
+ count: 8
763
+ };
764
+
765
+ const session = {
766
+ when: "2019-04-01T04:41:38.509Z",
767
+ user: "51c2dcca0c599704e400001f",
768
+ email: "marius+cc@tabletcommand.com",
769
+ nick: "ztc-marcc",
770
+ deviceId: "7evAKaFiOeaWTlsMTOSQMBKN",
771
+ remoteAddress: "124.148.161.107",
772
+ userAgent: "TCMobile/1.6 (iPhone; iOS 12.1; Scale/2.00)",
773
+ why: "password",
774
+ departmentId: "51a2529293e11b3569000057",
775
+ source: "iphone.beta",
776
+ token: uuid.v4(),
777
+ active: false,
778
+ ended: "2019-04-01T04:41:39.233Z"
779
+ };
780
+
781
+ const template = {
782
+ position: 1,
783
+ active: true,
784
+ name: "Vertical Test",
785
+ userId: "1234",
786
+ departmentId: "4321",
787
+ isMandatory: false,
788
+ group: [],
789
+ checklist: [],
790
+ agencyId: new mongoose.Types.ObjectId(agency._id)
791
+ };
792
+
793
+ const user = {
794
+ _id: mongoose.Types.ObjectId(),
795
+ nick: "Test",
796
+ email: "test@save.me",
797
+ mapId: "TEST",
798
+ departmentId: "d123",
799
+ isPro: true,
800
+ agencyId: new mongoose.Types.ObjectId(agency._id),
801
+ managedAgencies: [new mongoose.Types.ObjectId(agency._id)],
802
+ shareLocationPhone: false,
803
+ shareLocationTablet: true,
804
+ notificationSounds: [
805
+ //
806
+ {
807
+ sound: "testSound.caf",
808
+ soundType: "default",
809
+ }
810
+ ],
811
+ offlineMapsEnabled: true,
812
+ offDutyEnabled: true,
813
+ webMapSettings: {
814
+ defaultZoomLevel: 10,
815
+ defaultCenter: [1,1],
816
+ defaultMap: "Default"
817
+ }
818
+ };
819
+
820
+ const userRegistration = {
821
+ email: "test@email.com",
822
+ name: "John Waters",
823
+ firstName: "John",
824
+ lastName: "Waters",
825
+ department: "New York City, NY",
826
+ title: "Mr",
827
+ modifiedDate: 1426983552.49945,
828
+ status: "registered",
829
+ stage: "afterEULA",
830
+ presentedAt: 1488157071.042124,
831
+ managedIncidentsCount: 1,
832
+ checklistsCount: 2,
833
+ firstIncidentUnixTime: 1443666043.380937,
834
+ lastIncidentLocation: "40.999357,-85.767932",
835
+ lastIncidentUnixTime: 1480525299.50968
836
+ };
837
+
838
+ const userDevice = {
839
+ userId: "1234",
840
+ departmentID: "4321",
841
+ devices: [
842
+ //
843
+ {
844
+ token: "de2687382a9df6a1165616aac",
845
+ env: "testmock",
846
+ ver: "TC Mobile v1.0 b23",
847
+ ua: "TCMobile/1.0 (iPhone; iOS 10.1.1; Scale/3.00)",
848
+ time: 1438627429.956,
849
+ drift: 1438627429.956,
850
+ bundleIdentifier: "com.testtesttest.TCMobile",
851
+ silentEnabled: true,
852
+ criticalAlertsEnabled: true,
853
+ session: "1234321",
854
+ active: true,
855
+ offDuty: false
856
+ }
857
+ ],
858
+ notificationCount: 12,
859
+ notificationUnitSettings: [
860
+ {
861
+ radioName: "B1",
862
+ notificationType: "NORMAL",
863
+ notificationMode: "ON DUTY"
864
+ }
865
+ ],
866
+ notificationIncidentSettings: [
867
+ {
868
+ incidentType: "Cliff Rescue",
869
+ notificationType: "NORMAL",
870
+ notificationMode: "ON DUTY"
871
+ }
872
+ ],
873
+ notificationSounds: {
874
+ ios: {
875
+ sound: "a.caf",
876
+ soundType: "default",
877
+ os: "ios"
878
+ },
879
+ android: {
880
+ sound: "b.mp3",
881
+ soundType: "default",
882
+ os: "android"
883
+ }
884
+ },
885
+ offDuty: true,
886
+ criticalAlertsVolume: "MED",
887
+ };
888
+
889
+ const personnelImport = {
890
+ _id: mongoose.Types.ObjectId(),
891
+ PersonnelID: "AM0111",
892
+ PersonnelName: "Test User",
893
+ PersonnelRank: "Eng",
894
+ PersonnelWorkCode: "abcd1234",
895
+ PersonnelNote: "A test user",
896
+ departmentId: "123zzz",
897
+ radioNames: ["M10", "Z1"],
898
+ shiftStartTime: 1559446299,
899
+ shiftStart: "2019-06-02T03:31:39.000Z",
900
+ shiftEndTime: 1569446299,
901
+ shiftEnd: "2019-09-25T21:18:19.000Z",
902
+ modified_unix_date: 1570446299,
903
+ modified: "2019-10-07T11:04:59.000Z",
904
+ active: true,
905
+ agencyCode: "TC",
906
+ agencyName: "Tablet Command",
907
+ importNotes: "test note"
908
+ };
909
+
910
+ const csvImport = {
911
+ _id: mongoose.Types.ObjectId(),
912
+ batchId: "AM0111",
913
+ departmentId: "1234",
914
+ agencyId: "abcd1234",
915
+ importType: "users",
916
+ fileType: "csv",
917
+ fileName: "test file 123",
918
+ fileSize: 800,
919
+ records: [],
920
+ userId: "4321",
921
+ status: "success",
922
+ sendNotification: false
923
+ };
924
+
925
+ async function cleanup() {
926
+ config.checkIfTestDatabase();
927
+
928
+ await models.CADVehicleStatus.deleteMany({});
929
+ await models.Esri.deleteMany({});
930
+ await models.IncidentNotified.deleteMany({});
931
+ await models.PersonnelImport.deleteMany({});
932
+ await models.UserDevice.deleteMany({});
933
+ await models.User.deleteMany({});
934
+ }
935
+
936
+ return {
937
+ actionLog,
938
+ agency,
939
+ assignment,
940
+ arcGISGroup,
941
+ battalion,
942
+ cadIncident,
943
+ cadStatus,
944
+ cadStatusMap,
945
+ cadVehicle,
946
+ cadVehicleStatus,
947
+ cadVehicleStatusHistory,
948
+ checklist,
949
+ checklistItem,
950
+ cleanup,
951
+ department,
952
+ deviceMapping,
953
+ esri,
954
+ gstMapping,
955
+ incidentEvent,
956
+ incidentNotified,
957
+ incidentTakeover,
958
+ location,
959
+ mailLog,
960
+ message,
961
+ managedIncident,
962
+ monitor,
963
+ personnelImport,
964
+ rateLimit,
965
+ session,
966
+ template,
967
+ user,
968
+ userDevice,
969
+ userRegistration,
970
+ csvImport
971
+ };
972
+ };
973
+ */
974
+ //# sourceMappingURL=mock.js.map