tabletcommand-incident 0.6.19 → 0.7.0

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 (185) hide show
  1. package/build/ruleLegacy/karka.js +24 -0
  2. package/build/ruleLegacy/karka.js.map +1 -0
  3. package/build/ruleLegacy/specializer.js +142 -0
  4. package/build/ruleLegacy/specializer.js.map +1 -0
  5. package/build/ruleProcessorLegacy.js +1 -1
  6. package/build/ruleProcessorLegacy.js.map +1 -1
  7. package/build/rules/append-priority-description-to-call-type.js +1 -2
  8. package/build/rules/append-priority-description-to-call-type.js.map +1 -1
  9. package/build/rules/clean-up-comments.js +0 -1
  10. package/build/rules/clean-up-comments.js.map +1 -1
  11. package/build/rules/clean-up-lat-long.js +1 -2
  12. package/build/rules/clean-up-lat-long.js.map +1 -1
  13. package/build/rules/clear-field.js +0 -1
  14. package/build/rules/clear-field.js.map +1 -1
  15. package/build/rules/copy-location-comment.js +1 -1
  16. package/build/rules/copy-location-comment.js.map +1 -1
  17. package/build/rules/index.js +7 -4
  18. package/build/rules/index.js.map +1 -1
  19. package/build/rules/join-call-type-priority.js +0 -1
  20. package/build/rules/join-call-type-priority.js.map +1 -1
  21. package/build/rules/join-call-type-sacramento.js +0 -1
  22. package/build/rules/join-call-type-sacramento.js.map +1 -1
  23. package/build/rules/map-unit-dates-verdugo.js +0 -1
  24. package/build/rules/map-unit-dates-verdugo.js.map +1 -1
  25. package/build/rules/not-implemented.js +0 -1
  26. package/build/rules/not-implemented.js.map +1 -1
  27. package/build/rules/remove-incident-field.js +0 -2
  28. package/build/rules/remove-incident-field.js.map +1 -1
  29. package/build/rules/remove-person-from-unit.js +0 -2
  30. package/build/rules/remove-person-from-unit.js.map +1 -1
  31. package/build/rules/set-address.js +1 -1
  32. package/build/rules/set-address.js.map +1 -1
  33. package/build/rules/set-channels-from-radio-channels.js +0 -1
  34. package/build/rules/set-channels-from-radio-channels.js.map +1 -1
  35. package/build/rules/set-city-alameda.js +0 -1
  36. package/build/rules/set-city-alameda.js.map +1 -1
  37. package/build/rules/set-city-calfire-lnu.js +122 -123
  38. package/build/rules/set-city-calfire-lnu.js.map +1 -1
  39. package/build/rules/set-city-cleanup.js +0 -1
  40. package/build/rules/set-city-cleanup.js.map +1 -1
  41. package/build/rules/set-city-southern-marin.js +0 -1
  42. package/build/rules/set-city-southern-marin.js.map +1 -1
  43. package/build/rules/set-city-verdugo.js +0 -1
  44. package/build/rules/set-city-verdugo.js.map +1 -1
  45. package/build/rules/set-comment-opts-ack-type.js +0 -1
  46. package/build/rules/set-comment-opts-ack-type.js.map +1 -1
  47. package/build/rules/set-common-place-name.js +1 -2
  48. package/build/rules/set-common-place-name.js.map +1 -1
  49. package/build/rules/set-communication-channels-from-radio-names.js +1 -2
  50. package/build/rules/set-communication-channels-from-radio-names.js.map +1 -1
  51. package/build/rules/set-cross-streets.js +1 -2
  52. package/build/rules/set-cross-streets.js.map +1 -1
  53. package/build/rules/set-fire-alarm-at-dispatch-from-alarm-level.js +0 -1
  54. package/build/rules/set-fire-alarm-at-dispatch-from-alarm-level.js.map +1 -1
  55. package/build/rules/set-fire-map-pages-ontario.js +2 -3
  56. package/build/rules/set-fire-map-pages-ontario.js.map +1 -1
  57. package/build/rules/set-fire-map-santa-clara-city.js +0 -1
  58. package/build/rules/set-fire-map-santa-clara-city.js.map +1 -1
  59. package/build/rules/set-format-units-pulsepoint.js +1 -2
  60. package/build/rules/set-format-units-pulsepoint.js.map +1 -1
  61. package/build/rules/set-incident-type-ontario.js +1 -2
  62. package/build/rules/set-incident-type-ontario.js.map +1 -1
  63. package/build/rules/set-location-preference-derry.js +3 -4
  64. package/build/rules/set-location-preference-derry.js.map +1 -1
  65. package/build/rules/set-location-preference.js +0 -4
  66. package/build/rules/set-location-preference.js.map +1 -1
  67. package/build/rules/set-map-incident-type-pulsepoint.js +1 -2
  68. package/build/rules/set-map-incident-type-pulsepoint.js.map +1 -1
  69. package/build/rules/set-prior-incident-comment-field.js +1 -2
  70. package/build/rules/set-prior-incident-comment-field.js.map +1 -1
  71. package/build/rules/set-street-number.js +0 -1
  72. package/build/rules/set-street-number.js.map +1 -1
  73. package/build/store.js +1 -1
  74. package/build/store.js.map +1 -1
  75. package/build/test/domain.js +30 -30
  76. package/build/test/domain.js.map +1 -1
  77. package/build/test/mock.js +604 -604
  78. package/build/test/mock.js.map +1 -1
  79. package/build/test/rules/clean-up-comments.js +25 -25
  80. package/build/test/rules/clean-up-comments.js.map +1 -1
  81. package/build/test/rules/close-incident-matching-incident-number.js.map +1 -1
  82. package/build/test/rules/map-unit-dates-verdugo.js +5 -5
  83. package/build/test/rules/map-unit-dates-verdugo.js.map +1 -1
  84. package/build/test/rules/remove-person-from-unit.js +24 -24
  85. package/build/test/rules/remove-person-from-unit.js.map +1 -1
  86. package/build/test/rules/set-channels-from-radio-channels.js +40 -40
  87. package/build/test/rules/set-channels-from-radio-channels.js.map +1 -1
  88. package/build/test/rules/set-city-calfire-lnu.js +4 -4
  89. package/build/test/rules/set-city-calfire-lnu.js.map +1 -1
  90. package/build/test/rules/set-format-units-pulsepoint.js +16 -16
  91. package/build/test/rules/set-format-units-pulsepoint.js.map +1 -1
  92. package/build/test/rules/set-map-incident-type-pulsepoint.js +6 -6
  93. package/build/test/rules/set-map-incident-type-pulsepoint.js.map +1 -1
  94. package/build/test/rulesLegacy.js +1 -1
  95. package/build/test/rulesLegacy.js.map +1 -1
  96. package/definitions/ruleLegacy/karka.d.ts +5 -0
  97. package/definitions/ruleLegacy/karka.d.ts.map +1 -0
  98. package/definitions/ruleLegacy/specializer.d.ts +5 -0
  99. package/definitions/ruleLegacy/specializer.d.ts.map +1 -0
  100. package/definitions/rules/append-priority-description-to-call-type.d.ts.map +1 -1
  101. package/definitions/rules/clean-up-comments.d.ts.map +1 -1
  102. package/definitions/rules/clean-up-lat-long.d.ts.map +1 -1
  103. package/definitions/rules/clear-field.d.ts.map +1 -1
  104. package/definitions/rules/join-call-type-priority.d.ts.map +1 -1
  105. package/definitions/rules/join-call-type-sacramento.d.ts.map +1 -1
  106. package/definitions/rules/map-unit-dates-verdugo.d.ts.map +1 -1
  107. package/definitions/rules/not-implemented.d.ts.map +1 -1
  108. package/definitions/rules/remove-incident-field.d.ts.map +1 -1
  109. package/definitions/rules/remove-person-from-unit.d.ts.map +1 -1
  110. package/definitions/rules/set-channels-from-radio-channels.d.ts.map +1 -1
  111. package/definitions/rules/set-city-alameda.d.ts.map +1 -1
  112. package/definitions/rules/set-city-calfire-lnu.d.ts.map +1 -1
  113. package/definitions/rules/set-city-cleanup.d.ts.map +1 -1
  114. package/definitions/rules/set-city-southern-marin.d.ts.map +1 -1
  115. package/definitions/rules/set-city-verdugo.d.ts.map +1 -1
  116. package/definitions/rules/set-comment-opts-ack-type.d.ts.map +1 -1
  117. package/definitions/rules/set-common-place-name.d.ts.map +1 -1
  118. package/definitions/rules/set-communication-channels-from-radio-names.d.ts.map +1 -1
  119. package/definitions/rules/set-cross-streets.d.ts.map +1 -1
  120. package/definitions/rules/set-fire-alarm-at-dispatch-from-alarm-level.d.ts.map +1 -1
  121. package/definitions/rules/set-fire-map-santa-clara-city.d.ts.map +1 -1
  122. package/definitions/rules/set-format-units-pulsepoint.d.ts.map +1 -1
  123. package/definitions/rules/set-location-preference-derry.d.ts.map +1 -1
  124. package/definitions/rules/set-location-preference.d.ts.map +1 -1
  125. package/definitions/rules/set-map-incident-type-pulsepoint.d.ts.map +1 -1
  126. package/definitions/rules/set-prior-incident-comment-field.d.ts.map +1 -1
  127. package/definitions/rules/set-street-number.d.ts.map +1 -1
  128. package/definitions/store.d.ts +8 -4
  129. package/definitions/store.d.ts.map +1 -1
  130. package/definitions/types.d.ts.map +1 -1
  131. package/eslint.config.mjs +62 -42
  132. package/package.json +15 -13
  133. package/src/domain.ts +1 -1
  134. package/src/ruleLegacy/karka.js +25 -0
  135. package/src/ruleLegacy/specializer.js +158 -0
  136. package/src/ruleProcessorLegacy.d.ts +1 -1
  137. package/src/ruleProcessorLegacy.js +1 -1
  138. package/src/rules/append-priority-description-to-call-type.ts +1 -2
  139. package/src/rules/clean-up-comments.ts +0 -1
  140. package/src/rules/clean-up-lat-long.ts +1 -2
  141. package/src/rules/clear-field.ts +0 -1
  142. package/src/rules/copy-location-comment.ts +1 -1
  143. package/src/rules/index.ts +8 -8
  144. package/src/rules/join-call-type-priority.ts +0 -1
  145. package/src/rules/join-call-type-sacramento.ts +0 -1
  146. package/src/rules/map-unit-dates-verdugo.ts +0 -1
  147. package/src/rules/not-implemented.ts +0 -1
  148. package/src/rules/remove-incident-field.ts +0 -2
  149. package/src/rules/remove-person-from-unit.ts +0 -2
  150. package/src/rules/set-address.ts +2 -2
  151. package/src/rules/set-channels-from-radio-channels.ts +0 -1
  152. package/src/rules/set-city-alameda.ts +0 -1
  153. package/src/rules/set-city-calfire-lnu.ts +122 -123
  154. package/src/rules/set-city-cleanup.ts +0 -1
  155. package/src/rules/set-city-southern-marin.ts +0 -1
  156. package/src/rules/set-city-verdugo.ts +0 -1
  157. package/src/rules/set-comment-opts-ack-type.ts +0 -1
  158. package/src/rules/set-common-place-name.ts +1 -2
  159. package/src/rules/set-communication-channels-from-radio-names.ts +2 -3
  160. package/src/rules/set-cross-streets.ts +1 -2
  161. package/src/rules/set-fire-alarm-at-dispatch-from-alarm-level.ts +0 -1
  162. package/src/rules/set-fire-map-pages-ontario.ts +4 -4
  163. package/src/rules/set-fire-map-santa-clara-city.ts +0 -1
  164. package/src/rules/set-format-units-pulsepoint.ts +1 -2
  165. package/src/rules/set-incident-type-ontario.ts +3 -3
  166. package/src/rules/set-location-preference-derry.ts +3 -4
  167. package/src/rules/set-location-preference.ts +0 -4
  168. package/src/rules/set-map-incident-type-pulsepoint.ts +1 -2
  169. package/src/rules/set-prior-incident-comment-field.ts +1 -2
  170. package/src/rules/set-street-number.ts +0 -1
  171. package/src/store.ts +3 -3
  172. package/src/test/domain.ts +30 -30
  173. package/src/test/mock.ts +604 -604
  174. package/src/test/rules/clean-up-comments.ts +25 -25
  175. package/src/test/rules/close-incident-matching-incident-number.ts +1 -2
  176. package/src/test/rules/map-unit-dates-verdugo.ts +5 -5
  177. package/src/test/rules/remove-person-from-unit.ts +24 -24
  178. package/src/test/rules/set-address.ts +1 -1
  179. package/src/test/rules/set-channels-from-radio-channels.ts +40 -40
  180. package/src/test/rules/set-city-calfire-lnu.ts +4 -4
  181. package/src/test/rules/set-format-units-pulsepoint.ts +16 -16
  182. package/src/test/rules/set-map-incident-type-pulsepoint.ts +6 -6
  183. package/src/test/rulesLegacy.js +1 -1
  184. package/src/types.ts +1 -1
  185. package/src/verify/correction.ts +5 -5
