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.
Files changed (48) hide show
  1. package/dist/cjs/modules/partner/constants/partner-defaults.const.js +25 -1
  2. package/dist/cjs/modules/partner/constants/partner-defaults.const.js.map +1 -1
  3. package/dist/cjs/modules/partner/dtos/amend-partner-dispatch.dto.js +95 -0
  4. package/dist/cjs/modules/partner/dtos/amend-partner-dispatch.dto.js.map +1 -0
  5. package/dist/cjs/modules/partner/dtos/update-incident-partner-routing.dto.js +72 -1
  6. package/dist/cjs/modules/partner/dtos/update-incident-partner-routing.dto.js.map +1 -1
  7. package/dist/cjs/modules/partner/enums/partner-adapter-operation.enum.js +13 -0
  8. package/dist/cjs/modules/partner/enums/partner-adapter-operation.enum.js.map +1 -1
  9. package/dist/cjs/modules/partner/enums/partner-dispatch-status.enum.js +40 -11
  10. package/dist/cjs/modules/partner/enums/partner-dispatch-status.enum.js.map +1 -1
  11. package/dist/cjs/modules/partner/enums/partner-engagement-state.enum.js +24 -0
  12. package/dist/cjs/modules/partner/enums/partner-engagement-state.enum.js.map +1 -0
  13. package/dist/cjs/modules/partner/index.js +3 -0
  14. package/dist/cjs/modules/partner/index.js.map +1 -1
  15. package/dist/cjs/modules/partner/interfaces/partner-dispatch-progress.js +3 -0
  16. package/dist/cjs/modules/partner/interfaces/partner-dispatch-progress.js.map +1 -0
  17. package/dist/cjs/modules/partner/utils/partner-routing.util.js +10 -0
  18. package/dist/cjs/modules/partner/utils/partner-routing.util.js.map +1 -1
  19. package/dist/esm/modules/partner/constants/partner-defaults.const.js +24 -0
  20. package/dist/esm/modules/partner/constants/partner-defaults.const.js.map +1 -1
  21. package/dist/esm/modules/partner/dtos/amend-partner-dispatch.dto.js +90 -0
  22. package/dist/esm/modules/partner/dtos/amend-partner-dispatch.dto.js.map +1 -0
  23. package/dist/esm/modules/partner/dtos/update-incident-partner-routing.dto.js +69 -0
  24. package/dist/esm/modules/partner/dtos/update-incident-partner-routing.dto.js.map +1 -1
  25. package/dist/esm/modules/partner/enums/partner-adapter-operation.enum.js +13 -0
  26. package/dist/esm/modules/partner/enums/partner-adapter-operation.enum.js.map +1 -1
  27. package/dist/esm/modules/partner/enums/partner-dispatch-status.enum.js +39 -10
  28. package/dist/esm/modules/partner/enums/partner-dispatch-status.enum.js.map +1 -1
  29. package/dist/esm/modules/partner/enums/partner-engagement-state.enum.js +21 -0
  30. package/dist/esm/modules/partner/enums/partner-engagement-state.enum.js.map +1 -0
  31. package/dist/esm/modules/partner/index.js +3 -0
  32. package/dist/esm/modules/partner/index.js.map +1 -1
  33. package/dist/esm/modules/partner/interfaces/partner-dispatch-progress.js +2 -0
  34. package/dist/esm/modules/partner/interfaces/partner-dispatch-progress.js.map +1 -0
  35. package/dist/esm/modules/partner/utils/partner-routing.util.js +10 -0
  36. package/dist/esm/modules/partner/utils/partner-routing.util.js.map +1 -1
  37. package/dist/types/modules/partner/constants/partner-defaults.const.d.ts +24 -0
  38. package/dist/types/modules/partner/dtos/amend-partner-dispatch.dto.d.ts +27 -0
  39. package/dist/types/modules/partner/dtos/update-incident-partner-routing.dto.d.ts +16 -0
  40. package/dist/types/modules/partner/enums/partner-adapter-operation.enum.d.ts +14 -1
  41. package/dist/types/modules/partner/enums/partner-dispatch-status.enum.d.ts +33 -8
  42. package/dist/types/modules/partner/enums/partner-engagement-state.enum.d.ts +19 -0
  43. package/dist/types/modules/partner/index.d.ts +3 -0
  44. package/dist/types/modules/partner/interfaces/incident-partner-routing.d.ts +13 -0
  45. package/dist/types/modules/partner/interfaces/partner-dispatch-progress.d.ts +48 -0
  46. package/dist/types/modules/partner/interfaces/partner-dispatch.d.ts +22 -0
  47. package/dist/types/modules/partner/interfaces/partner-provider-descriptor.d.ts +29 -0
  48. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"amend-partner-dispatch.dto.js","sourceRoot":"","sources":["../../../../../src/modules/partner/dtos/amend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AAI,CAAC,GAAG,EAAE,CAAC,+BAA+B,CAAC;IAC3C,UAAU,EAAE;8BACF,+BAA+B;yDAAC;AAS3C;IAPC,mBAAmB,CAAC;QACjB,WAAW,EAAE,8DAA8D;QAC3E,OAAO,EAAE,4CAA4C;KACxD,CAAC;IACD,QAAQ,EAAE;IACV,SAAS,CAAC,GAAG,CAAC;IACd,UAAU,EAAE;;uDACG"}
@@ -11,10 +11,59 @@ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
11
11
  import { Type } from 'class-transformer';
12
12
  import { ArrayMaxSize, IsArray, IsBoolean, IsDateString, IsEnum, IsInt, IsOptional, IsPositive, IsString, MaxLength, Min, ValidateNested, } from 'class-validator';
13
13
  import { IncidentPartnerRoutingStatus } from '../enums/incident-partner-routing-status.enum';
