clarion-shared-types 1.0.86 → 1.0.87
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/modules/partner/enums/partner-enums.js +45 -2
- package/dist/cjs/modules/partner/enums/partner-enums.js.map +1 -1
- package/dist/cjs/modules/partner/index.js +1 -0
- package/dist/cjs/modules/partner/index.js.map +1 -1
- package/dist/cjs/modules/partner/interfaces/partner-dispatch-progress.dto.js +3 -0
- package/dist/cjs/modules/partner/interfaces/partner-dispatch-progress.dto.js.map +1 -0
- package/dist/cjs/modules/partner/utils/partner-display.util.js +30 -6
- package/dist/cjs/modules/partner/utils/partner-display.util.js.map +1 -1
- package/dist/esm/modules/partner/enums/partner-enums.js +44 -1
- package/dist/esm/modules/partner/enums/partner-enums.js.map +1 -1
- package/dist/esm/modules/partner/index.js +1 -0
- package/dist/esm/modules/partner/index.js.map +1 -1
- package/dist/esm/modules/partner/interfaces/partner-dispatch-progress.dto.js +2 -0
- package/dist/esm/modules/partner/interfaces/partner-dispatch-progress.dto.js.map +1 -0
- package/dist/esm/modules/partner/utils/partner-display.util.js +30 -6
- package/dist/esm/modules/partner/utils/partner-display.util.js.map +1 -1
- package/dist/types/modules/partner/enums/partner-enums.d.ts +44 -2
- package/dist/types/modules/partner/index.d.ts +1 -0
- package/dist/types/modules/partner/interfaces/incident-partner-routing.dto.d.ts +12 -1
- package/dist/types/modules/partner/interfaces/partner-dispatch-progress.dto.d.ts +49 -0
- package/dist/types/modules/partner/interfaces/partner-dispatch.dto.d.ts +19 -1
- package/dist/types/modules/partner/interfaces/partner-provider.dto.d.ts +17 -0
- package/dist/types/modules/partner/utils/partner-display.util.d.ts +17 -4
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* compile error.
|
|
10
10
|
*/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.PartnerDispatchScope = exports.IncidentPartnerRoutingStatus = exports.PartnerAdapterOperation = exports.PartnerLocationProvider = exports.PartnerDispatchFailureReason = exports.PartnerDispatchStatus = exports.PartnerCoverageMatchType = exports.PartnerIntegrationStatus = exports.PartnerIntegrationEnvironment = exports.PartnerRoutingMode = exports.PartnerServiceCapability = exports.PartnerProviderCode = void 0;
|
|
12
|
+
exports.PartnerDispatchScope = exports.IncidentPartnerRoutingStatus = exports.PartnerAdapterOperation = exports.PartnerLocationProvider = exports.PartnerDispatchFailureReason = exports.PartnerEngagementState = exports.PartnerDispatchStatus = exports.PartnerCoverageMatchType = exports.PartnerIntegrationStatus = exports.PartnerIntegrationEnvironment = exports.PartnerRoutingMode = exports.PartnerServiceCapability = exports.PartnerProviderCode = void 0;
|
|
13
13
|
/** The third-party partner behind a partnership. */
|
|
14
14
|
var PartnerProviderCode;
|
|
15
15
|
(function (PartnerProviderCode) {
|
|
@@ -61,19 +61,54 @@ var PartnerCoverageMatchType;
|
|
|
61
61
|
PartnerCoverageMatchType["INCIDENT_CATEGORY"] = "INCIDENT_CATEGORY";
|
|
62
62
|
PartnerCoverageMatchType["EMERGENCY_TYPE"] = "EMERGENCY_TYPE";
|
|
63
63
|
})(PartnerCoverageMatchType || (exports.PartnerCoverageMatchType = PartnerCoverageMatchType = {}));
|
|
64
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* Lifecycle of one incident's routing to one partner.
|
|
66
|
+
*
|
|
67
|
+
* Once the partner has it, the remaining transitions come from THEM: SENT ->
|
|
68
|
+
* ACKNOWLEDGED when they assign a responder, and either of those -> COMPLETED
|
|
69
|
+
* when they close it. WITHDRAWN is the exception - an organization standing a
|
|
70
|
+
* partner down after the fact.
|
|
71
|
+
*/
|
|
65
72
|
var PartnerDispatchStatus;
|
|
66
73
|
(function (PartnerDispatchStatus) {
|
|
67
74
|
PartnerDispatchStatus["PENDING_APPROVAL"] = "PENDING_APPROVAL";
|
|
68
75
|
PartnerDispatchStatus["QUEUED"] = "QUEUED";
|
|
69
76
|
PartnerDispatchStatus["SENDING"] = "SENDING";
|
|
70
77
|
PartnerDispatchStatus["SENT"] = "SENT";
|
|
78
|
+
/** The partner has assigned a responder, or otherwise confirmed it is working it. */
|
|
71
79
|
PartnerDispatchStatus["ACKNOWLEDGED"] = "ACKNOWLEDGED";
|
|
80
|
+
/** The partner has closed the request. The engagement is over. */
|
|
81
|
+
PartnerDispatchStatus["COMPLETED"] = "COMPLETED";
|
|
72
82
|
PartnerDispatchStatus["FAILED"] = "FAILED";
|
|
73
83
|
PartnerDispatchStatus["REJECTED"] = "REJECTED";
|
|
84
|
+
/** Withdrawn BEFORE the partner ever received it. */
|
|
74
85
|
PartnerDispatchStatus["CANCELLED"] = "CANCELLED";
|
|
86
|
+
/**
|
|
87
|
+
* Stood down AFTER the partner received it.
|
|
88
|
+
*
|
|
89
|
+
* Distinct from CANCELLED because they are very different facts: one is an
|
|
90
|
+
* emergency a partner never heard about, the other is a responder who was
|
|
91
|
+
* dispatched and recalled.
|
|
92
|
+
*/
|
|
93
|
+
PartnerDispatchStatus["WITHDRAWN"] = "WITHDRAWN";
|
|
75
94
|
PartnerDispatchStatus["EXPIRED"] = "EXPIRED";
|
|
76
95
|
})(PartnerDispatchStatus || (exports.PartnerDispatchStatus = PartnerDispatchStatus = {}));
|
|
96
|
+
/**
|
|
97
|
+
* What a partner says is happening with an emergency, reduced to the only three
|
|
98
|
+
* answers every partner can give.
|
|
99
|
+
*
|
|
100
|
+
* Partners describe progress in their own vocabulary and no screen should learn
|
|
101
|
+
* any of them; the raw word is kept alongside in `partnerStatus`.
|
|
102
|
+
*/
|
|
103
|
+
var PartnerEngagementState;
|
|
104
|
+
(function (PartnerEngagementState) {
|
|
105
|
+
/** The partner is working the emergency. */
|
|
106
|
+
PartnerEngagementState["ACTIVE"] = "ACTIVE";
|
|
107
|
+
/** The partner has closed it. */
|
|
108
|
+
PartnerEngagementState["CLOSED"] = "CLOSED";
|
|
109
|
+
/** The partner reported something the adapter does not recognise. */
|
|
110
|
+
PartnerEngagementState["UNKNOWN"] = "UNKNOWN";
|
|
111
|
+
})(PartnerEngagementState || (exports.PartnerEngagementState = PartnerEngagementState = {}));
|
|
77
112
|
/** Why a dispatch did not reach its partner. */
|
|
78
113
|
var PartnerDispatchFailureReason;
|
|
79
114
|
(function (PartnerDispatchFailureReason) {
|
|
@@ -104,6 +139,14 @@ var PartnerAdapterOperation;
|
|
|
104
139
|
PartnerAdapterOperation["AUTHENTICATE"] = "AUTHENTICATE";
|
|
105
140
|
PartnerAdapterOperation["HEALTH_CHECK"] = "HEALTH_CHECK";
|
|
106
141
|
PartnerAdapterOperation["DISPATCH"] = "DISPATCH";
|
|
142
|
+
/** Asking the partner what has happened since. */
|
|
143
|
+
PartnerAdapterOperation["FETCH_STATUS"] = "FETCH_STATUS";
|
|
144
|
+
/** Standing the partner down after they had already accepted it. */
|
|
145
|
+
PartnerAdapterOperation["WITHDRAW"] = "WITHDRAW";
|
|
146
|
+
/** Correcting details of an emergency the partner is already working. */
|
|
147
|
+
PartnerAdapterOperation["AMEND"] = "AMEND";
|
|
148
|
+
/** Checking whether a request we may already have sent exists. */
|
|
149
|
+
PartnerAdapterOperation["LOOKUP"] = "LOOKUP";
|
|
107
150
|
})(PartnerAdapterOperation || (exports.PartnerAdapterOperation = PartnerAdapterOperation = {}));
|
|
108
151
|
/** The incident-side summary of third-party routing, stored on the incident row. */
|
|
109
152
|
var IncidentPartnerRoutingStatus;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partner-enums.js","sourceRoot":"","sources":["../../../../../src/modules/partner/enums/partner-enums.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAEH,oDAAoD;AACpD,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC3B,8CAAuB,CAAA;IACvB,kCAAW,CAAA;IACX,0CAAmB,CAAA;IACnB,oDAA6B,CAAA;AACjC,CAAC,EALW,mBAAmB,mCAAnB,mBAAmB,QAK9B;AAED,sEAAsE;AACtE,IAAY,wBAQX;AARD,WAAY,wBAAwB;IAChC,mDAAuB,CAAA;IACvB,qEAAyC,CAAA;IACzC,2DAA+B,CAAA;IAC/B,mEAAuC,CAAA;IACvC,uEAA2C,CAAA;IAC3C,6CAAiB,CAAA;IACjB,2CAAe,CAAA;AACnB,CAAC,EARW,wBAAwB,wCAAxB,wBAAwB,QAQnC;AAED,gEAAgE;AAChE,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAC1B,+CAA+C;IAC/C,mCAAa,CAAA;IACb,0CAA0C;IAC1C,uCAAiB,CAAA;IACjB,0CAA0C;IAC1C,2CAAqB,CAAA;AACzB,CAAC,EAPW,kBAAkB,kCAAlB,kBAAkB,QAO7B;AAED,iEAAiE;AACjE,IAAY,6BAGX;AAHD,WAAY,6BAA6B;IACrC,oDAAmB,CAAA;IACnB,0DAAyB,CAAA;AAC7B,CAAC,EAHW,6BAA6B,6CAA7B,6BAA6B,QAGxC;AAED,sEAAsE;AACtE,IAAY,wBAKX;AALD,WAAY,wBAAwB;IAChC,+CAAmB,CAAA;IACnB,+CAAmB,CAAA;IACnB,iDAAqB,CAAA;IACrB,uDAA2B,CAAA;AAC/B,CAAC,EALW,wBAAwB,wCAAxB,wBAAwB,QAKnC;AAED,mDAAmD;AACnD,IAAY,wBAKX;AALD,WAAY,wBAAwB;IAChC,uCAAW,CAAA;IACX,2DAA+B,CAAA;IAC/B,mEAAuC,CAAA;IACvC,6DAAiC,CAAA;AACrC,CAAC,EALW,wBAAwB,wCAAxB,wBAAwB,QAKnC;AAED
|
|
1
|
+
{"version":3,"file":"partner-enums.js","sourceRoot":"","sources":["../../../../../src/modules/partner/enums/partner-enums.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAEH,oDAAoD;AACpD,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC3B,8CAAuB,CAAA;IACvB,kCAAW,CAAA;IACX,0CAAmB,CAAA;IACnB,oDAA6B,CAAA;AACjC,CAAC,EALW,mBAAmB,mCAAnB,mBAAmB,QAK9B;A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AY,4BAA4B;IACpC,yDAAyB,CAAA;IACzB,mDAAmB,CAAA;IACnB,uEAAuC,CAAA;IACvC,iDAAiB,CAAA;IACjB,qEAAqC,CAAA;IACrC,iDAAiB,CAAA;IACjB,qDAAqB,CAAA;AACzB,CAAC,EARW,4BAA4B,4CAA5B,4BAA4B,QAQvC;AAED,kEAAkE;AAClE,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC5B,mCAAW,CAAA;IACX,yCAAiB,CAAA;IACjB,+DAAuC,CAAA;IACvC,yCAAiB,CAAA;IACjB,iDAAyB,CAAA;AAC7B,CAAC,EANW,oBAAoB,oCAApB,oBAAoB,QAM/B"}
|
|
@@ -20,6 +20,7 @@ __exportStar(require("./enums/partner-enums"), exports);
|
|
|
20
20
|
__exportStar(require("./interfaces/partner-provider.dto"), exports);
|
|
21
21
|
__exportStar(require("./interfaces/partner-integration.dto"), exports);
|
|
22
22
|
__exportStar(require("./interfaces/partner-coverage-rule.dto"), exports);
|
|
23
|
+
__exportStar(require("./interfaces/partner-dispatch-progress.dto"), exports);
|
|
23
24
|
__exportStar(require("./interfaces/partner-dispatch.dto"), exports);
|
|
24
25
|
__exportStar(require("./interfaces/incident-partner-routing.dto"), exports);
|
|
25
26
|
// Utilities
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/partner/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,QAAQ;AACR,wDAAsC;AAEtC,oBAAoB;AACpB,oEAAkD;AAClD,uEAAqD;AACrD,yEAAuD;AACvD,oEAAkD;AAClD,4EAA0D;AAE1D,YAAY;AACZ,+DAA6C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/partner/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,QAAQ;AACR,wDAAsC;AAEtC,oBAAoB;AACpB,oEAAkD;AAClD,uEAAqD;AACrD,yEAAuD;AACvD,6EAA2D;AAC3D,oEAAkD;AAClD,4EAA0D;AAE1D,YAAY;AACZ,+DAA6C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partner-dispatch-progress.dto.js","sourceRoot":"","sources":["../../../../../src/modules/partner/interfaces/partner-dispatch-progress.dto.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PARTNER_COVERAGE_MATCH_TYPE_LABELS = exports.PARTNER_CAPABILITY_LABELS = exports.PARTNER_INTEGRATION_STATUS_LABELS = exports.PARTNER_ROUTING_MODE_LABELS = exports.INCIDENT_PARTNER_ROUTING_STATUS_LABELS = exports.PARTNER_DISPATCH_STATUS_LABELS = void 0;
|
|
3
|
+
exports.PARTNER_COVERAGE_MATCH_TYPE_LABELS = exports.PARTNER_CAPABILITY_LABELS = exports.PARTNER_INTEGRATION_STATUS_LABELS = exports.PARTNER_ROUTING_MODE_LABELS = exports.INCIDENT_PARTNER_ROUTING_STATUS_LABELS = exports.PARTNER_ENGAGEMENT_STATE_LABELS = exports.PARTNER_DISPATCH_STATUS_LABELS = void 0;
|
|
4
4
|
exports.partnerDispatchStatusTone = partnerDispatchStatusTone;
|
|
5
5
|
exports.incidentPartnerRoutingTone = incidentPartnerRoutingTone;
|
|
6
6
|
exports.partnerDispatchActions = partnerDispatchActions;
|
|
@@ -19,12 +19,23 @@ exports.PARTNER_DISPATCH_STATUS_LABELS = {
|
|
|
19
19
|
[partner_enums_1.PartnerDispatchStatus.QUEUED]: 'Queued',
|
|
20
20
|
[partner_enums_1.PartnerDispatchStatus.SENDING]: 'Sending',
|
|
21
21
|
[partner_enums_1.PartnerDispatchStatus.SENT]: 'Sent to partner',
|
|
22
|
-
[partner_enums_1.PartnerDispatchStatus.ACKNOWLEDGED]: '
|
|
22
|
+
[partner_enums_1.PartnerDispatchStatus.ACKNOWLEDGED]: 'Responder assigned',
|
|
23
|
+
[partner_enums_1.PartnerDispatchStatus.COMPLETED]: 'Closed by partner',
|
|
23
24
|
[partner_enums_1.PartnerDispatchStatus.FAILED]: 'Failed',
|
|
24
25
|
[partner_enums_1.PartnerDispatchStatus.REJECTED]: 'Declined',
|
|
25
|
-
|
|
26
|
+
// "Cancelled" and "Stood down" read differently on purpose: one is an
|
|
27
|
+
// emergency the partner never heard about, the other is a responder who was
|
|
28
|
+
// dispatched and recalled.
|
|
29
|
+
[partner_enums_1.PartnerDispatchStatus.CANCELLED]: 'Cancelled before sending',
|
|
30
|
+
[partner_enums_1.PartnerDispatchStatus.WITHDRAWN]: 'Stood down',
|
|
26
31
|
[partner_enums_1.PartnerDispatchStatus.EXPIRED]: 'Expired',
|
|
27
32
|
};
|
|
33
|
+
/** How a partner's own progress state reads on screen. */
|
|
34
|
+
exports.PARTNER_ENGAGEMENT_STATE_LABELS = {
|
|
35
|
+
[partner_enums_1.PartnerEngagementState.ACTIVE]: 'In progress',
|
|
36
|
+
[partner_enums_1.PartnerEngagementState.CLOSED]: 'Closed',
|
|
37
|
+
[partner_enums_1.PartnerEngagementState.UNKNOWN]: 'Unknown',
|
|
38
|
+
};
|
|
28
39
|
exports.INCIDENT_PARTNER_ROUTING_STATUS_LABELS = {
|
|
29
40
|
[partner_enums_1.IncidentPartnerRoutingStatus.NOT_ROUTED]: 'No partner',
|
|
30
41
|
[partner_enums_1.IncidentPartnerRoutingStatus.PENDING]: 'Contacting partner',
|
|
@@ -69,6 +80,7 @@ function partnerDispatchStatusTone(status) {
|
|
|
69
80
|
switch (status) {
|
|
70
81
|
case partner_enums_1.PartnerDispatchStatus.SENT:
|
|
71
82
|
case partner_enums_1.PartnerDispatchStatus.ACKNOWLEDGED:
|
|
83
|
+
case partner_enums_1.PartnerDispatchStatus.COMPLETED:
|
|
72
84
|
return 'success';
|
|
73
85
|
case partner_enums_1.PartnerDispatchStatus.PENDING_APPROVAL:
|
|
74
86
|
case partner_enums_1.PartnerDispatchStatus.QUEUED:
|
|
@@ -100,15 +112,27 @@ function incidentPartnerRoutingTone(status) {
|
|
|
100
112
|
* Whether an operator can act on a dispatch, so a table can enable or hide its
|
|
101
113
|
* buttons without duplicating the backend's transition rules.
|
|
102
114
|
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
115
|
+
* The two withdrawals are separate answers: `canCancel` is a local decision
|
|
116
|
+
* before the partner has it, `canStandDown` means telling THEM - which is only
|
|
117
|
+
* possible for a partner whose API supports it.
|
|
105
118
|
*/
|
|
106
|
-
function partnerDispatchActions(status) {
|
|
119
|
+
function partnerDispatchActions(status, capabilities = {}) {
|
|
107
120
|
const pending = status === partner_enums_1.PartnerDispatchStatus.PENDING_APPROVAL;
|
|
121
|
+
const withPartner = status === partner_enums_1.PartnerDispatchStatus.SENT ||
|
|
122
|
+
status === partner_enums_1.PartnerDispatchStatus.ACKNOWLEDGED;
|
|
108
123
|
return {
|
|
109
124
|
canApprove: pending,
|
|
110
125
|
canReject: pending,
|
|
126
|
+
/** Local withdrawal, before the partner ever heard about it. */
|
|
111
127
|
canCancel: pending || status === partner_enums_1.PartnerDispatchStatus.QUEUED,
|
|
128
|
+
/**
|
|
129
|
+
* Standing a partner down is only offered where the partner's API can
|
|
130
|
+
* actually do it. Everywhere else the screen should say "contact them
|
|
131
|
+
* directly" rather than show a button that changes a status here while
|
|
132
|
+
* an ambulance keeps driving.
|
|
133
|
+
*/
|
|
134
|
+
canStandDown: withPartner && !!capabilities.supportsWithdrawal,
|
|
135
|
+
canAmend: withPartner && !!capabilities.supportsAmendment,
|
|
112
136
|
canResend: status === partner_enums_1.PartnerDispatchStatus.FAILED ||
|
|
113
137
|
status === partner_enums_1.PartnerDispatchStatus.EXPIRED,
|
|
114
138
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partner-display.util.js","sourceRoot":"","sources":["../../../../../src/modules/partner/utils/partner-display.util.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"partner-display.util.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AO;QACnB,SAAS,EAAE,OAAO;QAClB,gEAAgE;QAChE,SAAS,EAAE,OAAO,IAAI,MAAM,KAAK,qCAAqB,CAAC,MAAM;QAC7D;;;;;WAKG;QACH,YAAY,EAAE,WAAW,IAAI,CAAC,CAAC,YAAY,CAAC,kBAAkB;QAC9D,QAAQ,EAAE,WAAW,IAAI,CAAC,CAAC,YAAY,CAAC,iBAAiB;QACzD,SAAS,EACL,MAAM,KAAK,qCAAqB,CAAC,MAAM;YACvC,MAAM,KAAK,qCAAqB,CAAC,OAAO;KAC/C,CAAC;AACN,CAAC"}
|
|
@@ -58,19 +58,54 @@ export var PartnerCoverageMatchType;
|
|
|
58
58
|
PartnerCoverageMatchType["INCIDENT_CATEGORY"] = "INCIDENT_CATEGORY";
|
|
59
59
|
PartnerCoverageMatchType["EMERGENCY_TYPE"] = "EMERGENCY_TYPE";
|
|
60
60
|
})(PartnerCoverageMatchType || (PartnerCoverageMatchType = {}));
|
|
61
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* Lifecycle of one incident's routing to one partner.
|
|
63
|
+
*
|
|
64
|
+
* Once the partner has it, the remaining transitions come from THEM: SENT ->
|
|
65
|
+
* ACKNOWLEDGED when they assign a responder, and either of those -> COMPLETED
|
|
66
|
+
* when they close it. WITHDRAWN is the exception - an organization standing a
|
|
67
|
+
* partner down after the fact.
|
|
68
|
+
*/
|
|
62
69
|
export var PartnerDispatchStatus;
|
|
63
70
|
(function (PartnerDispatchStatus) {
|
|
64
71
|
PartnerDispatchStatus["PENDING_APPROVAL"] = "PENDING_APPROVAL";
|
|
65
72
|
PartnerDispatchStatus["QUEUED"] = "QUEUED";
|
|
66
73
|
PartnerDispatchStatus["SENDING"] = "SENDING";
|
|
67
74
|
PartnerDispatchStatus["SENT"] = "SENT";
|
|
75
|
+
/** The partner has assigned a responder, or otherwise confirmed it is working it. */
|
|
68
76
|
PartnerDispatchStatus["ACKNOWLEDGED"] = "ACKNOWLEDGED";
|
|
77
|
+
/** The partner has closed the request. The engagement is over. */
|
|
78
|
+
PartnerDispatchStatus["COMPLETED"] = "COMPLETED";
|
|
69
79
|
PartnerDispatchStatus["FAILED"] = "FAILED";
|
|
70
80
|
PartnerDispatchStatus["REJECTED"] = "REJECTED";
|
|
81
|
+
/** Withdrawn BEFORE the partner ever received it. */
|
|
71
82
|
PartnerDispatchStatus["CANCELLED"] = "CANCELLED";
|
|
83
|
+
/**
|
|
84
|
+
* Stood down AFTER the partner received it.
|
|
85
|
+
*
|
|
86
|
+
* Distinct from CANCELLED because they are very different facts: one is an
|
|
87
|
+
* emergency a partner never heard about, the other is a responder who was
|
|
88
|
+
* dispatched and recalled.
|
|
89
|
+
*/
|
|
90
|
+
PartnerDispatchStatus["WITHDRAWN"] = "WITHDRAWN";
|
|
72
91
|
PartnerDispatchStatus["EXPIRED"] = "EXPIRED";
|
|
73
92
|
})(PartnerDispatchStatus || (PartnerDispatchStatus = {}));
|
|
93
|
+
/**
|
|
94
|
+
* What a partner says is happening with an emergency, reduced to the only three
|
|
95
|
+
* answers every partner can give.
|
|
96
|
+
*
|
|
97
|
+
* Partners describe progress in their own vocabulary and no screen should learn
|
|
98
|
+
* any of them; the raw word is kept alongside in `partnerStatus`.
|
|
99
|
+
*/
|
|
100
|
+
export var PartnerEngagementState;
|
|
101
|
+
(function (PartnerEngagementState) {
|
|
102
|
+
/** The partner is working the emergency. */
|
|
103
|
+
PartnerEngagementState["ACTIVE"] = "ACTIVE";
|
|
104
|
+
/** The partner has closed it. */
|
|
105
|
+
PartnerEngagementState["CLOSED"] = "CLOSED";
|
|
106
|
+
/** The partner reported something the adapter does not recognise. */
|
|
107
|
+
PartnerEngagementState["UNKNOWN"] = "UNKNOWN";
|
|
108
|
+
})(PartnerEngagementState || (PartnerEngagementState = {}));
|
|
74
109
|
/** Why a dispatch did not reach its partner. */
|
|
75
110
|
export var PartnerDispatchFailureReason;
|
|
76
111
|
(function (PartnerDispatchFailureReason) {
|
|
@@ -101,6 +136,14 @@ export var PartnerAdapterOperation;
|
|
|
101
136
|
PartnerAdapterOperation["AUTHENTICATE"] = "AUTHENTICATE";
|
|
102
137
|
PartnerAdapterOperation["HEALTH_CHECK"] = "HEALTH_CHECK";
|
|
103
138
|
PartnerAdapterOperation["DISPATCH"] = "DISPATCH";
|
|
139
|
+
/** Asking the partner what has happened since. */
|
|
140
|
+
PartnerAdapterOperation["FETCH_STATUS"] = "FETCH_STATUS";
|
|
141
|
+
/** Standing the partner down after they had already accepted it. */
|
|
142
|
+
PartnerAdapterOperation["WITHDRAW"] = "WITHDRAW";
|
|
143
|
+
/** Correcting details of an emergency the partner is already working. */
|
|
144
|
+
PartnerAdapterOperation["AMEND"] = "AMEND";
|
|
145
|
+
/** Checking whether a request we may already have sent exists. */
|
|
146
|
+
PartnerAdapterOperation["LOOKUP"] = "LOOKUP";
|
|
104
147
|
})(PartnerAdapterOperation || (PartnerAdapterOperation = {}));
|
|
105
148
|
/** The incident-side summary of third-party routing, stored on the incident row. */
|
|
106
149
|
export var IncidentPartnerRoutingStatus;
|
|
@@ -1 +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,EALW,mBAAmB,KAAnB,mBAAmB,QAK9B;AAED,sEAAsE;AACtE,MAAM,CAAN,IAAY,wBAQX;AARD,WAAY,wBAAwB;IAChC,mDAAuB,CAAA;IACvB,qEAAyC,CAAA;IACzC,2DAA+B,CAAA;IAC/B,mEAAuC,CAAA;IACvC,uEAA2C,CAAA;IAC3C,6CAAiB,CAAA;IACjB,2CAAe,CAAA;AACnB,CAAC,EARW,wBAAwB,KAAxB,wBAAwB,QAQnC;AAED,gEAAgE;AAChE,MAAM,CAAN,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAC1B,+CAA+C;IAC/C,mCAAa,CAAA;IACb,0CAA0C;IAC1C,uCAAiB,CAAA;IACjB,0CAA0C;IAC1C,2CAAqB,CAAA;AACzB,CAAC,EAPW,kBAAkB,KAAlB,kBAAkB,QAO7B;AAED,iEAAiE;AACjE,MAAM,CAAN,IAAY,6BAGX;AAHD,WAAY,6BAA6B;IACrC,oDAAmB,CAAA;IACnB,0DAAyB,CAAA;AAC7B,CAAC,EAHW,6BAA6B,KAA7B,6BAA6B,QAGxC;AAED,sEAAsE;AACtE,MAAM,CAAN,IAAY,wBAKX;AALD,WAAY,wBAAwB;IAChC,+CAAmB,CAAA;IACnB,+CAAmB,CAAA;IACnB,iDAAqB,CAAA;IACrB,uDAA2B,CAAA;AAC/B,CAAC,EALW,wBAAwB,KAAxB,wBAAwB,QAKnC;AAED,mDAAmD;AACnD,MAAM,CAAN,IAAY,wBAKX;AALD,WAAY,wBAAwB;IAChC,uCAAW,CAAA;IACX,2DAA+B,CAAA;IAC/B,mEAAuC,CAAA;IACvC,6DAAiC,CAAA;AACrC,CAAC,EALW,wBAAwB,KAAxB,wBAAwB,QAKnC;AAED
|
|
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,EALW,mBAAmB,KAAnB,mBAAmB,QAK9B;AAED,sEAAsE;AACtE,MAAM,CAAN,IAAY,wBAQX;AARD,WAAY,wBAAwB;IAChC,mDAAuB,CAAA;IACvB,qEAAyC,CAAA;IACzC,2DAA+B,CAAA;IAC/B,mEAAuC,CAAA;IACvC,uEAA2C,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DAAmB,CAAA;IACnB,uEAAuC,CAAA;IACvC,iDAAiB,CAAA;IACjB,qEAAqC,CAAA;IACrC,iDAAiB,CAAA;IACjB,qDAAqB,CAAA;AACzB,CAAC,EARW,4BAA4B,KAA5B,4BAA4B,QAQvC;AAED,kEAAkE;AAClE,MAAM,CAAN,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC5B,mCAAW,CAAA;IACX,yCAAiB,CAAA;IACjB,+DAAuC,CAAA;IACvC,yCAAiB,CAAA;IACjB,iDAAyB,CAAA;AAC7B,CAAC,EANW,oBAAoB,KAApB,oBAAoB,QAM/B"}
|
|
@@ -4,6 +4,7 @@ export * from './enums/partner-enums';
|
|
|
4
4
|
export * from './interfaces/partner-provider.dto';
|
|
5
5
|
export * from './interfaces/partner-integration.dto';
|
|
6
6
|
export * from './interfaces/partner-coverage-rule.dto';
|
|
7
|
+
export * from './interfaces/partner-dispatch-progress.dto';
|
|
7
8
|
export * from './interfaces/partner-dispatch.dto';
|
|
8
9
|
export * from './interfaces/incident-partner-routing.dto';
|
|
9
10
|
// Utilities
|
|
@@ -1 +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"}
|
|
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,4CAA4C,CAAC;AAC3D,cAAc,mCAAmC,CAAC;AAClD,cAAc,2CAA2C,CAAC;AAE1D,YAAY;AACZ,cAAc,8BAA8B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partner-dispatch-progress.dto.js","sourceRoot":"","sources":["../../../../../src/modules/partner/interfaces/partner-dispatch-progress.dto.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IncidentPartnerRoutingStatus, PartnerCoverageMatchType, PartnerDispatchStatus, PartnerIntegrationStatus, PartnerRoutingMode, PartnerServiceCapability, } from '../enums/partner-enums';
|
|
1
|
+
import { IncidentPartnerRoutingStatus, PartnerEngagementState, PartnerCoverageMatchType, PartnerDispatchStatus, PartnerIntegrationStatus, PartnerRoutingMode, PartnerServiceCapability, } from '../enums/partner-enums';
|
|
2
2
|
/**
|
|
3
3
|
* Human labels for the partner enums.
|
|
4
4
|
*
|
|
@@ -13,12 +13,23 @@ export const PARTNER_DISPATCH_STATUS_LABELS = {
|
|
|
13
13
|
[PartnerDispatchStatus.QUEUED]: 'Queued',
|
|
14
14
|
[PartnerDispatchStatus.SENDING]: 'Sending',
|
|
15
15
|
[PartnerDispatchStatus.SENT]: 'Sent to partner',
|
|
16
|
-
[PartnerDispatchStatus.ACKNOWLEDGED]: '
|
|
16
|
+
[PartnerDispatchStatus.ACKNOWLEDGED]: 'Responder assigned',
|
|
17
|
+
[PartnerDispatchStatus.COMPLETED]: 'Closed by partner',
|
|
17
18
|
[PartnerDispatchStatus.FAILED]: 'Failed',
|
|
18
19
|
[PartnerDispatchStatus.REJECTED]: 'Declined',
|
|
19
|
-
|
|
20
|
+
// "Cancelled" and "Stood down" read differently on purpose: one is an
|
|
21
|
+
// emergency the partner never heard about, the other is a responder who was
|
|
22
|
+
// dispatched and recalled.
|
|
23
|
+
[PartnerDispatchStatus.CANCELLED]: 'Cancelled before sending',
|
|
24
|
+
[PartnerDispatchStatus.WITHDRAWN]: 'Stood down',
|
|
20
25
|
[PartnerDispatchStatus.EXPIRED]: 'Expired',
|
|
21
26
|
};
|
|
27
|
+
/** How a partner's own progress state reads on screen. */
|
|
28
|
+
export const PARTNER_ENGAGEMENT_STATE_LABELS = {
|
|
29
|
+
[PartnerEngagementState.ACTIVE]: 'In progress',
|
|
30
|
+
[PartnerEngagementState.CLOSED]: 'Closed',
|
|
31
|
+
[PartnerEngagementState.UNKNOWN]: 'Unknown',
|
|
32
|
+
};
|
|
22
33
|
export const INCIDENT_PARTNER_ROUTING_STATUS_LABELS = {
|
|
23
34
|
[IncidentPartnerRoutingStatus.NOT_ROUTED]: 'No partner',
|
|
24
35
|
[IncidentPartnerRoutingStatus.PENDING]: 'Contacting partner',
|
|
@@ -63,6 +74,7 @@ export function partnerDispatchStatusTone(status) {
|
|
|
63
74
|
switch (status) {
|
|
64
75
|
case PartnerDispatchStatus.SENT:
|
|
65
76
|
case PartnerDispatchStatus.ACKNOWLEDGED:
|
|
77
|
+
case PartnerDispatchStatus.COMPLETED:
|
|
66
78
|
return 'success';
|
|
67
79
|
case PartnerDispatchStatus.PENDING_APPROVAL:
|
|
68
80
|
case PartnerDispatchStatus.QUEUED:
|
|
@@ -94,15 +106,27 @@ export function incidentPartnerRoutingTone(status) {
|
|
|
94
106
|
* Whether an operator can act on a dispatch, so a table can enable or hide its
|
|
95
107
|
* buttons without duplicating the backend's transition rules.
|
|
96
108
|
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
109
|
+
* The two withdrawals are separate answers: `canCancel` is a local decision
|
|
110
|
+
* before the partner has it, `canStandDown` means telling THEM - which is only
|
|
111
|
+
* possible for a partner whose API supports it.
|
|
99
112
|
*/
|
|
100
|
-
export function partnerDispatchActions(status) {
|
|
113
|
+
export function partnerDispatchActions(status, capabilities = {}) {
|
|
101
114
|
const pending = status === PartnerDispatchStatus.PENDING_APPROVAL;
|
|
115
|
+
const withPartner = status === PartnerDispatchStatus.SENT ||
|
|
116
|
+
status === PartnerDispatchStatus.ACKNOWLEDGED;
|
|
102
117
|
return {
|
|
103
118
|
canApprove: pending,
|
|
104
119
|
canReject: pending,
|
|
120
|
+
/** Local withdrawal, before the partner ever heard about it. */
|
|
105
121
|
canCancel: pending || status === PartnerDispatchStatus.QUEUED,
|
|
122
|
+
/**
|
|
123
|
+
* Standing a partner down is only offered where the partner's API can
|
|
124
|
+
* actually do it. Everywhere else the screen should say "contact them
|
|
125
|
+
* directly" rather than show a button that changes a status here while
|
|
126
|
+
* an ambulance keeps driving.
|
|
127
|
+
*/
|
|
128
|
+
canStandDown: withPartner && !!capabilities.supportsWithdrawal,
|
|
129
|
+
canAmend: withPartner && !!capabilities.supportsAmendment,
|
|
106
130
|
canResend: status === PartnerDispatchStatus.FAILED ||
|
|
107
131
|
status === PartnerDispatchStatus.EXPIRED,
|
|
108
132
|
};
|
|
@@ -1 +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,
|
|
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,sBAAsB,EACtB,wBAAwB,EAC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BAAqB,CAAC,YAAY,CAAC;IAElD,OAAO;QACH,UAAU,EAAE,OAAO;QACnB,SAAS,EAAE,OAAO;QAClB,gEAAgE;QAChE,SAAS,EAAE,OAAO,IAAI,MAAM,KAAK,qBAAqB,CAAC,MAAM;QAC7D;;;;;WAKG;QACH,YAAY,EAAE,WAAW,IAAI,CAAC,CAAC,YAAY,CAAC,kBAAkB;QAC9D,QAAQ,EAAE,WAAW,IAAI,CAAC,CAAC,YAAY,CAAC,iBAAiB;QACzD,SAAS,EACL,MAAM,KAAK,qBAAqB,CAAC,MAAM;YACvC,MAAM,KAAK,qBAAqB,CAAC,OAAO;KAC/C,CAAC;AACN,CAAC"}
|
|
@@ -52,18 +52,52 @@ export declare enum PartnerCoverageMatchType {
|
|
|
52
52
|
INCIDENT_CATEGORY = "INCIDENT_CATEGORY",
|
|
53
53
|
EMERGENCY_TYPE = "EMERGENCY_TYPE"
|
|
54
54
|
}
|
|
55
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* Lifecycle of one incident's routing to one partner.
|
|
57
|
+
*
|
|
58
|
+
* Once the partner has it, the remaining transitions come from THEM: SENT ->
|
|
59
|
+
* ACKNOWLEDGED when they assign a responder, and either of those -> COMPLETED
|
|
60
|
+
* when they close it. WITHDRAWN is the exception - an organization standing a
|
|
61
|
+
* partner down after the fact.
|
|
62
|
+
*/
|
|
56
63
|
export declare enum PartnerDispatchStatus {
|
|
57
64
|
PENDING_APPROVAL = "PENDING_APPROVAL",
|
|
58
65
|
QUEUED = "QUEUED",
|
|
59
66
|
SENDING = "SENDING",
|
|
60
67
|
SENT = "SENT",
|
|
68
|
+
/** The partner has assigned a responder, or otherwise confirmed it is working it. */
|
|
61
69
|
ACKNOWLEDGED = "ACKNOWLEDGED",
|
|
70
|
+
/** The partner has closed the request. The engagement is over. */
|
|
71
|
+
COMPLETED = "COMPLETED",
|
|
62
72
|
FAILED = "FAILED",
|
|
63
73
|
REJECTED = "REJECTED",
|
|
74
|
+
/** Withdrawn BEFORE the partner ever received it. */
|
|
64
75
|
CANCELLED = "CANCELLED",
|
|
76
|
+
/**
|
|
77
|
+
* Stood down AFTER the partner received it.
|
|
78
|
+
*
|
|
79
|
+
* Distinct from CANCELLED because they are very different facts: one is an
|
|
80
|
+
* emergency a partner never heard about, the other is a responder who was
|
|
81
|
+
* dispatched and recalled.
|
|
82
|
+
*/
|
|
83
|
+
WITHDRAWN = "WITHDRAWN",
|
|
65
84
|
EXPIRED = "EXPIRED"
|
|
66
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* What a partner says is happening with an emergency, reduced to the only three
|
|
88
|
+
* answers every partner can give.
|
|
89
|
+
*
|
|
90
|
+
* Partners describe progress in their own vocabulary and no screen should learn
|
|
91
|
+
* any of them; the raw word is kept alongside in `partnerStatus`.
|
|
92
|
+
*/
|
|
93
|
+
export declare enum PartnerEngagementState {
|
|
94
|
+
/** The partner is working the emergency. */
|
|
95
|
+
ACTIVE = "ACTIVE",
|
|
96
|
+
/** The partner has closed it. */
|
|
97
|
+
CLOSED = "CLOSED",
|
|
98
|
+
/** The partner reported something the adapter does not recognise. */
|
|
99
|
+
UNKNOWN = "UNKNOWN"
|
|
100
|
+
}
|
|
67
101
|
/** Why a dispatch did not reach its partner. */
|
|
68
102
|
export declare enum PartnerDispatchFailureReason {
|
|
69
103
|
INVALID_PAYLOAD = "INVALID_PAYLOAD",
|
|
@@ -90,7 +124,15 @@ export declare enum PartnerLocationProvider {
|
|
|
90
124
|
export declare enum PartnerAdapterOperation {
|
|
91
125
|
AUTHENTICATE = "AUTHENTICATE",
|
|
92
126
|
HEALTH_CHECK = "HEALTH_CHECK",
|
|
93
|
-
DISPATCH = "DISPATCH"
|
|
127
|
+
DISPATCH = "DISPATCH",
|
|
128
|
+
/** Asking the partner what has happened since. */
|
|
129
|
+
FETCH_STATUS = "FETCH_STATUS",
|
|
130
|
+
/** Standing the partner down after they had already accepted it. */
|
|
131
|
+
WITHDRAW = "WITHDRAW",
|
|
132
|
+
/** Correcting details of an emergency the partner is already working. */
|
|
133
|
+
AMEND = "AMEND",
|
|
134
|
+
/** Checking whether a request we may already have sent exists. */
|
|
135
|
+
LOOKUP = "LOOKUP"
|
|
94
136
|
}
|
|
95
137
|
/** The incident-side summary of third-party routing, stored on the incident row. */
|
|
96
138
|
export declare enum IncidentPartnerRoutingStatus {
|
|
@@ -2,6 +2,7 @@ export * from './enums/partner-enums';
|
|
|
2
2
|
export * from './interfaces/partner-provider.dto';
|
|
3
3
|
export * from './interfaces/partner-integration.dto';
|
|
4
4
|
export * from './interfaces/partner-coverage-rule.dto';
|
|
5
|
+
export * from './interfaces/partner-dispatch-progress.dto';
|
|
5
6
|
export * from './interfaces/partner-dispatch.dto';
|
|
6
7
|
export * from './interfaces/incident-partner-routing.dto';
|
|
7
8
|
export * from './utils/partner-display.util';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { IncidentPartnerRoutingStatus, PartnerDispatchStatus, PartnerProviderCode, PartnerRoutingMode, PartnerServiceCapability } from '../enums/partner-enums';
|
|
1
|
+
import { IncidentPartnerRoutingStatus, PartnerEngagementState, PartnerDispatchStatus, PartnerProviderCode, PartnerRoutingMode, PartnerServiceCapability } from '../enums/partner-enums';
|
|
2
|
+
import { PartnerResponderDto, PartnerResponderVehicleDto } from './partner-dispatch-progress.dto';
|
|
2
3
|
/** One partner's leg of an incident's routing, as stored on the incident. */
|
|
3
4
|
export interface IncidentPartnerRoutingEntryDto {
|
|
4
5
|
integrationId: number;
|
|
@@ -10,6 +11,16 @@ export interface IncidentPartnerRoutingEntryDto {
|
|
|
10
11
|
dispatchReference: string;
|
|
11
12
|
status: PartnerDispatchStatus;
|
|
12
13
|
partnerReference?: string | null;
|
|
14
|
+
/**
|
|
15
|
+
* What the partner last reported, carried on the incident itself.
|
|
16
|
+
*
|
|
17
|
+
* "An ambulance is on its way, registration KAA 123B, crew reachable on
|
|
18
|
+
* +254..." is the single most useful sentence on an incident screen, and it
|
|
19
|
+
* renders from here without a second request to another service.
|
|
20
|
+
*/
|
|
21
|
+
engagementState?: PartnerEngagementState | null;
|
|
22
|
+
responder?: PartnerResponderDto | null;
|
|
23
|
+
vehicle?: PartnerResponderVehicleDto | null;
|
|
13
24
|
updatedAt: string;
|
|
14
25
|
}
|
|
15
26
|
/**
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { PartnerEngagementState } from '../enums/partner-enums';
|
|
2
|
+
/** Whoever the partner has put on the job. */
|
|
3
|
+
export interface PartnerResponderDto {
|
|
4
|
+
name?: string | null;
|
|
5
|
+
phoneNumber?: string | null;
|
|
6
|
+
reference?: string | null;
|
|
7
|
+
}
|
|
8
|
+
/** The unit the partner has assigned, described the way a control room needs it. */
|
|
9
|
+
export interface PartnerResponderVehicleDto {
|
|
10
|
+
/** Registration or call sign. */
|
|
11
|
+
identifier?: string | null;
|
|
12
|
+
/** Human description, e.g. "White Toyota HiAce". */
|
|
13
|
+
description?: string | null;
|
|
14
|
+
/** The partner's own classification of the unit. */
|
|
15
|
+
serviceType?: string | null;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* What a partner reports about an emergency they are already working.
|
|
19
|
+
*
|
|
20
|
+
* This is the answer to the question a control room actually asks after
|
|
21
|
+
* dispatching - "is anyone coming, who, and where are they taking them?" - and
|
|
22
|
+
* every field is optional because partners differ enormously in what they
|
|
23
|
+
* publish. A screen built on this must be useful with nothing but a status.
|
|
24
|
+
*/
|
|
25
|
+
export interface PartnerDispatchProgressDto {
|
|
26
|
+
state: PartnerEngagementState;
|
|
27
|
+
/** The partner's own status string, unmodified. Show it verbatim. */
|
|
28
|
+
partnerStatus?: string | null;
|
|
29
|
+
partnerNumber?: string | null;
|
|
30
|
+
responder?: PartnerResponderDto | null;
|
|
31
|
+
vehicle?: PartnerResponderVehicleDto | null;
|
|
32
|
+
destination?: string | null;
|
|
33
|
+
journeyStatus?: string | null;
|
|
34
|
+
partnerUpdatedAt?: string | null;
|
|
35
|
+
/** When the platform last read it. */
|
|
36
|
+
observedAt: string;
|
|
37
|
+
}
|
|
38
|
+
/** Correct the details of an emergency a partner is already working. */
|
|
39
|
+
export interface AmendPartnerDispatchDto {
|
|
40
|
+
address?: string;
|
|
41
|
+
issue?: string;
|
|
42
|
+
location?: {
|
|
43
|
+
latitude: number;
|
|
44
|
+
longitude: number;
|
|
45
|
+
measuredAt?: string;
|
|
46
|
+
};
|
|
47
|
+
/** Why the details were corrected. Recorded in the audit trail. */
|
|
48
|
+
reason?: string;
|
|
49
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CountryCode } from '../../country/enums/country-code.enum';
|
|
2
|
-
import { PartnerAdapterOperation, PartnerDispatchFailureReason, PartnerDispatchStatus, PartnerLocationProvider, PartnerProviderCode, PartnerRoutingMode, PartnerServiceCapability } from '../enums/partner-enums';
|
|
2
|
+
import { PartnerAdapterOperation, PartnerEngagementState, PartnerDispatchFailureReason, PartnerDispatchStatus, PartnerLocationProvider, PartnerProviderCode, PartnerRoutingMode, PartnerServiceCapability } from '../enums/partner-enums';
|
|
3
|
+
import { PartnerDispatchProgressDto } from './partner-dispatch-progress.dto';
|
|
3
4
|
/** Where the emergency is, as sent to the partner. */
|
|
4
5
|
export interface PartnerDispatchLocationDto {
|
|
5
6
|
latitude: number;
|
|
@@ -89,7 +90,24 @@ export interface PartnerDispatchDto {
|
|
|
89
90
|
/** The partner's own identifier, e.g. a Rescue.co SOS request id. */
|
|
90
91
|
partnerReference: string | null;
|
|
91
92
|
partnerNumber: string | null;
|
|
93
|
+
/** The partner's own status string. Show it verbatim next to the mapped state. */
|
|
92
94
|
partnerStatus: string | null;
|
|
95
|
+
/** The partner's status reduced to something every screen can rely on. */
|
|
96
|
+
engagementState: PartnerEngagementState | null;
|
|
97
|
+
/**
|
|
98
|
+
* What the partner last reported - responder, vehicle, destination.
|
|
99
|
+
*
|
|
100
|
+
* The answer to "is anyone actually coming?", which is the only question a
|
|
101
|
+
* control room has once a dispatch has left the building.
|
|
102
|
+
*/
|
|
103
|
+
progress: PartnerDispatchProgressDto | null;
|
|
104
|
+
lastPolledAt: string | null;
|
|
105
|
+
/** When the partner first confirmed it was working the emergency. */
|
|
106
|
+
acknowledgedAt: string | null;
|
|
107
|
+
/** When the partner closed the request. */
|
|
108
|
+
closedAt: string | null;
|
|
109
|
+
withdrawnByUserId: number | null;
|
|
110
|
+
withdrawnAt: string | null;
|
|
93
111
|
requestPayload: Record<string, unknown> | null;
|
|
94
112
|
responsePayload: Record<string, unknown> | null;
|
|
95
113
|
failureReason: PartnerDispatchFailureReason | null;
|
|
@@ -36,6 +36,23 @@ export interface PartnerProviderDescriptorDto {
|
|
|
36
36
|
configFields: PartnerProviderConfigFieldDto[];
|
|
37
37
|
credentialFields: PartnerProviderCredentialFieldDto[];
|
|
38
38
|
supportsHealthCheck: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* True when the partner publishes the state of a request already sent, so
|
|
41
|
+
* progress can be shown and a dispatch can move past SENT on its own.
|
|
42
|
+
*/
|
|
43
|
+
supportsStatusPolling: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* True when a request can be stood down after the partner accepted it.
|
|
46
|
+
*
|
|
47
|
+
* When false the admin must NOT offer a stand-down button: the honest answer
|
|
48
|
+
* is to telephone the partner, and a button that changed a status here while
|
|
49
|
+
* a crew kept driving would be worse than none.
|
|
50
|
+
*/
|
|
51
|
+
supportsWithdrawal: boolean;
|
|
52
|
+
/** True when the details of a live request can be corrected. */
|
|
53
|
+
supportsAmendment: boolean;
|
|
54
|
+
/** True when the partner can be asked whether a request already exists. */
|
|
55
|
+
supportsDuplicateDetection: boolean;
|
|
39
56
|
available: boolean;
|
|
40
57
|
}
|
|
41
58
|
/** Result of the admin's "test connection" button. Never creates an emergency. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IncidentPartnerRoutingStatus, PartnerCoverageMatchType, PartnerDispatchStatus, PartnerIntegrationStatus, PartnerRoutingMode, PartnerServiceCapability } from '../enums/partner-enums';
|
|
1
|
+
import { IncidentPartnerRoutingStatus, PartnerEngagementState, PartnerCoverageMatchType, PartnerDispatchStatus, PartnerIntegrationStatus, PartnerRoutingMode, PartnerServiceCapability } from '../enums/partner-enums';
|
|
2
2
|
/**
|
|
3
3
|
* Human labels for the partner enums.
|
|
4
4
|
*
|
|
@@ -9,6 +9,8 @@ import { IncidentPartnerRoutingStatus, PartnerCoverageMatchType, PartnerDispatch
|
|
|
9
9
|
* different things.
|
|
10
10
|
*/
|
|
11
11
|
export declare const PARTNER_DISPATCH_STATUS_LABELS: Readonly<Record<PartnerDispatchStatus, string>>;
|
|
12
|
+
/** How a partner's own progress state reads on screen. */
|
|
13
|
+
export declare const PARTNER_ENGAGEMENT_STATE_LABELS: Readonly<Record<PartnerEngagementState, string>>;
|
|
12
14
|
export declare const INCIDENT_PARTNER_ROUTING_STATUS_LABELS: Readonly<Record<IncidentPartnerRoutingStatus, string>>;
|
|
13
15
|
export declare const PARTNER_ROUTING_MODE_LABELS: Readonly<Record<PartnerRoutingMode, string>>;
|
|
14
16
|
export declare const PARTNER_INTEGRATION_STATUS_LABELS: Readonly<Record<PartnerIntegrationStatus, string>>;
|
|
@@ -26,12 +28,23 @@ export declare function incidentPartnerRoutingTone(status: IncidentPartnerRoutin
|
|
|
26
28
|
* Whether an operator can act on a dispatch, so a table can enable or hide its
|
|
27
29
|
* buttons without duplicating the backend's transition rules.
|
|
28
30
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
+
* The two withdrawals are separate answers: `canCancel` is a local decision
|
|
32
|
+
* before the partner has it, `canStandDown` means telling THEM - which is only
|
|
33
|
+
* possible for a partner whose API supports it.
|
|
31
34
|
*/
|
|
32
|
-
export declare function partnerDispatchActions(status: PartnerDispatchStatus): {
|
|
35
|
+
export declare function partnerDispatchActions(status: PartnerDispatchStatus, capabilities?: PartnerActionCapabilities): {
|
|
33
36
|
canApprove: boolean;
|
|
34
37
|
canReject: boolean;
|
|
35
38
|
canCancel: boolean;
|
|
39
|
+
canStandDown: boolean;
|
|
40
|
+
canAmend: boolean;
|
|
36
41
|
canResend: boolean;
|
|
37
42
|
};
|
|
43
|
+
/**
|
|
44
|
+
* What the partner behind a dispatch can actually do, taken from its provider
|
|
45
|
+
* descriptor. Passed in rather than assumed, because it differs per partner.
|
|
46
|
+
*/
|
|
47
|
+
export interface PartnerActionCapabilities {
|
|
48
|
+
supportsWithdrawal?: boolean;
|
|
49
|
+
supportsAmendment?: boolean;
|
|
50
|
+
}
|