@@ -55,39 +55,39 @@ describe("IncidentRuleCleanUpComments", function describeFunc() {
55
55
  IncidentNumber: "F1111111",
56
56
  Comment: [
57
57
  {
58
- "Comment": "TEST COMMENT",
59
- "CommentSource": "s-db1",
60
- "CommentDateTime": "2025-04-29T01:15:40-07:00",
61
- "CommentConfidential": false,
62
- "CommentOpts": { "type": "", "item": "" },
58
+ Comment: "TEST COMMENT",
59
+ CommentSource: "s-db1",
60
+ CommentDateTime: "2025-04-29T01:15:40-07:00",
61
+ CommentConfidential: false,
62
+ CommentOpts: { type: "", item: "" },
63
63
  },
64
64
  {
65
- "Comment": "TEST COMMENT",
66
- "CommentSource": "ecccad-3",
67
- "CommentDateTime": "2025-04-29T01:16:25-07:00",
68
- "CommentConfidential": false,
69
- "CommentOpts": { "type": "", "item": "" },
65
+ Comment: "TEST COMMENT",
66
+ CommentSource: "ecccad-3",
67
+ CommentDateTime: "2025-04-29T01:16:25-07:00",
68
+ CommentConfidential: false,
69
+ CommentOpts: { type: "", item: "" },
70
70
  },
71
71
  {
72
- "Comment": "TEST COMMENT",
73
- "CommentSource": "cad-14",
74
- "CommentDateTime": "2025-04-29T01:16:41-07:00",
75
- "CommentConfidential": false,
76
- "CommentOpts": { "type": "", "item": "" },
72
+ Comment: "TEST COMMENT",
73
+ CommentSource: "cad-14",
74
+ CommentDateTime: "2025-04-29T01:16:41-07:00",
75
+ CommentConfidential: false,
76
+ CommentOpts: { type: "", item: "" },
77
77
  },
78
78
  {
79
- "Comment": "TEST COMMENT",
80
- "CommentSource": "ecccad-1",
81
- "CommentDateTime": "2025-04-29T01:20:08-07:00",
82
- "CommentConfidential": false,
83
- "CommentOpts": { "type": "", "item": "" },
79
+ Comment: "TEST COMMENT",
80
+ CommentSource: "ecccad-1",
81
+ CommentDateTime: "2025-04-29T01:20:08-07:00",
82
+ CommentConfidential: false,
83
+ CommentOpts: { type: "", item: "" },
84
84
  },
85
85
  {
86
- "Comment": "TEST COMMENT",
87
- "CommentSource": "ecccad-3",
88
- "CommentDateTime": "2025-04-29T01:48:09-07:00",
89
- "CommentConfidential": false,
90
- "CommentOpts": { "type": "", "item": "" },
86
+ Comment: "TEST COMMENT",
87
+ CommentSource: "ecccad-3",
88
+ CommentDateTime: "2025-04-29T01:48:09-07:00",
89
+ CommentConfidential: false,
90
+ CommentOpts: { type: "", item: "" },
91
91
  },
92
92
  ]
93
93
  };
@@ -3,7 +3,6 @@ import { assert } from "chai";
3
3
  import "mocha";
4
4
  import { CADIncident } from "tabletcommand-backend-models";
5
5
 
6
-
7
6
  import {
8
7
  IncidentRuleCloseMatchingIncidentNumber,
9
8
  } from "../../rules/close-incident-matching-incident-number";
@@ -149,4 +148,4 @@ describe("IncidentRuleCloseMatchingIncidentNumber", function describeFunc() {
149
148
  assert.isFalse(rule.changed);
150
149
  assert.equal(result.ClosedDateTime, originalClosedDate);
151
150
  });
152
- });
151
+ });
@@ -14,11 +14,11 @@ describe("IncidentRuleMapUnitDatesVerdugo", function describeFunc() {
14
14
  IncidentNumber: "F1111111",
15
15
  Unit: [
16
16
  {
17
- "UnitDispatchDateTime": "2022-02-23T16:01:32-0800",
18
- "UnitDispatchNumber": "F22035845M15",
19
- "UnitEnrouteDateTime": "2022-02-23T16:01:21-0800",
20
- "UnitID": "E1",
21
- "TimeTransportComplete": "2022-02-23T16:01:55-0800"
17
+ UnitDispatchDateTime: "2022-02-23T16:01:32-0800",
18
+ UnitDispatchNumber: "F22035845M15",
19
+ UnitEnrouteDateTime: "2022-02-23T16:01:21-0800",
20
+ UnitID: "E1",
21
+ TimeTransportComplete: "2022-02-23T16:01:55-0800"
22
22
  }
23
23
  ]
24
24
  };
@@ -13,49 +13,49 @@ describe("IncidentRuleRemovePersonFromUnit", function describeFunc() {
13
13
  IncidentNumber: "i1237",
14
14
  Unit: [
15
15
  {
16
- "AlarmAtDispatch": "1",
17
- "Personnel": [
16
+ AlarmAtDispatch: "1",
17
+ Personnel: [
18
18
  {
19
- "PersonnelID": "R295",
20
- "PersonnelName": "SMITH,BOB FF/P"
19
+ PersonnelID: "R295",
20
+ PersonnelName: "SMITH,BOB FF/P"
21
21
  },
22
22
  {
23
- "PersonnelID": "R261",
24
- "PersonnelName": "SMITH, ROB FF/P"
23
+ PersonnelID: "R261",
24
+ PersonnelName: "SMITH, ROB FF/P"
25
25
  },
26
26
  {
27
- "PersonnelID": "R267",
28
- "PersonnelName": "SMITH, KYLE FF"
27
+ PersonnelID: "R267",
28
+ PersonnelName: "SMITH, KYLE FF"
29
29
  },
30
30
  {
31
- "PersonnelID": "R216",
32
- "PersonnelName": "CID, JOHN CAPT"
31
+ PersonnelID: "R216",
32
+ PersonnelName: "CID, JOHN CAPT"
33
33
  },
34
34
  {
35
- "PersonnelID": "T9",
36
- "PersonnelName": "Truck 9"
35
+ PersonnelID: "T9",
36
+ PersonnelName: "Truck 9"
37
37
  },
38
38
  {
39
- "PersonnelID": "KM-TALL",
40
- "PersonnelName": "KINGS MTN VOLUNTEER ALL"
39
+ PersonnelID: "KM-TALL",
40
+ PersonnelName: "KINGS MTN VOLUNTEER ALL"
41
41
  },
42
42
  {
43
- "PersonnelID": "A0051",
44
- "PersonnelName": "RON SWANSON CAPT S/O"
43
+ PersonnelID: "A0051",
44
+ PersonnelName: "RON SWANSON CAPT S/O"
45
45
  },
46
46
  {
47
- "PersonnelID": "E52",
48
- "PersonnelName": "E52"
47
+ PersonnelID: "E52",
48
+ PersonnelName: "E52"
49
49
  },
50
50
  {
51
- "PersonnelID": "BC5",
52
- "PersonnelName": "BC5 PAGER"
51
+ PersonnelID: "BC5",
52
+ PersonnelName: "BC5 PAGER"
53
53
  }
54
54
  ],
55
- "PersonnelCount": 9,
56
- "TimeDispatched": "2021-03-18T20:45:15-0700",
57
- "UnitDispatchNumber": "T9.1616125515",
58
- "UnitID": "T9"
55
+ PersonnelCount: 9,
56
+ TimeDispatched: "2021-03-18T20:45:15-0700",
57
+ UnitDispatchNumber: "T9.1616125515",
58
+ UnitID: "T9"
59
59
  }
60
60
  ],
61
61
  };
@@ -27,7 +27,7 @@ describe("IncidentRuleSetAddress", function describeFunc() {
27
27
  PostalCode: "94549"
28
28
  };
29
29
  const testFormattedAddress = "2905 W Ptarmigan Dr, BLDG: B5 FLR: 2 # 2016, Walnut Creek CA 94549";
30
-
30
+
31
31
  const dateStr = "2022-12-08T11:53:42.000Z";
32
32
  const atDate = new Date(dateStr);
33
33
  const rule = new IncidentRuleSetAddress();
@@ -11,34 +11,34 @@ describe("IncidentRuleSetChannelsFromRadioChannels", function describeFunc() {
11
11
  IncidentNumber: "i1237",
12
12
  radioChannels: [
13
13
  {
14
- "name": "Cmd",
15
- "channel": "5B",
16
- "channelDescription": "D 5B",
17
- "url": "",
14
+ name: "Cmd",
15
+ channel: "5B",
16
+ channelDescription: "D 5B",
17
+ url: "",
18
18
  },
19
19
  {
20
- "name": "Tac",
21
- "channel": "5C",
22
- "channelDescription": "D 5C",
23
- "url": "",
20
+ name: "Tac",
21
+ channel: "5C",
22
+ channelDescription: "D 5C",
23
+ url: "",
24
24
  },
25
25
  {
26
- "name": "Grd",
27
- "channel": "XSD A/G",
28
- "channelDescription": "D XS",
29
- "url": "",
26
+ name: "Grd",
27
+ channel: "XSD A/G",
28
+ channelDescription: "D XS",
29
+ url: "",
30
30
  },
31
31
  {
32
- "name": "VICTOR",
33
- "channel": "135.975 RNM",
34
- "channelDescription": "D V",
35
- "url": "",
32
+ name: "VICTOR",
33
+ channel: "135.975 RNM",
34
+ channelDescription: "D V",
35
+ url: "",
36
36
  },
37
37
  {
38
- "name": "AIR-TO-AIR",
39
- "channel": "AIR TAC 22",
40
- "channelDescription": "ATC",
41
- "url": "",
38
+ name: "AIR-TO-AIR",
39
+ channel: "AIR TAC 22",
40
+ channelDescription: "ATC",
41
+ url: "",
42
42
  }
43
43
  ]
44
44
  };
@@ -58,34 +58,34 @@ describe("IncidentRuleSetChannelsFromRadioChannels", function describeFunc() {
58
58
  IncidentNumber: "i1237",
59
59
  radioChannels: [
60
60
  {
61
- "name": "test",
62
- "channel": "5A",
63
- "channelDescription": "D 5A",
64
- "url": "",
61
+ name: "test",
62
+ channel: "5A",
63
+ channelDescription: "D 5A",
64
+ url: "",
65
65
  },
66
66
  {
67
- "name": "test2",
68
- "channel": "5C",
69
- "channelDescription": "D 5C",
70
- "url": "",
67
+ name: "test2",
68
+ channel: "5C",
69
+ channelDescription: "D 5C",
70
+ url: "",
71
71
  },
72
72
  {
73
- "name": "Grd",
74
- "channel": "XSD A/G",
75
- "channelDescription": "D XS",
76
- "url": "",
73
+ name: "Grd",
74
+ channel: "XSD A/G",
75
+ channelDescription: "D XS",
76
+ url: "",
77
77
  },
78
78
  {
79
- "name": "VICTOR",
80
- "channel": "135.975 RNM",
81
- "channelDescription": "D V",
82
- "url": "",
79
+ name: "VICTOR",
80
+ channel: "135.975 RNM",
81
+ channelDescription: "D V",
82
+ url: "",
83
83
  },
84
84
  {
85
- "name": "AIR-TO-AIR",
86
- "channel": "AIR TAC 22",
87
- "channelDescription": "D AT",
88
- "url": "",
85
+ name: "AIR-TO-AIR",
86
+ channel: "AIR TAC 22",
87
+ channelDescription: "D AT",
88
+ url: "",
89
89
  }
90
90
  ]
91
91
  };
@@ -8,10 +8,10 @@ import {
8
8
  describe("IncidentRuleSetCityCalfireLNU", function describeFunc() {
9
9
  it("sets city from city code", function() {
10
10
  const testItem = {
11
- "StreetNumber": "1659",
12
- "StreetName": "ATLAS PEAK",
13
- "StreetSuffix": "RD",
14
- "CityOrLocality": "NAPA_STATE_HOSPITAL",
11
+ StreetNumber: "1659",
12
+ StreetName: "ATLAS PEAK",
13
+ StreetSuffix: "RD",
14
+ CityOrLocality: "NAPA_STATE_HOSPITAL",
15
15
  IncidentNumber: "Alameda-Test-0001"
16
16
  };
17
17
 
@@ -10,24 +10,24 @@ import { CADUnitType } from "tabletcommand-backend-models/definitions/types/cad-
10
10
  describe("IncidentRuleSetFormatUnitsPulsePoint", function describeFunc() {
11
11
  it("sets common place name", function() {
12
12
  const testItem = {
13
- "AgencyID": "11111",
14
- "IncidentNumber": "F1111111",
15
- "PulsePointIncidentCallType": "ME",
16
- "AgencyDeterminantCode": "21B2M",
17
- "EntryDateTime": "2022-03-02T15:44:53-0800",
18
- "ClosedDateTime": "2022-03-02T16:01:01-0800",
19
- "Unit":
13
+ AgencyID: "11111",
14
+ IncidentNumber: "F1111111",
15
+ PulsePointIncidentCallType: "ME",
16
+ AgencyDeterminantCode: "21B2M",
17
+ EntryDateTime: "2022-03-02T15:44:53-0800",
18
+ ClosedDateTime: "2022-03-02T16:01:01-0800",
19
+ Unit:
20
20
  {
21
- "0":
21
+ 0:
22
22
  {
23
- "AgencyDispatchStatus": "AIQ",
24
- "PulsePointDispatchStatus": "AR",
25
- "UnitClearedDateTime": "2022-02-23T16:25:08-0800",
26
- "UnitDispatchDateTime": "2022-02-23T16:01:32-0800",
27
- "UnitDispatchNumber": "F22035845M15",
28
- "UnitEnrouteDateTime": "2022-02-23T16:01:21-0800",
29
- "UnitID": "E1",
30
- "UnitOnSceneDateTime": "2022-02-23T16:01:55-0800"
23
+ AgencyDispatchStatus: "AIQ",
24
+ PulsePointDispatchStatus: "AR",
25
+ UnitClearedDateTime: "2022-02-23T16:25:08-0800",
26
+ UnitDispatchDateTime: "2022-02-23T16:01:32-0800",
27
+ UnitDispatchNumber: "F22035845M15",
28
+ UnitEnrouteDateTime: "2022-02-23T16:01:21-0800",
29
+ UnitID: "E1",
30
+ UnitOnSceneDateTime: "2022-02-23T16:01:55-0800"
31
31
  }
32
32
  }
33
33
  };
@@ -8,12 +8,12 @@ import {
8
8
  describe("IncidentRuleSetMapIncidentTypePulsePoint", function describeFunc() {
9
9
  it("sets common place name", function() {
10
10
  const testItem = {
11
- "AgencyID": "11111",
12
- "IncidentNumber": "F1111111",
13
- "PulsePointIncidentCallType": "ME",
14
- "AgencyDeterminantCode": "21B2M",
15
- "EntryDateTime": "2022-03-02T15:44:53-0800",
16
- "ClosedDateTime": "2022-03-02T16:01:01-0800"
11
+ AgencyID: "11111",
12
+ IncidentNumber: "F1111111",
13
+ PulsePointIncidentCallType: "ME",
14
+ AgencyDeterminantCode: "21B2M",
15
+ EntryDateTime: "2022-03-02T15:44:53-0800",
16
+ ClosedDateTime: "2022-03-02T16:01:01-0800"
17
17
  };
18
18
 
19
19
  const dateStr = "2022-12-08T11:53:42.000Z";
@@ -4,7 +4,7 @@ const assert = require("assert");
4
4
  const _ = require("lodash");
5
5
  const moment = require("moment-timezone");
6
6
 
7
- const karka = require("karka");
7
+ const karka = require("../ruleLegacy/karka");
8
8
 
9
9
  const cleanupLatLongSantaClaraCity = require("../ruleLegacy/cleanupLatLongSantaClaraCity");
10
10
  const cleanupNull = require("../ruleLegacy/cleanupNull");
package/src/types.ts CHANGED
@@ -5,7 +5,7 @@ import {
5
5
 
6
6
  export type RuleProcessorModule = {
7
7
  ruleProcessor(incident: Partial<CADIncident>, department: Partial<Department>): void;
8
- }
8
+ };
9
9
 
10
10
  export interface CADReportNumber extends Record<string, string | undefined> {
11
11
  name?: string
@@ -13,14 +13,14 @@ async function runCorrection(models: BackendModels) {
13
13
  const mainItem = main({
14
14
  models,
15
15
  });
16
-
16
+
17
17
  const processor = mainItem.incidentProcessor;
18
18
  const department = await models.Department.findById(departmentId);
19
19
  if (!department) {
20
20
  console.log(`Could not find department for ${departmentId}.`);
21
21
  return;
22
22
  }
23
-
23
+
24
24
  const result = await processor.handleProcessIncidentRequestCorrection(incidentNumber, department, atDate);
25
25
  if ("error" in result) {
26
26
  console.log("Error", result.error);
@@ -31,9 +31,9 @@ async function runCorrection(models: BackendModels) {
31
31
  incident
32
32
  } = result;
33
33
  console.log(
34
- "p", incident?.AgencyIncidentCallTypeDescription,
35
- "u", (incident?.units ?? []).length,
36
- "c", (incident?.Comment ?? []).length,
34
+ "p", incident?.AgencyIncidentCallTypeDescription,
35
+ "u", (incident?.units ?? []).length,
36
+ "c", (incident?.Comment ?? []).length,
37
37
  "st", (incident?.EntryDateTime),
38
38
  "cl", (incident?.ClosedDateTime),
39
39
  "z"