14
+ import { PartnerEngagementState } from '../enums/partner-engagement-state.enum';
14
15
  import { PartnerDispatchStatus } from '../enums/partner-dispatch-status.enum';
15
16
  import { PartnerProviderCode } from '../enums/partner-provider-code.enum';
16
17
  import { PartnerRoutingMode } from '../enums/partner-routing-mode.enum';
17
18
  import { PartnerServiceCapability } from '../enums/partner-service-capability.enum';
19
+ /** Whoever the partner has put on the job, as carried on the incident. */
20
+ export class IncidentPartnerResponderDto {
21
+ }
22
+ __decorate([
23
+ ApiPropertyOptional({ example: 'John Mwangi' }),
24
+ IsString(),
25
+ MaxLength(250),
26
+ IsOptional(),
27
+ __metadata("design:type", String)
28
+ ], IncidentPartnerResponderDto.prototype, "name", void 0);
29
+ __decorate([
30
+ ApiPropertyOptional({ example: '+254712345678' }),
31
+ IsString(),
32
+ MaxLength(30),
33
+ IsOptional(),
34
+ __metadata("design:type", String)
35
+ ], IncidentPartnerResponderDto.prototype, "phoneNumber", void 0);
36
+ __decorate([
37
+ ApiPropertyOptional({ description: "The partner's own identifier for the responder." }),
38
+ IsString(),
39
+ MaxLength(200),
40
+ IsOptional(),
41
+ __metadata("design:type", String)
42
+ ], IncidentPartnerResponderDto.prototype, "reference", void 0);
43
+ /** The unit the partner has assigned, as carried on the incident. */
44
+ export class IncidentPartnerVehicleDto {
45
+ }
46
+ __decorate([
47
+ ApiPropertyOptional({ description: 'Registration or call sign.', example: 'KAA 123B' }),
48
+ IsString(),
49
+ MaxLength(100),
50
+ IsOptional(),
51
+ __metadata("design:type", String)
52
+ ], IncidentPartnerVehicleDto.prototype, "identifier", void 0);
53
+ __decorate([
54
+ ApiPropertyOptional({ example: 'White Toyota HiAce' }),
55
+ IsString(),
56
+ MaxLength(200),
57
+ IsOptional(),
58
+ __metadata("design:type", String)
59
+ ], IncidentPartnerVehicleDto.prototype, "description", void 0);
60
+ __decorate([
61
+ ApiPropertyOptional({ description: "The partner's own classification of the unit." }),
62
+ IsString(),
63
+ MaxLength(100),
64
+ IsOptional(),
65
+ __metadata("design:type", String)
66
+ ], IncidentPartnerVehicleDto.prototype, "serviceType", void 0);
18
67
  /** One partner's leg of an incident's routing, as pushed back to clarion-incident. */
19
68
  export class IncidentPartnerRoutingEntryDto {
20
69
  }
@@ -72,6 +121,26 @@ __decorate([
72
121
  IsOptional(),
73
122
  __metadata("design:type", String)
74
123
  ], IncidentPartnerRoutingEntryDto.prototype, "partnerReference", void 0);
