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.
- package/build/ruleLegacy/karka.js +24 -0
- package/build/ruleLegacy/karka.js.map +1 -0
- package/build/ruleLegacy/specializer.js +142 -0
- package/build/ruleLegacy/specializer.js.map +1 -0
- package/build/ruleProcessorLegacy.js +1 -1
- package/build/ruleProcessorLegacy.js.map +1 -1
- package/build/rules/append-priority-description-to-call-type.js +1 -2
- package/build/rules/append-priority-description-to-call-type.js.map +1 -1
- package/build/rules/clean-up-comments.js +0 -1
- package/build/rules/clean-up-comments.js.map +1 -1
- package/build/rules/clean-up-lat-long.js +1 -2
- package/build/rules/clean-up-lat-long.js.map +1 -1
- package/build/rules/clear-field.js +0 -1
- package/build/rules/clear-field.js.map +1 -1
- package/build/rules/copy-location-comment.js +1 -1
- package/build/rules/copy-location-comment.js.map +1 -1
- package/build/rules/index.js +7 -4
- package/build/rules/index.js.map +1 -1
- package/build/rules/join-call-type-priority.js +0 -1
- package/build/rules/join-call-type-priority.js.map +1 -1
- package/build/rules/join-call-type-sacramento.js +0 -1
- package/build/rules/join-call-type-sacramento.js.map +1 -1
- package/build/rules/map-unit-dates-verdugo.js +0 -1
- package/build/rules/map-unit-dates-verdugo.js.map +1 -1
- package/build/rules/not-implemented.js +0 -1
- package/build/rules/not-implemented.js.map +1 -1
- package/build/rules/remove-incident-field.js +0 -2
- package/build/rules/remove-incident-field.js.map +1 -1
- package/build/rules/remove-person-from-unit.js +0 -2
- package/build/rules/remove-person-from-unit.js.map +1 -1
- package/build/rules/set-address.js +1 -1
- package/build/rules/set-address.js.map +1 -1
- package/build/rules/set-channels-from-radio-channels.js +0 -1
- package/build/rules/set-channels-from-radio-channels.js.map +1 -1
- package/build/rules/set-city-alameda.js +0 -1
- package/build/rules/set-city-alameda.js.map +1 -1
- package/build/rules/set-city-calfire-lnu.js +122 -123
- package/build/rules/set-city-calfire-lnu.js.map +1 -1
- package/build/rules/set-city-cleanup.js +0 -1
- package/build/rules/set-city-cleanup.js.map +1 -1
- package/build/rules/set-city-southern-marin.js +0 -1
- package/build/rules/set-city-southern-marin.js.map +1 -1
- package/build/rules/set-city-verdugo.js +0 -1
- package/build/rules/set-city-verdugo.js.map +1 -1
- package/build/rules/set-comment-opts-ack-type.js +0 -1
- package/build/rules/set-comment-opts-ack-type.js.map +1 -1
- package/build/rules/set-common-place-name.js +1 -2
- package/build/rules/set-common-place-name.js.map +1 -1
- package/build/rules/set-communication-channels-from-radio-names.js +1 -2
- package/build/rules/set-communication-channels-from-radio-names.js.map +1 -1
- package/build/rules/set-cross-streets.js +1 -2
- package/build/rules/set-cross-streets.js.map +1 -1
- package/build/rules/set-fire-alarm-at-dispatch-from-alarm-level.js +0 -1
- package/build/rules/set-fire-alarm-at-dispatch-from-alarm-level.js.map +1 -1
- package/build/rules/set-fire-map-pages-ontario.js +2 -3
- package/build/rules/set-fire-map-pages-ontario.js.map +1 -1
- package/build/rules/set-fire-map-santa-clara-city.js +0 -1
- package/build/rules/set-fire-map-santa-clara-city.js.map +1 -1
- package/build/rules/set-format-units-pulsepoint.js +1 -2
- package/build/rules/set-format-units-pulsepoint.js.map +1 -1
- package/build/rules/set-incident-type-ontario.js +1 -2
- package/build/rules/set-incident-type-ontario.js.map +1 -1
- package/build/rules/set-location-preference-derry.js +3 -4
- package/build/rules/set-location-preference-derry.js.map +1 -1
- package/build/rules/set-location-preference.js +0 -4
- package/build/rules/set-location-preference.js.map +1 -1
- package/build/rules/set-map-incident-type-pulsepoint.js +1 -2
- package/build/rules/set-map-incident-type-pulsepoint.js.map +1 -1
- package/build/rules/set-prior-incident-comment-field.js +1 -2
- package/build/rules/set-prior-incident-comment-field.js.map +1 -1
- package/build/rules/set-street-number.js +0 -1
- package/build/rules/set-street-number.js.map +1 -1
- package/build/store.js +1 -1
- package/build/store.js.map +1 -1
- package/build/test/domain.js +30 -30
- package/build/test/domain.js.map +1 -1
- package/build/test/mock.js +604 -604
- package/build/test/mock.js.map +1 -1
- package/build/test/rules/clean-up-comments.js +25 -25
- package/build/test/rules/clean-up-comments.js.map +1 -1
- package/build/test/rules/close-incident-matching-incident-number.js.map +1 -1
- package/build/test/rules/map-unit-dates-verdugo.js +5 -5
- package/build/test/rules/map-unit-dates-verdugo.js.map +1 -1
- package/build/test/rules/remove-person-from-unit.js +24 -24
- package/build/test/rules/remove-person-from-unit.js.map +1 -1
- package/build/test/rules/set-channels-from-radio-channels.js +40 -40
- package/build/test/rules/set-channels-from-radio-channels.js.map +1 -1
- package/build/test/rules/set-city-calfire-lnu.js +4 -4
- package/build/test/rules/set-city-calfire-lnu.js.map +1 -1
- package/build/test/rules/set-format-units-pulsepoint.js +16 -16
- package/build/test/rules/set-format-units-pulsepoint.js.map +1 -1
- package/build/test/rules/set-map-incident-type-pulsepoint.js +6 -6
- package/build/test/rules/set-map-incident-type-pulsepoint.js.map +1 -1
- package/build/test/rulesLegacy.js +1 -1
- package/build/test/rulesLegacy.js.map +1 -1
- package/definitions/ruleLegacy/karka.d.ts +5 -0
- package/definitions/ruleLegacy/karka.d.ts.map +1 -0
- package/definitions/ruleLegacy/specializer.d.ts +5 -0
- package/definitions/ruleLegacy/specializer.d.ts.map +1 -0
- package/definitions/rules/append-priority-description-to-call-type.d.ts.map +1 -1
- package/definitions/rules/clean-up-comments.d.ts.map +1 -1
- package/definitions/rules/clean-up-lat-long.d.ts.map +1 -1
- package/definitions/rules/clear-field.d.ts.map +1 -1
- package/definitions/rules/join-call-type-priority.d.ts.map +1 -1
- package/definitions/rules/join-call-type-sacramento.d.ts.map +1 -1
- package/definitions/rules/map-unit-dates-verdugo.d.ts.map +1 -1
- package/definitions/rules/not-implemented.d.ts.map +1 -1
- package/definitions/rules/remove-incident-field.d.ts.map +1 -1
- package/definitions/rules/remove-person-from-unit.d.ts.map +1 -1
- package/definitions/rules/set-channels-from-radio-channels.d.ts.map +1 -1
- package/definitions/rules/set-city-alameda.d.ts.map +1 -1
- package/definitions/rules/set-city-calfire-lnu.d.ts.map +1 -1
- package/definitions/rules/set-city-cleanup.d.ts.map +1 -1
- package/definitions/rules/set-city-southern-marin.d.ts.map +1 -1
- package/definitions/rules/set-city-verdugo.d.ts.map +1 -1
- package/definitions/rules/set-comment-opts-ack-type.d.ts.map +1 -1
- package/definitions/rules/set-common-place-name.d.ts.map +1 -1
- package/definitions/rules/set-communication-channels-from-radio-names.d.ts.map +1 -1
- package/definitions/rules/set-cross-streets.d.ts.map +1 -1
- package/definitions/rules/set-fire-alarm-at-dispatch-from-alarm-level.d.ts.map +1 -1
- package/definitions/rules/set-fire-map-santa-clara-city.d.ts.map +1 -1
- package/definitions/rules/set-format-units-pulsepoint.d.ts.map +1 -1
- package/definitions/rules/set-location-preference-derry.d.ts.map +1 -1
- package/definitions/rules/set-location-preference.d.ts.map +1 -1
- package/definitions/rules/set-map-incident-type-pulsepoint.d.ts.map +1 -1
- package/definitions/rules/set-prior-incident-comment-field.d.ts.map +1 -1
- package/definitions/rules/set-street-number.d.ts.map +1 -1
- package/definitions/store.d.ts +8 -4
- package/definitions/store.d.ts.map +1 -1
- package/definitions/types.d.ts.map +1 -1
- package/eslint.config.mjs +62 -42
- package/package.json +15 -13
- package/src/domain.ts +1 -1
- package/src/ruleLegacy/karka.js +25 -0
- package/src/ruleLegacy/specializer.js +158 -0
- package/src/ruleProcessorLegacy.d.ts +1 -1
- package/src/ruleProcessorLegacy.js +1 -1
- package/src/rules/append-priority-description-to-call-type.ts +1 -2
- package/src/rules/clean-up-comments.ts +0 -1
- package/src/rules/clean-up-lat-long.ts +1 -2
- package/src/rules/clear-field.ts +0 -1
- package/src/rules/copy-location-comment.ts +1 -1
- package/src/rules/index.ts +8 -8
- package/src/rules/join-call-type-priority.ts +0 -1
- package/src/rules/join-call-type-sacramento.ts +0 -1
- package/src/rules/map-unit-dates-verdugo.ts +0 -1
- package/src/rules/not-implemented.ts +0 -1
- package/src/rules/remove-incident-field.ts +0 -2
- package/src/rules/remove-person-from-unit.ts +0 -2
- package/src/rules/set-address.ts +2 -2
- package/src/rules/set-channels-from-radio-channels.ts +0 -1
- package/src/rules/set-city-alameda.ts +0 -1
- package/src/rules/set-city-calfire-lnu.ts +122 -123
- package/src/rules/set-city-cleanup.ts +0 -1
- package/src/rules/set-city-southern-marin.ts +0 -1
- package/src/rules/set-city-verdugo.ts +0 -1
- package/src/rules/set-comment-opts-ack-type.ts +0 -1
- package/src/rules/set-common-place-name.ts +1 -2
- package/src/rules/set-communication-channels-from-radio-names.ts +2 -3
- package/src/rules/set-cross-streets.ts +1 -2
- package/src/rules/set-fire-alarm-at-dispatch-from-alarm-level.ts +0 -1
- package/src/rules/set-fire-map-pages-ontario.ts +4 -4
- package/src/rules/set-fire-map-santa-clara-city.ts +0 -1
- package/src/rules/set-format-units-pulsepoint.ts +1 -2
- package/src/rules/set-incident-type-ontario.ts +3 -3
- package/src/rules/set-location-preference-derry.ts +3 -4
- package/src/rules/set-location-preference.ts +0 -4
- package/src/rules/set-map-incident-type-pulsepoint.ts +1 -2
- package/src/rules/set-prior-incident-comment-field.ts +1 -2
- package/src/rules/set-street-number.ts +0 -1
- package/src/store.ts +3 -3
- package/src/test/domain.ts +30 -30
- package/src/test/mock.ts +604 -604
- package/src/test/rules/clean-up-comments.ts +25 -25
- package/src/test/rules/close-incident-matching-incident-number.ts +1 -2
- package/src/test/rules/map-unit-dates-verdugo.ts +5 -5
- package/src/test/rules/remove-person-from-unit.ts +24 -24
- package/src/test/rules/set-address.ts +1 -1
- package/src/test/rules/set-channels-from-radio-channels.ts +40 -40
- package/src/test/rules/set-city-calfire-lnu.ts +4 -4
- package/src/test/rules/set-format-units-pulsepoint.ts +16 -16
- package/src/test/rules/set-map-incident-type-pulsepoint.ts +6 -6
- package/src/test/rulesLegacy.js +1 -1
- package/src/types.ts +1 -1
- 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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
17
|
-
|
|
16
|
+
AlarmAtDispatch: "1",
|
|
17
|
+
Personnel: [
|
|
18
18
|
{
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
PersonnelID: "R295",
|
|
20
|
+
PersonnelName: "SMITH,BOB FF/P"
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
PersonnelID: "R261",
|
|
24
|
+
PersonnelName: "SMITH, ROB FF/P"
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
PersonnelID: "R267",
|
|
28
|
+
PersonnelName: "SMITH, KYLE FF"
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
PersonnelID: "R216",
|
|
32
|
+
PersonnelName: "CID, JOHN CAPT"
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
PersonnelID: "T9",
|
|
36
|
+
PersonnelName: "Truck 9"
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
PersonnelID: "KM-TALL",
|
|
40
|
+
PersonnelName: "KINGS MTN VOLUNTEER ALL"
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
PersonnelID: "A0051",
|
|
44
|
+
PersonnelName: "RON SWANSON CAPT S/O"
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
PersonnelID: "E52",
|
|
48
|
+
PersonnelName: "E52"
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
PersonnelID: "BC5",
|
|
52
|
+
PersonnelName: "BC5 PAGER"
|
|
53
53
|
}
|
|
54
54
|
],
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
name: "Cmd",
|
|
15
|
+
channel: "5B",
|
|
16
|
+
channelDescription: "D 5B",
|
|
17
|
+
url: "",
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
name: "Tac",
|
|
21
|
+
channel: "5C",
|
|
22
|
+
channelDescription: "D 5C",
|
|
23
|
+
url: "",
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
name: "Grd",
|
|
27
|
+
channel: "XSD A/G",
|
|
28
|
+
channelDescription: "D XS",
|
|
29
|
+
url: "",
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
name: "VICTOR",
|
|
33
|
+
channel: "135.975 RNM",
|
|
34
|
+
channelDescription: "D V",
|
|
35
|
+
url: "",
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
name: "test",
|
|
62
|
+
channel: "5A",
|
|
63
|
+
channelDescription: "D 5A",
|
|
64
|
+
url: "",
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
name: "test2",
|
|
68
|
+
channel: "5C",
|
|
69
|
+
channelDescription: "D 5C",
|
|
70
|
+
url: "",
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
name: "Grd",
|
|
74
|
+
channel: "XSD A/G",
|
|
75
|
+
channelDescription: "D XS",
|
|
76
|
+
url: "",
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
name: "VICTOR",
|
|
80
|
+
channel: "135.975 RNM",
|
|
81
|
+
channelDescription: "D V",
|
|
82
|
+
url: "",
|
|
83
83
|
},
|
|
84
84
|
{
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
21
|
+
0:
|
|
22
22
|
{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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";
|
package/src/test/rulesLegacy.js
CHANGED
|
@@ -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
package/src/verify/correction.ts
CHANGED
|
@@ -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"
|