grm-shared-library 1.1.193 → 1.1.194
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/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/modules/alert-dispatch/enums/incident-dispatch-scope.enum.js +27 -0
- package/dist/cjs/modules/alert-dispatch/enums/incident-dispatch-scope.enum.js.map +1 -0
- package/dist/cjs/modules/alert-dispatch/index.js +23 -0
- package/dist/cjs/modules/alert-dispatch/index.js.map +1 -0
- package/dist/cjs/modules/alert-dispatch/interfaces/alert-dispatch.js +3 -0
- package/dist/cjs/modules/alert-dispatch/interfaces/alert-dispatch.js.map +1 -0
- package/dist/cjs/modules/alert-dispatch/utils/alert-dispatch.util.js +86 -0
- package/dist/cjs/modules/alert-dispatch/utils/alert-dispatch.util.js.map +1 -0
- package/dist/cjs/modules/incident/dtos/incident/create-incident.dto.js +18 -0
- package/dist/cjs/modules/incident/dtos/incident/create-incident.dto.js.map +1 -1
- package/dist/cjs/modules/incident/dtos/incident/incident.dto.js +11 -0
- package/dist/cjs/modules/incident/dtos/incident/incident.dto.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/modules/alert-dispatch/enums/incident-dispatch-scope.enum.js +24 -0
- package/dist/esm/modules/alert-dispatch/enums/incident-dispatch-scope.enum.js.map +1 -0
- package/dist/esm/modules/alert-dispatch/index.js +7 -0
- package/dist/esm/modules/alert-dispatch/index.js.map +1 -0
- package/dist/esm/modules/alert-dispatch/interfaces/alert-dispatch.js +2 -0
- package/dist/esm/modules/alert-dispatch/interfaces/alert-dispatch.js.map +1 -0
- package/dist/esm/modules/alert-dispatch/utils/alert-dispatch.util.js +78 -0
- package/dist/esm/modules/alert-dispatch/utils/alert-dispatch.util.js.map +1 -0
- package/dist/esm/modules/incident/dtos/incident/create-incident.dto.js +18 -0
- package/dist/esm/modules/incident/dtos/incident/create-incident.dto.js.map +1 -1
- package/dist/esm/modules/incident/dtos/incident/incident.dto.js +12 -1
- package/dist/esm/modules/incident/dtos/incident/incident.dto.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/interfaces/pagination.d.ts +8 -0
- package/dist/types/modules/alert-dispatch/enums/incident-dispatch-scope.enum.d.ts +22 -0
- package/dist/types/modules/alert-dispatch/index.d.ts +3 -0
- package/dist/types/modules/alert-dispatch/interfaces/alert-dispatch.d.ts +33 -0
- package/dist/types/modules/alert-dispatch/utils/alert-dispatch.util.d.ts +51 -0
- package/dist/types/modules/incident/dtos/incident/create-incident.dto.d.ts +14 -0
- package/dist/types/modules/incident/dtos/incident/incident.dto.d.ts +8 -0
- package/dist/types/modules/incident/intefaces/incident.d.ts +9 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -37,6 +37,7 @@ __exportStar(require("./modules/country/index"), exports);
|
|
|
37
37
|
__exportStar(require("./modules/phone/index"), exports);
|
|
38
38
|
__exportStar(require("./modules/tracking/index"), exports);
|
|
39
39
|
__exportStar(require("./modules/entitlement/index"), exports);
|
|
40
|
+
__exportStar(require("./modules/alert-dispatch/index"), exports);
|
|
40
41
|
__exportStar(require("./modules/system-user/index"), exports);
|
|
41
42
|
// Interfaces
|
|
42
43
|
__exportStar(require("./interfaces/server-message"), exports);
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,UAAU;AACV,uDAAqC;AACrC,+DAA6C;AAC7C,yDAAuC;AACvC,6DAA2C;AAC3C,uDAAqC;AACrC,uDAAqC;AACrC,iEAA+C;AAC/C,wDAAsC;AACtC,gEAA8C;AAC9C,2DAAyC;AACzC,2DAAyC;AACzC,sDAAoC;AACpC,sDAAoC;AACpC,sDAAoC;AACpC,yDAAuC;AACvC,mEAAiD;AACjD,+DAA6C;AAC7C,uDAAqC;AACrC,0DAAwC;AACxC,wDAAsC;AACtC,2DAAyC;AACzC,8DAA4C;AAC5C,8DAA4C;AAE5C,aAAa;AACb,8DAA4C;AAC5C,mEAAiD;AACjD,8DAA4C;AAC5C,2DAAyC;AACzC,0DAAwC;AAExC,YAAY;AACZ,2DAAyC;AAEzC,QAAQ;AACR,gDAA8B;AAE9B,YAAY;AACZ,+DAA6C;AAC7C,wFAAsE;AAEtE,aAAa;AACb,qDAAmC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,UAAU;AACV,uDAAqC;AACrC,+DAA6C;AAC7C,yDAAuC;AACvC,6DAA2C;AAC3C,uDAAqC;AACrC,uDAAqC;AACrC,iEAA+C;AAC/C,wDAAsC;AACtC,gEAA8C;AAC9C,2DAAyC;AACzC,2DAAyC;AACzC,sDAAoC;AACpC,sDAAoC;AACpC,sDAAoC;AACpC,yDAAuC;AACvC,mEAAiD;AACjD,+DAA6C;AAC7C,uDAAqC;AACrC,0DAAwC;AACxC,wDAAsC;AACtC,2DAAyC;AACzC,8DAA4C;AAC5C,iEAA+C;AAC/C,8DAA4C;AAE5C,aAAa;AACb,8DAA4C;AAC5C,mEAAiD;AACjD,8DAA4C;AAC5C,2DAAyC;AACzC,0DAAwC;AAExC,YAAY;AACZ,2DAAyC;AAEzC,QAAQ;AACR,gDAA8B;AAE9B,YAAY;AACZ,+DAA6C;AAC7C,wFAAsE;AAEtE,aAAa;AACb,qDAAmC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IncidentDispatchScope = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* List filter applied to incident queries on the *dispatch* dimension - i.e.
|
|
6
|
+
* whether the reporter asked for the service provider to be alerted at all.
|
|
7
|
+
*
|
|
8
|
+
* ALL - no dispatch filter (default; preserves legacy behaviour).
|
|
9
|
+
* DISPATCHED - only incidents the provider was asked to receive. Used by the
|
|
10
|
+
* primary admin incident list, map and kanban views.
|
|
11
|
+
* SUPPRESSED - only incidents the reporter explicitly withheld from the
|
|
12
|
+
* provider. Backs the "Incident List - Marked Ignore" admin
|
|
13
|
+
* view.
|
|
14
|
+
*
|
|
15
|
+
* Deliberately separate from {@link IncidentEntitlementScope}: entitlement is a
|
|
16
|
+
* billing fact about the reporter, dispatch is a choice the reporter made on
|
|
17
|
+
* this one alert. The two compose - the control room asks for
|
|
18
|
+
* `ENTITLED` + `DISPATCHED`, "Marked Ignore" asks for `ENTITLED` + `SUPPRESSED`,
|
|
19
|
+
* and "Free Users" asks for `FREE` on the entitlement dimension alone.
|
|
20
|
+
*/
|
|
21
|
+
var IncidentDispatchScope;
|
|
22
|
+
(function (IncidentDispatchScope) {
|
|
23
|
+
IncidentDispatchScope["ALL"] = "ALL";
|
|
24
|
+
IncidentDispatchScope["DISPATCHED"] = "DISPATCHED";
|
|
25
|
+
IncidentDispatchScope["SUPPRESSED"] = "SUPPRESSED";
|
|
26
|
+
})(IncidentDispatchScope || (exports.IncidentDispatchScope = IncidentDispatchScope = {}));
|
|
27
|
+
//# sourceMappingURL=incident-dispatch-scope.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"incident-dispatch-scope.enum.js","sourceRoot":"","sources":["../../../../../src/modules/alert-dispatch/enums/incident-dispatch-scope.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAC7B,oCAAW,CAAA;IACX,kDAAyB,CAAA;IACzB,kDAAyB,CAAA;AAC7B,CAAC,EAJW,qBAAqB,qCAArB,qBAAqB,QAIhC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
// Enums
|
|
18
|
+
__exportStar(require("./enums/incident-dispatch-scope.enum"), exports);
|
|
19
|
+
// Interfaces
|
|
20
|
+
__exportStar(require("./interfaces/alert-dispatch"), exports);
|
|
21
|
+
// Utilities
|
|
22
|
+
__exportStar(require("./utils/alert-dispatch.util"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/alert-dispatch/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,QAAQ;AACR,uEAAqD;AAErD,aAAa;AACb,8DAA4C;AAE5C,YAAY;AACZ,8DAA4C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-dispatch.js","sourceRoot":"","sources":["../../../../../src/modules/alert-dispatch/interfaces/alert-dispatch.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.reachesControlRoom = reachesControlRoom;
|
|
4
|
+
exports.reachesGuardians = reachesGuardians;
|
|
5
|
+
exports.isMarkedIgnore = isMarkedIgnore;
|
|
6
|
+
exports.resolveIncidentAlertDispatch = resolveIncidentAlertDispatch;
|
|
7
|
+
exports.reachesNobody = reachesNobody;
|
|
8
|
+
exports.parseIncidentDispatchScope = parseIncidentDispatchScope;
|
|
9
|
+
const entitlement_util_1 = require("../../entitlement/utils/entitlement.util");
|
|
10
|
+
const incident_dispatch_scope_enum_1 = require("../enums/incident-dispatch-scope.enum");
|
|
11
|
+
/**
|
|
12
|
+
* Whether an incident reaches the provider control room - live map, live list,
|
|
13
|
+
* kanban, operator assignment and operator notifications.
|
|
14
|
+
*
|
|
15
|
+
* Two independent reasons keep an alert out, and this is the single place both
|
|
16
|
+
* are expressed so no consumer can honour one and forget the other:
|
|
17
|
+
*
|
|
18
|
+
* 1. the reporter is a Free user, so the provider was never entitled to it;
|
|
19
|
+
* 2. the reporter explicitly unchecked the provider option ("Marked Ignore").
|
|
20
|
+
*
|
|
21
|
+
* A missing flag counts as dispatched: incidents written before this feature
|
|
22
|
+
* existed, and every operator-created record, keep their original behaviour.
|
|
23
|
+
*/
|
|
24
|
+
function reachesControlRoom(incident) {
|
|
25
|
+
if (!incident)
|
|
26
|
+
return true;
|
|
27
|
+
if ((0, entitlement_util_1.isFreeUserTier)(incident.entitlementTier))
|
|
28
|
+
return false;
|
|
29
|
+
return incident.notifyServiceProvider !== false;
|
|
30
|
+
}
|
|
31
|
+
/** Whether the reporter's guardians should be pulled in and notified. */
|
|
32
|
+
function reachesGuardians(incident) {
|
|
33
|
+
return !incident || incident.notifyGuardians !== false;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Whether the reporter deliberately withheld this alert from the provider, as
|
|
37
|
+
* opposed to never having been entitled to send it. Only the former belongs in
|
|
38
|
+
* the "Marked Ignore" admin list; a Free user's alert belongs in
|
|
39
|
+
* "Incident List - Free Users".
|
|
40
|
+
*/
|
|
41
|
+
function isMarkedIgnore(incident) {
|
|
42
|
+
if (!incident)
|
|
43
|
+
return false;
|
|
44
|
+
return incident.notifyServiceProvider === false && !(0, entitlement_util_1.isFreeUserTier)(incident.entitlementTier);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Applies dispatch policy to what the client asked for.
|
|
48
|
+
*
|
|
49
|
+
* The client's checkboxes are an intent, never the decision: a Free user's
|
|
50
|
+
* provider option is unchecked and read-only in the app, and this is what makes
|
|
51
|
+
* that true even for a caller that ignores the UI. Anything the client omits
|
|
52
|
+
* defaults to "notify", so existing callers (web admin, older app builds) are
|
|
53
|
+
* unaffected.
|
|
54
|
+
*
|
|
55
|
+
* Returns resolved flags only - it deliberately does not reject the
|
|
56
|
+
* both-off combination, so callers can decide whether that is a validation
|
|
57
|
+
* error (the SOS path) or simply nobody to notify.
|
|
58
|
+
*/
|
|
59
|
+
function resolveIncidentAlertDispatch(request) {
|
|
60
|
+
const applies = request.applies !== false;
|
|
61
|
+
if (!applies) {
|
|
62
|
+
return { notifyServiceProvider: true, notifyGuardians: true };
|
|
63
|
+
}
|
|
64
|
+
const notifyGuardians = request.notifyGuardians !== false;
|
|
65
|
+
const notifyServiceProvider = (0, entitlement_util_1.isFreeUserTier)(request.tier)
|
|
66
|
+
? false
|
|
67
|
+
: request.notifyServiceProvider !== false;
|
|
68
|
+
return { notifyServiceProvider, notifyGuardians };
|
|
69
|
+
}
|
|
70
|
+
/** True when an alert would reach nobody at all. */
|
|
71
|
+
function reachesNobody(dispatch) {
|
|
72
|
+
return (dispatch === null || dispatch === void 0 ? void 0 : dispatch.notifyServiceProvider) === false && (dispatch === null || dispatch === void 0 ? void 0 : dispatch.notifyGuardians) === false;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Parses a client-supplied dispatch scope. Unknown/absent values fall back to
|
|
76
|
+
* `ALL` so an unrecognised query string never silently hides incidents.
|
|
77
|
+
*/
|
|
78
|
+
function parseIncidentDispatchScope(value) {
|
|
79
|
+
if (!value)
|
|
80
|
+
return incident_dispatch_scope_enum_1.IncidentDispatchScope.ALL;
|
|
81
|
+
const normalized = value.trim().toUpperCase();
|
|
82
|
+
return Object.values(incident_dispatch_scope_enum_1.IncidentDispatchScope).includes(normalized)
|
|
83
|
+
? normalized
|
|
84
|
+
: incident_dispatch_scope_enum_1.IncidentDispatchScope.ALL;
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=alert-dispatch.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-dispatch.util.js","sourceRoot":"","sources":["../../../../../src/modules/alert-dispatch/utils/alert-dispatch.util.ts"],"names":[],"mappings":";;AAkBA,gDAMC;AAGD,4CAEC;AAQD,wCAKC;AAeD,oEAaC;AAGD,sCAEC;AAMD,gEAMC;AAtFD,+EAA0E;AAC1E,wFAA8E;AAG9E;;;;;;;;;;;;GAYG;AACH,SAAgB,kBAAkB,CAC9B,QAA+F;IAE/F,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC3B,IAAI,IAAA,iCAAc,EAAC,QAAQ,CAAC,eAAe,CAAC;QAAE,OAAO,KAAK,CAAC;IAC3D,OAAO,QAAQ,CAAC,qBAAqB,KAAK,KAAK,CAAC;AACpD,CAAC;AAED,yEAAyE;AACzE,SAAgB,gBAAgB,CAAC,QAA+B;IAC5D,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC,eAAe,KAAK,KAAK,CAAC;AAC3D,CAAC;AAED;;;;;GAKG;AACH,SAAgB,cAAc,CAC1B,QAA+F;IAE/F,IAAI,CAAC,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5B,OAAO,QAAQ,CAAC,qBAAqB,KAAK,KAAK,IAAI,CAAC,IAAA,iCAAc,EAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;AACjG,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,4BAA4B,CAAC,OAA6B;IACtE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,KAAK,KAAK,CAAC;IAE1C,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,OAAO,EAAE,qBAAqB,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC;IAClE,CAAC;IAED,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,KAAK,KAAK,CAAC;IAC1D,MAAM,qBAAqB,GAAG,IAAA,iCAAc,EAAC,OAAO,CAAC,IAAI,CAAC;QACtD,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,OAAO,CAAC,qBAAqB,KAAK,KAAK,CAAC;IAE9C,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,CAAC;AACtD,CAAC;AAED,oDAAoD;AACpD,SAAgB,aAAa,CAAC,QAA+B;IACzD,OAAO,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,qBAAqB,MAAK,KAAK,IAAI,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,eAAe,MAAK,KAAK,CAAC;AAC5F,CAAC;AAED;;;GAGG;AACH,SAAgB,0BAA0B,CAAC,KAAqB;IAC5D,IAAI,CAAC,KAAK;QAAE,OAAO,oDAAqB,CAAC,GAAG,CAAC;IAC7C,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC9C,OAAQ,MAAM,CAAC,MAAM,CAAC,oDAAqB,CAAc,CAAC,QAAQ,CAAC,UAAU,CAAC;QAC1E,CAAC,CAAE,UAAoC;QACvC,CAAC,CAAC,oDAAqB,CAAC,GAAG,CAAC;AACpC,CAAC"}
|
|
@@ -267,4 +267,22 @@ __decorate([
|
|
|
267
267
|
(0, class_validator_1.IsNotEmpty)(),
|
|
268
268
|
__metadata("design:type", Number)
|
|
269
269
|
], CreateIncidentDto.prototype, "organizationId", void 0);
|
|
270
|
+
__decorate([
|
|
271
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
272
|
+
description: "Whether the service provider's control room should be alerted. Defaults to true.",
|
|
273
|
+
example: true
|
|
274
|
+
}),
|
|
275
|
+
(0, class_validator_1.IsBoolean)(),
|
|
276
|
+
(0, class_validator_1.IsOptional)(),
|
|
277
|
+
__metadata("design:type", Boolean)
|
|
278
|
+
], CreateIncidentDto.prototype, "notifyServiceProvider", void 0);
|
|
279
|
+
__decorate([
|
|
280
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
281
|
+
description: "Whether the reporter's guardians should be alerted and added to the incident chat. Defaults to true.",
|
|
282
|
+
example: true
|
|
283
|
+
}),
|
|
284
|
+
(0, class_validator_1.IsBoolean)(),
|
|
285
|
+
(0, class_validator_1.IsOptional)(),
|
|
286
|
+
__metadata("design:type", Boolean)
|
|
287
|
+
], CreateIncidentDto.prototype, "notifyGuardians", void 0);
|
|
270
288
|
//# sourceMappingURL=create-incident.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-incident.dto.js","sourceRoot":"","sources":["../../../../../../src/modules/incident/dtos/incident/create-incident.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAyH;AACzH,6CAAmE;AACnE,2EAAiE;AACjE,yEAAgE;AAChE,6EAAoE;AACpE,yDAAyC;AACzC,+EAAsE;AACtE,4CAAiD;AACjD,2EAAkE;AAClE,qGAA8F;AAC9F,2FAAqF;AACrF,2FAAiF;AACjF,6FAAsF;AAEtF,MAAa,iBAAiB;
|
|
1
|
+
{"version":3,"file":"create-incident.dto.js","sourceRoot":"","sources":["../../../../../../src/modules/incident/dtos/incident/create-incident.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAyH;AACzH,6CAAmE;AACnE,2EAAiE;AACjE,yEAAgE;AAChE,6EAAoE;AACpE,yDAAyC;AACzC,+EAAsE;AACtE,4CAAiD;AACjD,2EAAkE;AAClE,qGAA8F;AAC9F,2FAAqF;AACrF,2FAAiF;AACjF,6FAAsF;AAEtF,MAAa,iBAAiB;CAoP7B;AApPD,8CAoPC;AA5OG;IAPC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,+CA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AmB,EAAC;QACjB,WAAW,EAAE,sGAAsG;QACnH,OAAO,EAAE,IAAI;KAChB,CAAC;IACD,IAAA,2BAAS,GAAE;IACX,IAAA,4BAAU,GAAE;;0DACa"}
|
|
@@ -21,6 +21,7 @@ const incident_assignment_dto_1 = require("../assignment/incident-assignment.dto
|
|
|
21
21
|
const update_incident_response_unit_assignment_dto_1 = require("../response-unit-assignment/update-incident-response-unit-assignment.dto");
|
|
22
22
|
const incident_reporter_dto_1 = require("../reporter/incident-reporter.dto");
|
|
23
23
|
const incident_status_details_dto_1 = require("./incident-status-details.dto");
|
|
24
|
+
const incident_entitlement_tier_enum_1 = require("../../../entitlement/enums/incident-entitlement-tier.enum");
|
|
24
25
|
class IncidentDto extends (0, swagger_1.OmitType)(create_incident_dto_1.CreateIncidentDto, ['reporter', 'statusDetails']) {
|
|
25
26
|
}
|
|
26
27
|
exports.IncidentDto = IncidentDto;
|
|
@@ -124,4 +125,14 @@ __decorate([
|
|
|
124
125
|
(0, class_validator_1.IsNotEmpty)(),
|
|
125
126
|
__metadata("design:type", String)
|
|
126
127
|
], IncidentDto.prototype, "updatedAt", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
130
|
+
description: 'Premium entitlement tier stamped on the incident at creation',
|
|
131
|
+
enum: incident_entitlement_tier_enum_1.IncidentEntitlementTier,
|
|
132
|
+
example: incident_entitlement_tier_enum_1.IncidentEntitlementTier.PREMIUM
|
|
133
|
+
}),
|
|
134
|
+
(0, class_validator_1.IsEnum)(incident_entitlement_tier_enum_1.IncidentEntitlementTier),
|
|
135
|
+
(0, class_validator_1.IsOptional)(),
|
|
136
|
+
__metadata("design:type", String)
|
|
137
|
+
], IncidentDto.prototype, "entitlementTier", void 0);
|
|
127
138
|
//# sourceMappingURL=incident.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"incident.dto.js","sourceRoot":"","sources":["../../../../../../src/modules/incident/dtos/incident/incident.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"incident.dto.js","sourceRoot":"","sources":["../../../../../../src/modules/incident/dtos/incident/incident.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAkH;AAClH,6CAA6E;AAC7E,+DAA0D;AAC1D,yDAAyC;AACzC,2FAAqF;AACrF,+EAAyE;AACzE,uEAAkE;AAClE,mFAA8E;AAC9E,2IAA6H;AAC7H,6EAAwE;AACxE,+EAAyE;AACzE,8GAAoG;AAEpG,MAAa,WAAY,SAAQ,IAAA,kBAAQ,EAAC,uCAAiB,EAAE,CAAC,UAAU,EAAE,eAAe,CAAU,CAAC;CAyGnG;AAzGD,kCAyGC;AAlGG;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,mCAAmC;QAChD,OAAO,EAAE,GAAG;KACf,CAAC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;uCACD;AASZ;IAPC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EAAE,gDAAgD;QAC7D,IAAI,EAAE,2CAAmB;KAC5B,CAAC;IACD,IAAA,gCAAc,GAAE;IAChB,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,2CAAmB,CAAC;IAC/B,IAAA,4BAAU,GAAE;8BACF,2CAAmB;6CAAC;AAS/B;IAPC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EAAE,8CAA8C;QAC3D,IAAI,EAAE,sDAAwB;KACjC,CAAC;IACD,IAAA,gCAAc,GAAE;IAChB,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,sDAAwB,CAAC;IACpC,IAAA,4BAAU,GAAE;8BACG,sDAAwB;kDAAC;AASzC;IAPC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EAAE,uCAAuC;QACpD,IAAI,EAAE,wDAAyB;KAClC,CAAC;IACD,IAAA,gCAAc,GAAE;IAChB,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,wD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ACtC,CAAC;IACD,IAAA,8BAAY,GAAE;IACd,IAAA,4BAAU,GAAE;;8CACM;AAQnB;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,kDAAkD;QAC/D,OAAO,EAAE,0BAA0B;KACtC,CAAC;IACD,IAAA,8BAAY,GAAE;IACd,IAAA,4BAAU,GAAE;;8CACM;AAenB;IAPC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EAAE,8DAA8D;QAC3E,IAAI,EAAE,wDAAuB;QAC7B,OAAO,EAAE,wDAAuB,CAAC,OAAO;KAC3C,CAAC;IACD,IAAA,wBAAM,EAAC,wDAAuB,CAAC;IAC/B,IAAA,4BAAU,GAAE;;oDAC6B"}
|
package/dist/esm/index.js
CHANGED
|
@@ -21,6 +21,7 @@ export * from './modules/country/index';
|
|
|
21
21
|
export * from './modules/phone/index';
|
|
22
22
|
export * from './modules/tracking/index';
|
|
23
23
|
export * from './modules/entitlement/index';
|
|
24
|
+
export * from './modules/alert-dispatch/index';
|
|
24
25
|
export * from './modules/system-user/index';
|
|
25
26
|
// Interfaces
|
|
26
27
|
export * from './interfaces/server-message';
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cA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;AAC/C,cAAc,6BAA6B,CAAC;AAE5C,aAAa;AACb,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AAExC,YAAY;AACZ,cAAc,0BAA0B,CAAC;AAEzC,QAAQ;AACR,cAAc,eAAe,CAAC;AAE9B,YAAY;AACZ,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uDAAuD,CAAC;AAEtE,aAAa;AACb,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* List filter applied to incident queries on the *dispatch* dimension - i.e.
|
|
3
|
+
* whether the reporter asked for the service provider to be alerted at all.
|
|
4
|
+
*
|
|
5
|
+
* ALL - no dispatch filter (default; preserves legacy behaviour).
|
|
6
|
+
* DISPATCHED - only incidents the provider was asked to receive. Used by the
|
|
7
|
+
* primary admin incident list, map and kanban views.
|
|
8
|
+
* SUPPRESSED - only incidents the reporter explicitly withheld from the
|
|
9
|
+
* provider. Backs the "Incident List - Marked Ignore" admin
|
|
10
|
+
* view.
|
|
11
|
+
*
|
|
12
|
+
* Deliberately separate from {@link IncidentEntitlementScope}: entitlement is a
|
|
13
|
+
* billing fact about the reporter, dispatch is a choice the reporter made on
|
|
14
|
+
* this one alert. The two compose - the control room asks for
|
|
15
|
+
* `ENTITLED` + `DISPATCHED`, "Marked Ignore" asks for `ENTITLED` + `SUPPRESSED`,
|
|
16
|
+
* and "Free Users" asks for `FREE` on the entitlement dimension alone.
|
|
17
|
+
*/
|
|
18
|
+
export var IncidentDispatchScope;
|
|
19
|
+
(function (IncidentDispatchScope) {
|
|
20
|
+
IncidentDispatchScope["ALL"] = "ALL";
|
|
21
|
+
IncidentDispatchScope["DISPATCHED"] = "DISPATCHED";
|
|
22
|
+
IncidentDispatchScope["SUPPRESSED"] = "SUPPRESSED";
|
|
23
|
+
})(IncidentDispatchScope || (IncidentDispatchScope = {}));
|
|
24
|
+
//# sourceMappingURL=incident-dispatch-scope.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"incident-dispatch-scope.enum.js","sourceRoot":"","sources":["../../../../../src/modules/alert-dispatch/enums/incident-dispatch-scope.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAN,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAC7B,oCAAW,CAAA;IACX,kDAAyB,CAAA;IACzB,kDAAyB,CAAA;AAC7B,CAAC,EAJW,qBAAqB,KAArB,qBAAqB,QAIhC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/alert-dispatch/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,sCAAsC,CAAC;AAErD,aAAa;AACb,cAAc,6BAA6B,CAAC;AAE5C,YAAY;AACZ,cAAc,6BAA6B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-dispatch.js","sourceRoot":"","sources":["../../../../../src/modules/alert-dispatch/interfaces/alert-dispatch.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { isFreeUserTier } from '../../entitlement/utils/entitlement.util';
|
|
2
|
+
import { IncidentDispatchScope } from '../enums/incident-dispatch-scope.enum';
|
|
3
|
+
/**
|
|
4
|
+
* Whether an incident reaches the provider control room - live map, live list,
|
|
5
|
+
* kanban, operator assignment and operator notifications.
|
|
6
|
+
*
|
|
7
|
+
* Two independent reasons keep an alert out, and this is the single place both
|
|
8
|
+
* are expressed so no consumer can honour one and forget the other:
|
|
9
|
+
*
|
|
10
|
+
* 1. the reporter is a Free user, so the provider was never entitled to it;
|
|
11
|
+
* 2. the reporter explicitly unchecked the provider option ("Marked Ignore").
|
|
12
|
+
*
|
|
13
|
+
* A missing flag counts as dispatched: incidents written before this feature
|
|
14
|
+
* existed, and every operator-created record, keep their original behaviour.
|
|
15
|
+
*/
|
|
16
|
+
export function reachesControlRoom(incident) {
|
|
17
|
+
if (!incident)
|
|
18
|
+
return true;
|
|
19
|
+
if (isFreeUserTier(incident.entitlementTier))
|
|
20
|
+
return false;
|
|
21
|
+
return incident.notifyServiceProvider !== false;
|
|
22
|
+
}
|
|
23
|
+
/** Whether the reporter's guardians should be pulled in and notified. */
|
|
24
|
+
export function reachesGuardians(incident) {
|
|
25
|
+
return !incident || incident.notifyGuardians !== false;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Whether the reporter deliberately withheld this alert from the provider, as
|
|
29
|
+
* opposed to never having been entitled to send it. Only the former belongs in
|
|
30
|
+
* the "Marked Ignore" admin list; a Free user's alert belongs in
|
|
31
|
+
* "Incident List - Free Users".
|
|
32
|
+
*/
|
|
33
|
+
export function isMarkedIgnore(incident) {
|
|
34
|
+
if (!incident)
|
|
35
|
+
return false;
|
|
36
|
+
return incident.notifyServiceProvider === false && !isFreeUserTier(incident.entitlementTier);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Applies dispatch policy to what the client asked for.
|
|
40
|
+
*
|
|
41
|
+
* The client's checkboxes are an intent, never the decision: a Free user's
|
|
42
|
+
* provider option is unchecked and read-only in the app, and this is what makes
|
|
43
|
+
* that true even for a caller that ignores the UI. Anything the client omits
|
|
44
|
+
* defaults to "notify", so existing callers (web admin, older app builds) are
|
|
45
|
+
* unaffected.
|
|
46
|
+
*
|
|
47
|
+
* Returns resolved flags only - it deliberately does not reject the
|
|
48
|
+
* both-off combination, so callers can decide whether that is a validation
|
|
49
|
+
* error (the SOS path) or simply nobody to notify.
|
|
50
|
+
*/
|
|
51
|
+
export function resolveIncidentAlertDispatch(request) {
|
|
52
|
+
const applies = request.applies !== false;
|
|
53
|
+
if (!applies) {
|
|
54
|
+
return { notifyServiceProvider: true, notifyGuardians: true };
|
|
55
|
+
}
|
|
56
|
+
const notifyGuardians = request.notifyGuardians !== false;
|
|
57
|
+
const notifyServiceProvider = isFreeUserTier(request.tier)
|
|
58
|
+
? false
|
|
59
|
+
: request.notifyServiceProvider !== false;
|
|
60
|
+
return { notifyServiceProvider, notifyGuardians };
|
|
61
|
+
}
|
|
62
|
+
/** True when an alert would reach nobody at all. */
|
|
63
|
+
export function reachesNobody(dispatch) {
|
|
64
|
+
return (dispatch === null || dispatch === void 0 ? void 0 : dispatch.notifyServiceProvider) === false && (dispatch === null || dispatch === void 0 ? void 0 : dispatch.notifyGuardians) === false;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Parses a client-supplied dispatch scope. Unknown/absent values fall back to
|
|
68
|
+
* `ALL` so an unrecognised query string never silently hides incidents.
|
|
69
|
+
*/
|
|
70
|
+
export function parseIncidentDispatchScope(value) {
|
|
71
|
+
if (!value)
|
|
72
|
+
return IncidentDispatchScope.ALL;
|
|
73
|
+
const normalized = value.trim().toUpperCase();
|
|
74
|
+
return Object.values(IncidentDispatchScope).includes(normalized)
|
|
75
|
+
? normalized
|
|
76
|
+
: IncidentDispatchScope.ALL;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=alert-dispatch.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-dispatch.util.js","sourceRoot":"","sources":["../../../../../src/modules/alert-dispatch/utils/alert-dispatch.util.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAG9E;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,kBAAkB,CAC9B,QAA+F;IAE/F,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC3B,IAAI,cAAc,CAAC,QAAQ,CAAC,eAAe,CAAC;QAAE,OAAO,KAAK,CAAC;IAC3D,OAAO,QAAQ,CAAC,qBAAqB,KAAK,KAAK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,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC9C,OAAQ,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAc,CAAC,QAAQ,CAAC,UAAU,CAAC;QAC1E,CAAC,CAAE,UAAoC;QACvC,CAAC,CAAC,qBAAqB,CAAC,GAAG,CAAC;AACpC,CAAC"}
|
|
@@ -263,4 +263,22 @@ __decorate([
|
|
|
263
263
|
IsNotEmpty(),
|
|
264
264
|
__metadata("design:type", Number)
|
|
265
265
|
], CreateIncidentDto.prototype, "organizationId", void 0);
|
|
266
|
+
__decorate([
|
|
267
|
+
ApiPropertyOptional({
|
|
268
|
+
description: "Whether the service provider's control room should be alerted. Defaults to true.",
|
|
269
|
+
example: true
|
|
270
|
+
}),
|
|
271
|
+
IsBoolean(),
|
|
272
|
+
IsOptional(),
|
|
273
|
+
__metadata("design:type", Boolean)
|
|
274
|
+
], CreateIncidentDto.prototype, "notifyServiceProvider", void 0);
|
|
275
|
+
__decorate([
|
|
276
|
+
ApiPropertyOptional({
|
|
277
|
+
description: "Whether the reporter's guardians should be alerted and added to the incident chat. Defaults to true.",
|
|
278
|
+
example: true
|
|
279
|
+
}),
|
|
280
|
+
IsBoolean(),
|
|
281
|
+
IsOptional(),
|
|
282
|
+
__metadata("design:type", Boolean)
|
|
283
|
+
], CreateIncidentDto.prototype, "notifyGuardians", void 0);
|
|
266
284
|
//# sourceMappingURL=create-incident.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-incident.dto.js","sourceRoot":"","sources":["../../../../../../src/modules/incident/dtos/incident/create-incident.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACzH,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,6BAA6B,EAAE,MAAM,+CAA+C,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AAEtF,MAAM,OAAO,iBAAiB;
|
|
1
|
+
{"version":3,"file":"create-incident.dto.js","sourceRoot":"","sources":["../../../../../../src/modules/incident/dtos/incident/create-incident.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACzH,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;A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AAC;KACtB,CAAC;IACD,OAAO,EAAE;IACT,QAAQ,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC5B,UAAU,EAAE;;0DACc;AAU3B;IARC,mBAAmB,CAAC;QACjB,WAAW,EAAE,uDAAuD;QACpE,IAAI,EAAE,CAAC,MAAM,CAAC;QACd,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;KACtB,CAAC;IACD,OAAO,EAAE;IACT,QAAQ,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC5B,UAAU,EAAE;;wDACY;AASzB;IAPC,WAAW,CAAC;QACT,WAAW,EAAE,sDAAsD;QACnE,IAAI,EAAE,6BAA6B;QACnC,OAAO,EAAE,6BAA6B,CAAC,cAAc;KACxD,CAAC;IACD,MAAM,CAAC,6BAA6B,CAAC;IACrC,UAAU,EAAE;;gEACyC;AAQtD;IANC,mBAAmB,CAAC;QACjB,WAAW,EAAE,gDAAgD;QAC7D,OAAO,EAAE,CAAC;KACb,CAAC;IACD,QAAQ,EAAE;IACV,UAAU,EAAE;;0DACY;AAQzB;IANC,WAAW,CAAC;QACT,WAAW,EAAE,gDAAgD;QAC7D,OAAO,EAAE,CAAC;KACb,CAAC;IACD,QAAQ,EAAE;IACV,UAAU,EAAE;;yDACW;AAgBxB;IANC,mBAAmB,CAAC;QACjB,WAAW,EAAE,kFAAkF;QAC/F,OAAO,EAAE,IAAI;KAChB,CAAC;IACD,SAAS,EAAE;IACX,UAAU,EAAE;;gEACmB;AAYhC;IANC,mBAAmB,CAAC;QACjB,WAAW,EAAE,sGAAsG;QACnH,OAAO,EAAE,IAAI;KAChB,CAAC;IACD,SAAS,EAAE;IACX,UAAU,EAAE;;0DACa"}
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import { IsArray, IsDateString, IsNotEmpty, IsNumber, IsOptional, ValidateNested } from "class-validator";
|
|
10
|
+
import { IsArray, IsDateString, IsEnum, IsNotEmpty, IsNumber, IsOptional, ValidateNested } from "class-validator";
|
|
11
11
|
import { ApiProperty, ApiPropertyOptional, OmitType } from "@nestjs/swagger";
|
|
12
12
|
import { CreateIncidentDto } from "./create-incident.dto";
|
|
13
13
|
import { Type } from "class-transformer";
|
|
@@ -18,6 +18,7 @@ import { IncidentAssignmentDto } from "../assignment/incident-assignment.dto";
|
|
|
18
18
|
import { IncidentResponseUnitAssignmentDto } from "../response-unit-assignment/update-incident-response-unit-assignment.dto";
|
|
19
19
|
import { IncidentReporterDto } from "../reporter/incident-reporter.dto";
|
|
20
20
|
import { IncidentStatusDetailsDto } from "./incident-status-details.dto";
|
|
21
|
+
import { IncidentEntitlementTier } from "../../../entitlement/enums/incident-entitlement-tier.enum";
|
|
21
22
|
export class IncidentDto extends OmitType(CreateIncidentDto, ['reporter', 'statusDetails']) {
|
|
22
23
|
}
|
|
23
24
|
__decorate([
|
|
@@ -120,4 +121,14 @@ __decorate([
|
|
|
120
121
|
IsNotEmpty(),
|
|
121
122
|
__metadata("design:type", String)
|
|
122
123
|
], IncidentDto.prototype, "updatedAt", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
ApiPropertyOptional({
|
|
126
|
+
description: 'Premium entitlement tier stamped on the incident at creation',
|
|
127
|
+
enum: IncidentEntitlementTier,
|
|
128
|
+
example: IncidentEntitlementTier.PREMIUM
|
|
129
|
+
}),
|
|
130
|
+
IsEnum(IncidentEntitlementTier),
|
|
131
|
+
IsOptional(),
|
|
132
|
+
__metadata("design:type", String)
|
|
133
|
+
], IncidentDto.prototype, "entitlementTier", void 0);
|
|
123
134
|
//# sourceMappingURL=incident.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"incident.dto.js","sourceRoot":"","sources":["../../../../../../src/modules/incident/dtos/incident/incident.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"incident.dto.js","sourceRoot":"","sources":["../../../../../../src/modules/incident/dtos/incident/incident.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAClH,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,iCAAiC,EAAE,MAAM,0EAA0E,CAAC;AAC7H,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2DAA2D,CAAC;AAEpG,MAAM,OAAO,WAAY,SAAQ,QAAQ,CAAC,iBAAiB,EAAE,CAAC,UAAU,EAAE,eAAe,CAAU,CAAC;CAyGnG;AAlGG;IANC,WAAW,CAAC;QACT,WAAW,EAAE,mCAAmC;QAChD,OAAO,EAAE,GAAG;KACf,CAAC;IACD,QAAQ,EAA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C,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAI,CAAC,GAAG,EAAE,CAAC,qBAAqB,CAAC;;gDACI;AAUtC;IARC,mBAAmB,CAAC;QACjB,WAAW,EAAE,oDAAoD;QACjE,IAAI,EAAE,CAAC,iCAAiC,CAAC;KAC5C,CAAC;IACD,OAAO,EAAE;IACT,UAAU,EAAE;IACZ,cAAc,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAI,CAAC,GAAG,EAAE,CAAC,iCAAiC,CAAC;;4DACgB;AAQ9D;IANC,WAAW,CAAC;QACT,WAAW,EAAE,6CAA6C;QAC1D,OAAO,EAAE,0BAA0B;KACtC,CAAC;IACD,YAAY,EAAE;IACd,UAAU,EAAE;;8CACM;AAQnB;IANC,WAAW,CAAC;QACT,WAAW,EAAE,kDAAkD;QAC/D,OAAO,EAAE,0BAA0B;KACtC,CAAC;IACD,YAAY,EAAE;IACd,UAAU,EAAE;;8CACM;AAenB;IAPC,mBAAmB,CAAC;QACjB,WAAW,EAAE,8DAA8D;QAC3E,IAAI,EAAE,uBAAuB;QAC7B,OAAO,EAAE,uBAAuB,CAAC,OAAO;KAC3C,CAAC;IACD,MAAM,CAAC,uBAAuB,CAAC;IAC/B,UAAU,EAAE;;oDAC6B"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export * from './modules/country/index';
|
|
|
20
20
|
export * from './modules/phone/index';
|
|
21
21
|
export * from './modules/tracking/index';
|
|
22
22
|
export * from './modules/entitlement/index';
|
|
23
|
+
export * from './modules/alert-dispatch/index';
|
|
23
24
|
export * from './modules/system-user/index';
|
|
24
25
|
export * from './interfaces/server-message';
|
|
25
26
|
export * from './interfaces/i-request-with-user';
|
|
@@ -6,6 +6,7 @@ import { ResponseUnit } from "../modules/response-unit";
|
|
|
6
6
|
import { User } from "../modules/user";
|
|
7
7
|
import { WebNotification } from "../modules/web-notification";
|
|
8
8
|
import { IncidentEntitlementScope } from "../modules/entitlement/enums/incident-entitlement-scope.enum";
|
|
9
|
+
import { IncidentDispatchScope } from "../modules/alert-dispatch/enums/incident-dispatch-scope.enum";
|
|
9
10
|
export interface CursorPaginatedResponse<T> {
|
|
10
11
|
data: T[];
|
|
11
12
|
nextCursor: string | null;
|
|
@@ -26,6 +27,13 @@ export interface PaginationParams {
|
|
|
26
27
|
*/
|
|
27
28
|
export interface IncidentQueryParams extends PaginationParams {
|
|
28
29
|
entitlementScope?: IncidentEntitlementScope;
|
|
30
|
+
/**
|
|
31
|
+
* Independent of `entitlementScope`: filters on whether the reporter asked
|
|
32
|
+
* for the provider to be alerted at all. The control room combines
|
|
33
|
+
* `ENTITLED` + `DISPATCHED`; the "Incident List - Marked Ignore" view asks
|
|
34
|
+
* for `ENTITLED` + `SUPPRESSED`. Omitting it applies no dispatch filter.
|
|
35
|
+
*/
|
|
36
|
+
dispatchScope?: IncidentDispatchScope;
|
|
29
37
|
}
|
|
30
38
|
export interface PaginatedResponse<T> {
|
|
31
39
|
data: T[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* List filter applied to incident queries on the *dispatch* dimension - i.e.
|
|
3
|
+
* whether the reporter asked for the service provider to be alerted at all.
|
|
4
|
+
*
|
|
5
|
+
* ALL - no dispatch filter (default; preserves legacy behaviour).
|
|
6
|
+
* DISPATCHED - only incidents the provider was asked to receive. Used by the
|
|
7
|
+
* primary admin incident list, map and kanban views.
|
|
8
|
+
* SUPPRESSED - only incidents the reporter explicitly withheld from the
|
|
9
|
+
* provider. Backs the "Incident List - Marked Ignore" admin
|
|
10
|
+
* view.
|
|
11
|
+
*
|
|
12
|
+
* Deliberately separate from {@link IncidentEntitlementScope}: entitlement is a
|
|
13
|
+
* billing fact about the reporter, dispatch is a choice the reporter made on
|
|
14
|
+
* this one alert. The two compose - the control room asks for
|
|
15
|
+
* `ENTITLED` + `DISPATCHED`, "Marked Ignore" asks for `ENTITLED` + `SUPPRESSED`,
|
|
16
|
+
* and "Free Users" asks for `FREE` on the entitlement dimension alone.
|
|
17
|
+
*/
|
|
18
|
+
export declare enum IncidentDispatchScope {
|
|
19
|
+
ALL = "ALL",
|
|
20
|
+
DISPATCHED = "DISPATCHED",
|
|
21
|
+
SUPPRESSED = "SUPPRESSED"
|
|
22
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { IncidentEntitlementTier } from '../../entitlement/enums/incident-entitlement-tier.enum';
|
|
2
|
+
/**
|
|
3
|
+
* Who an incident's alert was actually dispatched to.
|
|
4
|
+
*
|
|
5
|
+
* Both flags are resolved server-side at creation and then stored on the
|
|
6
|
+
* incident, so every downstream consumer (realtime publisher, notification
|
|
7
|
+
* service, admin lists, the mobile confirmation dialog) reads one recorded fact
|
|
8
|
+
* rather than re-deriving policy. `undefined` means "not recorded" and is
|
|
9
|
+
* always treated as `true`, which is what every incident written before this
|
|
10
|
+
* existed implicitly did.
|
|
11
|
+
*/
|
|
12
|
+
export interface IncidentAlertDispatch {
|
|
13
|
+
/**
|
|
14
|
+
* False when the alert must not reach the provider control room: the
|
|
15
|
+
* reporter unchecked the option, or they are a Free user who never had it.
|
|
16
|
+
*/
|
|
17
|
+
notifyServiceProvider?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* False when the reporter's guardians must not be pulled into the incident
|
|
20
|
+
* chat or notified about the alert.
|
|
21
|
+
*/
|
|
22
|
+
notifyGuardians?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/** The inputs {@link resolveIncidentAlertDispatch} decides from. */
|
|
25
|
+
export interface AlertDispatchRequest extends IncidentAlertDispatch {
|
|
26
|
+
/** Entitlement tier already decided for this incident. */
|
|
27
|
+
tier?: IncidentEntitlementTier | string | null;
|
|
28
|
+
/**
|
|
29
|
+
* False for records that predate or sit outside the SOS flow (grievances,
|
|
30
|
+
* operator-created incidents), which keep both channels on.
|
|
31
|
+
*/
|
|
32
|
+
applies?: boolean;
|
|
33
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { IncidentEntitlementTier } from '../../entitlement/enums/incident-entitlement-tier.enum';
|
|
2
|
+
import { IncidentDispatchScope } from '../enums/incident-dispatch-scope.enum';
|
|
3
|
+
import { AlertDispatchRequest, IncidentAlertDispatch } from '../interfaces/alert-dispatch';
|
|
4
|
+
/**
|
|
5
|
+
* Whether an incident reaches the provider control room - live map, live list,
|
|
6
|
+
* kanban, operator assignment and operator notifications.
|
|
7
|
+
*
|
|
8
|
+
* Two independent reasons keep an alert out, and this is the single place both
|
|
9
|
+
* are expressed so no consumer can honour one and forget the other:
|
|
10
|
+
*
|
|
11
|
+
* 1. the reporter is a Free user, so the provider was never entitled to it;
|
|
12
|
+
* 2. the reporter explicitly unchecked the provider option ("Marked Ignore").
|
|
13
|
+
*
|
|
14
|
+
* A missing flag counts as dispatched: incidents written before this feature
|
|
15
|
+
* existed, and every operator-created record, keep their original behaviour.
|
|
16
|
+
*/
|
|
17
|
+
export declare function reachesControlRoom(incident: IncidentAlertDispatch & {
|
|
18
|
+
entitlementTier?: IncidentEntitlementTier | string | null;
|
|
19
|
+
}): boolean;
|
|
20
|
+
/** Whether the reporter's guardians should be pulled in and notified. */
|
|
21
|
+
export declare function reachesGuardians(incident: IncidentAlertDispatch): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the reporter deliberately withheld this alert from the provider, as
|
|
24
|
+
* opposed to never having been entitled to send it. Only the former belongs in
|
|
25
|
+
* the "Marked Ignore" admin list; a Free user's alert belongs in
|
|
26
|
+
* "Incident List - Free Users".
|
|
27
|
+
*/
|
|
28
|
+
export declare function isMarkedIgnore(incident: IncidentAlertDispatch & {
|
|
29
|
+
entitlementTier?: IncidentEntitlementTier | string | null;
|
|
30
|
+
}): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Applies dispatch policy to what the client asked for.
|
|
33
|
+
*
|
|
34
|
+
* The client's checkboxes are an intent, never the decision: a Free user's
|
|
35
|
+
* provider option is unchecked and read-only in the app, and this is what makes
|
|
36
|
+
* that true even for a caller that ignores the UI. Anything the client omits
|
|
37
|
+
* defaults to "notify", so existing callers (web admin, older app builds) are
|
|
38
|
+
* unaffected.
|
|
39
|
+
*
|
|
40
|
+
* Returns resolved flags only - it deliberately does not reject the
|
|
41
|
+
* both-off combination, so callers can decide whether that is a validation
|
|
42
|
+
* error (the SOS path) or simply nobody to notify.
|
|
43
|
+
*/
|
|
44
|
+
export declare function resolveIncidentAlertDispatch(request: AlertDispatchRequest): Required<IncidentAlertDispatch>;
|
|
45
|
+
/** True when an alert would reach nobody at all. */
|
|
46
|
+
export declare function reachesNobody(dispatch: IncidentAlertDispatch): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Parses a client-supplied dispatch scope. Unknown/absent values fall back to
|
|
49
|
+
* `ALL` so an unrecognised query string never silently hides incidents.
|
|
50
|
+
*/
|
|
51
|
+
export declare function parseIncidentDispatchScope(value?: string | null): IncidentDispatchScope;
|
|
@@ -34,4 +34,18 @@ export declare class CreateIncidentDto {
|
|
|
34
34
|
workflowTaskQueueName: IncidentWorkflowTaskQueueName;
|
|
35
35
|
controlCentreId?: number;
|
|
36
36
|
organizationId: number;
|
|
37
|
+
/**
|
|
38
|
+
* Whether the service provider's control room should receive this alert.
|
|
39
|
+
*
|
|
40
|
+
* The reporter's choice, not the decision: clarion-incident resolves it
|
|
41
|
+
* against the reporter's entitlement before storing it (a Free user's option
|
|
42
|
+
* is always off). Omitting it means "notify", so callers that predate the
|
|
43
|
+
* option - the web admin, older app builds - are unaffected.
|
|
44
|
+
*/
|
|
45
|
+
notifyServiceProvider?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Whether the reporter's guardians should join the incident chat and be
|
|
48
|
+
* notified. Omitting it means "notify".
|
|
49
|
+
*/
|
|
50
|
+
notifyGuardians?: boolean;
|
|
37
51
|
}
|
|
@@ -6,6 +6,7 @@ import { IncidentAssignmentDto } from "../assignment/incident-assignment.dto";
|
|
|
6
6
|
import { IncidentResponseUnitAssignmentDto } from "../response-unit-assignment/update-incident-response-unit-assignment.dto";
|
|
7
7
|
import { IncidentReporterDto } from "../reporter/incident-reporter.dto";
|
|
8
8
|
import { IncidentStatusDetailsDto } from "./incident-status-details.dto";
|
|
9
|
+
import { IncidentEntitlementTier } from "../../../entitlement/enums/incident-entitlement-tier.enum";
|
|
9
10
|
declare const IncidentDto_base: import("@nestjs/common").Type<Omit<CreateIncidentDto, "reporter" | "statusDetails">>;
|
|
10
11
|
export declare class IncidentDto extends IncidentDto_base {
|
|
11
12
|
id: number;
|
|
@@ -18,5 +19,12 @@ export declare class IncidentDto extends IncidentDto_base {
|
|
|
18
19
|
responseUnitAssignments?: IncidentResponseUnitAssignmentDto[];
|
|
19
20
|
createdAt: string;
|
|
20
21
|
updatedAt: string;
|
|
22
|
+
/**
|
|
23
|
+
* Premium standing of the reporter when the alert was raised. Server-derived
|
|
24
|
+
* and read-only; it appears here so Kafka consumers (notably
|
|
25
|
+
* clarion-notification, which whitelists this DTO) can tell a Free-user
|
|
26
|
+
* alert from an entitled one without calling back into billing.
|
|
27
|
+
*/
|
|
28
|
+
entitlementTier?: IncidentEntitlementTier;
|
|
21
29
|
}
|
|
22
30
|
export {};
|
|
@@ -57,6 +57,15 @@ export interface Incident {
|
|
|
57
57
|
entitlementTier?: IncidentEntitlementTier;
|
|
58
58
|
/** Point-in-time audit of how `entitlementTier` was decided. */
|
|
59
59
|
entitlementSnapshot?: IncidentEntitlementSnapshot | null;
|
|
60
|
+
/**
|
|
61
|
+
* Who the reporter asked to be alerted, resolved against their entitlement
|
|
62
|
+
* at creation. `false` on the provider flag withholds the incident from the
|
|
63
|
+
* control room exactly as a Free tier does; `false` on the guardian flag
|
|
64
|
+
* keeps guardians out of the incident chat and its notifications. Absent on
|
|
65
|
+
* incidents raised before the options existed, which notified both.
|
|
66
|
+
*/
|
|
67
|
+
notifyServiceProvider?: boolean;
|
|
68
|
+
notifyGuardians?: boolean;
|
|
60
69
|
createdAt?: string;
|
|
61
70
|
updatedAt?: string;
|
|
62
71
|
category?: IncidentCategory;
|