124
+ __decorate([
125
+ ApiPropertyOptional({ enum: PartnerEngagementState }),
126
+ IsEnum(PartnerEngagementState),
127
+ IsOptional(),
128
+ __metadata("design:type", String)
129
+ ], IncidentPartnerRoutingEntryDto.prototype, "engagementState", void 0);
130
+ __decorate([
131
+ ApiPropertyOptional({ type: IncidentPartnerResponderDto }),
132
+ ValidateNested(),
133
+ Type(() => IncidentPartnerResponderDto),
134
+ IsOptional(),
135
+ __metadata("design:type", IncidentPartnerResponderDto)
136
+ ], IncidentPartnerRoutingEntryDto.prototype, "responder", void 0);
137
+ __decorate([
138
+ ApiPropertyOptional({ type: IncidentPartnerVehicleDto }),
139
+ ValidateNested(),
140
+ Type(() => IncidentPartnerVehicleDto),
141
+ IsOptional(),
142
+ __metadata("design:type", IncidentPartnerVehicleDto)
143
+ ], IncidentPartnerRoutingEntryDto.prototype, "vehicle", void 0);
75
144
  __decorate([
76
145
  ApiProperty({ example: '2026-08-26T05:25:41.400Z' }),
77
146
  IsDateString(),
@@ -1 +1 @@
1
- {"version":3,"file":"update-incident-partner-routing.dto.js","sourceRoot":"","sources":["../../../../../src/modules/partner/dtos/update-incident-partner-routing.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EACH,YAAY,EACZ,OAAO,EACP,SAAS,EACT,YAAY,EACZ,MAAM,EACN,KAAK,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,SAAS,EACT,GAAG,EACH,cAAc,GACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AAEpF,sFAAsF;AACtF,MAAM,OAAO,8BAA8B;CAiD1C;AA5CG;IAJC,WAAW,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IAC3B,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IAClB,KAAK,EAAE;IACP,UAAU,EAAE;;qEACU;AAIvB;IAFC,WAAW,CAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,CAAC;IAC1C,MAAM,CAAC,mBAAmB,CAAC;;oEACO;AAMnC;IAJC,mBAAmB,CAAC,EAAE,OAAO,EAAE,kCAAkC,EAAE,CAAC;IACpE,QAAQ,EAAE;IACV,SAAS,CAAC,GAAG,CAAC;I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,MAAM,CAAC;IAClB,KAAK,EAAE;IACP,GAAG,CAAC,CAAC,CAAC;IACN,UAAU,EAAE;;mFACuB;AAQpC;IANC,mBAAmB,CAAC,EAAE,IAAI,EAAE,CAAC,8BAA8B,CAAC,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;IACvG,OAAO,EAAE;IACT,YAAY,CAAC,EAAE,CAAC;IAChB,cAAc,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAI,CAAC,GAAG,EAAE,CAAC,8BAA8B,CAAC;IAC1C,UAAU,EAAE;;gEAC8B;AAQ3C;IANC,mBAAmB,CAAC;QACjB,WAAW,EAAE,wFAAwF;QACrG,OAAO,EAAE,KAAK;KACjB,CAAC;IACD,SAAS,EAAE;IACX,UAAU,EAAE;;iEACM"}
1
+ {"version":3,"file":"update-incident-partner-routing.dto.js","sourceRoot":"","sources":["../../../../../src/modules/partner/dtos/update-incident-partner-routing.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EACH,YAAY,EACZ,OAAO,EACP,SAAS,EACT,YAAY,EACZ,MAAM,EACN,KAAK,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,SAAS,EACT,GAAG,EACH,cAAc,GACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AAC7F,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AA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self. */
13
13
  PartnerAdapterOperation["DISPATCH"] = "DISPATCH";
14
+ /** Asking the partner what has happened since. */
15
+ PartnerAdapterOperation["FETCH_STATUS"] = "FETCH_STATUS";
16
+ /** Standing the partner down after they had already accepted it. */
17
+ PartnerAdapterOperation["WITHDRAW"] = "WITHDRAW";
18
+ /** Correcting details of an emergency the partner is already working. */
19
+ PartnerAdapterOperation["AMEND"] = "AMEND";
20
+ /**
21
+ * Asking the partner whether a request we may have already sent exists.
22
+ *
23
+ * Used after a timeout, where the request might have landed but the reply
24
+ * never arrived - the one case where re-sending could produce a duplicate.
25
+ */
26
+ PartnerAdapterOperation["LOOKUP"] = "LOOKUP";
14
27
  })(PartnerAdapterOperation || (PartnerAdapterOperation = {}));
15
28
  //# sourceMappingURL=partner-adapter-operation.enum.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"partner-adapter-operation.enum.js","sourceRoot":"","sources":["../../../../../src/modules/partner/enums/partner-adapter-operation.enum.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAN,IAAY,uBAOX;AAPD,WAAY,uBAAuB;IAC/B,uEAAuE;IACvE,wDAA6B,CAAA;IAC7B,yCAAyC;IACzC,wDAA6B,CAAA;IAC7B,uCAAuC;IACvC,gDAAqB,CAAA;AACzB,CAAC,EAPW,uBAAuB,KAAvB,uBAAuB,QAOlC"}
1
+ {"version":3,"file":"partner-adapter-operation.enum.js","sourceRoot":"","sources":["../../../../../src/modules/partner/enums/partner-adapter-operation.enum.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAN,IAAY,uBAoBX;AApBD,WAAY,uBAAuB;IAC/B,uEAAuE;IACvE,wDAA6B,CAAA;IAC7B,yCAAyC;IACzC,wDAA6B,CAAA;IAC7B,uCAAuC;IACvC,gDAAqB,CAAA;IACrB,kDAAkD;IAClD,wDAA6B,CAAA;IAC7B,oEAAoE;IACpE,gDAAqB,CAAA;IACrB,yEAAyE;IACzE,0CAAe,CAAA;IACf;;;;;OAKG;IACH,4CAAiB,CAAA;AACrB,CAAC,EApBW,uBAAuB,KAAvB,uBAAuB,QAoBlC"}
@@ -1,15 +1,18 @@
1
1
  /**
2
2
  * Lifecycle of one incident's routing to one partner.
3
3
  *
4
- * Terminal states are SENT/ACKNOWLEDGED (the partner has the emergency),
5
- * FAILED, REJECTED, CANCELLED and EXPIRED. Everything else is in flight.
6
- *
7
4
  * MANUAL routing starts at PENDING_APPROVAL and reaches QUEUED only when an
8
5
  * operator approves; declining gives REJECTED, withdrawing gives CANCELLED and
9
6
  * letting the approval window elapse gives EXPIRED. AUTO routing starts at
10
7
  * QUEUED directly. QUEUED -> SENDING -> SENT on success, or back to QUEUED for a
11
8
  * transient retry, or FAILED when the failure is permanent or the attempts run
12
- * out. SENT -> ACKNOWLEDGED when the partner later reports progress.
9
+ * out.
10
+ *
11
+ * Once the partner has it, the remaining transitions come from THEM rather than
12
+ * from us: SENT -> ACKNOWLEDGED when they assign a responder, and either of
13
+ * those -> COMPLETED when they close it. WITHDRAWN is the one exception - an
14
+ * organization standing a partner down after the fact, which is only possible
15
+ * with a partner whose API supports it.
13
16
  */
14
17
  export var PartnerDispatchStatus;
15
18
  (function (PartnerDispatchStatus) {
@@ -21,29 +24,55 @@ export var PartnerDispatchStatus;
21
24
  PartnerDispatchStatus["SENDING"] = "SENDING";
22
25
  /** The partner accepted the request and returned its own reference. */
23
26
  PartnerDispatchStatus["SENT"] = "SENT";
24
- /** The partner has since confirmed progress on the request (status callback). */
27
+ /** The partner has assigned a responder, or otherwise confirmed it is working it. */
25
28
  PartnerDispatchStatus["ACKNOWLEDGED"] = "ACKNOWLEDGED";
29
+ /** The partner has closed the request. The engagement is over. */
30
+ PartnerDispatchStatus["COMPLETED"] = "COMPLETED";
26
31
  /** Permanently failed - rejected by the partner, or out of attempts. */
27
32
  PartnerDispatchStatus["FAILED"] = "FAILED";
28
33
  /** Declined by the organization instead of being sent. */
29
34
  PartnerDispatchStatus["REJECTED"] = "REJECTED";
30
- /** Withdrawn by the organization (before or after approval, never after SENT). */
35
+ /** Withdrawn by the organization BEFORE the partner ever received it. */
31
36
  PartnerDispatchStatus["CANCELLED"] = "CANCELLED";
37
+ /**
38
+ * Stood down by the organization AFTER the partner received it.
39
+ *
40
+ * Kept apart from CANCELLED because they are very different facts: one is an
41
+ * emergency a partner never heard about, the other is a responder who was
42
+ * dispatched and recalled. Only the second one costs a partner anything, and
43
+ * only the second one needs explaining in a monthly report.
44
+ */
45
+ PartnerDispatchStatus["WITHDRAWN"] = "WITHDRAWN";
32
46
  /** The manual-approval window elapsed with no decision. */
33
47
  PartnerDispatchStatus["EXPIRED"] = "EXPIRED";
34
48
  })(PartnerDispatchStatus || (PartnerDispatchStatus = {}));
35
- /** Statuses from which no further transition happens. */
49
+ /**
50
+ * Statuses from which no further transition happens.
51
+ *
52
+ * SENT and ACKNOWLEDGED are deliberately NOT terminal: with a partner that
53
+ * publishes request status, both still move - to COMPLETED when the partner
54
+ * closes the request, or to WITHDRAWN if the organization stands them down.
55
+ */
36
56
  export const TERMINAL_PARTNER_DISPATCH_STATUSES = [
37
- PartnerDispatchStatus.SENT,
38
- PartnerDispatchStatus.ACKNOWLEDGED,
57
+ PartnerDispatchStatus.COMPLETED,
39
58
  PartnerDispatchStatus.FAILED,
40
59
  PartnerDispatchStatus.REJECTED,
41
60
  PartnerDispatchStatus.CANCELLED,
61
+ PartnerDispatchStatus.WITHDRAWN,
42
62
  PartnerDispatchStatus.EXPIRED,
43
63
  ];
44
- /** Statuses that mean the partner is (or should shortly be) working the emergency. */
64
+ /** Statuses that mean the partner received the emergency and acted on it. */
45
65
  export const DELIVERED_PARTNER_DISPATCH_STATUSES = [
46
66
  PartnerDispatchStatus.SENT,
47
67
  PartnerDispatchStatus.ACKNOWLEDGED,
68
+ PartnerDispatchStatus.COMPLETED,
69
+ ];
70
+ /**
71
+ * Statuses where the partner holds the emergency and it is not finished, so
72
+ * asking them for progress is worthwhile.
73
+ */
74
+ export const POLLABLE_PARTNER_DISPATCH_STATUSES = [
75
+ PartnerDispatchStatus.SENT,
76
+ PartnerDispatchStatus.ACKNOWLEDGED,
48
77
  ];
49
78
  //# sourceMappingURL=partner-dispatch-status.enum.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"partner-dispatch-status.enum.js","sourceRoot":"","sources":["../../../../../src/modules/partner/enums/partner-dispatch-status.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,CAAN,IAAY,qBAmBX;AAnBD,WAAY,qBAAqB;IAC7B,0EAA0E;IAC1E,8DAAqC,CAAA;IACrC,mFAAmF;IACnF,0CAAiB,CAAA;IACjB,mCAAmC;IACnC,4CAAmB,CAAA;IACnB,uEAAuE;IACvE,sCAAa,CAAA;IACb,iFAAiF;IACjF,sDAA6B,CAAA;IAC7B,wEAAwE;IACxE,0CAAiB,CAAA;IACjB,0DAA0D;IAC1D,8CAAqB,CAAA;IACrB,kFAAkF;IAClF,gDAAuB,CAAA;IACvB,2DAA2D;IAC3D,4CAAmB,CAAA;AACvB,CAAC,EAnBW,qBAAqB,KAArB,qBAAqB,QAmBhC;AAED,yDAAyD;AACzD,MAAM,CAAC,MAAM,kCAAkC,GAAqC;IAChF,qBAAqB,CAAC,IAAI;IAC1B,qBAAqB,CAAC,YAAY;IAClC,qBAAqB,CAAC,MAAM;IAC5B,qBAAqB,CAAC,QAAQ;IAC9B,qBAAqB,CAAC,SAAS;IAC/B,qBAAqB,CAAC,OAAO;CAChC,CAAC;AAEF,sFAAsF;AACtF,MAAM,CAAC,MAAM,mCAAmC,GAAqC;IACjF,qBAAqB,CAAC,IAAI;IAC1B,qBAAqB,CAAC,YAAY;CACrC,CAAC"}
1
+ {"version":3,"file":"partner-dispatch-status.enum.js","sourceRoot":"","sources":["../../../../../src/modules/partner/enums/partner-dispatch-status.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAN,IAAY,qBA8BX;AA9BD,WAAY,qBAAqB;IAC7B,0EAA0E;IAC1E,8DAAqC,CAAA;IACrC,mFAAmF;IACnF,0CAAiB,CAAA;IACjB,mCAAmC;IACnC,4CAAmB,CAAA;IACnB,uEAAuE;IACvE,sCAAa,CAAA;IACb,qFAAqF;IACrF,sDAA6B,CAAA;IAC7B,kEAAkE;IAClE,gDAAuB,CAAA;IACvB,wEAAwE;IACxE,0CAAiB,CAAA;IACjB,0DAA0D;IAC1D,8CAAqB,CAAA;IACrB,yEAAyE;IACzE,gDAAuB,CAAA;IACvB;;;;;;;OAOG;IACH,gDAAuB,CAAA;IACvB,2DAA2D;IAC3D,4CAAmB,CAAA;AACvB,CAAC,EA9BW,qBAAqB,KAArB,qBAAqB,QA8BhC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAqC;IAChF,qBAAqB,CAAC,SAAS;IAC/B,qBAAqB,CAAC,MAAM;IAC5B,qBAAqB,CAAC,QAAQ;IAC9B,qBAAqB,CAAC,SAAS;IAC/B,qBAAqB,CAAC,SAAS;IAC/B,qBAAqB,CAAC,OAAO;CAChC,CAAC;AAEF,6EAA6E;AAC7E,MAAM,CAAC,MAAM,mCAAmC,GAAqC;IACjF,qBAAqB,CAAC,IAAI;IAC1B,qBAAqB,CAAC,YAAY;IAClC,qBAAqB,CAAC,SAAS;CAClC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAqC;IAChF,qBAAqB,CAAC,IAAI;IAC1B,qBAAqB,CAAC,YAAY;CACrC,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * What a partner says is happening with an emergency we handed them, reduced to
3
+ * the only three answers every partner can give.
4
+ *
5
+ * Provider-neutral on purpose. Partners describe progress in their own
6
+ * vocabulary - Rescue.co says CURRENT and CLOSED, another will say OPEN and
7
+ * RESOLVED, a third will have six intermediate states - and the platform must
8
+ * not learn any of them. The adapter maps its partner's word onto one of these,
9
+ * and keeps the original in `partnerStatus` so an operator still sees exactly
10
+ * what the partner said.
11
+ */
12
+ export var PartnerEngagementState;
13
+ (function (PartnerEngagementState) {
14
+ /** The partner is working the emergency. */
15
+ PartnerEngagementState["ACTIVE"] = "ACTIVE";
16
+ /** The partner has closed it. Nothing further will happen on their side. */
17
+ PartnerEngagementState["CLOSED"] = "CLOSED";
18
+ /** The partner reported something this adapter does not recognise. */
19
+ PartnerEngagementState["UNKNOWN"] = "UNKNOWN";
20
+ })(PartnerEngagementState || (PartnerEngagementState = {}));
21
+ //# sourceMappingURL=partner-engagement-state.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partner-engagement-state.enum.js","sourceRoot":"","sources":["../../../../../src/modules/partner/enums/partner-engagement-state.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,CAAN,IAAY,sBAOX;AAPD,WAAY,sBAAsB;IAC9B,4CAA4C;IAC5C,2CAAiB,CAAA;IACjB,4EAA4E;IAC5E,2CAAiB,CAAA;IACjB,sEAAsE;IACtE,6CAAmB,CAAA;AACvB,CAAC,EAPW,sBAAsB,KAAtB,sBAAsB,QAOjC"}
@@ -6,6 +6,7 @@ export * from './enums/partner-integration-environment.enum';
6
6
  export * from './enums/partner-integration-status.enum';
7
7
  export * from './enums/partner-coverage-match-type.enum';
8
8
  export * from './enums/partner-dispatch-status.enum';
9
+ export * from './enums/partner-engagement-state.enum';
9
10
  export * from './enums/partner-dispatch-failure-reason.enum';
10
11
  export * from './enums/partner-location-provider.enum';
11
12
  export * from './enums/partner-adapter-operation.enum';
@@ -16,6 +17,7 @@ export * from './interfaces/partner-provider-descriptor';
16
17
  export * from './interfaces/partner-integration';
17
18
  export * from './interfaces/partner-coverage-rule';
18
19
  export * from './interfaces/partner-dispatch-location';
20
+ export * from './interfaces/partner-dispatch-progress';
19
21
  export * from './interfaces/partner-emergency-contact';
20
22
  export * from './interfaces/partner-dispatch';
21
23
  export * from './interfaces/incident-partner-routing';
@@ -32,6 +34,7 @@ export * from './dtos/create-partner-coverage-rule.dto';
32
34
  export * from './dtos/update-partner-coverage-rule.dto';
33
35
  export * from './dtos/route-incident-to-partners.dto';
34
36
  export * from './dtos/partner-dispatch-decision.dto';
37
+ export * from './dtos/amend-partner-dispatch.dto';
35
38
  export * from './dtos/update-incident-partner-routing.dto';
36
39
  // Utilities
37
40
  export * from './utils/partner-routing.util';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/partner/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,oCAAoC,CAAC;AACnD,cAAc,yCAAyC,CAAC;AACxD,cAAc,mCAAmC,CAAC;AAClD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,yCAAyC,CAAC;AACxD,cAAc,0CAA0C,CAAC;AACzD,cAAc,sCAAsC,CAAC;AACrD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,wCAAwC,CAAC;AACvD,cAAc,wCAAwC,CAAC;AACvD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,qCAAqC,CAAC;AAEpD,aAAa;AACb,cAAc,0CAA0C,CAAC;AACzD,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,wCAAwC,CAAC;AACvD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uCAAuC,CAAC;AACtD,cAAc,qCAAqC,CAAC;AACpD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,sCAAsC,CAAC;AAErD,YAAY;AACZ,cAAc,oCAAoC,CAAC;AACnD,cAAc,iCAAiC,CAAC;AAEhD,OAAO;AACP,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,uCAAuC,CAAC;AACtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,4CAA4C,CAAC;AAE3D,YAAY;AACZ,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/partner/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,oCAAoC,CAAC;AACnD,cAAc,yCAAyC,CAAC;AACxD,cAAc,mCAAmC,CAAC;AAClD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,yCAAyC,CAAC;AACxD,cAAc,0CAA0C,CAAC;AACzD,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,wCAAwC,CAAC;AACvD,cAAc,wCAAwC,CAAC;AACvD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,qCAAqC,CAAC;AAEpD,aAAa;AACb,cAAc,0CAA0C,CAAC;AACzD,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,wCAAwC,CAAC;AACvD,cAAc,wCAAwC,CAAC;AACvD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uCAAuC,CAAC;AACtD,cAAc,qCAAqC,CAAC;AACpD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,sCAAsC,CAAC;AAErD,YAAY;AACZ,cAAc,oCAAoC,CAAC;AACnD,cAAc,iCAAiC,CAAC;AAEhD,OAAO;AACP,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,uCAAuC,CAAC;AACtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,mCAAmC,CAAC;AAClD,cAAc,4CAA4C,CAAC;AAE3D,YAAY;AACZ,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=partner-dispatch-progress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partner-dispatch-progress.js","sourceRoot":"","sources":["../../../../../src/modules/partner/interfaces/partner-dispatch-progress.ts"],"names":[],"mappings":""}
@@ -117,8 +117,18 @@ export function summarizeIncidentRoutingStatus(statuses) {
117
117
  return IncidentPartnerRoutingStatus.ROUTED;
118
118
  if (delivered > 0)
119
119
  return IncidentPartnerRoutingStatus.PARTIALLY_ROUTED;
120
+ /**
121
+ * WITHDRAWN counts as declined rather than delivered, even though the
122
+ * partner did receive it.
123
+ *
124
+ * The incident-level status answers one question - "is a partner coming?" -
125
+ * and for a stood-down dispatch the answer is no. The per-dispatch entries
126
+ * carry the fuller truth, which is where anyone asking "was one ever sent?"
127
+ * should look.
128
+ */
120
129
  const declined = statuses.filter((s) => s === PartnerDispatchStatus.REJECTED ||
121
130
  s === PartnerDispatchStatus.CANCELLED ||
131
+ s === PartnerDispatchStatus.WITHDRAWN ||
122
132
  s === PartnerDispatchStatus.EXPIRED).length;
123
133
  if (declined === statuses.length)
124
134
  return IncidentPartnerRoutingStatus.DECLINED;
@@ -1 +1 @@
1
- {"version":3,"file":"partner-routing.util.js","sourceRoot":"","sources":["../../../../../src/modules/partner/utils/partner-routing.util.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iCAAiC,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AACnH,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AAC7F,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,EACH,0CAA0C,GAE7C,MAAM,+CAA+C,CAAC;AACvD,OAAO,EACH,mCAAmC,EACnC,qBAAqB,GACxB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAkBxE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CAC/B,IAA6B,EAC7B,OAA+B;IAE/B,IAAI,IAAI,CAAC,OAAO,KAAK,KAAK;QA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AAC;IAC9E,IAAI,SAAS,GAAG,CAAC;QAAE,OAAO,4BAA4B,CAAC,gBAAgB,CAAC;IAExE;;;;;;;;OAQG;IACH,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAC5B,CAAC,CAAC,EAAE,EAAE,CACF,CAAC,KAAK,qBAAqB,CAAC,QAAQ;QACpC,CAAC,KAAK,qBAAqB,CAAC,SAAS;QACrC,CAAC,KAAK,qBAAqB,CAAC,SAAS;QACrC,CAAC,KAAK,qBAAqB,CAAC,OAAO,CAC1C,CAAC,MAAM,CAAC;IACT,IAAI,QAAQ,KAAK,QAAQ,CAAC,MAAM;QAAE,OAAO,4BAA4B,CAAC,QAAQ,CAAC;IAE/E,OAAO,4BAA4B,CAAC,MAAM,CAAC;AAC/C,CAAC"}
@@ -33,6 +33,30 @@ export declare const PARTNER_DISPATCH_DEFAULTS: {
33
33
  /** Longest a partner access token is cached, whatever lifetime the partner advertises. */
34
34
  readonly TOKEN_MAX_CACHE_SECONDS: number;
35
35
  };
36
+ /**
37
+ * How often a partner is asked what has happened to an emergency it already
38
+ * has, for the partners that publish that at all.
39
+ *
40
+ * The cadence starts tight and loosens. The first minutes after a dispatch are
41
+ * when a control room most needs to know whether anyone is coming; six hours
42
+ * later the answer has almost certainly stopped changing, and a partner should
43
+ * not be asked every minute forever on the off-chance.
44
+ */
45
+ export declare const PARTNER_POLL_DEFAULTS: {
46
+ /** Delay before the first progress check, and the base of the backoff. */
47
+ readonly INITIAL_SECONDS: 60;
48
+ /** Ceiling for the exponential backoff between checks. */
49
+ readonly MAX_SECONDS: 600;
50
+ /**
51
+ * How long to keep asking about a request the partner has never closed.
52
+ *
53
+ * Not a judgement that the emergency is over - only that the partner has
54
+ * stopped saying anything new, and an unanswered question repeated for a day
55
+ * is just load. The dispatch keeps its last known state and an operator can
56
+ * still ask the partner directly.
57
+ */
58
+ readonly GIVE_UP_HOURS: 12;
59
+ };
36
60
  /**
37
61
  * How an incident's reporting channel is described to a partner.
38
62
  *
@@ -0,0 +1,27 @@
1
+ /** A corrected location for an emergency a partner is already working. */
2
+ export declare class AmendPartnerDispatchLocationDto {
3
+ latitude: number;
4
+ longitude: number;
5
+ measuredAt?: string;
6
+ }
7
+ /**
8
+ * Correct the details of an emergency a partner already has.
9
+ *
10
+ * The case this exists for is the ordinary one: a caller rings back with a
11
+ * better address while a responder is already moving. Sending the correction
12
+ * beats hoping the crew works it out.
13
+ *
14
+ * Only the fields a partner will actually accept mid-flight are here - who the
15
+ * emergency is FOR never changes, so the reporter and their phone number are
16
+ * deliberately absent. Every field is optional; sending none is a no-op rather
17
+ * than an error.
18
+ *
19
+ * Only meaningful for a partner whose descriptor sets `supportsAmendment`. For
20
+ * anyone else clarion-partner-services refuses plainly rather than pretending.
21
+ */
22
+ export declare class AmendPartnerDispatchDto {
23
+ address?: string;
24
+ issue?: string;
25
+ location?: AmendPartnerDispatchLocationDto;
26
+ reason?: string;
27
+ }
@@ -1,8 +1,21 @@
1
1
  import { IncidentPartnerRoutingStatus } from '../enums/incident-partner-routing-status.enum';
2
+ import { PartnerEngagementState } from '../enums/partner-engagement-state.enum';
2
3
  import { PartnerDispatchStatus } from '../enums/partner-dispatch-status.enum';
3
4
  import { PartnerProviderCode } from '../enums/partner-provider-code.enum';
4
5
  import { PartnerRoutingMode } from '../enums/partner-routing-mode.enum';
5
6
  import { PartnerServiceCapability } from '../enums/partner-service-capability.enum';
7
+ /** Whoever the partner has put on the job, as carried on the incident. */
8
+ export declare class IncidentPartnerResponderDto {
9
+ name?: string;
10
+ phoneNumber?: string;
11
+ reference?: string;
12
+ }
13
+ /** The unit the partner has assigned, as carried on the incident. */
14
+ export declare class IncidentPartnerVehicleDto {
15
+ identifier?: string;
16
+ description?: string;
17
+ serviceType?: string;
18
+ }
6
19
  /** One partner's leg of an incident's routing, as pushed back to clarion-incident. */
7
20
  export declare class IncidentPartnerRoutingEntryDto {
8
21
  integrationId: number;
@@ -14,6 +27,9 @@ export declare class IncidentPartnerRoutingEntryDto {
14
27
  dispatchReference: string;
15
28
  status: PartnerDispatchStatus;
16
29
  partnerReference?: string;
30
+ engagementState?: PartnerEngagementState;
31
+ responder?: IncidentPartnerResponderDto;
32
+ vehicle?: IncidentPartnerVehicleDto;
17
33
  updatedAt: string;
18
34
  }
19
35
  /**
@@ -9,5 +9,18 @@ export declare enum PartnerAdapterOperation {
9
9
  /** A non-mutating connectivity probe. */
10
10
  HEALTH_CHECK = "HEALTH_CHECK",
11
11
  /** Submitting the emergency itself. */
12
- DISPATCH = "DISPATCH"
12
+ DISPATCH = "DISPATCH",
13
+ /** Asking the partner what has happened since. */
14
+ FETCH_STATUS = "FETCH_STATUS",
15
+ /** Standing the partner down after they had already accepted it. */
16
+ WITHDRAW = "WITHDRAW",
17
+ /** Correcting details of an emergency the partner is already working. */
18
+ AMEND = "AMEND",
19
+ /**
20
+ * Asking the partner whether a request we may have already sent exists.
21
+ *
22
+ * Used after a timeout, where the request might have landed but the reply
23
+ * never arrived - the one case where re-sending could produce a duplicate.
24
+ */
25
+ LOOKUP = "LOOKUP"
13
26
  }
@@ -1,15 +1,18 @@
1
1
  /**
2
2
  * Lifecycle of one incident's routing to one partner.
3
3
  *
4
- * Terminal states are SENT/ACKNOWLEDGED (the partner has the emergency),
5
- * FAILED, REJECTED, CANCELLED and EXPIRED. Everything else is in flight.
6
- *
7
4
  * MANUAL routing starts at PENDING_APPROVAL and reaches QUEUED only when an
8
5
  * operator approves; declining gives REJECTED, withdrawing gives CANCELLED and
9
6
  * letting the approval window elapse gives EXPIRED. AUTO routing starts at
10
7
  * QUEUED directly. QUEUED -> SENDING -> SENT on success, or back to QUEUED for a
11
8
  * transient retry, or FAILED when the failure is permanent or the attempts run
12
- * out. SENT -> ACKNOWLEDGED when the partner later reports progress.
9
+ * out.
10
+ *
11
+ * Once the partner has it, the remaining transitions come from THEM rather than
12
+ * from us: SENT -> ACKNOWLEDGED when they assign a responder, and either of
13
+ * those -> COMPLETED when they close it. WITHDRAWN is the one exception - an
14
+ * organization standing a partner down after the fact, which is only possible
15
+ * with a partner whose API supports it.
13
16
  */
14
17
  export declare enum PartnerDispatchStatus {
15
18
  /** MANUAL routing: waiting for the organization to confirm or decline. */
@@ -20,18 +23,40 @@ export declare enum PartnerDispatchStatus {
20
23
  SENDING = "SENDING",
21
24
  /** The partner accepted the request and returned its own reference. */
22
25
  SENT = "SENT",
23
- /** The partner has since confirmed progress on the request (status callback). */
26
+ /** The partner has assigned a responder, or otherwise confirmed it is working it. */
24
27
  ACKNOWLEDGED = "ACKNOWLEDGED",
28
+ /** The partner has closed the request. The engagement is over. */
29
+ COMPLETED = "COMPLETED",
25
30
  /** Permanently failed - rejected by the partner, or out of attempts. */
26
31
  FAILED = "FAILED",
27
32
  /** Declined by the organization instead of being sent. */
28
33
  REJECTED = "REJECTED",
29
- /** Withdrawn by the organization (before or after approval, never after SENT). */
34
+ /** Withdrawn by the organization BEFORE the partner ever received it. */
30
35
  CANCELLED = "CANCELLED",
36
+ /**
37
+ * Stood down by the organization AFTER the partner received it.
38
+ *
39
+ * Kept apart from CANCELLED because they are very different facts: one is an
40
+ * emergency a partner never heard about, the other is a responder who was
41
+ * dispatched and recalled. Only the second one costs a partner anything, and
42
+ * only the second one needs explaining in a monthly report.
43
+ */
44
+ WITHDRAWN = "WITHDRAWN",
31
45
  /** The manual-approval window elapsed with no decision. */
32
46
  EXPIRED = "EXPIRED"
33
47
  }
34
- /** Statuses from which no further transition happens. */
48
+ /**
49
+ * Statuses from which no further transition happens.
50
+ *
51
+ * SENT and ACKNOWLEDGED are deliberately NOT terminal: with a partner that
52
+ * publishes request status, both still move - to COMPLETED when the partner
53
+ * closes the request, or to WITHDRAWN if the organization stands them down.
54
+ */
35
55
  export declare const TERMINAL_PARTNER_DISPATCH_STATUSES: readonly PartnerDispatchStatus[];
36
- /** Statuses that mean the partner is (or should shortly be) working the emergency. */
56
+ /** Statuses that mean the partner received the emergency and acted on it. */
37
57
  export declare const DELIVERED_PARTNER_DISPATCH_STATUSES: readonly PartnerDispatchStatus[];
58
+ /**
59
+ * Statuses where the partner holds the emergency and it is not finished, so
60
+ * asking them for progress is worthwhile.
61
+ */
62
+ export declare const POLLABLE_PARTNER_DISPATCH_STATUSES: readonly PartnerDispatchStatus[];
@@ -0,0 +1,19 @@
1
+ /**
2
+ * What a partner says is happening with an emergency we handed them, reduced to
3
+ * the only three answers every partner can give.
4
+ *
5
+ * Provider-neutral on purpose. Partners describe progress in their own
6
+ * vocabulary - Rescue.co says CURRENT and CLOSED, another will say OPEN and
7
+ * RESOLVED, a third will have six intermediate states - and the platform must
8
+ * not learn any of them. The adapter maps its partner's word onto one of these,
9
+ * and keeps the original in `partnerStatus` so an operator still sees exactly
10
+ * what the partner said.
11
+ */
12
+ export declare enum PartnerEngagementState {
13
+ /** The partner is working the emergency. */
14
+ ACTIVE = "ACTIVE",
15
+ /** The partner has closed it. Nothing further will happen on their side. */
16
+ CLOSED = "CLOSED",
17
+ /** The partner reported something this adapter does not recognise. */
18
+ UNKNOWN = "UNKNOWN"
19
+ }
@@ -5,6 +5,7 @@ export * from './enums/partner-integration-environment.enum';
5
5
  export * from './enums/partner-integration-status.enum';
6
6
  export * from './enums/partner-coverage-match-type.enum';
7
7
  export * from './enums/partner-dispatch-status.enum';
8
+ export * from './enums/partner-engagement-state.enum';
8
9
  export * from './enums/partner-dispatch-failure-reason.enum';
9
10
  export * from './enums/partner-location-provider.enum';
10
11
  export * from './enums/partner-adapter-operation.enum';
@@ -14,6 +15,7 @@ export * from './interfaces/partner-provider-descriptor';
14
15
  export * from './interfaces/partner-integration';
15
16
  export * from './interfaces/partner-coverage-rule';
16
17
  export * from './interfaces/partner-dispatch-location';
18
+ export * from './interfaces/partner-dispatch-progress';
17
19
  export * from './interfaces/partner-emergency-contact';
18
20
  export * from './interfaces/partner-dispatch';
19
21
  export * from './interfaces/incident-partner-routing';
@@ -28,6 +30,7 @@ export * from './dtos/create-partner-coverage-rule.dto';
28
30
  export * from './dtos/update-partner-coverage-rule.dto';
29
31
  export * from './dtos/route-incident-to-partners.dto';
30
32
  export * from './dtos/partner-dispatch-decision.dto';
33
+ export * from './dtos/amend-partner-dispatch.dto';
31
34
  export * from './dtos/update-incident-partner-routing.dto';
32
35
  export * from './utils/partner-routing.util';
33
36
  export * from './utils/partner-payload.util';
@@ -1,8 +1,10 @@
1
1
  import { IncidentPartnerRoutingStatus } from '../enums/incident-partner-routing-status.enum';
2
+ import { PartnerEngagementState } from '../enums/partner-engagement-state.enum';
2
3
  import { PartnerDispatchStatus } from '../enums/partner-dispatch-status.enum';
3
4
  import { PartnerProviderCode } from '../enums/partner-provider-code.enum';
4
5
  import { PartnerRoutingMode } from '../enums/partner-routing-mode.enum';
5
6
  import { PartnerServiceCapability } from '../enums/partner-service-capability.enum';
7
+ import { PartnerResponderInfo, PartnerResponderVehicle } from './partner-dispatch-progress';
6
8
  /** One partner's leg of an incident's routing, as recorded on the incident. */
7
9
  export interface IncidentPartnerRoutingEntry {
8
10
  integrationId: number;
@@ -16,6 +18,17 @@ export interface IncidentPartnerRoutingEntry {
16
18
  status: PartnerDispatchStatus;
17
19
  /** The partner's own reference once it has accepted the request. */
18
20
  partnerReference?: string | null;
21
+ /**
22
+ * What the partner last reported, carried on the incident itself.
23
+ *
24
+ * Denormalized deliberately: "an ambulance is on its way, registration
25
+ * KAA 123B, crew reachable on +254..." is the single most useful sentence
26
+ * on an incident screen, and it should not cost a second request to another
27
+ * service to render it.
28
+ */
29
+ engagementState?: PartnerEngagementState | null;
30
+ responder?: PartnerResponderInfo | null;
31
+ vehicle?: PartnerResponderVehicle | null;
19
32
  updatedAt: string;
20
33
  }
21
34
  /**