grm-shared-library 1.1.197 → 1.1.198
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/constants/partner-defaults.const.js +25 -1
- package/dist/cjs/modules/partner/constants/partner-defaults.const.js.map +1 -1
- package/dist/cjs/modules/partner/dtos/amend-partner-dispatch.dto.js +95 -0
- package/dist/cjs/modules/partner/dtos/amend-partner-dispatch.dto.js.map +1 -0
- package/dist/cjs/modules/partner/dtos/update-incident-partner-routing.dto.js +72 -1
- package/dist/cjs/modules/partner/dtos/update-incident-partner-routing.dto.js.map +1 -1
- package/dist/cjs/modules/partner/enums/partner-adapter-operation.enum.js +13 -0
- package/dist/cjs/modules/partner/enums/partner-adapter-operation.enum.js.map +1 -1
- package/dist/cjs/modules/partner/enums/partner-dispatch-status.enum.js +40 -11
- package/dist/cjs/modules/partner/enums/partner-dispatch-status.enum.js.map +1 -1
- package/dist/cjs/modules/partner/enums/partner-engagement-state.enum.js +24 -0
- package/dist/cjs/modules/partner/enums/partner-engagement-state.enum.js.map +1 -0
- package/dist/cjs/modules/partner/index.js +3 -0
- package/dist/cjs/modules/partner/index.js.map +1 -1
- package/dist/cjs/modules/partner/interfaces/partner-dispatch-progress.js +3 -0
- package/dist/cjs/modules/partner/interfaces/partner-dispatch-progress.js.map +1 -0
- package/dist/cjs/modules/partner/utils/partner-routing.util.js +10 -0
- package/dist/cjs/modules/partner/utils/partner-routing.util.js.map +1 -1
- package/dist/esm/modules/partner/constants/partner-defaults.const.js +24 -0
- package/dist/esm/modules/partner/constants/partner-defaults.const.js.map +1 -1
- package/dist/esm/modules/partner/dtos/amend-partner-dispatch.dto.js +90 -0
- package/dist/esm/modules/partner/dtos/amend-partner-dispatch.dto.js.map +1 -0
- package/dist/esm/modules/partner/dtos/update-incident-partner-routing.dto.js +69 -0
- package/dist/esm/modules/partner/dtos/update-incident-partner-routing.dto.js.map +1 -1
- package/dist/esm/modules/partner/enums/partner-adapter-operation.enum.js +13 -0
- package/dist/esm/modules/partner/enums/partner-adapter-operation.enum.js.map +1 -1
- package/dist/esm/modules/partner/enums/partner-dispatch-status.enum.js +39 -10
- package/dist/esm/modules/partner/enums/partner-dispatch-status.enum.js.map +1 -1
- package/dist/esm/modules/partner/enums/partner-engagement-state.enum.js +21 -0
- package/dist/esm/modules/partner/enums/partner-engagement-state.enum.js.map +1 -0
- package/dist/esm/modules/partner/index.js +3 -0
- package/dist/esm/modules/partner/index.js.map +1 -1
- package/dist/esm/modules/partner/interfaces/partner-dispatch-progress.js +2 -0
- package/dist/esm/modules/partner/interfaces/partner-dispatch-progress.js.map +1 -0
- package/dist/esm/modules/partner/utils/partner-routing.util.js +10 -0
- package/dist/esm/modules/partner/utils/partner-routing.util.js.map +1 -1
- package/dist/types/modules/partner/constants/partner-defaults.const.d.ts +24 -0
- package/dist/types/modules/partner/dtos/amend-partner-dispatch.dto.d.ts +27 -0
- package/dist/types/modules/partner/dtos/update-incident-partner-routing.dto.d.ts +16 -0
- package/dist/types/modules/partner/enums/partner-adapter-operation.enum.d.ts +14 -1
- package/dist/types/modules/partner/enums/partner-dispatch-status.enum.d.ts +33 -8
- package/dist/types/modules/partner/enums/partner-engagement-state.enum.d.ts +19 -0
- package/dist/types/modules/partner/index.d.ts +3 -0
- package/dist/types/modules/partner/interfaces/incident-partner-routing.d.ts +13 -0
- package/dist/types/modules/partner/interfaces/partner-dispatch-progress.d.ts +48 -0
- package/dist/types/modules/partner/interfaces/partner-dispatch.d.ts +22 -0
- package/dist/types/modules/partner/interfaces/partner-provider-descriptor.d.ts +29 -0
- package/package.json +1 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { PartnerEngagementState } from '../enums/partner-engagement-state.enum';
|
|
2
|
+
/** Whoever the partner has put on the job. */
|
|
3
|
+
export interface PartnerResponderInfo {
|
|
4
|
+
name?: string | null;
|
|
5
|
+
/** E.164 where the partner gives one. */
|
|
6
|
+
phoneNumber?: string | null;
|
|
7
|
+
/** The partner's own identifier for the responder. */
|
|
8
|
+
reference?: string | null;
|
|
9
|
+
}
|
|
10
|
+
/** The unit the partner has assigned, described the way a control room needs it. */
|
|
11
|
+
export interface PartnerResponderVehicle {
|
|
12
|
+
/** Registration, call sign, or whatever the partner uses to identify the unit. */
|
|
13
|
+
identifier?: string | null;
|
|
14
|
+
/** Human description, e.g. "White Toyota HiAce". */
|
|
15
|
+
description?: string | null;
|
|
16
|
+
/** The partner's own classification of the unit, e.g. "ADVANCED_LIFE_SUPPORT". */
|
|
17
|
+
serviceType?: string | null;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* What a partner reports about an emergency they are already working.
|
|
21
|
+
*
|
|
22
|
+
* This is the answer to the question a control room actually asks after
|
|
23
|
+
* dispatching: "is anyone coming, who, and where are they taking them?" Every
|
|
24
|
+
* field is optional because partners differ enormously in what they publish -
|
|
25
|
+
* some return a full crew and vehicle, some return nothing but a status - and
|
|
26
|
+
* the platform must be useful with either.
|
|
27
|
+
*
|
|
28
|
+
* Provider-neutral: `partnerStatus` keeps the partner's own word verbatim so an
|
|
29
|
+
* operator sees exactly what was said, while `state` reduces it to something
|
|
30
|
+
* every screen and every report can rely on.
|
|
31
|
+
*/
|
|
32
|
+
export interface PartnerDispatchProgress {
|
|
33
|
+
state: PartnerEngagementState;
|
|
34
|
+
/** The partner's own status string, unmodified. */
|
|
35
|
+
partnerStatus?: string | null;
|
|
36
|
+
/** The partner's human-facing reference, if it appears or changes here. */
|
|
37
|
+
partnerNumber?: string | null;
|
|
38
|
+
responder?: PartnerResponderInfo | null;
|
|
39
|
+
vehicle?: PartnerResponderVehicle | null;
|
|
40
|
+
/** Where the responder is taking the patient, when the partner says. */
|
|
41
|
+
destination?: string | null;
|
|
42
|
+
/** The partner's own label for the journey, e.g. "PENDING", "EN_ROUTE". */
|
|
43
|
+
journeyStatus?: string | null;
|
|
44
|
+
/** When the partner last changed anything, as the partner reports it. */
|
|
45
|
+
partnerUpdatedAt?: string | null;
|
|
46
|
+
/** When this platform last read it. */
|
|
47
|
+
observedAt: string;
|
|
48
|
+
}
|
|
@@ -5,7 +5,9 @@ import { PartnerDispatchStatus } from '../enums/partner-dispatch-status.enum';
|
|
|
5
5
|
import { PartnerProviderCode } from '../enums/partner-provider-code.enum';
|
|
6
6
|
import { PartnerRoutingMode } from '../enums/partner-routing-mode.enum';
|
|
7
7
|
import { PartnerServiceCapability } from '../enums/partner-service-capability.enum';
|
|
8
|
+
import { PartnerEngagementState } from '../enums/partner-engagement-state.enum';
|
|
8
9
|
import { PartnerDispatchLocation } from './partner-dispatch-location';
|
|
10
|
+
import { PartnerDispatchProgress } from './partner-dispatch-progress';
|
|
9
11
|
import { PartnerEmergencyContact } from './partner-emergency-contact';
|
|
10
12
|
/**
|
|
11
13
|
* The incident facts a dispatch was built from, frozen at routing time.
|
|
@@ -100,6 +102,26 @@ export interface PartnerDispatch {
|
|
|
100
102
|
partnerNumber?: string | null;
|
|
101
103
|
/** The partner's own status string, passed through verbatim. */
|
|
102
104
|
partnerStatus?: string | null;
|
|
105
|
+
/**
|
|
106
|
+
* The partner's status reduced to something every screen can rely on.
|
|
107
|
+
* Absent for a partner that publishes no status at all.
|
|
108
|
+
*/
|
|
109
|
+
engagementState?: PartnerEngagementState | null;
|
|
110
|
+
/**
|
|
111
|
+
* What the partner last reported - responder, vehicle, destination.
|
|
112
|
+
*
|
|
113
|
+
* This is the answer to "is anyone actually coming?", which is the only
|
|
114
|
+
* question a control room has once a dispatch has left the building.
|
|
115
|
+
*/
|
|
116
|
+
progress?: PartnerDispatchProgress | null;
|
|
117
|
+
/** When progress was last read from the partner. */
|
|
118
|
+
lastPolledAt?: string | null;
|
|
119
|
+
/** When the partner first confirmed it was working the emergency. */
|
|
120
|
+
acknowledgedAt?: string | null;
|
|
121
|
+
/** When the partner closed the request. */
|
|
122
|
+
closedAt?: string | null;
|
|
123
|
+
withdrawnByUserId?: number | null;
|
|
124
|
+
withdrawnAt?: string | null;
|
|
103
125
|
/** The sanitized body sent to the partner. Never contains a credential. */
|
|
104
126
|
requestPayload?: Record<string, unknown> | null;
|
|
105
127
|
/** The sanitized body the partner returned. */
|
|
@@ -51,6 +51,35 @@ export interface PartnerProviderDescriptor {
|
|
|
51
51
|
credentialFields: PartnerProviderCredentialField[];
|
|
52
52
|
/** True when the adapter implements a non-mutating connectivity probe. */
|
|
53
53
|
supportsHealthCheck: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* True when the partner publishes the state of a request we have already
|
|
56
|
+
* sent, so progress can be polled and shown to a control room.
|
|
57
|
+
*/
|
|
58
|
+
supportsStatusPolling: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* True when the partner lets a request be stood down after they accepted it.
|
|
61
|
+
*
|
|
62
|
+
* When false, an organization that changes its mind has to telephone the
|
|
63
|
+
* partner - and the platform says so plainly rather than offering a button
|
|
64
|
+
* that quietly does nothing.
|
|
65
|
+
*/
|
|
66
|
+
supportsWithdrawal: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* True when the partner lets the details of a live request be corrected.
|
|
69
|
+
*
|
|
70
|
+
* The case that matters is a caller ringing back with a better location
|
|
71
|
+
* after a responder is already moving.
|
|
72
|
+
*/
|
|
73
|
+
supportsAmendment: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* True when the partner can be asked whether a request we may already have
|
|
76
|
+
* sent exists.
|
|
77
|
+
*
|
|
78
|
+
* This is what makes a retry after a TIMEOUT safe. Without it, a request
|
|
79
|
+
* that landed but whose reply was lost can only be retried blind, and a
|
|
80
|
+
* blind retry on a non-idempotent emergency API means two ambulances.
|
|
81
|
+
*/
|
|
82
|
+
supportsDuplicateDetection: boolean;
|
|
54
83
|
/** False for reserved provider codes that have no working adapter yet. */
|
|
55
84
|
available: boolean;
|
|
56
85
|
}
|