clarion-shared-types 1.0.84 → 1.0.86
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 +15 -7
- package/dist/cjs/modules/alert-dispatch/enums/incident-dispatch-scope.enum.js.map +1 -1
- package/dist/cjs/modules/alert-dispatch/utils/alert-dispatch.util.js +50 -15
- package/dist/cjs/modules/alert-dispatch/utils/alert-dispatch.util.js.map +1 -1
- package/dist/cjs/modules/entitlement/enums/incident-entitlement-scope.enum.js +16 -5
- package/dist/cjs/modules/entitlement/enums/incident-entitlement-scope.enum.js.map +1 -1
- package/dist/cjs/modules/partner/enums/partner-enums.js +128 -0
- package/dist/cjs/modules/partner/enums/partner-enums.js.map +1 -0
- package/dist/cjs/modules/partner/index.js +27 -0
- package/dist/cjs/modules/partner/index.js.map +1 -0
- package/dist/cjs/modules/partner/interfaces/incident-partner-routing.dto.js +3 -0
- package/dist/cjs/modules/partner/interfaces/incident-partner-routing.dto.js.map +1 -0
- package/dist/cjs/modules/partner/interfaces/partner-coverage-rule.dto.js +3 -0
- package/dist/cjs/modules/partner/interfaces/partner-coverage-rule.dto.js.map +1 -0
- package/dist/cjs/modules/partner/interfaces/partner-dispatch.dto.js +3 -0
- package/dist/cjs/modules/partner/interfaces/partner-dispatch.dto.js.map +1 -0
- package/dist/cjs/modules/partner/interfaces/partner-integration.dto.js +3 -0
- package/dist/cjs/modules/partner/interfaces/partner-integration.dto.js.map +1 -0
- package/dist/cjs/modules/partner/interfaces/partner-provider.dto.js +3 -0
- package/dist/cjs/modules/partner/interfaces/partner-provider.dto.js.map +1 -0
- package/dist/cjs/modules/partner/utils/partner-display.util.js +116 -0
- package/dist/cjs/modules/partner/utils/partner-display.util.js.map +1 -0
- 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 +15 -7
- package/dist/esm/modules/alert-dispatch/enums/incident-dispatch-scope.enum.js.map +1 -1
- package/dist/esm/modules/alert-dispatch/utils/alert-dispatch.util.js +48 -15
- package/dist/esm/modules/alert-dispatch/utils/alert-dispatch.util.js.map +1 -1
- package/dist/esm/modules/entitlement/enums/incident-entitlement-scope.enum.js +16 -5
- package/dist/esm/modules/entitlement/enums/incident-entitlement-scope.enum.js.map +1 -1
- package/dist/esm/modules/partner/enums/partner-enums.js +125 -0
- package/dist/esm/modules/partner/enums/partner-enums.js.map +1 -0
- package/dist/esm/modules/partner/index.js +11 -0
- package/dist/esm/modules/partner/index.js.map +1 -0
- package/dist/esm/modules/partner/interfaces/incident-partner-routing.dto.js +2 -0
- package/dist/esm/modules/partner/interfaces/incident-partner-routing.dto.js.map +1 -0
- package/dist/esm/modules/partner/interfaces/partner-coverage-rule.dto.js +2 -0
- package/dist/esm/modules/partner/interfaces/partner-coverage-rule.dto.js.map +1 -0
- package/dist/esm/modules/partner/interfaces/partner-dispatch.dto.js +2 -0
- package/dist/esm/modules/partner/interfaces/partner-dispatch.dto.js.map +1 -0
- package/dist/esm/modules/partner/interfaces/partner-integration.dto.js +2 -0
- package/dist/esm/modules/partner/interfaces/partner-integration.dto.js.map +1 -0
- package/dist/esm/modules/partner/interfaces/partner-provider.dto.js +2 -0
- package/dist/esm/modules/partner/interfaces/partner-provider.dto.js.map +1 -0
- package/dist/esm/modules/partner/utils/partner-display.util.js +110 -0
- package/dist/esm/modules/partner/utils/partner-display.util.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/modules/alert-dispatch/enums/incident-dispatch-scope.enum.d.ts +15 -7
- package/dist/types/modules/alert-dispatch/interfaces/alert-dispatch.d.ts +13 -0
- package/dist/types/modules/alert-dispatch/utils/alert-dispatch.util.d.ts +43 -15
- package/dist/types/modules/entitlement/enums/incident-entitlement-scope.enum.d.ts +17 -6
- package/dist/types/modules/incident/intefaces/incident.d.ts +15 -0
- package/dist/types/modules/partner/enums/partner-enums.d.ts +112 -0
- package/dist/types/modules/partner/index.d.ts +7 -0
- package/dist/types/modules/partner/interfaces/incident-partner-routing.dto.d.ts +30 -0
- package/dist/types/modules/partner/interfaces/partner-coverage-rule.dto.d.ts +42 -0
- package/dist/types/modules/partner/interfaces/partner-dispatch.dto.d.ts +126 -0
- package/dist/types/modules/partner/interfaces/partner-integration.dto.d.ts +86 -0
- package/dist/types/modules/partner/interfaces/partner-provider.dto.d.ts +53 -0
- package/dist/types/modules/partner/utils/partner-display.util.d.ts +37 -0
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EntitlementDecisionReason } from '../../entitlement/enums/entitlement-decision-reason.enum';
|
|
1
2
|
import { isFreeUserTier } from '../../entitlement/utils/entitlement.util';
|
|
2
3
|
import { IncidentDispatchScope } from '../enums/incident-dispatch-scope.enum';
|
|
3
4
|
/**
|
|
@@ -7,9 +8,11 @@ import { IncidentDispatchScope } from '../enums/incident-dispatch-scope.enum';
|
|
|
7
8
|
* Two independent reasons keep an alert out, and this is the single place both
|
|
8
9
|
* are expressed so no consumer can honour one and forget the other:
|
|
9
10
|
*
|
|
10
|
-
* 1. the reporter
|
|
11
|
-
*
|
|
11
|
+
* 1. the reporter was not entitled to send it (no subscription, or one that
|
|
12
|
+
* does not cover this incident type), so the provider was never asked;
|
|
13
|
+
* 2. the reporter explicitly unchecked the provider option.
|
|
12
14
|
*
|
|
15
|
+
* Reads `notifyServiceProvider`, the resolved OUTCOME - never the request.
|
|
13
16
|
* A missing flag counts as dispatched: incidents written before this feature
|
|
14
17
|
* existed, and every operator-created record, keep their original behaviour.
|
|
15
18
|
*/
|
|
@@ -25,15 +28,36 @@ export function reachesGuardians(incident) {
|
|
|
25
28
|
return !incident || incident.notifyGuardians !== false;
|
|
26
29
|
}
|
|
27
30
|
/**
|
|
28
|
-
* Whether the reporter deliberately withheld this alert from the provider
|
|
29
|
-
*
|
|
30
|
-
* the
|
|
31
|
-
*
|
|
31
|
+
* Whether the reporter deliberately withheld this alert from the provider.
|
|
32
|
+
*
|
|
33
|
+
* Reads the REQUEST, not the outcome. An alert entitlement withheld is not an
|
|
34
|
+
* alert somebody chose to withhold, and only the second belongs in a
|
|
35
|
+
* "Marked Ignore" view - a free user never had the option to decline, so their
|
|
36
|
+
* alert is not "marked ignore" however the resolved flag ended up.
|
|
37
|
+
*
|
|
38
|
+
* Independent of entitlement, so it holds equally for a subscriber who declined
|
|
39
|
+
* on a covered type and one who declined on a type their package excludes.
|
|
40
|
+
* Which of the two Marked Ignore lists they land in is decided by pairing this
|
|
41
|
+
* with the entitlement scope.
|
|
32
42
|
*/
|
|
33
43
|
export function isMarkedIgnore(incident) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
44
|
+
return (incident === null || incident === void 0 ? void 0 : incident.notifyServiceProviderRequested) === false;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Whether the reporter pays for cover, but not for the incident type they
|
|
48
|
+
* raised. Distinct from having no entitlement at all: this is a paying customer
|
|
49
|
+
* finding a gap in their package, not someone to upsell from scratch.
|
|
50
|
+
*/
|
|
51
|
+
export function isUncoveredIncidentType(incident) {
|
|
52
|
+
return (incident === null || incident === void 0 ? void 0 : incident.entitlementReason) === EntitlementDecisionReason.INCIDENT_TYPE_NOT_COVERED;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Whether the reporter had no entitlement whatsoever - never subscribed,
|
|
56
|
+
* lapsed, or a spent/expired trial. Deliberately excludes the uncovered-type
|
|
57
|
+
* case, which carries the same FREE tier but is a different conversation.
|
|
58
|
+
*/
|
|
59
|
+
export function isUnentitledReporter(incident) {
|
|
60
|
+
return isFreeUserTier(incident === null || incident === void 0 ? void 0 : incident.entitlementTier) && !isUncoveredIncidentType(incident);
|
|
37
61
|
}
|
|
38
62
|
/**
|
|
39
63
|
* Applies dispatch policy to what the client asked for.
|
|
@@ -44,20 +68,29 @@ export function isMarkedIgnore(incident) {
|
|
|
44
68
|
* defaults to "notify", so existing callers (web admin, older app builds) are
|
|
45
69
|
* unaffected.
|
|
46
70
|
*
|
|
47
|
-
* Returns
|
|
48
|
-
*
|
|
49
|
-
*
|
|
71
|
+
* Returns both what was asked for and what will happen, because the two diverge
|
|
72
|
+
* exactly when entitlement overrides the reporter - and that difference is what
|
|
73
|
+
* the admin's Marked Ignore views are built on.
|
|
74
|
+
*
|
|
75
|
+
* It deliberately does not reject the both-off combination, so callers can
|
|
76
|
+
* decide whether that is a validation error (the SOS path) or simply nobody to
|
|
77
|
+
* notify.
|
|
50
78
|
*/
|
|
51
79
|
export function resolveIncidentAlertDispatch(request) {
|
|
52
80
|
const applies = request.applies !== false;
|
|
53
81
|
if (!applies) {
|
|
54
|
-
return {
|
|
82
|
+
return {
|
|
83
|
+
notifyServiceProvider: true,
|
|
84
|
+
notifyGuardians: true,
|
|
85
|
+
notifyServiceProviderRequested: true,
|
|
86
|
+
};
|
|
55
87
|
}
|
|
56
88
|
const notifyGuardians = request.notifyGuardians !== false;
|
|
89
|
+
const notifyServiceProviderRequested = request.notifyServiceProvider !== false;
|
|
57
90
|
const notifyServiceProvider = isFreeUserTier(request.tier)
|
|
58
91
|
? false
|
|
59
|
-
:
|
|
60
|
-
return { notifyServiceProvider, notifyGuardians };
|
|
92
|
+
: notifyServiceProviderRequested;
|
|
93
|
+
return { notifyServiceProvider, notifyGuardians, notifyServiceProviderRequested };
|
|
61
94
|
}
|
|
62
95
|
/** True when an alert would reach nobody at all. */
|
|
63
96
|
export function reachesNobody(dispatch) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-dispatch.util.js","sourceRoot":"","sources":["../../../../../src/modules/alert-dispatch/utils/alert-dispatch.util.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"alert-dispatch.util.js","sourceRoot":"","sources":["../../../../../src/modules/alert-dispatch/utils/alert-dispatch.util.ts"],"names":[],"mappings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).
|
|
5
|
+
* ENTITLED — everything except incidents the reporter was not entitled
|
|
6
|
+
* to send. Used by the primary admin list, map and kanban.
|
|
7
|
+
* FREE — reporters with no entitlement at all: never subscribed,
|
|
8
|
+
* lapsed, or a spent/expired trial. Backs
|
|
9
|
+
* "Incident List - Free Users".
|
|
10
|
+
* UNCOVERED_TYPE — reporters who DO pay, but whose package excludes the
|
|
11
|
+
* incident type they raised. Backs
|
|
12
|
+
* "Incident List - Uncovered Types".
|
|
13
|
+
*
|
|
14
|
+
* The last two both carry tier FREE, because that is what billing stamps in
|
|
15
|
+
* either case, but they are very different situations for an operator: one is
|
|
16
|
+
* an upsell, the other is a paying customer discovering a gap in their cover.
|
|
17
|
+
* `FREE` therefore excludes uncovered-type incidents rather than absorbing
|
|
18
|
+
* them, so the three scopes partition the data with no overlap and no gaps.
|
|
9
19
|
*/
|
|
10
20
|
export var IncidentEntitlementScope;
|
|
11
21
|
(function (IncidentEntitlementScope) {
|
|
12
22
|
IncidentEntitlementScope["ALL"] = "ALL";
|
|
13
23
|
IncidentEntitlementScope["ENTITLED"] = "ENTITLED";
|
|
14
24
|
IncidentEntitlementScope["FREE"] = "FREE";
|
|
25
|
+
IncidentEntitlementScope["UNCOVERED_TYPE"] = "UNCOVERED_TYPE";
|
|
15
26
|
})(IncidentEntitlementScope || (IncidentEntitlementScope = {}));
|
|
16
27
|
//# sourceMappingURL=incident-entitlement-scope.enum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"incident-entitlement-scope.enum.js","sourceRoot":"","sources":["../../../../../src/modules/entitlement/enums/incident-entitlement-scope.enum.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"incident-entitlement-scope.enum.js","sourceRoot":"","sources":["../../../../../src/modules/entitlement/enums/incident-entitlement-scope.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAN,IAAY,wBAKX;AALD,WAAY,wBAAwB;IAChC,uCAAW,CAAA;IACX,iDAAqB,CAAA;IACrB,yCAAa,CAAA;IACb,6DAAiC,CAAA;AACrC,CAAC,EALW,wBAAwB,KAAxB,wBAAwB,QAKnC"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Frontend mirrors of the partner enums in grm-shared-library.
|
|
3
|
+
*
|
|
4
|
+
* Kept in ONE file rather than one per enum: the admin's partner screens import
|
|
5
|
+
* most of them together, and the set only means anything as a whole. The values
|
|
6
|
+
* are byte-identical to the backend's, because they travel over the wire as
|
|
7
|
+
* strings and any drift would show up as a silently unstyled chip rather than a
|
|
8
|
+
* compile error.
|
|
9
|
+
*/
|
|
10
|
+
/** The third-party partner behind a partnership. */
|
|
11
|
+
export var PartnerProviderCode;
|
|
12
|
+
(function (PartnerProviderCode) {
|
|
13
|
+
PartnerProviderCode["RESCUE_CO"] = "RESCUE_CO";
|
|
14
|
+
PartnerProviderCode["AAR"] = "AAR";
|
|
15
|
+
PartnerProviderCode["ST_JOHN"] = "ST_JOHN";
|
|
16
|
+
PartnerProviderCode["GENERIC_REST"] = "GENERIC_REST";
|
|
17
|
+
})(PartnerProviderCode || (PartnerProviderCode = {}));
|
|
18
|
+
/** A class of emergency service a partner can be asked to provide. */
|
|
19
|
+
export var PartnerServiceCapability;
|
|
20
|
+
(function (PartnerServiceCapability) {
|
|
21
|
+
PartnerServiceCapability["AMBULANCE"] = "AMBULANCE";
|
|
22
|
+
PartnerServiceCapability["MEDICAL_EVACUATION"] = "MEDICAL_EVACUATION";
|
|
23
|
+
PartnerServiceCapability["FIRE_RESPONSE"] = "FIRE_RESPONSE";
|
|
24
|
+
PartnerServiceCapability["SECURITY_RESPONSE"] = "SECURITY_RESPONSE";
|
|
25
|
+
PartnerServiceCapability["ROADSIDE_ASSISTANCE"] = "ROADSIDE_ASSISTANCE";
|
|
26
|
+
PartnerServiceCapability["TOWING"] = "TOWING";
|
|
27
|
+
PartnerServiceCapability["OTHER"] = "OTHER";
|
|
28
|
+
})(PartnerServiceCapability || (PartnerServiceCapability = {}));
|
|
29
|
+
/** How an incident a partnership covers reaches the partner. */
|
|
30
|
+
export var PartnerRoutingMode;
|
|
31
|
+
(function (PartnerRoutingMode) {
|
|
32
|
+
/** Sent as soon as the incident is created. */
|
|
33
|
+
PartnerRoutingMode["AUTO"] = "AUTO";
|
|
34
|
+
/** Held until an operator confirms it. */
|
|
35
|
+
PartnerRoutingMode["MANUAL"] = "MANUAL";
|
|
36
|
+
/** Configuration kept, nothing routed. */
|
|
37
|
+
PartnerRoutingMode["DISABLED"] = "DISABLED";
|
|
38
|
+
})(PartnerRoutingMode || (PartnerRoutingMode = {}));
|
|
39
|
+
/** Which of a partner's environments a partnership points at. */
|
|
40
|
+
export var PartnerIntegrationEnvironment;
|
|
41
|
+
(function (PartnerIntegrationEnvironment) {
|
|
42
|
+
PartnerIntegrationEnvironment["SANDBOX"] = "SANDBOX";
|
|
43
|
+
PartnerIntegrationEnvironment["PRODUCTION"] = "PRODUCTION";
|
|
44
|
+
})(PartnerIntegrationEnvironment || (PartnerIntegrationEnvironment = {}));
|
|
45
|
+
/** Last known health of a partnership's connection. Advisory only. */
|
|
46
|
+
export var PartnerIntegrationStatus;
|
|
47
|
+
(function (PartnerIntegrationStatus) {
|
|
48
|
+
PartnerIntegrationStatus["UNKNOWN"] = "UNKNOWN";
|
|
49
|
+
PartnerIntegrationStatus["HEALTHY"] = "HEALTHY";
|
|
50
|
+
PartnerIntegrationStatus["DEGRADED"] = "DEGRADED";
|
|
51
|
+
PartnerIntegrationStatus["UNREACHABLE"] = "UNREACHABLE";
|
|
52
|
+
})(PartnerIntegrationStatus || (PartnerIntegrationStatus = {}));
|
|
53
|
+
/** What a coverage rule matches an incident on. */
|
|
54
|
+
export var PartnerCoverageMatchType;
|
|
55
|
+
(function (PartnerCoverageMatchType) {
|
|
56
|
+
PartnerCoverageMatchType["ALL"] = "ALL";
|
|
57
|
+
PartnerCoverageMatchType["INCIDENT_TYPE"] = "INCIDENT_TYPE";
|
|
58
|
+
PartnerCoverageMatchType["INCIDENT_CATEGORY"] = "INCIDENT_CATEGORY";
|
|
59
|
+
PartnerCoverageMatchType["EMERGENCY_TYPE"] = "EMERGENCY_TYPE";
|
|
60
|
+
})(PartnerCoverageMatchType || (PartnerCoverageMatchType = {}));
|
|
61
|
+
/** Lifecycle of one incident's routing to one partner. */
|
|
62
|
+
export var PartnerDispatchStatus;
|
|
63
|
+
(function (PartnerDispatchStatus) {
|
|
64
|
+
PartnerDispatchStatus["PENDING_APPROVAL"] = "PENDING_APPROVAL";
|
|
65
|
+
PartnerDispatchStatus["QUEUED"] = "QUEUED";
|
|
66
|
+
PartnerDispatchStatus["SENDING"] = "SENDING";
|
|
67
|
+
PartnerDispatchStatus["SENT"] = "SENT";
|
|
68
|
+
PartnerDispatchStatus["ACKNOWLEDGED"] = "ACKNOWLEDGED";
|
|
69
|
+
PartnerDispatchStatus["FAILED"] = "FAILED";
|
|
70
|
+
PartnerDispatchStatus["REJECTED"] = "REJECTED";
|
|
71
|
+
PartnerDispatchStatus["CANCELLED"] = "CANCELLED";
|
|
72
|
+
PartnerDispatchStatus["EXPIRED"] = "EXPIRED";
|
|
73
|
+
})(PartnerDispatchStatus || (PartnerDispatchStatus = {}));
|
|
74
|
+
/** Why a dispatch did not reach its partner. */
|
|
75
|
+
export var PartnerDispatchFailureReason;
|
|
76
|
+
(function (PartnerDispatchFailureReason) {
|
|
77
|
+
PartnerDispatchFailureReason["INVALID_PAYLOAD"] = "INVALID_PAYLOAD";
|
|
78
|
+
PartnerDispatchFailureReason["MISSING_REQUIRED_FIELD"] = "MISSING_REQUIRED_FIELD";
|
|
79
|
+
PartnerDispatchFailureReason["AUTHENTICATION_FAILED"] = "AUTHENTICATION_FAILED";
|
|
80
|
+
PartnerDispatchFailureReason["FEATURE_NOT_ENABLED"] = "FEATURE_NOT_ENABLED";
|
|
81
|
+
PartnerDispatchFailureReason["PROVIDER_REJECTED"] = "PROVIDER_REJECTED";
|
|
82
|
+
PartnerDispatchFailureReason["ADAPTER_NOT_SUPPORTED"] = "ADAPTER_NOT_SUPPORTED";
|
|
83
|
+
PartnerDispatchFailureReason["INTEGRATION_DISABLED"] = "INTEGRATION_DISABLED";
|
|
84
|
+
PartnerDispatchFailureReason["CREDENTIAL_UNAVAILABLE"] = "CREDENTIAL_UNAVAILABLE";
|
|
85
|
+
PartnerDispatchFailureReason["RATE_LIMITED"] = "RATE_LIMITED";
|
|
86
|
+
PartnerDispatchFailureReason["PROVIDER_UNAVAILABLE"] = "PROVIDER_UNAVAILABLE";
|
|
87
|
+
PartnerDispatchFailureReason["TIMEOUT"] = "TIMEOUT";
|
|
88
|
+
PartnerDispatchFailureReason["MAX_ATTEMPTS_EXCEEDED"] = "MAX_ATTEMPTS_EXCEEDED";
|
|
89
|
+
PartnerDispatchFailureReason["UNKNOWN"] = "UNKNOWN";
|
|
90
|
+
})(PartnerDispatchFailureReason || (PartnerDispatchFailureReason = {}));
|
|
91
|
+
/** How the location attached to a dispatch was obtained. */
|
|
92
|
+
export var PartnerLocationProvider;
|
|
93
|
+
(function (PartnerLocationProvider) {
|
|
94
|
+
PartnerLocationProvider["GPS"] = "GPS";
|
|
95
|
+
PartnerLocationProvider["NETWORK"] = "NETWORK";
|
|
96
|
+
PartnerLocationProvider["FUSED"] = "FUSED";
|
|
97
|
+
})(PartnerLocationProvider || (PartnerLocationProvider = {}));
|
|
98
|
+
/** The outbound partner call an attempt record describes. */
|
|
99
|
+
export var PartnerAdapterOperation;
|
|
100
|
+
(function (PartnerAdapterOperation) {
|
|
101
|
+
PartnerAdapterOperation["AUTHENTICATE"] = "AUTHENTICATE";
|
|
102
|
+
PartnerAdapterOperation["HEALTH_CHECK"] = "HEALTH_CHECK";
|
|
103
|
+
PartnerAdapterOperation["DISPATCH"] = "DISPATCH";
|
|
104
|
+
})(PartnerAdapterOperation || (PartnerAdapterOperation = {}));
|
|
105
|
+
/** The incident-side summary of third-party routing, stored on the incident row. */
|
|
106
|
+
export var IncidentPartnerRoutingStatus;
|
|
107
|
+
(function (IncidentPartnerRoutingStatus) {
|
|
108
|
+
IncidentPartnerRoutingStatus["NOT_ROUTED"] = "NOT_ROUTED";
|
|
109
|
+
IncidentPartnerRoutingStatus["PENDING"] = "PENDING";
|
|
110
|
+
IncidentPartnerRoutingStatus["AWAITING_APPROVAL"] = "AWAITING_APPROVAL";
|
|
111
|
+
IncidentPartnerRoutingStatus["ROUTED"] = "ROUTED";
|
|
112
|
+
IncidentPartnerRoutingStatus["PARTIALLY_ROUTED"] = "PARTIALLY_ROUTED";
|
|
113
|
+
IncidentPartnerRoutingStatus["FAILED"] = "FAILED";
|
|
114
|
+
IncidentPartnerRoutingStatus["DECLINED"] = "DECLINED";
|
|
115
|
+
})(IncidentPartnerRoutingStatus || (IncidentPartnerRoutingStatus = {}));
|
|
116
|
+
/** List filter for the admin's partner-routing incident views. */
|
|
117
|
+
export var PartnerDispatchScope;
|
|
118
|
+
(function (PartnerDispatchScope) {
|
|
119
|
+
PartnerDispatchScope["ALL"] = "ALL";
|
|
120
|
+
PartnerDispatchScope["ROUTED"] = "ROUTED";
|
|
121
|
+
PartnerDispatchScope["AWAITING_APPROVAL"] = "AWAITING_APPROVAL";
|
|
122
|
+
PartnerDispatchScope["FAILED"] = "FAILED";
|
|
123
|
+
PartnerDispatchScope["NOT_ROUTED"] = "NOT_ROUTED";
|
|
124
|
+
})(PartnerDispatchScope || (PartnerDispatchScope = {}));
|
|
125
|
+
//# sourceMappingURL=partner-enums.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partner-enums.js","sourceRoot":"","sources":["../../../../../src/modules/partner/enums/partner-enums.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,oDAAoD;AACpD,MAAM,CAAN,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC3B,8CAAuB,CAAA;IACvB,kCAAW,CAAA;IACX,0CAAmB,CAAA;IACnB,oDAA6B,CAAA;AACjC,CAAC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,+DAAuC,CAAA;IACvC,yCAAiB,CAAA;IACjB,iDAAyB,CAAA;AAC7B,CAAC,EANW,oBAAoB,KAApB,oBAAoB,QAM/B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Enums
|
|
2
|
+
export * from './enums/partner-enums';
|
|
3
|
+
// Interfaces / DTOs
|
|
4
|
+
export * from './interfaces/partner-provider.dto';
|
|
5
|
+
export * from './interfaces/partner-integration.dto';
|
|
6
|
+
export * from './interfaces/partner-coverage-rule.dto';
|
|
7
|
+
export * from './interfaces/partner-dispatch.dto';
|
|
8
|
+
export * from './interfaces/incident-partner-routing.dto';
|
|
9
|
+
// Utilities
|
|
10
|
+
export * from './utils/partner-display.util';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/partner/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,uBAAuB,CAAC;AAEtC,oBAAoB;AACpB,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,wCAAwC,CAAC;AACvD,cAAc,mCAAmC,CAAC;AAClD,cAAc,2CAA2C,CAAC;AAE1D,YAAY;AACZ,cAAc,8BAA8B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"incident-partner-routing.dto.js","sourceRoot":"","sources":["../../../../../src/modules/partner/interfaces/incident-partner-routing.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partner-coverage-rule.dto.js","sourceRoot":"","sources":["../../../../../src/modules/partner/interfaces/partner-coverage-rule.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partner-dispatch.dto.js","sourceRoot":"","sources":["../../../../../src/modules/partner/interfaces/partner-dispatch.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partner-integration.dto.js","sourceRoot":"","sources":["../../../../../src/modules/partner/interfaces/partner-integration.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partner-provider.dto.js","sourceRoot":"","sources":["../../../../../src/modules/partner/interfaces/partner-provider.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { IncidentPartnerRoutingStatus, PartnerCoverageMatchType, PartnerDispatchStatus, PartnerIntegrationStatus, PartnerRoutingMode, PartnerServiceCapability, } from '../enums/partner-enums';
|
|
2
|
+
/**
|
|
3
|
+
* Human labels for the partner enums.
|
|
4
|
+
*
|
|
5
|
+
* Kept in the shared package rather than in the admin app so every screen that
|
|
6
|
+
* shows a dispatch - the list, the detail drawer, the incident view - names the
|
|
7
|
+
* same state the same way. An operator reading "Waiting for confirmation" in one
|
|
8
|
+
* place and "Pending approval" in another would reasonably assume they were
|
|
9
|
+
* different things.
|
|
10
|
+
*/
|
|
11
|
+
export const PARTNER_DISPATCH_STATUS_LABELS = {
|
|
12
|
+
[PartnerDispatchStatus.PENDING_APPROVAL]: 'Waiting for confirmation',
|
|
13
|
+
[PartnerDispatchStatus.QUEUED]: 'Queued',
|
|
14
|
+
[PartnerDispatchStatus.SENDING]: 'Sending',
|
|
15
|
+
[PartnerDispatchStatus.SENT]: 'Sent to partner',
|
|
16
|
+
[PartnerDispatchStatus.ACKNOWLEDGED]: 'Acknowledged by partner',
|
|
17
|
+
[PartnerDispatchStatus.FAILED]: 'Failed',
|
|
18
|
+
[PartnerDispatchStatus.REJECTED]: 'Declined',
|
|
19
|
+
[PartnerDispatchStatus.CANCELLED]: 'Withdrawn',
|
|
20
|
+
[PartnerDispatchStatus.EXPIRED]: 'Expired',
|
|
21
|
+
};
|
|
22
|
+
export const INCIDENT_PARTNER_ROUTING_STATUS_LABELS = {
|
|
23
|
+
[IncidentPartnerRoutingStatus.NOT_ROUTED]: 'No partner',
|
|
24
|
+
[IncidentPartnerRoutingStatus.PENDING]: 'Contacting partner',
|
|
25
|
+
[IncidentPartnerRoutingStatus.AWAITING_APPROVAL]: 'Waiting for confirmation',
|
|
26
|
+
[IncidentPartnerRoutingStatus.ROUTED]: 'Partner notified',
|
|
27
|
+
[IncidentPartnerRoutingStatus.PARTIALLY_ROUTED]: 'Partly notified',
|
|
28
|
+
[IncidentPartnerRoutingStatus.FAILED]: 'Partner not reached',
|
|
29
|
+
[IncidentPartnerRoutingStatus.DECLINED]: 'Declined',
|
|
30
|
+
};
|
|
31
|
+
export const PARTNER_ROUTING_MODE_LABELS = {
|
|
32
|
+
[PartnerRoutingMode.AUTO]: 'Automatic',
|
|
33
|
+
[PartnerRoutingMode.MANUAL]: 'Needs confirmation',
|
|
34
|
+
[PartnerRoutingMode.DISABLED]: 'Routing off',
|
|
35
|
+
};
|
|
36
|
+
export const PARTNER_INTEGRATION_STATUS_LABELS = {
|
|
37
|
+
[PartnerIntegrationStatus.UNKNOWN]: 'Not tested',
|
|
38
|
+
[PartnerIntegrationStatus.HEALTHY]: 'Healthy',
|
|
39
|
+
[PartnerIntegrationStatus.DEGRADED]: 'Degraded',
|
|
40
|
+
[PartnerIntegrationStatus.UNREACHABLE]: 'Unreachable',
|
|
41
|
+
};
|
|
42
|
+
export const PARTNER_CAPABILITY_LABELS = {
|
|
43
|
+
[PartnerServiceCapability.AMBULANCE]: 'Ambulance',
|
|
44
|
+
[PartnerServiceCapability.MEDICAL_EVACUATION]: 'Medical evacuation',
|
|
45
|
+
[PartnerServiceCapability.FIRE_RESPONSE]: 'Fire response',
|
|
46
|
+
[PartnerServiceCapability.SECURITY_RESPONSE]: 'Security response',
|
|
47
|
+
[PartnerServiceCapability.ROADSIDE_ASSISTANCE]: 'Roadside assistance',
|
|
48
|
+
[PartnerServiceCapability.TOWING]: 'Towing',
|
|
49
|
+
[PartnerServiceCapability.OTHER]: 'Other',
|
|
50
|
+
};
|
|
51
|
+
export const PARTNER_COVERAGE_MATCH_TYPE_LABELS = {
|
|
52
|
+
[PartnerCoverageMatchType.ALL]: 'Every incident',
|
|
53
|
+
[PartnerCoverageMatchType.INCIDENT_TYPE]: 'Incident type',
|
|
54
|
+
[PartnerCoverageMatchType.INCIDENT_CATEGORY]: 'Incident category',
|
|
55
|
+
[PartnerCoverageMatchType.EMERGENCY_TYPE]: 'Emergency classification',
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Chip family for a dispatch status, matching the admin's existing chip
|
|
59
|
+
* vocabulary: `success` for anything the partner has, `warn` for anything still
|
|
60
|
+
* needing a human, `danger` for a failure, `neutral` for a settled non-event.
|
|
61
|
+
*/
|
|
62
|
+
export function partnerDispatchStatusTone(status) {
|
|
63
|
+
switch (status) {
|
|
64
|
+
case PartnerDispatchStatus.SENT:
|
|
65
|
+
case PartnerDispatchStatus.ACKNOWLEDGED:
|
|
66
|
+
return 'success';
|
|
67
|
+
case PartnerDispatchStatus.PENDING_APPROVAL:
|
|
68
|
+
case PartnerDispatchStatus.QUEUED:
|
|
69
|
+
case PartnerDispatchStatus.SENDING:
|
|
70
|
+
return 'warn';
|
|
71
|
+
case PartnerDispatchStatus.FAILED:
|
|
72
|
+
case PartnerDispatchStatus.EXPIRED:
|
|
73
|
+
return 'danger';
|
|
74
|
+
default:
|
|
75
|
+
return 'neutral';
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/** The same tone mapping for the incident-level rolled-up status. */
|
|
79
|
+
export function incidentPartnerRoutingTone(status) {
|
|
80
|
+
switch (status) {
|
|
81
|
+
case IncidentPartnerRoutingStatus.ROUTED:
|
|
82
|
+
return 'success';
|
|
83
|
+
case IncidentPartnerRoutingStatus.PENDING:
|
|
84
|
+
case IncidentPartnerRoutingStatus.AWAITING_APPROVAL:
|
|
85
|
+
case IncidentPartnerRoutingStatus.PARTIALLY_ROUTED:
|
|
86
|
+
return 'warn';
|
|
87
|
+
case IncidentPartnerRoutingStatus.FAILED:
|
|
88
|
+
return 'danger';
|
|
89
|
+
default:
|
|
90
|
+
return 'neutral';
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Whether an operator can act on a dispatch, so a table can enable or hide its
|
|
95
|
+
* buttons without duplicating the backend's transition rules.
|
|
96
|
+
*
|
|
97
|
+
* Withdrawing is deliberately impossible once the partner has the emergency:
|
|
98
|
+
* standing an ambulance down is a phone call to the partner, not a button here.
|
|
99
|
+
*/
|
|
100
|
+
export function partnerDispatchActions(status) {
|
|
101
|
+
const pending = status === PartnerDispatchStatus.PENDING_APPROVAL;
|
|
102
|
+
return {
|
|
103
|
+
canApprove: pending,
|
|
104
|
+
canReject: pending,
|
|
105
|
+
canCancel: pending || status === PartnerDispatchStatus.QUEUED,
|
|
106
|
+
canResend: status === PartnerDispatchStatus.FAILED ||
|
|
107
|
+
status === PartnerDispatchStatus.EXPIRED,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=partner-display.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partner-display.util.js","sourceRoot":"","sources":["../../../../../src/modules/partner/utils/partner-display.util.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,4BAA4B,EAC5B,wBAAwB,EACxB,qBAAqB,EACrB,wBAAwB,EACxB,kBAAkB,EAClB,wBAAwB,GAC3B,MAAM,wBAAwB,CAAC;AAEhC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAoD;IAC3F,CAAC,qBAAqB,CAAC,gBAAgB,CAAC,EAAE,0BAA0B;IACpE,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,QAAQ;IACxC,CAAC,qBAAqB,CAAC,OAAO,CAAC,EAAE,SAAS;IAC1C,CAAC,qBAAqB,CAAC,IAAI,CAAC,EAAE,iBAAiB;IAC/C,CAAC,qBAAqB,CAAC,YAAY,CAAC,EAAE,yBAAyB;IAC/D,CAAC,qBAAqB,C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QACpD,KAAK,4BAA4B,CAAC,gBAAgB;YAC9C,OAAO,MAAM,CAAC;QAClB,KAAK,4BAA4B,CAAC,MAAM;YACpC,OAAO,QAAQ,CAAC;QACpB;YACI,OAAO,SAAS,CAAC;IACzB,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAA6B;IAMhE,MAAM,OAAO,GAAG,MAAM,KAAK,qBAAqB,CAAC,gBAAgB,CAAC;IAClE,OAAO;QACH,UAAU,EAAE,OAAO;QACnB,SAAS,EAAE,OAAO;QAClB,SAAS,EAAE,OAAO,IAAI,MAAM,KAAK,qBAAqB,CAAC,MAAM;QAC7D,SAAS,EACL,MAAM,KAAK,qBAAqB,CAAC,MAAM;YACvC,MAAM,KAAK,qBAAqB,CAAC,OAAO;KAC/C,CAAC;AACN,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -19,5 +19,6 @@ export * from './modules/country/index';
|
|
|
19
19
|
export * from './modules/tracking/index';
|
|
20
20
|
export * from './modules/entitlement/index';
|
|
21
21
|
export * from './modules/alert-dispatch/index';
|
|
22
|
+
export * from './modules/partner/index';
|
|
22
23
|
export * from './modules/common/interfaces/server-message';
|
|
23
24
|
export * from './modules/common/interfaces/pagination';
|
|
@@ -3,17 +3,25 @@
|
|
|
3
3
|
* whether the reporter asked for the service provider to be alerted at all.
|
|
4
4
|
*
|
|
5
5
|
* ALL - no dispatch filter (default; preserves legacy behaviour).
|
|
6
|
-
* DISPATCHED - only incidents the
|
|
7
|
-
* primary admin incident list, map and kanban views.
|
|
6
|
+
* DISPATCHED - only incidents the reporter asked the provider to receive.
|
|
7
|
+
* Used by the primary admin incident list, map and kanban views.
|
|
8
8
|
* SUPPRESSED - only incidents the reporter explicitly withheld from the
|
|
9
|
-
* provider. Backs the "
|
|
10
|
-
*
|
|
9
|
+
* provider. Backs the "Marked Ignore" admin views.
|
|
10
|
+
*
|
|
11
|
+
* Both read what the reporter ASKED FOR, not what they got. Entitlement can
|
|
12
|
+
* close the provider channel on its own, and an operator looking at a
|
|
13
|
+
* "Marked Ignore" list wants the alerts somebody chose to withhold - not the
|
|
14
|
+
* ones billing withheld for them.
|
|
11
15
|
*
|
|
12
16
|
* Deliberately separate from {@link IncidentEntitlementScope}: entitlement is a
|
|
13
17
|
* billing fact about the reporter, dispatch is a choice the reporter made on
|
|
14
|
-
* this one alert. The two compose
|
|
15
|
-
*
|
|
16
|
-
*
|
|
18
|
+
* this one alert. The two compose into the admin's operator views:
|
|
19
|
+
*
|
|
20
|
+
* Incidents (list/map/kanban) ENTITLED + DISPATCHED
|
|
21
|
+
* Incident List - Marked Ignore ENTITLED + SUPPRESSED
|
|
22
|
+
* Incident List - Uncovered Types UNCOVERED_TYPE + DISPATCHED
|
|
23
|
+
* Uncovered Types - Marked Ignore UNCOVERED_TYPE + SUPPRESSED
|
|
24
|
+
* Incident List - Free Users FREE
|
|
17
25
|
*/
|
|
18
26
|
export declare enum IncidentDispatchScope {
|
|
19
27
|
ALL = "ALL",
|
|
@@ -20,6 +20,19 @@ export interface IncidentAlertDispatch {
|
|
|
20
20
|
* chat or notified about the alert.
|
|
21
21
|
*/
|
|
22
22
|
notifyGuardians?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* What the reporter actually asked for, before entitlement had its say.
|
|
25
|
+
*
|
|
26
|
+
* Kept apart from `notifyServiceProvider` because that one records the
|
|
27
|
+
* OUTCOME, and once entitlement forces it false the reporter's own choice
|
|
28
|
+
* is no longer recoverable from it. The distinction is the whole basis of
|
|
29
|
+
* the "Marked Ignore" views: an alert billing withheld is not an alert
|
|
30
|
+
* somebody chose to withhold.
|
|
31
|
+
*
|
|
32
|
+
* Absent on incidents raised before the option existed, and on records the
|
|
33
|
+
* option does not govern - both of which count as "did not withhold".
|
|
34
|
+
*/
|
|
35
|
+
notifyServiceProviderRequested?: boolean;
|
|
23
36
|
}
|
|
24
37
|
/** The inputs {@link resolveIncidentAlertDispatch} decides from. */
|
|
25
38
|
export interface AlertDispatchRequest extends IncidentAlertDispatch {
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
import { EntitlementDecisionReason } from '../../entitlement/enums/entitlement-decision-reason.enum';
|
|
1
2
|
import { IncidentEntitlementTier } from '../../entitlement/enums/incident-entitlement-tier.enum';
|
|
2
3
|
import { IncidentDispatchScope } from '../enums/incident-dispatch-scope.enum';
|
|
3
4
|
import { AlertDispatchRequest, IncidentAlertDispatch } from '../interfaces/alert-dispatch';
|
|
5
|
+
/** The two entitlement facts an incident carries, as the helpers below read them. */
|
|
6
|
+
export interface IncidentEntitlementFacts {
|
|
7
|
+
entitlementTier?: IncidentEntitlementTier | string | null;
|
|
8
|
+
/** Promoted out of the entitlement snapshot so it can be filtered and indexed. */
|
|
9
|
+
entitlementReason?: EntitlementDecisionReason | string | null;
|
|
10
|
+
}
|
|
4
11
|
/**
|
|
5
12
|
* Whether an incident reaches the provider control room - live map, live list,
|
|
6
13
|
* kanban, operator assignment and operator notifications.
|
|
@@ -8,26 +15,43 @@ import { AlertDispatchRequest, IncidentAlertDispatch } from '../interfaces/alert
|
|
|
8
15
|
* Two independent reasons keep an alert out, and this is the single place both
|
|
9
16
|
* are expressed so no consumer can honour one and forget the other:
|
|
10
17
|
*
|
|
11
|
-
* 1. the reporter
|
|
12
|
-
*
|
|
18
|
+
* 1. the reporter was not entitled to send it (no subscription, or one that
|
|
19
|
+
* does not cover this incident type), so the provider was never asked;
|
|
20
|
+
* 2. the reporter explicitly unchecked the provider option.
|
|
13
21
|
*
|
|
22
|
+
* Reads `notifyServiceProvider`, the resolved OUTCOME - never the request.
|
|
14
23
|
* A missing flag counts as dispatched: incidents written before this feature
|
|
15
24
|
* existed, and every operator-created record, keep their original behaviour.
|
|
16
25
|
*/
|
|
17
|
-
export declare function reachesControlRoom(incident: IncidentAlertDispatch &
|
|
18
|
-
entitlementTier?: IncidentEntitlementTier | string | null;
|
|
19
|
-
}): boolean;
|
|
26
|
+
export declare function reachesControlRoom(incident: IncidentAlertDispatch & IncidentEntitlementFacts): boolean;
|
|
20
27
|
/** Whether the reporter's guardians should be pulled in and notified. */
|
|
21
28
|
export declare function reachesGuardians(incident: IncidentAlertDispatch): boolean;
|
|
22
29
|
/**
|
|
23
|
-
* Whether the reporter deliberately withheld this alert from the provider
|
|
24
|
-
*
|
|
25
|
-
* the
|
|
26
|
-
*
|
|
30
|
+
* Whether the reporter deliberately withheld this alert from the provider.
|
|
31
|
+
*
|
|
32
|
+
* Reads the REQUEST, not the outcome. An alert entitlement withheld is not an
|
|
33
|
+
* alert somebody chose to withhold, and only the second belongs in a
|
|
34
|
+
* "Marked Ignore" view - a free user never had the option to decline, so their
|
|
35
|
+
* alert is not "marked ignore" however the resolved flag ended up.
|
|
36
|
+
*
|
|
37
|
+
* Independent of entitlement, so it holds equally for a subscriber who declined
|
|
38
|
+
* on a covered type and one who declined on a type their package excludes.
|
|
39
|
+
* Which of the two Marked Ignore lists they land in is decided by pairing this
|
|
40
|
+
* with the entitlement scope.
|
|
27
41
|
*/
|
|
28
|
-
export declare function isMarkedIgnore(incident: IncidentAlertDispatch &
|
|
29
|
-
|
|
30
|
-
|
|
42
|
+
export declare function isMarkedIgnore(incident: IncidentAlertDispatch & Partial<IncidentEntitlementFacts>): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Whether the reporter pays for cover, but not for the incident type they
|
|
45
|
+
* raised. Distinct from having no entitlement at all: this is a paying customer
|
|
46
|
+
* finding a gap in their package, not someone to upsell from scratch.
|
|
47
|
+
*/
|
|
48
|
+
export declare function isUncoveredIncidentType(incident: IncidentEntitlementFacts): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Whether the reporter had no entitlement whatsoever - never subscribed,
|
|
51
|
+
* lapsed, or a spent/expired trial. Deliberately excludes the uncovered-type
|
|
52
|
+
* case, which carries the same FREE tier but is a different conversation.
|
|
53
|
+
*/
|
|
54
|
+
export declare function isUnentitledReporter(incident: IncidentEntitlementFacts): boolean;
|
|
31
55
|
/**
|
|
32
56
|
* Applies dispatch policy to what the client asked for.
|
|
33
57
|
*
|
|
@@ -37,9 +61,13 @@ export declare function isMarkedIgnore(incident: IncidentAlertDispatch & {
|
|
|
37
61
|
* defaults to "notify", so existing callers (web admin, older app builds) are
|
|
38
62
|
* unaffected.
|
|
39
63
|
*
|
|
40
|
-
* Returns
|
|
41
|
-
*
|
|
42
|
-
*
|
|
64
|
+
* Returns both what was asked for and what will happen, because the two diverge
|
|
65
|
+
* exactly when entitlement overrides the reporter - and that difference is what
|
|
66
|
+
* the admin's Marked Ignore views are built on.
|
|
67
|
+
*
|
|
68
|
+
* It deliberately does not reject the both-off combination, so callers can
|
|
69
|
+
* decide whether that is a validation error (the SOS path) or simply nobody to
|
|
70
|
+
* notify.
|
|
43
71
|
*/
|
|
44
72
|
export declare function resolveIncidentAlertDispatch(request: AlertDispatchRequest): Required<IncidentAlertDispatch>;
|
|
45
73
|
/** True when an alert would reach nobody at all. */
|