clarion-shared-types 1.0.116 → 1.0.118
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/dispatch/enums/response-unit-dispatch-enums.js +4 -0
- package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-enums.js.map +1 -1
- package/dist/cjs/modules/dispatch/utils/response-unit-dispatch-display.util.js +4 -0
- package/dist/cjs/modules/dispatch/utils/response-unit-dispatch-display.util.js.map +1 -1
- package/dist/cjs/modules/incident/enums/incident-actions.enum.js +4 -0
- package/dist/cjs/modules/incident/enums/incident-actions.enum.js.map +1 -1
- package/dist/cjs/modules/incident-sla/enums/incident-sla-enums.js +241 -0
- package/dist/cjs/modules/incident-sla/enums/incident-sla-enums.js.map +1 -0
- package/dist/cjs/modules/incident-sla/index.js +23 -0
- package/dist/cjs/modules/incident-sla/index.js.map +1 -0
- package/dist/cjs/modules/incident-sla/interfaces/incident-sla.dto.js +32 -0
- package/dist/cjs/modules/incident-sla/interfaces/incident-sla.dto.js.map +1 -0
- package/dist/cjs/modules/incident-sla/utils/incident-sla-display.util.js +337 -0
- package/dist/cjs/modules/incident-sla/utils/incident-sla-display.util.js.map +1 -0
- package/dist/cjs/modules/permission/enums/permission-actions.enum.js +8 -0
- package/dist/cjs/modules/permission/enums/permission-actions.enum.js.map +1 -1
- package/dist/cjs/modules/permission/enums/permissions-moudule.enum.js +1 -0
- package/dist/cjs/modules/permission/enums/permissions-moudule.enum.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/modules/dispatch/enums/response-unit-dispatch-enums.js +4 -0
- package/dist/esm/modules/dispatch/enums/response-unit-dispatch-enums.js.map +1 -1
- package/dist/esm/modules/dispatch/utils/response-unit-dispatch-display.util.js +4 -0
- package/dist/esm/modules/dispatch/utils/response-unit-dispatch-display.util.js.map +1 -1
- package/dist/esm/modules/incident/enums/incident-actions.enum.js +4 -0
- package/dist/esm/modules/incident/enums/incident-actions.enum.js.map +1 -1
- package/dist/esm/modules/incident-sla/enums/incident-sla-enums.js +238 -0
- package/dist/esm/modules/incident-sla/enums/incident-sla-enums.js.map +1 -0
- package/dist/esm/modules/incident-sla/index.js +7 -0
- package/dist/esm/modules/incident-sla/index.js.map +1 -0
- package/dist/esm/modules/incident-sla/interfaces/incident-sla.dto.js +29 -0
- package/dist/esm/modules/incident-sla/interfaces/incident-sla.dto.js.map +1 -0
- package/dist/esm/modules/incident-sla/utils/incident-sla-display.util.js +326 -0
- package/dist/esm/modules/incident-sla/utils/incident-sla-display.util.js.map +1 -0
- package/dist/esm/modules/permission/enums/permission-actions.enum.js +8 -0
- package/dist/esm/modules/permission/enums/permission-actions.enum.js.map +1 -1
- package/dist/esm/modules/permission/enums/permissions-moudule.enum.js +1 -0
- package/dist/esm/modules/permission/enums/permissions-moudule.enum.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/modules/dispatch/enums/response-unit-dispatch-enums.d.ts +6 -2
- package/dist/types/modules/dispatch/interfaces/response-unit-dispatch.dto.d.ts +4 -0
- package/dist/types/modules/incident/enums/incident-actions.enum.d.ts +4 -0
- package/dist/types/modules/incident-sla/enums/incident-sla-enums.d.ts +210 -0
- package/dist/types/modules/incident-sla/index.d.ts +3 -0
- package/dist/types/modules/incident-sla/interfaces/incident-sla.dto.d.ts +656 -0
- package/dist/types/modules/incident-sla/utils/incident-sla-display.util.d.ts +55 -0
- package/dist/types/modules/permission/enums/permission-actions.enum.d.ts +6 -0
- package/dist/types/modules/permission/enums/permissions-moudule.enum.d.ts +2 -1
- package/package.json +45 -45
|
@@ -0,0 +1,656 @@
|
|
|
1
|
+
import { IncidentEmergencyType } from '../../incident/enums/incident-emergency-type.enum';
|
|
2
|
+
import { IncidentPriority } from '../../incident/enums/incident-priority.enum';
|
|
3
|
+
import { EmergencyIncidentStage, EtaBasis, EtaStatus, IncidentActorType, IncidentArrivalSource, IncidentClosureReason, IncidentSlaEventSource, IncidentSlaEventType, IncidentSlaStage, IncidentSlaStatus, SlaEscalationLevel, SlaEscalationTrigger, SlaExceptionReason, SlaExceptionStatus, SlaOverallState, SlaPauseReason, SlaPauseStatus, SlaPolicyScope, SlaPriorityLevel } from '../enums/incident-sla-enums';
|
|
4
|
+
export interface IncidentSlaExceptionDto {
|
|
5
|
+
status: SlaExceptionStatus;
|
|
6
|
+
reason: SlaExceptionReason | null;
|
|
7
|
+
note: string | null;
|
|
8
|
+
requestedBy: number | null;
|
|
9
|
+
requestedAt: string | null;
|
|
10
|
+
decidedBy: number | null;
|
|
11
|
+
decidedAt: string | null;
|
|
12
|
+
decisionNote: string | null;
|
|
13
|
+
}
|
|
14
|
+
export interface IncidentSlaInstanceDto {
|
|
15
|
+
id: number;
|
|
16
|
+
stage: IncidentSlaStage;
|
|
17
|
+
cycle: number;
|
|
18
|
+
responseUnitDispatchId: number | null;
|
|
19
|
+
responseUnitId: number | null;
|
|
20
|
+
responseUnitName: string | null;
|
|
21
|
+
priority: IncidentPriority;
|
|
22
|
+
status: IncidentSlaStatus;
|
|
23
|
+
targetSeconds: number | null;
|
|
24
|
+
startedAt: string | null;
|
|
25
|
+
deadlineAt: string | null;
|
|
26
|
+
originalDeadlineAt: string | null;
|
|
27
|
+
warningAt: string | null;
|
|
28
|
+
atRiskAt: string | null;
|
|
29
|
+
warnedAt: string | null;
|
|
30
|
+
atRiskSince: string | null;
|
|
31
|
+
breachedAt: string | null;
|
|
32
|
+
completedAt: string | null;
|
|
33
|
+
endedAt: string | null;
|
|
34
|
+
endReason: string | null;
|
|
35
|
+
pausedAt: string | null;
|
|
36
|
+
totalPausedSeconds: number;
|
|
37
|
+
elapsedSeconds: number | null;
|
|
38
|
+
remainingSeconds: number | null;
|
|
39
|
+
overdueSeconds: number | null;
|
|
40
|
+
exception: IncidentSlaExceptionDto | null;
|
|
41
|
+
waivedBy: number | null;
|
|
42
|
+
waivedAt: string | null;
|
|
43
|
+
waiveReason: string | null;
|
|
44
|
+
slaPolicyId: number | null;
|
|
45
|
+
slaPolicyVersion: number | null;
|
|
46
|
+
}
|
|
47
|
+
export type IncidentSlaTimelineState = 'DONE' | 'CURRENT' | 'PENDING' | 'SKIPPED';
|
|
48
|
+
export interface IncidentSlaTimelineItemDto {
|
|
49
|
+
milestone: EmergencyIncidentStage;
|
|
50
|
+
state: IncidentSlaTimelineState;
|
|
51
|
+
at: string | null;
|
|
52
|
+
implied: boolean;
|
|
53
|
+
actorType: IncidentActorType | null;
|
|
54
|
+
source: IncidentSlaEventSource | null;
|
|
55
|
+
stage: IncidentSlaStage | null;
|
|
56
|
+
slaStatus: IncidentSlaStatus | null;
|
|
57
|
+
targetAt: string | null;
|
|
58
|
+
etaAt: string | null;
|
|
59
|
+
arrivalSource: IncidentArrivalSource | null;
|
|
60
|
+
}
|
|
61
|
+
export interface IncidentSlaStatsDto {
|
|
62
|
+
total: number;
|
|
63
|
+
decided: number;
|
|
64
|
+
met: number;
|
|
65
|
+
breached: number;
|
|
66
|
+
breachedWithApprovedException: number;
|
|
67
|
+
open: number;
|
|
68
|
+
warnings: number;
|
|
69
|
+
atRisk: number;
|
|
70
|
+
compliancePercent: number | null;
|
|
71
|
+
complianceWithExceptionsPercent: number | null;
|
|
72
|
+
}
|
|
73
|
+
export interface IncidentEtaDto {
|
|
74
|
+
dispatchId: number;
|
|
75
|
+
responseUnitId: number;
|
|
76
|
+
responseUnitName: string | null;
|
|
77
|
+
status: EtaStatus;
|
|
78
|
+
etaSeconds: number | null;
|
|
79
|
+
predictedArrivalAt: string | null;
|
|
80
|
+
distanceMetres: number | null;
|
|
81
|
+
basis: EtaBasis | null;
|
|
82
|
+
computedAt: string | null;
|
|
83
|
+
lastLocationAt: string | null;
|
|
84
|
+
locationAgeSeconds: number | null;
|
|
85
|
+
arrivalDeadlineAt: string | null;
|
|
86
|
+
}
|
|
87
|
+
export interface IncidentSlaPauseDto {
|
|
88
|
+
id: number;
|
|
89
|
+
instanceId: number;
|
|
90
|
+
stage: IncidentSlaStage;
|
|
91
|
+
reason: SlaPauseReason;
|
|
92
|
+
note: string | null;
|
|
93
|
+
status: SlaPauseStatus;
|
|
94
|
+
requestedBy: number | null;
|
|
95
|
+
requestedAt: string;
|
|
96
|
+
decidedBy: number | null;
|
|
97
|
+
decidedAt: string | null;
|
|
98
|
+
decisionNote: string | null;
|
|
99
|
+
startedAt: string | null;
|
|
100
|
+
endedAt: string | null;
|
|
101
|
+
pausedSeconds: number;
|
|
102
|
+
}
|
|
103
|
+
export interface IncidentSlaAlternativeDto {
|
|
104
|
+
responseUnitId: number;
|
|
105
|
+
responseUnitName: string | null;
|
|
106
|
+
distanceMetres: number | null;
|
|
107
|
+
etaSeconds: number | null;
|
|
108
|
+
trigger: SlaEscalationTrigger;
|
|
109
|
+
forDispatchId: number | null;
|
|
110
|
+
recommendedAt: string;
|
|
111
|
+
}
|
|
112
|
+
export interface IncidentSlaAllowedActionsDto {
|
|
113
|
+
acknowledge: boolean;
|
|
114
|
+
triage: boolean;
|
|
115
|
+
recordAssessment: boolean;
|
|
116
|
+
requestPause: boolean;
|
|
117
|
+
approvePause: boolean;
|
|
118
|
+
endPause: boolean;
|
|
119
|
+
requestException: boolean;
|
|
120
|
+
approveException: boolean;
|
|
121
|
+
waive: boolean;
|
|
122
|
+
}
|
|
123
|
+
export interface IncidentSlaClosureDto {
|
|
124
|
+
resolvedAt: string | null;
|
|
125
|
+
closedAt: string | null;
|
|
126
|
+
closureReason: IncidentClosureReason | null;
|
|
127
|
+
closedBy: number | null;
|
|
128
|
+
autoCloseEnabled: boolean;
|
|
129
|
+
autoCloseAt: string | null;
|
|
130
|
+
}
|
|
131
|
+
export interface IncidentSlaContributingPolicyDto {
|
|
132
|
+
policyId: number;
|
|
133
|
+
policyKey: string;
|
|
134
|
+
version: number;
|
|
135
|
+
name: string;
|
|
136
|
+
scope: SlaPolicyScope;
|
|
137
|
+
}
|
|
138
|
+
export interface IncidentSlaPolicyReferenceDto {
|
|
139
|
+
id: number | null;
|
|
140
|
+
key: string | null;
|
|
141
|
+
version: number | null;
|
|
142
|
+
name: string;
|
|
143
|
+
scope: SlaPolicyScope;
|
|
144
|
+
contributingPolicies: IncidentSlaContributingPolicyDto[];
|
|
145
|
+
}
|
|
146
|
+
/** `GET /api/incidents/:id/sla`. */
|
|
147
|
+
export interface IncidentSlaSummaryDto {
|
|
148
|
+
incidentId: number;
|
|
149
|
+
tracked: boolean;
|
|
150
|
+
notTrackedReason: string | null;
|
|
151
|
+
serverTime: string;
|
|
152
|
+
priority: IncidentPriority | null;
|
|
153
|
+
priorityLevel: SlaPriorityLevel | null;
|
|
154
|
+
policy: IncidentSlaPolicyReferenceDto | null;
|
|
155
|
+
overall: SlaOverallState;
|
|
156
|
+
currentStage: EmergencyIncidentStage | null;
|
|
157
|
+
currentInstance: IncidentSlaInstanceDto | null;
|
|
158
|
+
instances: IncidentSlaInstanceDto[];
|
|
159
|
+
timeline: IncidentSlaTimelineItemDto[];
|
|
160
|
+
stats: IncidentSlaStatsDto;
|
|
161
|
+
etas: IncidentEtaDto[];
|
|
162
|
+
primaryEta: IncidentEtaDto | null;
|
|
163
|
+
pauses: IncidentSlaPauseDto[];
|
|
164
|
+
alternative: IncidentSlaAlternativeDto | null;
|
|
165
|
+
closure: IncidentSlaClosureDto;
|
|
166
|
+
allowedActions: IncidentSlaAllowedActionsDto;
|
|
167
|
+
workflowId: string | null;
|
|
168
|
+
}
|
|
169
|
+
/** One row of `GET /api/incidents/:id/sla/events`. */
|
|
170
|
+
export interface IncidentSlaEventDto {
|
|
171
|
+
id: number;
|
|
172
|
+
eventType: IncidentSlaEventType;
|
|
173
|
+
stage: IncidentSlaStage | null;
|
|
174
|
+
cycle: number | null;
|
|
175
|
+
instanceId: number | null;
|
|
176
|
+
milestone: EmergencyIncidentStage | null;
|
|
177
|
+
fromStatus: IncidentSlaStatus | null;
|
|
178
|
+
toStatus: IncidentSlaStatus | null;
|
|
179
|
+
actorUserId: number | null;
|
|
180
|
+
actorType: IncidentActorType;
|
|
181
|
+
source: IncidentSlaEventSource;
|
|
182
|
+
reason: string | null;
|
|
183
|
+
note: string | null;
|
|
184
|
+
metadata: Record<string, unknown> | null;
|
|
185
|
+
correlationId: string | null;
|
|
186
|
+
workflowId: string | null;
|
|
187
|
+
occurredAt: string;
|
|
188
|
+
recordedAt: string;
|
|
189
|
+
}
|
|
190
|
+
export interface IncidentSlaEventPageDto {
|
|
191
|
+
data: IncidentSlaEventDto[];
|
|
192
|
+
total: number;
|
|
193
|
+
page: number;
|
|
194
|
+
limit: number;
|
|
195
|
+
}
|
|
196
|
+
/** Bodies of the SLA write routes. */
|
|
197
|
+
export interface TriageEmergencyIncidentRequest {
|
|
198
|
+
priority?: IncidentPriority;
|
|
199
|
+
note?: string;
|
|
200
|
+
}
|
|
201
|
+
export interface RequestSlaPauseRequest {
|
|
202
|
+
reason: SlaPauseReason;
|
|
203
|
+
note?: string;
|
|
204
|
+
instanceIds?: number[];
|
|
205
|
+
}
|
|
206
|
+
export interface RequestSlaExceptionRequest {
|
|
207
|
+
reason: SlaExceptionReason;
|
|
208
|
+
note: string;
|
|
209
|
+
}
|
|
210
|
+
/** A stored SLA policy version (`GET /api/incident-sla/policies`). */
|
|
211
|
+
export interface IncidentSlaPolicyDto {
|
|
212
|
+
id: number;
|
|
213
|
+
policyKey: string;
|
|
214
|
+
version: number;
|
|
215
|
+
name: string;
|
|
216
|
+
description: string | null;
|
|
217
|
+
scope: SlaPolicyScope;
|
|
218
|
+
organizationId: number | null;
|
|
219
|
+
controlCentreId: number | null;
|
|
220
|
+
categoryId: number | null;
|
|
221
|
+
typeId: number | null;
|
|
222
|
+
priority: IncidentPriority | null;
|
|
223
|
+
zoneId: number | null;
|
|
224
|
+
incidentClass: string;
|
|
225
|
+
effectiveFrom: string;
|
|
226
|
+
effectiveTo: string | null;
|
|
227
|
+
active: boolean;
|
|
228
|
+
settings: Record<string, number | boolean>;
|
|
229
|
+
priorityFloors: Partial<Record<IncidentEmergencyType, IncidentPriority>> | null;
|
|
230
|
+
startAnchors: Partial<Record<IncidentSlaStage, EmergencyIncidentStage>> | null;
|
|
231
|
+
targets: {
|
|
232
|
+
stage: IncidentSlaStage;
|
|
233
|
+
priority: IncidentPriority;
|
|
234
|
+
targetSeconds: number | null;
|
|
235
|
+
}[];
|
|
236
|
+
escalationRules: {
|
|
237
|
+
key: string;
|
|
238
|
+
trigger: SlaEscalationTrigger;
|
|
239
|
+
stages: IncidentSlaStage[];
|
|
240
|
+
priorities: IncidentPriority[];
|
|
241
|
+
level: SlaEscalationLevel;
|
|
242
|
+
channels: string[];
|
|
243
|
+
actions: string[];
|
|
244
|
+
delaySeconds: number;
|
|
245
|
+
recipientRoles: string[];
|
|
246
|
+
contacts: {
|
|
247
|
+
name?: string | null;
|
|
248
|
+
phoneNumber?: string | null;
|
|
249
|
+
email?: string | null;
|
|
250
|
+
}[];
|
|
251
|
+
}[] | null;
|
|
252
|
+
usageCount?: number;
|
|
253
|
+
createdBy: number | null;
|
|
254
|
+
updatedBy: number | null;
|
|
255
|
+
createdAt: string;
|
|
256
|
+
updatedAt: string;
|
|
257
|
+
}
|
|
258
|
+
export type IncidentSlaAnalyticsBucket = 'hour' | 'day' | 'week' | 'month';
|
|
259
|
+
export interface IncidentSlaAnalyticsRangeDto {
|
|
260
|
+
from: string;
|
|
261
|
+
to: string;
|
|
262
|
+
bucket: IncidentSlaAnalyticsBucket;
|
|
263
|
+
timeZone: string;
|
|
264
|
+
}
|
|
265
|
+
export interface IncidentSlaAnalyticsCountDto {
|
|
266
|
+
key: string;
|
|
267
|
+
count: number;
|
|
268
|
+
}
|
|
269
|
+
export interface IncidentSlaDurationSummaryDto {
|
|
270
|
+
median: number | null;
|
|
271
|
+
p90: number | null;
|
|
272
|
+
count: number;
|
|
273
|
+
}
|
|
274
|
+
export interface IncidentSlaDurationPercentilesDto {
|
|
275
|
+
p50: number | null;
|
|
276
|
+
p75: number | null;
|
|
277
|
+
p90: number | null;
|
|
278
|
+
p95: number | null;
|
|
279
|
+
p99: number | null;
|
|
280
|
+
average: number | null;
|
|
281
|
+
count: number;
|
|
282
|
+
}
|
|
283
|
+
export interface IncidentSlaAnalyticsSummaryDto {
|
|
284
|
+
emergencies: number;
|
|
285
|
+
openNow: number;
|
|
286
|
+
breachedEmergencies: number;
|
|
287
|
+
breachedEmergencyPercent: number | null;
|
|
288
|
+
decided: number;
|
|
289
|
+
met: number;
|
|
290
|
+
breached: number;
|
|
291
|
+
breachedWithApprovedException: number;
|
|
292
|
+
compliancePercent: number | null;
|
|
293
|
+
complianceWithExceptionsPercent: number | null;
|
|
294
|
+
acknowledged: number;
|
|
295
|
+
dispatched: number;
|
|
296
|
+
arrived: number;
|
|
297
|
+
resolved: number;
|
|
298
|
+
closed: number;
|
|
299
|
+
autoClosed: number;
|
|
300
|
+
timeToAcknowledge: IncidentSlaDurationSummaryDto;
|
|
301
|
+
timeToDispatch: IncidentSlaDurationSummaryDto;
|
|
302
|
+
timeToArrival: IncidentSlaDurationSummaryDto;
|
|
303
|
+
travelTime: IncidentSlaDurationSummaryDto;
|
|
304
|
+
timeToResolve: IncidentSlaDurationSummaryDto;
|
|
305
|
+
escalations: number;
|
|
306
|
+
alternativesRecommended: number;
|
|
307
|
+
reassignments: number;
|
|
308
|
+
notificationsFailed: number;
|
|
309
|
+
}
|
|
310
|
+
export interface IncidentSlaStageAnalyticsDto {
|
|
311
|
+
stage: IncidentSlaStage;
|
|
312
|
+
instances: number;
|
|
313
|
+
met: number;
|
|
314
|
+
breached: number;
|
|
315
|
+
breachedWithApprovedException: number;
|
|
316
|
+
open: number;
|
|
317
|
+
waived: number;
|
|
318
|
+
expired: number;
|
|
319
|
+
cancelled: number;
|
|
320
|
+
warned: number;
|
|
321
|
+
atRisk: number;
|
|
322
|
+
compliancePercent: number | null;
|
|
323
|
+
complianceWithExceptionsPercent: number | null;
|
|
324
|
+
targetSeconds: number | null;
|
|
325
|
+
duration: IncidentSlaDurationPercentilesDto;
|
|
326
|
+
overrun: IncidentSlaDurationSummaryDto;
|
|
327
|
+
}
|
|
328
|
+
export interface IncidentSlaStageCellDto {
|
|
329
|
+
stage: IncidentSlaStage;
|
|
330
|
+
met: number;
|
|
331
|
+
breached: number;
|
|
332
|
+
compliancePercent: number | null;
|
|
333
|
+
medianSeconds: number | null;
|
|
334
|
+
}
|
|
335
|
+
export interface IncidentSlaPriorityRowDto {
|
|
336
|
+
priority: IncidentPriority;
|
|
337
|
+
level: SlaPriorityLevel;
|
|
338
|
+
emergencies: number;
|
|
339
|
+
breachedEmergencies: number;
|
|
340
|
+
met: number;
|
|
341
|
+
breached: number;
|
|
342
|
+
compliancePercent: number | null;
|
|
343
|
+
medianSecondsToAcknowledge: number | null;
|
|
344
|
+
medianSecondsToArrival: number | null;
|
|
345
|
+
stages: IncidentSlaStageCellDto[];
|
|
346
|
+
}
|
|
347
|
+
export interface IncidentSlaTimelinePointDto {
|
|
348
|
+
bucket: string;
|
|
349
|
+
emergencies: number;
|
|
350
|
+
breachedEmergencies: number;
|
|
351
|
+
met: number;
|
|
352
|
+
breached: number;
|
|
353
|
+
compliancePercent: number | null;
|
|
354
|
+
medianSecondsToAcknowledge: number | null;
|
|
355
|
+
medianSecondsToArrival: number | null;
|
|
356
|
+
escalations: number;
|
|
357
|
+
}
|
|
358
|
+
export interface IncidentSlaControlCentreRowDto {
|
|
359
|
+
controlCentreId: number | null;
|
|
360
|
+
emergencies: number;
|
|
361
|
+
breachedEmergencies: number;
|
|
362
|
+
met: number;
|
|
363
|
+
breached: number;
|
|
364
|
+
compliancePercent: number | null;
|
|
365
|
+
medianSecondsToAcknowledge: number | null;
|
|
366
|
+
medianSecondsToDispatch: number | null;
|
|
367
|
+
medianSecondsToArrival: number | null;
|
|
368
|
+
escalations: number;
|
|
369
|
+
}
|
|
370
|
+
export interface IncidentSlaTypeRowDto {
|
|
371
|
+
typeId: number | null;
|
|
372
|
+
typeName: string | null;
|
|
373
|
+
categoryId: number | null;
|
|
374
|
+
categoryName: string | null;
|
|
375
|
+
emergencies: number;
|
|
376
|
+
breachedEmergencies: number;
|
|
377
|
+
met: number;
|
|
378
|
+
breached: number;
|
|
379
|
+
compliancePercent: number | null;
|
|
380
|
+
medianSecondsToArrival: number | null;
|
|
381
|
+
}
|
|
382
|
+
export interface IncidentSlaResponseUnitRowDto {
|
|
383
|
+
responseUnitId: number;
|
|
384
|
+
responseUnitName: string;
|
|
385
|
+
dispatches: number;
|
|
386
|
+
accepted: number;
|
|
387
|
+
declined: number;
|
|
388
|
+
stoodDown: number;
|
|
389
|
+
arrived: number;
|
|
390
|
+
arrivalsInferred: number;
|
|
391
|
+
acceptanceMet: number;
|
|
392
|
+
acceptanceBreached: number;
|
|
393
|
+
acceptanceCompliancePercent: number | null;
|
|
394
|
+
medianSecondsToAccept: number | null;
|
|
395
|
+
medianSecondsToMobilize: number | null;
|
|
396
|
+
medianSecondsToArrive: number | null;
|
|
397
|
+
}
|
|
398
|
+
export interface IncidentSlaArrivalAnalyticsDto {
|
|
399
|
+
arrivals: number;
|
|
400
|
+
bySource: IncidentSlaAnalyticsCountDto[];
|
|
401
|
+
inferredPercent: number | null;
|
|
402
|
+
etaAtRisk: number;
|
|
403
|
+
etaLikelyLate: number;
|
|
404
|
+
etaUncertain: number;
|
|
405
|
+
predictedLate: number;
|
|
406
|
+
predictedLateAndBreached: number;
|
|
407
|
+
latePredictionPrecisionPercent: number | null;
|
|
408
|
+
firstEtaError: IncidentSlaDurationSummaryDto;
|
|
409
|
+
distanceAtDispatch: IncidentSlaDurationSummaryDto;
|
|
410
|
+
}
|
|
411
|
+
export interface IncidentSlaEscalationAnalyticsDto {
|
|
412
|
+
total: number;
|
|
413
|
+
byTrigger: IncidentSlaAnalyticsCountDto[];
|
|
414
|
+
byLevel: IncidentSlaAnalyticsCountDto[];
|
|
415
|
+
byStage: IncidentSlaAnalyticsCountDto[];
|
|
416
|
+
byRule: IncidentSlaAnalyticsCountDto[];
|
|
417
|
+
alternativesRecommended: number;
|
|
418
|
+
reassignments: number;
|
|
419
|
+
escalatedEmergencies: number;
|
|
420
|
+
}
|
|
421
|
+
export interface IncidentSlaPauseAnalyticsDto {
|
|
422
|
+
requested: number;
|
|
423
|
+
approved: number;
|
|
424
|
+
rejected: number;
|
|
425
|
+
pending: number;
|
|
426
|
+
withdrawn: number;
|
|
427
|
+
totalPausedSeconds: number;
|
|
428
|
+
pausedTime: IncidentSlaDurationSummaryDto;
|
|
429
|
+
byReason: IncidentSlaAnalyticsCountDto[];
|
|
430
|
+
}
|
|
431
|
+
export interface IncidentSlaExceptionAnalyticsDto {
|
|
432
|
+
requested: number;
|
|
433
|
+
approved: number;
|
|
434
|
+
rejected: number;
|
|
435
|
+
pending: number;
|
|
436
|
+
byReason: IncidentSlaAnalyticsCountDto[];
|
|
437
|
+
}
|
|
438
|
+
export interface IncidentSlaNotificationEventRowDto {
|
|
439
|
+
event: string;
|
|
440
|
+
requests: number;
|
|
441
|
+
failed: number;
|
|
442
|
+
}
|
|
443
|
+
export interface IncidentSlaNotificationChannelRowDto {
|
|
444
|
+
channel: string;
|
|
445
|
+
recipients: number;
|
|
446
|
+
sent: number;
|
|
447
|
+
failed: number;
|
|
448
|
+
successPercent: number | null;
|
|
449
|
+
}
|
|
450
|
+
export interface IncidentSlaNotificationAnalyticsDto {
|
|
451
|
+
requests: number;
|
|
452
|
+
byStatus: IncidentSlaAnalyticsCountDto[];
|
|
453
|
+
byEvent: IncidentSlaNotificationEventRowDto[];
|
|
454
|
+
byChannel: IncidentSlaNotificationChannelRowDto[];
|
|
455
|
+
byAudience: IncidentSlaAnalyticsCountDto[];
|
|
456
|
+
}
|
|
457
|
+
export interface IncidentSlaClosureAnalyticsDto {
|
|
458
|
+
resolved: number;
|
|
459
|
+
closed: number;
|
|
460
|
+
manual: number;
|
|
461
|
+
automatic: number;
|
|
462
|
+
awaitingClosure: number;
|
|
463
|
+
autoCloseDeferred: number;
|
|
464
|
+
resolvedToClosed: IncidentSlaDurationSummaryDto;
|
|
465
|
+
}
|
|
466
|
+
export interface IncidentSlaHeatmapCellDto {
|
|
467
|
+
weekday: number;
|
|
468
|
+
hour: number;
|
|
469
|
+
emergencies: number;
|
|
470
|
+
breachedEmergencies: number;
|
|
471
|
+
}
|
|
472
|
+
export interface IncidentSlaWorstIncidentDto {
|
|
473
|
+
incidentId: number;
|
|
474
|
+
reference: string;
|
|
475
|
+
priority: IncidentPriority;
|
|
476
|
+
typeName: string | null;
|
|
477
|
+
controlCentreId: number | null;
|
|
478
|
+
createdAt: string;
|
|
479
|
+
breachedStages: number;
|
|
480
|
+
worstStage: IncidentSlaStage | null;
|
|
481
|
+
maxOverrunSeconds: number;
|
|
482
|
+
totalOverrunSeconds: number;
|
|
483
|
+
timeToArrivalSeconds: number | null;
|
|
484
|
+
}
|
|
485
|
+
export interface IncidentSlaOrganizationRowDto {
|
|
486
|
+
organizationId: number;
|
|
487
|
+
emergencies: number;
|
|
488
|
+
breachedEmergencies: number;
|
|
489
|
+
met: number;
|
|
490
|
+
breached: number;
|
|
491
|
+
compliancePercent: number | null;
|
|
492
|
+
medianSecondsToAcknowledge: number | null;
|
|
493
|
+
medianSecondsToArrival: number | null;
|
|
494
|
+
}
|
|
495
|
+
/** `GET /api/incident-sla/analytics`. */
|
|
496
|
+
export interface IncidentSlaAnalyticsDto {
|
|
497
|
+
range: IncidentSlaAnalyticsRangeDto;
|
|
498
|
+
organizationId: number | null;
|
|
499
|
+
controlCentreId: number | null;
|
|
500
|
+
platform: boolean;
|
|
501
|
+
summary: IncidentSlaAnalyticsSummaryDto;
|
|
502
|
+
previous: IncidentSlaAnalyticsSummaryDto | null;
|
|
503
|
+
stages: IncidentSlaStageAnalyticsDto[];
|
|
504
|
+
byPriority: IncidentSlaPriorityRowDto[];
|
|
505
|
+
timeline: IncidentSlaTimelinePointDto[];
|
|
506
|
+
byControlCentre: IncidentSlaControlCentreRowDto[];
|
|
507
|
+
byType: IncidentSlaTypeRowDto[];
|
|
508
|
+
byResponseUnit: IncidentSlaResponseUnitRowDto[];
|
|
509
|
+
arrival: IncidentSlaArrivalAnalyticsDto;
|
|
510
|
+
escalations: IncidentSlaEscalationAnalyticsDto;
|
|
511
|
+
pauses: IncidentSlaPauseAnalyticsDto;
|
|
512
|
+
exceptions: IncidentSlaExceptionAnalyticsDto;
|
|
513
|
+
notifications: IncidentSlaNotificationAnalyticsDto;
|
|
514
|
+
closure: IncidentSlaClosureAnalyticsDto;
|
|
515
|
+
emergencyTypes: IncidentSlaAnalyticsCountDto[];
|
|
516
|
+
heatmap: IncidentSlaHeatmapCellDto[];
|
|
517
|
+
worstIncidents: IncidentSlaWorstIncidentDto[];
|
|
518
|
+
byOrganization: IncidentSlaOrganizationRowDto[];
|
|
519
|
+
generatedAt: string;
|
|
520
|
+
}
|
|
521
|
+
/** The query of `GET /api/incident-sla/analytics`. */
|
|
522
|
+
export interface IncidentSlaAnalyticsQuery {
|
|
523
|
+
from?: string;
|
|
524
|
+
to?: string;
|
|
525
|
+
timeZone?: string;
|
|
526
|
+
organizationId?: number;
|
|
527
|
+
controlCentreId?: number;
|
|
528
|
+
priority?: IncidentPriority;
|
|
529
|
+
stage?: IncidentSlaStage;
|
|
530
|
+
typeId?: number;
|
|
531
|
+
categoryId?: number;
|
|
532
|
+
responseUnitId?: number;
|
|
533
|
+
}
|
|
534
|
+
/** Policy settings beside the targets. On a stored policy every field is optional (absent = inherit). */
|
|
535
|
+
export interface IncidentSlaPolicySettingsDto {
|
|
536
|
+
warningThresholdPercent: number;
|
|
537
|
+
atRiskThresholdPercent: number;
|
|
538
|
+
arrivalRadiusMetres: number;
|
|
539
|
+
arrivalExitRadiusMetres: number;
|
|
540
|
+
arrivalDwellSeconds: number;
|
|
541
|
+
arrivalMinObservations: number;
|
|
542
|
+
maxLocationAccuracyMetres: number;
|
|
543
|
+
trackingStaleSeconds: number;
|
|
544
|
+
etaAtRiskMarginPercent: number;
|
|
545
|
+
etaAssumedSpeedKph: number;
|
|
546
|
+
etaRoadFactor: number;
|
|
547
|
+
autoCloseEnabled: boolean;
|
|
548
|
+
autoCloseAfterSeconds: number;
|
|
549
|
+
allowAutomaticReassignment: boolean;
|
|
550
|
+
pauseRequiresApproval: boolean;
|
|
551
|
+
notifyReporter: boolean;
|
|
552
|
+
}
|
|
553
|
+
export interface IncidentSlaEscalationContactRequest {
|
|
554
|
+
name?: string;
|
|
555
|
+
phoneNumber?: string;
|
|
556
|
+
email?: string;
|
|
557
|
+
}
|
|
558
|
+
export interface IncidentSlaEscalationRuleRequest {
|
|
559
|
+
key: string;
|
|
560
|
+
trigger: SlaEscalationTrigger;
|
|
561
|
+
stages: IncidentSlaStage[];
|
|
562
|
+
priorities: IncidentPriority[];
|
|
563
|
+
level: SlaEscalationLevel;
|
|
564
|
+
channels: string[];
|
|
565
|
+
actions: string[];
|
|
566
|
+
delaySeconds: number;
|
|
567
|
+
recipientRoles: string[];
|
|
568
|
+
contacts: IncidentSlaEscalationContactRequest[];
|
|
569
|
+
}
|
|
570
|
+
/** The body of a new policy version (and, with a scope, of a new policy). */
|
|
571
|
+
export interface IncidentSlaPolicyContentRequest {
|
|
572
|
+
name: string;
|
|
573
|
+
description?: string;
|
|
574
|
+
effectiveFrom?: string;
|
|
575
|
+
effectiveTo?: string;
|
|
576
|
+
settings?: Partial<IncidentSlaPolicySettingsDto>;
|
|
577
|
+
targets?: {
|
|
578
|
+
stage: IncidentSlaStage;
|
|
579
|
+
priority: IncidentPriority;
|
|
580
|
+
targetSeconds: number | null;
|
|
581
|
+
}[];
|
|
582
|
+
priorityFloors?: {
|
|
583
|
+
emergencyType: IncidentEmergencyType;
|
|
584
|
+
priority: IncidentPriority;
|
|
585
|
+
}[];
|
|
586
|
+
/** Absent: inherit the less specific policy's rules. [] : no escalation at all. */
|
|
587
|
+
escalationRules?: IncidentSlaEscalationRuleRequest[];
|
|
588
|
+
}
|
|
589
|
+
export interface CreateIncidentSlaPolicyRequest extends IncidentSlaPolicyContentRequest {
|
|
590
|
+
organizationId?: number;
|
|
591
|
+
controlCentreId?: number;
|
|
592
|
+
categoryId?: number;
|
|
593
|
+
typeId?: number;
|
|
594
|
+
priority?: IncidentPriority;
|
|
595
|
+
zoneId?: number;
|
|
596
|
+
}
|
|
597
|
+
/** The policy an incident like the one described would run under (`GET /api/incident-sla/policies/effective`). */
|
|
598
|
+
export interface ResolvedIncidentSlaPolicyDto {
|
|
599
|
+
schemaVersion: 1;
|
|
600
|
+
policyId: number | null;
|
|
601
|
+
policyKey: string | null;
|
|
602
|
+
policyVersion: number | null;
|
|
603
|
+
policyName: string;
|
|
604
|
+
scope: SlaPolicyScope;
|
|
605
|
+
contributingPolicies: IncidentSlaContributingPolicyDto[];
|
|
606
|
+
effectiveAt: string;
|
|
607
|
+
resolvedAt: string;
|
|
608
|
+
targets: Record<IncidentPriority, Record<IncidentSlaStage, number | null>>;
|
|
609
|
+
startAnchors: Record<IncidentSlaStage, EmergencyIncidentStage>;
|
|
610
|
+
settings: IncidentSlaPolicySettingsDto;
|
|
611
|
+
priorityFloors: Partial<Record<IncidentEmergencyType, IncidentPriority>>;
|
|
612
|
+
escalationRules: IncidentSlaEscalationRuleRequest[];
|
|
613
|
+
}
|
|
614
|
+
export interface EffectiveIncidentSlaPolicyQuery {
|
|
615
|
+
organizationId: number;
|
|
616
|
+
controlCentreId?: number;
|
|
617
|
+
categoryId?: number;
|
|
618
|
+
typeId?: number;
|
|
619
|
+
priority?: IncidentPriority;
|
|
620
|
+
emergencyType?: IncidentEmergencyType;
|
|
621
|
+
zoneId?: number;
|
|
622
|
+
at?: string;
|
|
623
|
+
}
|
|
624
|
+
export interface IncidentSlaPolicyListQuery {
|
|
625
|
+
organizationId?: number;
|
|
626
|
+
activeOnly?: boolean;
|
|
627
|
+
includePlatform?: boolean;
|
|
628
|
+
}
|
|
629
|
+
/** The bounds the API enforces on a policy (grm-shared-library INCIDENT_SLA_LIMITS), for the admin's form. */
|
|
630
|
+
export declare const INCIDENT_SLA_POLICY_LIMITS: {
|
|
631
|
+
readonly minTargetSeconds: 5;
|
|
632
|
+
readonly maxTargetSeconds: number;
|
|
633
|
+
readonly minThresholdPercent: 10;
|
|
634
|
+
readonly maxThresholdPercent: 99;
|
|
635
|
+
readonly minRadiusMetres: 10;
|
|
636
|
+
readonly maxRadiusMetres: 5000;
|
|
637
|
+
readonly maxDwellSeconds: number;
|
|
638
|
+
readonly maxObservations: 20;
|
|
639
|
+
readonly minAccuracyMetres: 5;
|
|
640
|
+
readonly maxAccuracyMetres: 5000;
|
|
641
|
+
readonly minStaleSeconds: 15;
|
|
642
|
+
readonly maxStaleSeconds: number;
|
|
643
|
+
readonly maxEtaMarginPercent: 90;
|
|
644
|
+
readonly minSpeedKph: 5;
|
|
645
|
+
readonly maxSpeedKph: 150;
|
|
646
|
+
readonly minRoadFactor: 1;
|
|
647
|
+
readonly maxRoadFactor: 3;
|
|
648
|
+
readonly minAutoCloseSeconds: number;
|
|
649
|
+
readonly maxAutoCloseSeconds: number;
|
|
650
|
+
readonly maxEscalationDelaySeconds: number;
|
|
651
|
+
readonly maxEscalationRules: 50;
|
|
652
|
+
readonly maxEscalationContacts: 10;
|
|
653
|
+
readonly policyNameMaxLength: 120;
|
|
654
|
+
readonly policyDescriptionMaxLength: 1000;
|
|
655
|
+
readonly ruleKeyMaxLength: 60;
|
|
656
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { EmergencyIncidentStage, EtaStatus, IncidentActorType, IncidentArrivalSource, IncidentSlaEventType, IncidentSlaStage, IncidentSlaStatus, SlaExceptionReason, SlaExceptionStatus, SlaOverallState, SlaEscalationAction, SlaEscalationLevel, SlaEscalationTrigger, SlaNotificationChannel, SlaPauseReason, SlaPolicyScope, SlaPriorityLevel } from '../enums/incident-sla-enums';
|
|
2
|
+
import { IncidentSlaInstanceDto } from '../interfaces/incident-sla.dto';
|
|
3
|
+
/** A Clarion colour family: bg-light-{tone} text-{tone}. */
|
|
4
|
+
export type SlaTone = 'success' | 'info' | 'warning' | 'error' | 'grey' | 'primary' | 'accent';
|
|
5
|
+
export declare const INCIDENT_SLA_STAGE_LABELS: Readonly<Record<IncidentSlaStage, string>>;
|
|
6
|
+
export declare const INCIDENT_SLA_STATUS_LABELS: Readonly<Record<IncidentSlaStatus, string>>;
|
|
7
|
+
export declare const SLA_OVERALL_STATE_LABELS: Readonly<Record<SlaOverallState, string>>;
|
|
8
|
+
export declare const EMERGENCY_INCIDENT_STAGE_LABELS: Readonly<Record<EmergencyIncidentStage, string>>;
|
|
9
|
+
export declare const SLA_PAUSE_REASON_LABELS: Readonly<Record<SlaPauseReason, string>>;
|
|
10
|
+
export declare const SLA_EXCEPTION_REASON_LABELS: Readonly<Record<SlaExceptionReason, string>>;
|
|
11
|
+
export declare const SLA_EXCEPTION_STATUS_LABELS: Readonly<Record<SlaExceptionStatus, string>>;
|
|
12
|
+
export declare const ETA_STATUS_LABELS: Readonly<Record<EtaStatus, string>>;
|
|
13
|
+
export declare const INCIDENT_ARRIVAL_SOURCE_LABELS: Readonly<Record<IncidentArrivalSource, string>>;
|
|
14
|
+
export declare const INCIDENT_ACTOR_TYPE_LABELS: Readonly<Record<IncidentActorType, string>>;
|
|
15
|
+
export declare const INCIDENT_SLA_EVENT_TYPE_LABELS: Readonly<Record<IncidentSlaEventType, string>>;
|
|
16
|
+
/** The colour of an instance's status chip. */
|
|
17
|
+
export declare function incidentSlaStatusTone(status: IncidentSlaStatus | string | null | undefined, exceptionStatus?: SlaExceptionStatus | string | null): SlaTone;
|
|
18
|
+
export declare function slaOverallStateTone(state: SlaOverallState | string | null | undefined): SlaTone;
|
|
19
|
+
export declare function etaStatusTone(status: EtaStatus | string | null | undefined): SlaTone;
|
|
20
|
+
/** "01:12", "12:05", "1:05:00", and overdue as "+00:45". */
|
|
21
|
+
export declare function formatSlaClock(seconds: number | null | undefined): string;
|
|
22
|
+
/** "15 sec", "2 min", "1 h 30 min", "1 d 2 h". */
|
|
23
|
+
export declare function formatSlaTarget(seconds: number | null | undefined): string;
|
|
24
|
+
/**
|
|
25
|
+
* Seconds left on an instance at the browser's `nowMs`, corrected for the
|
|
26
|
+
* difference between the server's clock and the browser's (`skewMs` = server -
|
|
27
|
+
* browser, measured when the summary arrived). Null when its clock is not
|
|
28
|
+
* running. Display only - the server decides every transition.
|
|
29
|
+
*/
|
|
30
|
+
export declare function liveRemainingSeconds(instance: Pick<IncidentSlaInstanceDto, 'status' | 'deadlineAt'>, nowMs: number, skewMs?: number): number | null;
|
|
31
|
+
/**
|
|
32
|
+
* The status an open instance shows at `nowMs`: what the server said, or the
|
|
33
|
+
* next threshold if the clock has passed it since (the server's own event
|
|
34
|
+
* follows within seconds). Never goes backwards.
|
|
35
|
+
*/
|
|
36
|
+
export declare function liveIncidentSlaStatus(instance: Pick<IncidentSlaInstanceDto, 'status' | 'warningAt' | 'atRiskAt' | 'deadlineAt' | 'completedAt'>, nowMs: number, skewMs?: number): IncidentSlaStatus;
|
|
37
|
+
/** Statuses whose clock is running (or paused). */
|
|
38
|
+
export declare function isOpenIncidentSlaStatus(status: IncidentSlaStatus | string | null | undefined): boolean;
|
|
39
|
+
/** Stages in the order an emergency goes through them. */
|
|
40
|
+
export declare const INCIDENT_SLA_STAGE_ORDER: readonly IncidentSlaStage[];
|
|
41
|
+
export declare const SLA_ESCALATION_TRIGGER_LABELS: Readonly<Record<SlaEscalationTrigger, string>>;
|
|
42
|
+
export declare const SLA_ESCALATION_LEVEL_LABELS: Readonly<Record<SlaEscalationLevel, string>>;
|
|
43
|
+
export declare const SLA_NOTIFICATION_CHANNEL_LABELS: Readonly<Record<SlaNotificationChannel, string>>;
|
|
44
|
+
export declare const SLA_ESCALATION_ACTION_LABELS: Readonly<Record<SlaEscalationAction, string>>;
|
|
45
|
+
export declare const SLA_POLICY_SCOPE_LABELS: Readonly<Record<SlaPolicyScope, string>>;
|
|
46
|
+
/** The emergency notifications, as clarion-incident asks for them. */
|
|
47
|
+
export declare const EMERGENCY_NOTIFICATION_EVENT_LABELS: Readonly<Record<string, string>>;
|
|
48
|
+
/** The SLA level of each priority (P1 = Critical ... P4 = Low). */
|
|
49
|
+
export declare const INCIDENT_PRIORITY_SLA_LEVEL: Readonly<Record<string, SlaPriorityLevel>>;
|
|
50
|
+
/** What each policy setting means, for the policy editor. */
|
|
51
|
+
export declare const INCIDENT_SLA_SETTING_LABELS: Readonly<Record<string, {
|
|
52
|
+
label: string;
|
|
53
|
+
unit: string;
|
|
54
|
+
help: string;
|
|
55
|
+
}>>;
|