clarion-shared-types 1.0.85 → 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/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/modules/partner/enums/partner-enums.js +171 -0
- package/dist/cjs/modules/partner/enums/partner-enums.js.map +1 -0
- package/dist/cjs/modules/partner/index.js +28 -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-progress.dto.js +3 -0
- package/dist/cjs/modules/partner/interfaces/partner-dispatch-progress.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 +140 -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/partner/enums/partner-enums.js +168 -0
- package/dist/esm/modules/partner/enums/partner-enums.js.map +1 -0
- package/dist/esm/modules/partner/index.js +12 -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-progress.dto.js +2 -0
- package/dist/esm/modules/partner/interfaces/partner-dispatch-progress.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 +134 -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/partner/enums/partner-enums.d.ts +154 -0
- package/dist/types/modules/partner/index.d.ts +8 -0
- package/dist/types/modules/partner/interfaces/incident-partner-routing.dto.d.ts +41 -0
- package/dist/types/modules/partner/interfaces/partner-coverage-rule.dto.d.ts +42 -0
- 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 +144 -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 +70 -0
- package/dist/types/modules/partner/utils/partner-display.util.d.ts +50 -0
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
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-progress.dto';
|
|
8
|
+
export * from './interfaces/partner-dispatch.dto';
|
|
9
|
+
export * from './interfaces/incident-partner-routing.dto';
|
|
10
|
+
// Utilities
|
|
11
|
+
export * from './utils/partner-display.util';
|
|
12
|
+
//# 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,4CAA4C,CAAC;AAC3D,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-progress.dto.js","sourceRoot":"","sources":["../../../../../src/modules/partner/interfaces/partner-dispatch-progress.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,134 @@
|
|
|
1
|
+
import { IncidentPartnerRoutingStatus, PartnerEngagementState, 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]: 'Responder assigned',
|
|
17
|
+
[PartnerDispatchStatus.COMPLETED]: 'Closed by partner',
|
|
18
|
+
[PartnerDispatchStatus.FAILED]: 'Failed',
|
|
19
|
+
[PartnerDispatchStatus.REJECTED]: 'Declined',
|
|
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',
|
|
25
|
+
[PartnerDispatchStatus.EXPIRED]: 'Expired',
|
|
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
|
+
};
|
|
33
|
+
export const INCIDENT_PARTNER_ROUTING_STATUS_LABELS = {
|
|
34
|
+
[IncidentPartnerRoutingStatus.NOT_ROUTED]: 'No partner',
|
|
35
|
+
[IncidentPartnerRoutingStatus.PENDING]: 'Contacting partner',
|
|
36
|
+
[IncidentPartnerRoutingStatus.AWAITING_APPROVAL]: 'Waiting for confirmation',
|
|
37
|
+
[IncidentPartnerRoutingStatus.ROUTED]: 'Partner notified',
|
|
38
|
+
[IncidentPartnerRoutingStatus.PARTIALLY_ROUTED]: 'Partly notified',
|
|
39
|
+
[IncidentPartnerRoutingStatus.FAILED]: 'Partner not reached',
|
|
40
|
+
[IncidentPartnerRoutingStatus.DECLINED]: 'Declined',
|
|
41
|
+
};
|
|
42
|
+
export const PARTNER_ROUTING_MODE_LABELS = {
|
|
43
|
+
[PartnerRoutingMode.AUTO]: 'Automatic',
|
|
44
|
+
[PartnerRoutingMode.MANUAL]: 'Needs confirmation',
|
|
45
|
+
[PartnerRoutingMode.DISABLED]: 'Routing off',
|
|
46
|
+
};
|
|
47
|
+
export const PARTNER_INTEGRATION_STATUS_LABELS = {
|
|
48
|
+
[PartnerIntegrationStatus.UNKNOWN]: 'Not tested',
|
|
49
|
+
[PartnerIntegrationStatus.HEALTHY]: 'Healthy',
|
|
50
|
+
[PartnerIntegrationStatus.DEGRADED]: 'Degraded',
|
|
51
|
+
[PartnerIntegrationStatus.UNREACHABLE]: 'Unreachable',
|
|
52
|
+
};
|
|
53
|
+
export const PARTNER_CAPABILITY_LABELS = {
|
|
54
|
+
[PartnerServiceCapability.AMBULANCE]: 'Ambulance',
|
|
55
|
+
[PartnerServiceCapability.MEDICAL_EVACUATION]: 'Medical evacuation',
|
|
56
|
+
[PartnerServiceCapability.FIRE_RESPONSE]: 'Fire response',
|
|
57
|
+
[PartnerServiceCapability.SECURITY_RESPONSE]: 'Security response',
|
|
58
|
+
[PartnerServiceCapability.ROADSIDE_ASSISTANCE]: 'Roadside assistance',
|
|
59
|
+
[PartnerServiceCapability.TOWING]: 'Towing',
|
|
60
|
+
[PartnerServiceCapability.OTHER]: 'Other',
|
|
61
|
+
};
|
|
62
|
+
export const PARTNER_COVERAGE_MATCH_TYPE_LABELS = {
|
|
63
|
+
[PartnerCoverageMatchType.ALL]: 'Every incident',
|
|
64
|
+
[PartnerCoverageMatchType.INCIDENT_TYPE]: 'Incident type',
|
|
65
|
+
[PartnerCoverageMatchType.INCIDENT_CATEGORY]: 'Incident category',
|
|
66
|
+
[PartnerCoverageMatchType.EMERGENCY_TYPE]: 'Emergency classification',
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Chip family for a dispatch status, matching the admin's existing chip
|
|
70
|
+
* vocabulary: `success` for anything the partner has, `warn` for anything still
|
|
71
|
+
* needing a human, `danger` for a failure, `neutral` for a settled non-event.
|
|
72
|
+
*/
|
|
73
|
+
export function partnerDispatchStatusTone(status) {
|
|
74
|
+
switch (status) {
|
|
75
|
+
case PartnerDispatchStatus.SENT:
|
|
76
|
+
case PartnerDispatchStatus.ACKNOWLEDGED:
|
|
77
|
+
case PartnerDispatchStatus.COMPLETED:
|
|
78
|
+
return 'success';
|
|
79
|
+
case PartnerDispatchStatus.PENDING_APPROVAL:
|
|
80
|
+
case PartnerDispatchStatus.QUEUED:
|
|
81
|
+
case PartnerDispatchStatus.SENDING:
|
|
82
|
+
return 'warn';
|
|
83
|
+
case PartnerDispatchStatus.FAILED:
|
|
84
|
+
case PartnerDispatchStatus.EXPIRED:
|
|
85
|
+
return 'danger';
|
|
86
|
+
default:
|
|
87
|
+
return 'neutral';
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/** The same tone mapping for the incident-level rolled-up status. */
|
|
91
|
+
export function incidentPartnerRoutingTone(status) {
|
|
92
|
+
switch (status) {
|
|
93
|
+
case IncidentPartnerRoutingStatus.ROUTED:
|
|
94
|
+
return 'success';
|
|
95
|
+
case IncidentPartnerRoutingStatus.PENDING:
|
|
96
|
+
case IncidentPartnerRoutingStatus.AWAITING_APPROVAL:
|
|
97
|
+
case IncidentPartnerRoutingStatus.PARTIALLY_ROUTED:
|
|
98
|
+
return 'warn';
|
|
99
|
+
case IncidentPartnerRoutingStatus.FAILED:
|
|
100
|
+
return 'danger';
|
|
101
|
+
default:
|
|
102
|
+
return 'neutral';
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Whether an operator can act on a dispatch, so a table can enable or hide its
|
|
107
|
+
* buttons without duplicating the backend's transition rules.
|
|
108
|
+
*
|
|
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.
|
|
112
|
+
*/
|
|
113
|
+
export function partnerDispatchActions(status, capabilities = {}) {
|
|
114
|
+
const pending = status === PartnerDispatchStatus.PENDING_APPROVAL;
|
|
115
|
+
const withPartner = status === PartnerDispatchStatus.SENT ||
|
|
116
|
+
status === PartnerDispatchStatus.ACKNOWLEDGED;
|
|
117
|
+
return {
|
|
118
|
+
canApprove: pending,
|
|
119
|
+
canReject: pending,
|
|
120
|
+
/** Local withdrawal, before the partner ever heard about it. */
|
|
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,
|
|
130
|
+
canResend: status === PartnerDispatchStatus.FAILED ||
|
|
131
|
+
status === PartnerDispatchStatus.EXPIRED,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
//# 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":"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"}
|
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';
|
|
@@ -0,0 +1,154 @@
|
|
|
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 declare enum PartnerProviderCode {
|
|
12
|
+
RESCUE_CO = "RESCUE_CO",
|
|
13
|
+
AAR = "AAR",
|
|
14
|
+
ST_JOHN = "ST_JOHN",
|
|
15
|
+
GENERIC_REST = "GENERIC_REST"
|
|
16
|
+
}
|
|
17
|
+
/** A class of emergency service a partner can be asked to provide. */
|
|
18
|
+
export declare enum PartnerServiceCapability {
|
|
19
|
+
AMBULANCE = "AMBULANCE",
|
|
20
|
+
MEDICAL_EVACUATION = "MEDICAL_EVACUATION",
|
|
21
|
+
FIRE_RESPONSE = "FIRE_RESPONSE",
|
|
22
|
+
SECURITY_RESPONSE = "SECURITY_RESPONSE",
|
|
23
|
+
ROADSIDE_ASSISTANCE = "ROADSIDE_ASSISTANCE",
|
|
24
|
+
TOWING = "TOWING",
|
|
25
|
+
OTHER = "OTHER"
|
|
26
|
+
}
|
|
27
|
+
/** How an incident a partnership covers reaches the partner. */
|
|
28
|
+
export declare enum PartnerRoutingMode {
|
|
29
|
+
/** Sent as soon as the incident is created. */
|
|
30
|
+
AUTO = "AUTO",
|
|
31
|
+
/** Held until an operator confirms it. */
|
|
32
|
+
MANUAL = "MANUAL",
|
|
33
|
+
/** Configuration kept, nothing routed. */
|
|
34
|
+
DISABLED = "DISABLED"
|
|
35
|
+
}
|
|
36
|
+
/** Which of a partner's environments a partnership points at. */
|
|
37
|
+
export declare enum PartnerIntegrationEnvironment {
|
|
38
|
+
SANDBOX = "SANDBOX",
|
|
39
|
+
PRODUCTION = "PRODUCTION"
|
|
40
|
+
}
|
|
41
|
+
/** Last known health of a partnership's connection. Advisory only. */
|
|
42
|
+
export declare enum PartnerIntegrationStatus {
|
|
43
|
+
UNKNOWN = "UNKNOWN",
|
|
44
|
+
HEALTHY = "HEALTHY",
|
|
45
|
+
DEGRADED = "DEGRADED",
|
|
46
|
+
UNREACHABLE = "UNREACHABLE"
|
|
47
|
+
}
|
|
48
|
+
/** What a coverage rule matches an incident on. */
|
|
49
|
+
export declare enum PartnerCoverageMatchType {
|
|
50
|
+
ALL = "ALL",
|
|
51
|
+
INCIDENT_TYPE = "INCIDENT_TYPE",
|
|
52
|
+
INCIDENT_CATEGORY = "INCIDENT_CATEGORY",
|
|
53
|
+
EMERGENCY_TYPE = "EMERGENCY_TYPE"
|
|
54
|
+
}
|
|
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
|
+
*/
|
|
63
|
+
export declare enum PartnerDispatchStatus {
|
|
64
|
+
PENDING_APPROVAL = "PENDING_APPROVAL",
|
|
65
|
+
QUEUED = "QUEUED",
|
|
66
|
+
SENDING = "SENDING",
|
|
67
|
+
SENT = "SENT",
|
|
68
|
+
/** The partner has assigned a responder, or otherwise confirmed it is working it. */
|
|
69
|
+
ACKNOWLEDGED = "ACKNOWLEDGED",
|
|
70
|
+
/** The partner has closed the request. The engagement is over. */
|
|
71
|
+
COMPLETED = "COMPLETED",
|
|
72
|
+
FAILED = "FAILED",
|
|
73
|
+
REJECTED = "REJECTED",
|
|
74
|
+
/** Withdrawn BEFORE the partner ever received it. */
|
|
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",
|
|
84
|
+
EXPIRED = "EXPIRED"
|
|
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
|
+
}
|
|
101
|
+
/** Why a dispatch did not reach its partner. */
|
|
102
|
+
export declare enum PartnerDispatchFailureReason {
|
|
103
|
+
INVALID_PAYLOAD = "INVALID_PAYLOAD",
|
|
104
|
+
MISSING_REQUIRED_FIELD = "MISSING_REQUIRED_FIELD",
|
|
105
|
+
AUTHENTICATION_FAILED = "AUTHENTICATION_FAILED",
|
|
106
|
+
FEATURE_NOT_ENABLED = "FEATURE_NOT_ENABLED",
|
|
107
|
+
PROVIDER_REJECTED = "PROVIDER_REJECTED",
|
|
108
|
+
ADAPTER_NOT_SUPPORTED = "ADAPTER_NOT_SUPPORTED",
|
|
109
|
+
INTEGRATION_DISABLED = "INTEGRATION_DISABLED",
|
|
110
|
+
CREDENTIAL_UNAVAILABLE = "CREDENTIAL_UNAVAILABLE",
|
|
111
|
+
RATE_LIMITED = "RATE_LIMITED",
|
|
112
|
+
PROVIDER_UNAVAILABLE = "PROVIDER_UNAVAILABLE",
|
|
113
|
+
TIMEOUT = "TIMEOUT",
|
|
114
|
+
MAX_ATTEMPTS_EXCEEDED = "MAX_ATTEMPTS_EXCEEDED",
|
|
115
|
+
UNKNOWN = "UNKNOWN"
|
|
116
|
+
}
|
|
117
|
+
/** How the location attached to a dispatch was obtained. */
|
|
118
|
+
export declare enum PartnerLocationProvider {
|
|
119
|
+
GPS = "GPS",
|
|
120
|
+
NETWORK = "NETWORK",
|
|
121
|
+
FUSED = "FUSED"
|
|
122
|
+
}
|
|
123
|
+
/** The outbound partner call an attempt record describes. */
|
|
124
|
+
export declare enum PartnerAdapterOperation {
|
|
125
|
+
AUTHENTICATE = "AUTHENTICATE",
|
|
126
|
+
HEALTH_CHECK = "HEALTH_CHECK",
|
|
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"
|
|
136
|
+
}
|
|
137
|
+
/** The incident-side summary of third-party routing, stored on the incident row. */
|
|
138
|
+
export declare enum IncidentPartnerRoutingStatus {
|
|
139
|
+
NOT_ROUTED = "NOT_ROUTED",
|
|
140
|
+
PENDING = "PENDING",
|
|
141
|
+
AWAITING_APPROVAL = "AWAITING_APPROVAL",
|
|
142
|
+
ROUTED = "ROUTED",
|
|
143
|
+
PARTIALLY_ROUTED = "PARTIALLY_ROUTED",
|
|
144
|
+
FAILED = "FAILED",
|
|
145
|
+
DECLINED = "DECLINED"
|
|
146
|
+
}
|
|
147
|
+
/** List filter for the admin's partner-routing incident views. */
|
|
148
|
+
export declare enum PartnerDispatchScope {
|
|
149
|
+
ALL = "ALL",
|
|
150
|
+
ROUTED = "ROUTED",
|
|
151
|
+
AWAITING_APPROVAL = "AWAITING_APPROVAL",
|
|
152
|
+
FAILED = "FAILED",
|
|
153
|
+
NOT_ROUTED = "NOT_ROUTED"
|
|
154
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './enums/partner-enums';
|
|
2
|
+
export * from './interfaces/partner-provider.dto';
|
|
3
|
+
export * from './interfaces/partner-integration.dto';
|
|
4
|
+
export * from './interfaces/partner-coverage-rule.dto';
|
|
5
|
+
export * from './interfaces/partner-dispatch-progress.dto';
|
|
6
|
+
export * from './interfaces/partner-dispatch.dto';
|
|
7
|
+
export * from './interfaces/incident-partner-routing.dto';
|
|
8
|
+
export * from './utils/partner-display.util';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { IncidentPartnerRoutingStatus, PartnerEngagementState, PartnerDispatchStatus, PartnerProviderCode, PartnerRoutingMode, PartnerServiceCapability } from '../enums/partner-enums';
|
|
2
|
+
import { PartnerResponderDto, PartnerResponderVehicleDto } from './partner-dispatch-progress.dto';
|
|
3
|
+
/** One partner's leg of an incident's routing, as stored on the incident. */
|
|
4
|
+
export interface IncidentPartnerRoutingEntryDto {
|
|
5
|
+
integrationId: number;
|
|
6
|
+
providerCode: PartnerProviderCode;
|
|
7
|
+
providerName?: string | null;
|
|
8
|
+
capability: PartnerServiceCapability;
|
|
9
|
+
routingMode: PartnerRoutingMode;
|
|
10
|
+
dispatchId: number;
|
|
11
|
+
dispatchReference: string;
|
|
12
|
+
status: PartnerDispatchStatus;
|
|
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;
|
|
24
|
+
updatedAt: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The third-party routing summary carried on an incident.
|
|
28
|
+
*
|
|
29
|
+
* A read model owned by clarion-partner-services, so the incident list and
|
|
30
|
+
* detail can answer "was an ambulance called for this?" without a second
|
|
31
|
+
* request. The dispatches themselves live behind
|
|
32
|
+
* `GET /partner-services/dispatches/incidents/:incidentId`.
|
|
33
|
+
*/
|
|
34
|
+
export interface IncidentPartnerRoutingSnapshotDto {
|
|
35
|
+
status: IncidentPartnerRoutingStatus;
|
|
36
|
+
evaluatedAt: string;
|
|
37
|
+
consideredIntegrationCount: number;
|
|
38
|
+
entries: IncidentPartnerRoutingEntryDto[];
|
|
39
|
+
/** True when produced without a live answer from clarion-partner-services. */
|
|
40
|
+
degraded?: boolean;
|
|
41
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { IncidentEmergencyType } from '../../incident/enums/incident-emergency-type.enum';
|
|
2
|
+
import { PartnerCoverageMatchType, PartnerRoutingMode, PartnerServiceCapability } from '../enums/partner-enums';
|
|
3
|
+
/**
|
|
4
|
+
* One "this kind of incident goes to this partner" statement.
|
|
5
|
+
*
|
|
6
|
+
* The match key must agree with `matchType`: INCIDENT_TYPE needs
|
|
7
|
+
* `incidentTypeId`, INCIDENT_CATEGORY needs `incidentCategoryId`,
|
|
8
|
+
* EMERGENCY_TYPE needs `emergencyType`, ALL needs none. The backend enforces
|
|
9
|
+
* that and blanks the other two, so a form that switches match type must clear
|
|
10
|
+
* the previous key rather than leaving it in the payload.
|
|
11
|
+
*/
|
|
12
|
+
export interface PartnerCoverageRuleDto {
|
|
13
|
+
id: number;
|
|
14
|
+
integrationId: number;
|
|
15
|
+
organizationId: number;
|
|
16
|
+
matchType: PartnerCoverageMatchType;
|
|
17
|
+
incidentTypeId: number | null;
|
|
18
|
+
incidentCategoryId: number | null;
|
|
19
|
+
emergencyType: IncidentEmergencyType | null;
|
|
20
|
+
capability: PartnerServiceCapability;
|
|
21
|
+
routingModeOverride: PartnerRoutingMode | null;
|
|
22
|
+
priority: number;
|
|
23
|
+
enabled: boolean;
|
|
24
|
+
notes: string | null;
|
|
25
|
+
createdBy: number | null;
|
|
26
|
+
updatedBy: number | null;
|
|
27
|
+
createdAt: string;
|
|
28
|
+
updatedAt: string;
|
|
29
|
+
}
|
|
30
|
+
export interface CreatePartnerCoverageRuleDto {
|
|
31
|
+
matchType: PartnerCoverageMatchType;
|
|
32
|
+
incidentTypeId?: number;
|
|
33
|
+
incidentCategoryId?: number;
|
|
34
|
+
emergencyType?: IncidentEmergencyType;
|
|
35
|
+
/** Must be a capability the partnership declares. */
|
|
36
|
+
capability: PartnerServiceCapability;
|
|
37
|
+
routingModeOverride?: PartnerRoutingMode;
|
|
38
|
+
priority?: number;
|
|
39
|
+
enabled?: boolean;
|
|
40
|
+
notes?: string;
|
|
41
|
+
}
|
|
42
|
+
export type UpdatePartnerCoverageRuleDto = Partial<CreatePartnerCoverageRuleDto>;
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { CountryCode } from '../../country/enums/country-code.enum';
|
|
2
|
+
import { PartnerAdapterOperation, PartnerEngagementState, PartnerDispatchFailureReason, PartnerDispatchStatus, PartnerLocationProvider, PartnerProviderCode, PartnerRoutingMode, PartnerServiceCapability } from '../enums/partner-enums';
|
|
3
|
+
import { PartnerDispatchProgressDto } from './partner-dispatch-progress.dto';
|
|
4
|
+
/** Where the emergency is, as sent to the partner. */
|
|
5
|
+
export interface PartnerDispatchLocationDto {
|
|
6
|
+
latitude: number;
|
|
7
|
+
longitude: number;
|
|
8
|
+
measuredAt: string;
|
|
9
|
+
provider: PartnerLocationProvider;
|
|
10
|
+
address?: string | null;
|
|
11
|
+
}
|
|
12
|
+
/** Who the partner should call about the person in trouble. */
|
|
13
|
+
export interface PartnerEmergencyContactDto {
|
|
14
|
+
emergencyContactName: string;
|
|
15
|
+
/** E.164 numbers, primary guardian first. */
|
|
16
|
+
phoneNumbers: string[];
|
|
17
|
+
relationship?: string;
|
|
18
|
+
}
|
|
19
|
+
/** The incident facts a dispatch was built from, frozen at routing time. */
|
|
20
|
+
export interface PartnerDispatchIncidentSnapshotDto {
|
|
21
|
+
incidentId: number;
|
|
22
|
+
organizationId: number;
|
|
23
|
+
controlCentreId?: number | null;
|
|
24
|
+
incidentTypeId?: number | null;
|
|
25
|
+
incidentTypeName?: string | null;
|
|
26
|
+
incidentCategoryId?: number | null;
|
|
27
|
+
incidentCategoryName?: string | null;
|
|
28
|
+
emergencyType?: string | null;
|
|
29
|
+
incidentClass?: string | null;
|
|
30
|
+
channel?: string | null;
|
|
31
|
+
priority?: string | null;
|
|
32
|
+
description?: string | null;
|
|
33
|
+
createdAt: string;
|
|
34
|
+
reporterName?: string | null;
|
|
35
|
+
reporterPhoneNumber?: string | null;
|
|
36
|
+
reporterUserId?: number | null;
|
|
37
|
+
location?: PartnerDispatchLocationDto | null;
|
|
38
|
+
address?: string | null;
|
|
39
|
+
}
|
|
40
|
+
/** One outbound call made on a dispatch's behalf, success or failure. */
|
|
41
|
+
export interface PartnerDispatchAttemptDto {
|
|
42
|
+
id: number;
|
|
43
|
+
dispatchId: number;
|
|
44
|
+
attemptNumber: number;
|
|
45
|
+
operation: PartnerAdapterOperation;
|
|
46
|
+
/** Query string already masked by the backend. */
|
|
47
|
+
requestUrl: string;
|
|
48
|
+
httpStatus: number | null;
|
|
49
|
+
success: boolean;
|
|
50
|
+
failureReason: PartnerDispatchFailureReason | null;
|
|
51
|
+
errorCode: string | null;
|
|
52
|
+
errorMessage: string | null;
|
|
53
|
+
durationMs: number;
|
|
54
|
+
responseSnapshot: Record<string, unknown> | null;
|
|
55
|
+
createdAt: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* One incident's routing to one partnership.
|
|
59
|
+
*
|
|
60
|
+
* `requestPayload` and `responsePayload` are sanitized by the backend before
|
|
61
|
+
* they are stored, so they are safe to render verbatim in a support view.
|
|
62
|
+
*/
|
|
63
|
+
export interface PartnerDispatchDto {
|
|
64
|
+
id: number;
|
|
65
|
+
/** Stable reference, safe to quote to the partner or in a support ticket. */
|
|
66
|
+
dispatchReference: string;
|
|
67
|
+
organizationId: number;
|
|
68
|
+
controlCentreId: number | null;
|
|
69
|
+
integrationId: number;
|
|
70
|
+
providerCode: PartnerProviderCode;
|
|
71
|
+
capability: PartnerServiceCapability;
|
|
72
|
+
coverageRuleId: number | null;
|
|
73
|
+
incidentId: number;
|
|
74
|
+
incidentTypeId: number | null;
|
|
75
|
+
incidentCategoryId: number | null;
|
|
76
|
+
routingMode: PartnerRoutingMode;
|
|
77
|
+
status: PartnerDispatchStatus;
|
|
78
|
+
countryCode: CountryCode;
|
|
79
|
+
attemptCount: number;
|
|
80
|
+
maxAttempts: number;
|
|
81
|
+
nextAttemptAt: string | null;
|
|
82
|
+
approvalExpiresAt: string | null;
|
|
83
|
+
approvedByUserId: number | null;
|
|
84
|
+
approvedAt: string | null;
|
|
85
|
+
rejectedByUserId: number | null;
|
|
86
|
+
rejectedAt: string | null;
|
|
87
|
+
cancelledByUserId: number | null;
|
|
88
|
+
cancelledAt: string | null;
|
|
89
|
+
decisionReason: string | null;
|
|
90
|
+
/** The partner's own identifier, e.g. a Rescue.co SOS request id. */
|
|
91
|
+
partnerReference: string | null;
|
|
92
|
+
partnerNumber: string | null;
|
|
93
|
+
/** The partner's own status string. Show it verbatim next to the mapped state. */
|
|
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;
|
|
111
|
+
requestPayload: Record<string, unknown> | null;
|
|
112
|
+
responsePayload: Record<string, unknown> | null;
|
|
113
|
+
failureReason: PartnerDispatchFailureReason | null;
|
|
114
|
+
lastErrorCode: string | null;
|
|
115
|
+
lastErrorMessage: string | null;
|
|
116
|
+
incidentSnapshot: PartnerDispatchIncidentSnapshotDto;
|
|
117
|
+
emergencyContact: PartnerEmergencyContactDto | null;
|
|
118
|
+
sentAt: string | null;
|
|
119
|
+
completedAt: string | null;
|
|
120
|
+
createdAt: string;
|
|
121
|
+
updatedAt: string;
|
|
122
|
+
/** Present on the detail endpoint. */
|
|
123
|
+
attempts?: PartnerDispatchAttemptDto[];
|
|
124
|
+
}
|
|
125
|
+
/** Body for approve / reject / cancel. The acting user comes from the session. */
|
|
126
|
+
export interface PartnerDispatchDecisionDto {
|
|
127
|
+
reason?: string;
|
|
128
|
+
}
|
|
129
|
+
/** List filters for the dispatches table. */
|
|
130
|
+
export interface PartnerDispatchQueryParams {
|
|
131
|
+
page?: number;
|
|
132
|
+
limit?: number;
|
|
133
|
+
sortBy?: string;
|
|
134
|
+
sortOrder?: 'ASC' | 'DESC';
|
|
135
|
+
/** Super-Admin only. */
|
|
136
|
+
organizationId?: number;
|
|
137
|
+
incidentId?: number;
|
|
138
|
+
integrationId?: number;
|
|
139
|
+
status?: PartnerDispatchStatus;
|
|
140
|
+
providerCode?: PartnerProviderCode;
|
|
141
|
+
capability?: PartnerServiceCapability;
|
|
142
|
+
routingMode?: PartnerRoutingMode;
|
|
143
|
+
countryCode?: CountryCode;
|
|
144
|
+
}
|