grm-shared-library 1.1.237 → 1.1.239
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/README.md +369 -369
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/kafka/topics.js +11 -0
- package/dist/cjs/kafka/topics.js.map +1 -1
- package/dist/cjs/modules/dispatch/constants/response-unit-dispatch-defaults.const.js +1 -0
- package/dist/cjs/modules/dispatch/constants/response-unit-dispatch-defaults.const.js.map +1 -1
- package/dist/cjs/modules/dispatch/dtos/response-unit-dispatch-notification.dto.js +5 -0
- package/dist/cjs/modules/dispatch/dtos/response-unit-dispatch-notification.dto.js.map +1 -1
- package/dist/cjs/modules/dispatch/dtos/update-response-unit-dispatch-status.dto.js +1 -0
- package/dist/cjs/modules/dispatch/dtos/update-response-unit-dispatch-status.dto.js.map +1 -1
- package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-status.enum.js +6 -0
- package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-status.enum.js.map +1 -1
- package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-transition-source.enum.js +3 -1
- package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-transition-source.enum.js.map +1 -1
- package/dist/cjs/modules/dispatch/utils/response-unit-dispatch-status.util.js +6 -2
- package/dist/cjs/modules/dispatch/utils/response-unit-dispatch-status.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/constants/emergency-incident-workflow.const.js +53 -0
- package/dist/cjs/modules/incident-sla/constants/emergency-incident-workflow.const.js.map +1 -0
- package/dist/cjs/modules/incident-sla/constants/incident-sla-defaults.const.js +258 -0
- package/dist/cjs/modules/incident-sla/constants/incident-sla-defaults.const.js.map +1 -0
- package/dist/cjs/modules/incident-sla/constants/incident-sla-kafka.const.js +27 -0
- package/dist/cjs/modules/incident-sla/constants/incident-sla-kafka.const.js.map +1 -0
- package/dist/cjs/modules/incident-sla/dtos/emergency-notification.dto.js +419 -0
- package/dist/cjs/modules/incident-sla/dtos/emergency-notification.dto.js.map +1 -0
- package/dist/cjs/modules/incident-sla/dtos/emergency-operations.dto.js +155 -0
- package/dist/cjs/modules/incident-sla/dtos/emergency-operations.dto.js.map +1 -0
- package/dist/cjs/modules/incident-sla/dtos/emergency-workflow.dto.js +216 -0
- package/dist/cjs/modules/incident-sla/dtos/emergency-workflow.dto.js.map +1 -0
- package/dist/cjs/modules/incident-sla/dtos/incident-sla-analytics-query.dto.js +95 -0
- package/dist/cjs/modules/incident-sla/dtos/incident-sla-analytics-query.dto.js.map +1 -0
- package/dist/cjs/modules/incident-sla/dtos/incident-sla-policy.dto.js +509 -0
- package/dist/cjs/modules/incident-sla/dtos/incident-sla-policy.dto.js.map +1 -0
- package/dist/cjs/modules/incident-sla/enums/emergency-incident-stage.enum.js +32 -0
- package/dist/cjs/modules/incident-sla/enums/emergency-incident-stage.enum.js.map +1 -0
- package/dist/cjs/modules/incident-sla/enums/emergency-notification.enum.js +44 -0
- package/dist/cjs/modules/incident-sla/enums/emergency-notification.enum.js.map +1 -0
- package/dist/cjs/modules/incident-sla/enums/eta-status.enum.js +32 -0
- package/dist/cjs/modules/incident-sla/enums/eta-status.enum.js.map +1 -0
- package/dist/cjs/modules/incident-sla/enums/incident-closure.enum.js +23 -0
- package/dist/cjs/modules/incident-sla/enums/incident-closure.enum.js.map +1 -0
- package/dist/cjs/modules/incident-sla/enums/incident-sla-actor.enum.js +46 -0
- package/dist/cjs/modules/incident-sla/enums/incident-sla-actor.enum.js.map +1 -0
- package/dist/cjs/modules/incident-sla/enums/incident-sla-error-code.enum.js +26 -0
- package/dist/cjs/modules/incident-sla/enums/incident-sla-error-code.enum.js.map +1 -0
- package/dist/cjs/modules/incident-sla/enums/incident-sla-event-type.enum.js +45 -0
- package/dist/cjs/modules/incident-sla/enums/incident-sla-event-type.enum.js.map +1 -0
- package/dist/cjs/modules/incident-sla/enums/incident-sla-stage.enum.js +26 -0
- package/dist/cjs/modules/incident-sla/enums/incident-sla-stage.enum.js.map +1 -0
- package/dist/cjs/modules/incident-sla/enums/incident-sla-status.enum.js +38 -0
- package/dist/cjs/modules/incident-sla/enums/incident-sla-status.enum.js.map +1 -0
- package/dist/cjs/modules/incident-sla/enums/sla-escalation.enum.js +50 -0
- package/dist/cjs/modules/incident-sla/enums/sla-escalation.enum.js.map +1 -0
- package/dist/cjs/modules/incident-sla/enums/sla-exception.enum.js +27 -0
- package/dist/cjs/modules/incident-sla/enums/sla-exception.enum.js.map +1 -0
- package/dist/cjs/modules/incident-sla/enums/sla-overall-state.enum.js +28 -0
- package/dist/cjs/modules/incident-sla/enums/sla-overall-state.enum.js.map +1 -0
- package/dist/cjs/modules/incident-sla/enums/sla-pause.enum.js +28 -0
- package/dist/cjs/modules/incident-sla/enums/sla-pause.enum.js.map +1 -0
- package/dist/cjs/modules/incident-sla/enums/sla-policy-scope.enum.js +19 -0
- package/dist/cjs/modules/incident-sla/enums/sla-policy-scope.enum.js.map +1 -0
- package/dist/cjs/modules/incident-sla/index.js +53 -0
- package/dist/cjs/modules/incident-sla/index.js.map +1 -0
- package/dist/cjs/modules/incident-sla/interfaces/emergency-workflow.js +3 -0
- package/dist/cjs/modules/incident-sla/interfaces/emergency-workflow.js.map +1 -0
- package/dist/cjs/modules/incident-sla/interfaces/incident-sla-analytics.js +3 -0
- package/dist/cjs/modules/incident-sla/interfaces/incident-sla-analytics.js.map +1 -0
- package/dist/cjs/modules/incident-sla/interfaces/incident-sla-events.js +3 -0
- package/dist/cjs/modules/incident-sla/interfaces/incident-sla-events.js.map +1 -0
- package/dist/cjs/modules/incident-sla/interfaces/incident-sla-policy.js +3 -0
- package/dist/cjs/modules/incident-sla/interfaces/incident-sla-policy.js.map +1 -0
- package/dist/cjs/modules/incident-sla/interfaces/incident-sla-views.js +3 -0
- package/dist/cjs/modules/incident-sla/interfaces/incident-sla-views.js.map +1 -0
- package/dist/cjs/modules/incident-sla/utils/incident-sla-eta.util.js +40 -0
- package/dist/cjs/modules/incident-sla/utils/incident-sla-eta.util.js.map +1 -0
- package/dist/cjs/modules/incident-sla/utils/incident-sla-event-id.util.js +18 -0
- package/dist/cjs/modules/incident-sla/utils/incident-sla-event-id.util.js.map +1 -0
- package/dist/cjs/modules/incident-sla/utils/incident-sla-priority.util.js +31 -0
- package/dist/cjs/modules/incident-sla/utils/incident-sla-priority.util.js.map +1 -0
- package/dist/cjs/modules/incident-sla/utils/incident-sla-time.util.js +129 -0
- package/dist/cjs/modules/incident-sla/utils/incident-sla-time.util.js.map +1 -0
- package/dist/cjs/modules/permission/data/permissions.data.js +11 -0
- package/dist/cjs/modules/permission/data/permissions.data.js.map +1 -1
- package/dist/cjs/modules/permission/enums/permission-actions.enum.js +21 -0
- package/dist/cjs/modules/permission/enums/permission-actions.enum.js.map +1 -1
- package/dist/cjs/modules/permission/enums/permissions-module.enum.js +1 -0
- package/dist/cjs/modules/permission/enums/permissions-module.enum.js.map +1 -1
- package/dist/cjs/modules/role/data/roles.data.js +37 -0
- package/dist/cjs/modules/role/data/roles.data.js.map +1 -1
- package/dist/cjs/modules/sms/constants/sms-templates.config.js +27 -1
- package/dist/cjs/modules/sms/constants/sms-templates.config.js.map +1 -1
- package/dist/cjs/modules/sms/enums/sms-template.enum.js +2 -0
- package/dist/cjs/modules/sms/enums/sms-template.enum.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/kafka/topics.js +11 -0
- package/dist/esm/kafka/topics.js.map +1 -1
- package/dist/esm/modules/dispatch/constants/response-unit-dispatch-defaults.const.js +1 -0
- package/dist/esm/modules/dispatch/constants/response-unit-dispatch-defaults.const.js.map +1 -1
- package/dist/esm/modules/dispatch/dtos/response-unit-dispatch-notification.dto.js +5 -0
- package/dist/esm/modules/dispatch/dtos/response-unit-dispatch-notification.dto.js.map +1 -1
- package/dist/esm/modules/dispatch/dtos/update-response-unit-dispatch-status.dto.js +1 -0
- package/dist/esm/modules/dispatch/dtos/update-response-unit-dispatch-status.dto.js.map +1 -1
- package/dist/esm/modules/dispatch/enums/response-unit-dispatch-status.enum.js +6 -0
- package/dist/esm/modules/dispatch/enums/response-unit-dispatch-status.enum.js.map +1 -1
- package/dist/esm/modules/dispatch/enums/response-unit-dispatch-transition-source.enum.js +3 -1
- package/dist/esm/modules/dispatch/enums/response-unit-dispatch-transition-source.enum.js.map +1 -1
- package/dist/esm/modules/dispatch/utils/response-unit-dispatch-status.util.js +6 -2
- package/dist/esm/modules/dispatch/utils/response-unit-dispatch-status.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/constants/emergency-incident-workflow.const.js +49 -0
- package/dist/esm/modules/incident-sla/constants/emergency-incident-workflow.const.js.map +1 -0
- package/dist/esm/modules/incident-sla/constants/incident-sla-defaults.const.js +255 -0
- package/dist/esm/modules/incident-sla/constants/incident-sla-defaults.const.js.map +1 -0
- package/dist/esm/modules/incident-sla/constants/incident-sla-kafka.const.js +24 -0
- package/dist/esm/modules/incident-sla/constants/incident-sla-kafka.const.js.map +1 -0
- package/dist/esm/modules/incident-sla/dtos/emergency-notification.dto.js +405 -0
- package/dist/esm/modules/incident-sla/dtos/emergency-notification.dto.js.map +1 -0
- package/dist/esm/modules/incident-sla/dtos/emergency-operations.dto.js +144 -0
- package/dist/esm/modules/incident-sla/dtos/emergency-operations.dto.js.map +1 -0
- package/dist/esm/modules/incident-sla/dtos/emergency-workflow.dto.js +206 -0
- package/dist/esm/modules/incident-sla/dtos/emergency-workflow.dto.js.map +1 -0
- package/dist/esm/modules/incident-sla/dtos/incident-sla-analytics-query.dto.js +91 -0
- package/dist/esm/modules/incident-sla/dtos/incident-sla-analytics-query.dto.js.map +1 -0
- package/dist/esm/modules/incident-sla/dtos/incident-sla-policy.dto.js +495 -0
- package/dist/esm/modules/incident-sla/dtos/incident-sla-policy.dto.js.map +1 -0
- package/dist/esm/modules/incident-sla/enums/emergency-incident-stage.enum.js +29 -0
- package/dist/esm/modules/incident-sla/enums/emergency-incident-stage.enum.js.map +1 -0
- package/dist/esm/modules/incident-sla/enums/emergency-notification.enum.js +41 -0
- package/dist/esm/modules/incident-sla/enums/emergency-notification.enum.js.map +1 -0
- package/dist/esm/modules/incident-sla/enums/eta-status.enum.js +29 -0
- package/dist/esm/modules/incident-sla/enums/eta-status.enum.js.map +1 -0
- package/dist/esm/modules/incident-sla/enums/incident-closure.enum.js +20 -0
- package/dist/esm/modules/incident-sla/enums/incident-closure.enum.js.map +1 -0
- package/dist/esm/modules/incident-sla/enums/incident-sla-actor.enum.js +43 -0
- package/dist/esm/modules/incident-sla/enums/incident-sla-actor.enum.js.map +1 -0
- package/dist/esm/modules/incident-sla/enums/incident-sla-error-code.enum.js +23 -0
- package/dist/esm/modules/incident-sla/enums/incident-sla-error-code.enum.js.map +1 -0
- package/dist/esm/modules/incident-sla/enums/incident-sla-event-type.enum.js +42 -0
- package/dist/esm/modules/incident-sla/enums/incident-sla-event-type.enum.js.map +1 -0
- package/dist/esm/modules/incident-sla/enums/incident-sla-stage.enum.js +23 -0
- package/dist/esm/modules/incident-sla/enums/incident-sla-stage.enum.js.map +1 -0
- package/dist/esm/modules/incident-sla/enums/incident-sla-status.enum.js +35 -0
- package/dist/esm/modules/incident-sla/enums/incident-sla-status.enum.js.map +1 -0
- package/dist/esm/modules/incident-sla/enums/sla-escalation.enum.js +47 -0
- package/dist/esm/modules/incident-sla/enums/sla-escalation.enum.js.map +1 -0
- package/dist/esm/modules/incident-sla/enums/sla-exception.enum.js +24 -0
- package/dist/esm/modules/incident-sla/enums/sla-exception.enum.js.map +1 -0
- package/dist/esm/modules/incident-sla/enums/sla-overall-state.enum.js +25 -0
- package/dist/esm/modules/incident-sla/enums/sla-overall-state.enum.js.map +1 -0
- package/dist/esm/modules/incident-sla/enums/sla-pause.enum.js +25 -0
- package/dist/esm/modules/incident-sla/enums/sla-pause.enum.js.map +1 -0
- package/dist/esm/modules/incident-sla/enums/sla-policy-scope.enum.js +16 -0
- package/dist/esm/modules/incident-sla/enums/sla-policy-scope.enum.js.map +1 -0
- package/dist/esm/modules/incident-sla/index.js +37 -0
- package/dist/esm/modules/incident-sla/index.js.map +1 -0
- package/dist/esm/modules/incident-sla/interfaces/emergency-workflow.js +2 -0
- package/dist/esm/modules/incident-sla/interfaces/emergency-workflow.js.map +1 -0
- package/dist/esm/modules/incident-sla/interfaces/incident-sla-analytics.js +2 -0
- package/dist/esm/modules/incident-sla/interfaces/incident-sla-analytics.js.map +1 -0
- package/dist/esm/modules/incident-sla/interfaces/incident-sla-events.js +2 -0
- package/dist/esm/modules/incident-sla/interfaces/incident-sla-events.js.map +1 -0
- package/dist/esm/modules/incident-sla/interfaces/incident-sla-policy.js +2 -0
- package/dist/esm/modules/incident-sla/interfaces/incident-sla-policy.js.map +1 -0
- package/dist/esm/modules/incident-sla/interfaces/incident-sla-views.js +2 -0
- package/dist/esm/modules/incident-sla/interfaces/incident-sla-views.js.map +1 -0
- package/dist/esm/modules/incident-sla/utils/incident-sla-eta.util.js +35 -0
- package/dist/esm/modules/incident-sla/utils/incident-sla-eta.util.js.map +1 -0
- package/dist/esm/modules/incident-sla/utils/incident-sla-event-id.util.js +14 -0
- package/dist/esm/modules/incident-sla/utils/incident-sla-event-id.util.js.map +1 -0
- package/dist/esm/modules/incident-sla/utils/incident-sla-priority.util.js +25 -0
- package/dist/esm/modules/incident-sla/utils/incident-sla-priority.util.js.map +1 -0
- package/dist/esm/modules/incident-sla/utils/incident-sla-time.util.js +119 -0
- package/dist/esm/modules/incident-sla/utils/incident-sla-time.util.js.map +1 -0
- package/dist/esm/modules/permission/data/permissions.data.js +11 -0
- package/dist/esm/modules/permission/data/permissions.data.js.map +1 -1
- package/dist/esm/modules/permission/enums/permission-actions.enum.js +21 -0
- package/dist/esm/modules/permission/enums/permission-actions.enum.js.map +1 -1
- package/dist/esm/modules/permission/enums/permissions-module.enum.js +1 -0
- package/dist/esm/modules/permission/enums/permissions-module.enum.js.map +1 -1
- package/dist/esm/modules/role/data/roles.data.js +37 -0
- package/dist/esm/modules/role/data/roles.data.js.map +1 -1
- package/dist/esm/modules/sms/constants/sms-templates.config.js +27 -1
- package/dist/esm/modules/sms/constants/sms-templates.config.js.map +1 -1
- package/dist/esm/modules/sms/enums/sms-template.enum.js +2 -0
- package/dist/esm/modules/sms/enums/sms-template.enum.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/kafka/topics.d.ts +5 -0
- package/dist/types/modules/dispatch/dtos/response-unit-dispatch-notification.dto.d.ts +1 -0
- package/dist/types/modules/dispatch/enums/response-unit-dispatch-status.enum.d.ts +7 -1
- package/dist/types/modules/dispatch/enums/response-unit-dispatch-transition-source.enum.d.ts +4 -2
- package/dist/types/modules/dispatch/interfaces/incident-response-unit-dispatch.d.ts +5 -0
- package/dist/types/modules/dispatch/interfaces/response-unit-dispatch-events.d.ts +2 -0
- package/dist/types/modules/dispatch/utils/response-unit-dispatch-status.util.d.ts +1 -1
- package/dist/types/modules/incident/enums/incident-actions.enum.d.ts +4 -0
- package/dist/types/modules/incident-sla/constants/emergency-incident-workflow.const.d.ts +46 -0
- package/dist/types/modules/incident-sla/constants/incident-sla-defaults.const.d.ts +81 -0
- package/dist/types/modules/incident-sla/constants/incident-sla-kafka.const.d.ts +22 -0
- package/dist/types/modules/incident-sla/dtos/emergency-notification.dto.d.ts +99 -0
- package/dist/types/modules/incident-sla/dtos/emergency-operations.dto.d.ts +52 -0
- package/dist/types/modules/incident-sla/dtos/emergency-workflow.dto.d.ts +55 -0
- package/dist/types/modules/incident-sla/dtos/incident-sla-analytics-query.dto.d.ts +23 -0
- package/dist/types/modules/incident-sla/dtos/incident-sla-policy.dto.d.ts +104 -0
- package/dist/types/modules/incident-sla/enums/emergency-incident-stage.enum.d.ts +27 -0
- package/dist/types/modules/incident-sla/enums/emergency-notification.enum.d.ts +37 -0
- package/dist/types/modules/incident-sla/enums/eta-status.enum.d.ts +26 -0
- package/dist/types/modules/incident-sla/enums/incident-closure.enum.d.ts +17 -0
- package/dist/types/modules/incident-sla/enums/incident-sla-actor.enum.d.ts +40 -0
- package/dist/types/modules/incident-sla/enums/incident-sla-error-code.enum.d.ts +21 -0
- package/dist/types/modules/incident-sla/enums/incident-sla-event-type.enum.d.ts +36 -0
- package/dist/types/modules/incident-sla/enums/incident-sla-stage.enum.d.ts +21 -0
- package/dist/types/modules/incident-sla/enums/incident-sla-status.enum.d.ts +33 -0
- package/dist/types/modules/incident-sla/enums/sla-escalation.enum.d.ts +42 -0
- package/dist/types/modules/incident-sla/enums/sla-exception.enum.d.ts +21 -0
- package/dist/types/modules/incident-sla/enums/sla-overall-state.enum.d.ts +22 -0
- package/dist/types/modules/incident-sla/enums/sla-pause.enum.d.ts +22 -0
- package/dist/types/modules/incident-sla/enums/sla-policy-scope.enum.d.ts +14 -0
- package/dist/types/modules/incident-sla/index.d.ts +31 -0
- package/dist/types/modules/incident-sla/interfaces/emergency-workflow.d.ts +131 -0
- package/dist/types/modules/incident-sla/interfaces/incident-sla-analytics.d.ts +356 -0
- package/dist/types/modules/incident-sla/interfaces/incident-sla-events.d.ts +173 -0
- package/dist/types/modules/incident-sla/interfaces/incident-sla-policy.d.ts +147 -0
- package/dist/types/modules/incident-sla/interfaces/incident-sla-views.d.ts +224 -0
- package/dist/types/modules/incident-sla/utils/incident-sla-eta.util.d.ts +15 -0
- package/dist/types/modules/incident-sla/utils/incident-sla-event-id.util.d.ts +8 -0
- package/dist/types/modules/incident-sla/utils/incident-sla-priority.util.d.ts +14 -0
- package/dist/types/modules/incident-sla/utils/incident-sla-time.util.d.ts +65 -0
- package/dist/types/modules/permission/enums/permission-actions.enum.d.ts +6 -0
- package/dist/types/modules/permission/enums/permissions-module.enum.d.ts +2 -1
- package/dist/types/modules/sms/enums/sms-template.enum.d.ts +2 -0
- package/package.json +72 -72
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
import { IncidentPriority } from '../../incident/enums/incident-priority.enum';
|
|
2
|
+
import { IncidentSlaStage } from '../enums/incident-sla-stage.enum';
|
|
3
|
+
import { SlaPriorityLevel } from '../enums/sla-overall-state.enum';
|
|
4
|
+
/**
|
|
5
|
+
* Emergency SLA analytics (the admin's SLA Analytics): how fast the control room
|
|
6
|
+
* and the response units answered the emergencies raised over a period, stage by
|
|
7
|
+
* stage, against the targets of the policy each emergency ran under - and what
|
|
8
|
+
* happened when they did not (escalations, alternative units, pauses, exceptions,
|
|
9
|
+
* notifications).
|
|
10
|
+
*
|
|
11
|
+
* One read, computed by clarion-incident from one consistent snapshot. Counts,
|
|
12
|
+
* rates and durations only.
|
|
13
|
+
*
|
|
14
|
+
* How it is counted:
|
|
15
|
+
* - Everything belongs to the period its EMERGENCY was raised in (the incident's
|
|
16
|
+
* creation): its stage clocks, dispatches, escalations and notifications, even
|
|
17
|
+
* when they happened after the period ended. So every figure on the page is
|
|
18
|
+
* about the same emergencies.
|
|
19
|
+
* - Compliance = met / (met + breached), over stage clocks that were decided.
|
|
20
|
+
* An approved exception shows in its own figure; the breach stays a breach.
|
|
21
|
+
* - Durations are in SECONDS, measured from the incident's creation (the SLA's
|
|
22
|
+
* start) unless the field says otherwise; stage durations exclude paused time.
|
|
23
|
+
* - Only measured emergencies count: INCIDENT class, reaching a control room.
|
|
24
|
+
*/
|
|
25
|
+
/** How the period is cut into points for the charts. Chosen by the service from the length of the period. */
|
|
26
|
+
export type IncidentSlaAnalyticsBucket = 'hour' | 'day' | 'week' | 'month';
|
|
27
|
+
export interface IncidentSlaAnalyticsRange {
|
|
28
|
+
/** Inclusive, ISO 8601. The first emergency when the period asked for was "forever". */
|
|
29
|
+
from: string;
|
|
30
|
+
/** Exclusive, ISO 8601. */
|
|
31
|
+
to: string;
|
|
32
|
+
bucket: IncidentSlaAnalyticsBucket;
|
|
33
|
+
/** IANA time zone the buckets and the hour-of-week grid are cut in. */
|
|
34
|
+
timeZone: string;
|
|
35
|
+
}
|
|
36
|
+
/** A count by a key, largest first unless the section says otherwise. */
|
|
37
|
+
export interface IncidentSlaAnalyticsCount<K extends string = string> {
|
|
38
|
+
key: K;
|
|
39
|
+
count: number;
|
|
40
|
+
}
|
|
41
|
+
/** Median and 90th percentile of one duration, in seconds; null when nothing was measured. */
|
|
42
|
+
export interface IncidentSlaDurationSummary {
|
|
43
|
+
median: number | null;
|
|
44
|
+
p90: number | null;
|
|
45
|
+
/** How many were measured. */
|
|
46
|
+
count: number;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Durations at percentiles, in seconds. Percentiles are the point: an average
|
|
50
|
+
* hides the slow tail, and the slow tail is the emergency that went wrong.
|
|
51
|
+
*/
|
|
52
|
+
export interface IncidentSlaDurationPercentiles {
|
|
53
|
+
p50: number | null;
|
|
54
|
+
p75: number | null;
|
|
55
|
+
p90: number | null;
|
|
56
|
+
p95: number | null;
|
|
57
|
+
p99: number | null;
|
|
58
|
+
average: number | null;
|
|
59
|
+
/** How many were measured. */
|
|
60
|
+
count: number;
|
|
61
|
+
}
|
|
62
|
+
/** The headline figures of a period. */
|
|
63
|
+
export interface IncidentSlaAnalyticsSummary {
|
|
64
|
+
/** Measured emergencies raised in the period. */
|
|
65
|
+
emergencies: number;
|
|
66
|
+
/** Of those, still being worked (not yet closed / ended). */
|
|
67
|
+
openNow: number;
|
|
68
|
+
/** With at least one breached stage. */
|
|
69
|
+
breachedEmergencies: number;
|
|
70
|
+
breachedEmergencyPercent: number | null;
|
|
71
|
+
/** Stage clocks decided: met + breached. */
|
|
72
|
+
decided: number;
|
|
73
|
+
met: number;
|
|
74
|
+
breached: number;
|
|
75
|
+
breachedWithApprovedException: number;
|
|
76
|
+
compliancePercent: number | null;
|
|
77
|
+
complianceWithExceptionsPercent: number | null;
|
|
78
|
+
acknowledged: number;
|
|
79
|
+
dispatched: number;
|
|
80
|
+
/** A unit reached the scene. */
|
|
81
|
+
arrived: number;
|
|
82
|
+
resolved: number;
|
|
83
|
+
closed: number;
|
|
84
|
+
autoClosed: number;
|
|
85
|
+
/** Raised to acknowledged. */
|
|
86
|
+
timeToAcknowledge: IncidentSlaDurationSummary;
|
|
87
|
+
/** Raised to the first dispatch. */
|
|
88
|
+
timeToDispatch: IncidentSlaDurationSummary;
|
|
89
|
+
/** Raised to the first unit on scene - the response time the reporter lives through. */
|
|
90
|
+
timeToArrival: IncidentSlaDurationSummary;
|
|
91
|
+
/** First unit assigned to first unit on scene - the travel. */
|
|
92
|
+
travelTime: IncidentSlaDurationSummary;
|
|
93
|
+
/** Raised to resolved. */
|
|
94
|
+
timeToResolve: IncidentSlaDurationSummary;
|
|
95
|
+
escalations: number;
|
|
96
|
+
alternativesRecommended: number;
|
|
97
|
+
reassignments: number;
|
|
98
|
+
/** Notification requests that reached nobody or only some (FAILED, PARTIAL). */
|
|
99
|
+
notificationsFailed: number;
|
|
100
|
+
}
|
|
101
|
+
/** One stage across the period's emergencies. */
|
|
102
|
+
export interface IncidentSlaStageAnalytics {
|
|
103
|
+
stage: IncidentSlaStage;
|
|
104
|
+
/** Clocks of this stage (one per dispatch for acceptance and mobilization). */
|
|
105
|
+
instances: number;
|
|
106
|
+
met: number;
|
|
107
|
+
breached: number;
|
|
108
|
+
breachedWithApprovedException: number;
|
|
109
|
+
/** Still running, or paused. */
|
|
110
|
+
open: number;
|
|
111
|
+
waived: number;
|
|
112
|
+
/** Ended with the incident before its milestone (expired), or never started (cancelled). */
|
|
113
|
+
expired: number;
|
|
114
|
+
cancelled: number;
|
|
115
|
+
/** Reached the warning (75 %) / at-risk (90 %) mark. */
|
|
116
|
+
warned: number;
|
|
117
|
+
atRisk: number;
|
|
118
|
+
compliancePercent: number | null;
|
|
119
|
+
complianceWithExceptionsPercent: number | null;
|
|
120
|
+
/** The target most of these clocks ran against (median), seconds. */
|
|
121
|
+
targetSeconds: number | null;
|
|
122
|
+
/** Start to milestone, pauses excluded, over the clocks that reached it. */
|
|
123
|
+
duration: IncidentSlaDurationPercentiles;
|
|
124
|
+
/** By how much the breached ones were late. */
|
|
125
|
+
overrun: IncidentSlaDurationSummary;
|
|
126
|
+
}
|
|
127
|
+
/** One stage of one priority, for the priority × stage grid. */
|
|
128
|
+
export interface IncidentSlaStageCell {
|
|
129
|
+
stage: IncidentSlaStage;
|
|
130
|
+
met: number;
|
|
131
|
+
breached: number;
|
|
132
|
+
compliancePercent: number | null;
|
|
133
|
+
medianSeconds: number | null;
|
|
134
|
+
}
|
|
135
|
+
export interface IncidentSlaPriorityRow {
|
|
136
|
+
priority: IncidentPriority;
|
|
137
|
+
level: SlaPriorityLevel;
|
|
138
|
+
emergencies: number;
|
|
139
|
+
breachedEmergencies: number;
|
|
140
|
+
met: number;
|
|
141
|
+
breached: number;
|
|
142
|
+
compliancePercent: number | null;
|
|
143
|
+
medianSecondsToAcknowledge: number | null;
|
|
144
|
+
medianSecondsToArrival: number | null;
|
|
145
|
+
stages: IncidentSlaStageCell[];
|
|
146
|
+
}
|
|
147
|
+
/** One point of the charts. `bucket` is its start, local to the range's zone, without an offset. */
|
|
148
|
+
export interface IncidentSlaTimelinePoint {
|
|
149
|
+
bucket: string;
|
|
150
|
+
emergencies: number;
|
|
151
|
+
breachedEmergencies: number;
|
|
152
|
+
met: number;
|
|
153
|
+
breached: number;
|
|
154
|
+
compliancePercent: number | null;
|
|
155
|
+
medianSecondsToAcknowledge: number | null;
|
|
156
|
+
medianSecondsToArrival: number | null;
|
|
157
|
+
escalations: number;
|
|
158
|
+
}
|
|
159
|
+
export interface IncidentSlaControlCentreRow {
|
|
160
|
+
/** Null: emergencies no control centre was set on. */
|
|
161
|
+
controlCentreId: number | null;
|
|
162
|
+
emergencies: number;
|
|
163
|
+
breachedEmergencies: number;
|
|
164
|
+
met: number;
|
|
165
|
+
breached: number;
|
|
166
|
+
compliancePercent: number | null;
|
|
167
|
+
medianSecondsToAcknowledge: number | null;
|
|
168
|
+
medianSecondsToDispatch: number | null;
|
|
169
|
+
medianSecondsToArrival: number | null;
|
|
170
|
+
escalations: number;
|
|
171
|
+
}
|
|
172
|
+
export interface IncidentSlaTypeRow {
|
|
173
|
+
typeId: number | null;
|
|
174
|
+
typeName: string | null;
|
|
175
|
+
categoryId: number | null;
|
|
176
|
+
categoryName: string | null;
|
|
177
|
+
emergencies: number;
|
|
178
|
+
breachedEmergencies: number;
|
|
179
|
+
met: number;
|
|
180
|
+
breached: number;
|
|
181
|
+
compliancePercent: number | null;
|
|
182
|
+
medianSecondsToArrival: number | null;
|
|
183
|
+
}
|
|
184
|
+
export interface IncidentSlaResponseUnitRow {
|
|
185
|
+
responseUnitId: number;
|
|
186
|
+
responseUnitName: string;
|
|
187
|
+
dispatches: number;
|
|
188
|
+
/** Acknowledged the dispatch (accepted). */
|
|
189
|
+
accepted: number;
|
|
190
|
+
declined: number;
|
|
191
|
+
stoodDown: number;
|
|
192
|
+
arrived: number;
|
|
193
|
+
/** Arrivals inferred from the unit's live tracking. */
|
|
194
|
+
arrivalsInferred: number;
|
|
195
|
+
/** The acceptance clock, for this unit. */
|
|
196
|
+
acceptanceMet: number;
|
|
197
|
+
acceptanceBreached: number;
|
|
198
|
+
acceptanceCompliancePercent: number | null;
|
|
199
|
+
medianSecondsToAccept: number | null;
|
|
200
|
+
/** Accepted to en route. */
|
|
201
|
+
medianSecondsToMobilize: number | null;
|
|
202
|
+
/** Dispatched to on scene. */
|
|
203
|
+
medianSecondsToArrive: number | null;
|
|
204
|
+
}
|
|
205
|
+
export interface IncidentSlaArrivalAnalytics {
|
|
206
|
+
arrivals: number;
|
|
207
|
+
/** How each first arrival is known: inferred from tracking, the responder, the control room (UNKNOWN for older ones). */
|
|
208
|
+
bySource: IncidentSlaAnalyticsCount[];
|
|
209
|
+
inferredPercent: number | null;
|
|
210
|
+
/** Dispatches whose live ETA turned at risk / likely late / uncertain at least once. */
|
|
211
|
+
etaAtRisk: number;
|
|
212
|
+
etaLikelyLate: number;
|
|
213
|
+
etaUncertain: number;
|
|
214
|
+
/** Emergencies a unit was predicted late for, and of those, how many breached the arrival target. */
|
|
215
|
+
predictedLate: number;
|
|
216
|
+
predictedLateAndBreached: number;
|
|
217
|
+
/** predictedLateAndBreached / predictedLate. */
|
|
218
|
+
latePredictionPrecisionPercent: number | null;
|
|
219
|
+
/** How far the first ETA was from the actual arrival (absolute seconds). */
|
|
220
|
+
firstEtaError: IncidentSlaDurationSummary;
|
|
221
|
+
/** Straight-line distance of the unit when dispatched, metres. */
|
|
222
|
+
distanceAtDispatch: IncidentSlaDurationSummary;
|
|
223
|
+
}
|
|
224
|
+
export interface IncidentSlaEscalationAnalytics {
|
|
225
|
+
total: number;
|
|
226
|
+
/** SLA_BREACHED, SLA_AT_RISK, ETA_LIKELY_BREACH, DISPATCH_REJECTED... */
|
|
227
|
+
byTrigger: IncidentSlaAnalyticsCount[];
|
|
228
|
+
/** DISPATCHER, SUPERVISOR, DUTY_MANAGER, ORGANIZATION_ADMIN. */
|
|
229
|
+
byLevel: IncidentSlaAnalyticsCount[];
|
|
230
|
+
byStage: IncidentSlaAnalyticsCount[];
|
|
231
|
+
/** The policy rules that fired most - the ten commonest. */
|
|
232
|
+
byRule: IncidentSlaAnalyticsCount[];
|
|
233
|
+
alternativesRecommended: number;
|
|
234
|
+
reassignments: number;
|
|
235
|
+
/** Emergencies escalated at least once. */
|
|
236
|
+
escalatedEmergencies: number;
|
|
237
|
+
}
|
|
238
|
+
export interface IncidentSlaPauseAnalytics {
|
|
239
|
+
requested: number;
|
|
240
|
+
approved: number;
|
|
241
|
+
rejected: number;
|
|
242
|
+
/** Waiting for a supervisor. */
|
|
243
|
+
pending: number;
|
|
244
|
+
withdrawn: number;
|
|
245
|
+
totalPausedSeconds: number;
|
|
246
|
+
pausedTime: IncidentSlaDurationSummary;
|
|
247
|
+
byReason: IncidentSlaAnalyticsCount[];
|
|
248
|
+
}
|
|
249
|
+
export interface IncidentSlaExceptionAnalytics {
|
|
250
|
+
requested: number;
|
|
251
|
+
approved: number;
|
|
252
|
+
rejected: number;
|
|
253
|
+
pending: number;
|
|
254
|
+
byReason: IncidentSlaAnalyticsCount[];
|
|
255
|
+
}
|
|
256
|
+
export interface IncidentSlaNotificationEventRow {
|
|
257
|
+
/** emergency-created, emergency-sla-breached... */
|
|
258
|
+
event: string;
|
|
259
|
+
requests: number;
|
|
260
|
+
failed: number;
|
|
261
|
+
}
|
|
262
|
+
export interface IncidentSlaNotificationChannelRow {
|
|
263
|
+
channel: string;
|
|
264
|
+
recipients: number;
|
|
265
|
+
sent: number;
|
|
266
|
+
failed: number;
|
|
267
|
+
successPercent: number | null;
|
|
268
|
+
}
|
|
269
|
+
export interface IncidentSlaNotificationAnalytics {
|
|
270
|
+
/** Requests clarion-notification answered. */
|
|
271
|
+
requests: number;
|
|
272
|
+
/** SENT, PARTIAL, FAILED, NOT_POSSIBLE. */
|
|
273
|
+
byStatus: IncidentSlaAnalyticsCount[];
|
|
274
|
+
byEvent: IncidentSlaNotificationEventRow[];
|
|
275
|
+
byChannel: IncidentSlaNotificationChannelRow[];
|
|
276
|
+
/** By audience: REPORTER, DISPATCHER, SUPERVISOR... (people reached). */
|
|
277
|
+
byAudience: IncidentSlaAnalyticsCount[];
|
|
278
|
+
}
|
|
279
|
+
export interface IncidentSlaClosureAnalytics {
|
|
280
|
+
resolved: number;
|
|
281
|
+
closed: number;
|
|
282
|
+
manual: number;
|
|
283
|
+
automatic: number;
|
|
284
|
+
/** Resolved and not closed yet. */
|
|
285
|
+
awaitingClosure: number;
|
|
286
|
+
/** Emergencies whose automatic closure waited for a unit still out. */
|
|
287
|
+
autoCloseDeferred: number;
|
|
288
|
+
resolvedToClosed: IncidentSlaDurationSummary;
|
|
289
|
+
}
|
|
290
|
+
/** One hour of one weekday (1 = Monday), in the range's zone. */
|
|
291
|
+
export interface IncidentSlaHeatmapCell {
|
|
292
|
+
weekday: number;
|
|
293
|
+
hour: number;
|
|
294
|
+
emergencies: number;
|
|
295
|
+
breachedEmergencies: number;
|
|
296
|
+
}
|
|
297
|
+
/** The emergencies that went most wrong - by total time over target. */
|
|
298
|
+
export interface IncidentSlaWorstIncident {
|
|
299
|
+
incidentId: number;
|
|
300
|
+
/** `#1234`. */
|
|
301
|
+
reference: string;
|
|
302
|
+
priority: IncidentPriority;
|
|
303
|
+
typeName: string | null;
|
|
304
|
+
controlCentreId: number | null;
|
|
305
|
+
createdAt: string;
|
|
306
|
+
breachedStages: number;
|
|
307
|
+
worstStage: IncidentSlaStage | null;
|
|
308
|
+
maxOverrunSeconds: number;
|
|
309
|
+
totalOverrunSeconds: number;
|
|
310
|
+
timeToArrivalSeconds: number | null;
|
|
311
|
+
}
|
|
312
|
+
/** A Super-Admin's platform view: one row per organization. */
|
|
313
|
+
export interface IncidentSlaOrganizationRow {
|
|
314
|
+
organizationId: number;
|
|
315
|
+
emergencies: number;
|
|
316
|
+
breachedEmergencies: number;
|
|
317
|
+
met: number;
|
|
318
|
+
breached: number;
|
|
319
|
+
compliancePercent: number | null;
|
|
320
|
+
medianSecondsToAcknowledge: number | null;
|
|
321
|
+
medianSecondsToArrival: number | null;
|
|
322
|
+
}
|
|
323
|
+
/** `GET /incident-sla/analytics`. */
|
|
324
|
+
export interface IncidentSlaAnalytics {
|
|
325
|
+
range: IncidentSlaAnalyticsRange;
|
|
326
|
+
/** The organization the figures are for; null in a Super-Admin's platform view. */
|
|
327
|
+
organizationId: number | null;
|
|
328
|
+
controlCentreId: number | null;
|
|
329
|
+
/** A Super-Admin across every organization (`byOrganization` is filled). */
|
|
330
|
+
platform: boolean;
|
|
331
|
+
summary: IncidentSlaAnalyticsSummary;
|
|
332
|
+
/** The previous period of the same length; null for "forever". */
|
|
333
|
+
previous: IncidentSlaAnalyticsSummary | null;
|
|
334
|
+
stages: IncidentSlaStageAnalytics[];
|
|
335
|
+
/** Critical, High, Medium, Low - in that order, zeros included. */
|
|
336
|
+
byPriority: IncidentSlaPriorityRow[];
|
|
337
|
+
timeline: IncidentSlaTimelinePoint[];
|
|
338
|
+
byControlCentre: IncidentSlaControlCentreRow[];
|
|
339
|
+
byType: IncidentSlaTypeRow[];
|
|
340
|
+
/** The 25 units dispatched most. */
|
|
341
|
+
byResponseUnit: IncidentSlaResponseUnitRow[];
|
|
342
|
+
arrival: IncidentSlaArrivalAnalytics;
|
|
343
|
+
escalations: IncidentSlaEscalationAnalytics;
|
|
344
|
+
pauses: IncidentSlaPauseAnalytics;
|
|
345
|
+
exceptions: IncidentSlaExceptionAnalytics;
|
|
346
|
+
notifications: IncidentSlaNotificationAnalytics;
|
|
347
|
+
closure: IncidentSlaClosureAnalytics;
|
|
348
|
+
/** emergency, panic... (the alert's own kind). */
|
|
349
|
+
emergencyTypes: IncidentSlaAnalyticsCount[];
|
|
350
|
+
heatmap: IncidentSlaHeatmapCell[];
|
|
351
|
+
worstIncidents: IncidentSlaWorstIncident[];
|
|
352
|
+
byOrganization: IncidentSlaOrganizationRow[];
|
|
353
|
+
generatedAt: string;
|
|
354
|
+
}
|
|
355
|
+
/** The name the first release used. */
|
|
356
|
+
export type IncidentSlaAnalyticsResult = IncidentSlaAnalytics;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { IncidentPriority } from '../../incident/enums/incident-priority.enum';
|
|
2
|
+
import { EmergencyIncidentStage } from '../enums/emergency-incident-stage.enum';
|
|
3
|
+
import { EmergencyNotificationAudience, EmergencyNotificationEvent, EmergencyNotificationResultStatus } from '../enums/emergency-notification.enum';
|
|
4
|
+
import { EtaBasis, EtaStatus } from '../enums/eta-status.enum';
|
|
5
|
+
import { IncidentArrivalSource, IncidentClosureReason } from '../enums/incident-closure.enum';
|
|
6
|
+
import { IncidentActorType, IncidentSlaEventSource } from '../enums/incident-sla-actor.enum';
|
|
7
|
+
import { IncidentSlaEventType } from '../enums/incident-sla-event-type.enum';
|
|
8
|
+
import { IncidentSlaStage } from '../enums/incident-sla-stage.enum';
|
|
9
|
+
import { IncidentSlaStatus } from '../enums/incident-sla-status.enum';
|
|
10
|
+
import { SlaEscalationLevel, SlaEscalationTrigger, SlaNotificationChannel } from '../enums/sla-escalation.enum';
|
|
11
|
+
import { SlaPriorityLevel } from '../enums/sla-overall-state.enum';
|
|
12
|
+
import { IncidentSlaEscalationContact } from './incident-sla-policy';
|
|
13
|
+
/** Fields every emergency/SLA domain event carries. Keyed by incident id on Kafka. */
|
|
14
|
+
export interface EmergencyIncidentEventBase {
|
|
15
|
+
schemaVersion: 1;
|
|
16
|
+
/** Deterministic per change, so a redelivery is recognisable. */
|
|
17
|
+
eventId: string;
|
|
18
|
+
/** When the change happened (a milestone's own time, a threshold's instant). */
|
|
19
|
+
occurredAt: string;
|
|
20
|
+
/** When clarion-incident recorded it. */
|
|
21
|
+
recordedAt: string;
|
|
22
|
+
incidentId: number;
|
|
23
|
+
organizationId: number;
|
|
24
|
+
controlCentreId: number | null;
|
|
25
|
+
actorType: IncidentActorType;
|
|
26
|
+
source: IncidentSlaEventSource;
|
|
27
|
+
actorUserId: number | null;
|
|
28
|
+
correlationId: string | null;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* `incident.emergency.milestone-recorded.v1` - the response reached a milestone
|
|
32
|
+
* (acknowledged, dispatched, on scene, resolved, closed...). No names, numbers
|
|
33
|
+
* or addresses.
|
|
34
|
+
*/
|
|
35
|
+
export interface EmergencyMilestoneRecordedEventV1 extends EmergencyIncidentEventBase {
|
|
36
|
+
milestone: EmergencyIncidentStage;
|
|
37
|
+
currentStage: EmergencyIncidentStage;
|
|
38
|
+
/** Proven by a later milestone rather than recorded directly. */
|
|
39
|
+
implied: boolean;
|
|
40
|
+
incidentStatus: string;
|
|
41
|
+
responseUnitDispatchId: number | null;
|
|
42
|
+
responseUnitId: number | null;
|
|
43
|
+
arrivalSource: IncidentArrivalSource | null;
|
|
44
|
+
closureReason: IncidentClosureReason | null;
|
|
45
|
+
}
|
|
46
|
+
/** `incident.sla.changed.v1` - one SLA instance changed state. */
|
|
47
|
+
export interface IncidentSlaChangedEventV1 extends EmergencyIncidentEventBase {
|
|
48
|
+
eventType: IncidentSlaEventType;
|
|
49
|
+
instanceId: number;
|
|
50
|
+
stage: IncidentSlaStage;
|
|
51
|
+
cycle: number;
|
|
52
|
+
responseUnitDispatchId: number | null;
|
|
53
|
+
priority: IncidentPriority;
|
|
54
|
+
previousStatus: IncidentSlaStatus | null;
|
|
55
|
+
status: IncidentSlaStatus;
|
|
56
|
+
startedAt: string | null;
|
|
57
|
+
deadlineAt: string | null;
|
|
58
|
+
completedAt: string | null;
|
|
59
|
+
slaPolicyId: number | null;
|
|
60
|
+
slaPolicyVersion: number | null;
|
|
61
|
+
}
|
|
62
|
+
/** `incident.emergency.eta-changed.v1` - a dispatched unit's ETA status changed. */
|
|
63
|
+
export interface EmergencyEtaChangedEventV1 extends EmergencyIncidentEventBase {
|
|
64
|
+
responseUnitDispatchId: number;
|
|
65
|
+
responseUnitId: number;
|
|
66
|
+
previousStatus: EtaStatus | null;
|
|
67
|
+
status: EtaStatus;
|
|
68
|
+
etaSeconds: number | null;
|
|
69
|
+
predictedArrivalAt: string | null;
|
|
70
|
+
arrivalDeadlineAt: string | null;
|
|
71
|
+
distanceMetres: number | null;
|
|
72
|
+
locationAgeSeconds: number | null;
|
|
73
|
+
basis: EtaBasis | null;
|
|
74
|
+
}
|
|
75
|
+
/** The incident facts an emergency notification is written from. */
|
|
76
|
+
export interface EmergencyNotificationIncidentFacts {
|
|
77
|
+
/** `#1234`. */
|
|
78
|
+
reference: string;
|
|
79
|
+
typeName: string | null;
|
|
80
|
+
categoryName: string | null;
|
|
81
|
+
priority: IncidentPriority | null;
|
|
82
|
+
priorityLevel: SlaPriorityLevel | null;
|
|
83
|
+
status: string;
|
|
84
|
+
/** The description, clamped; null for a sensitive incident. */
|
|
85
|
+
summary: string | null;
|
|
86
|
+
address: string | null;
|
|
87
|
+
latitude: number | null;
|
|
88
|
+
longitude: number | null;
|
|
89
|
+
createdAt: string;
|
|
90
|
+
/** For the reporter's own notifications; never shown to staff by notification. */
|
|
91
|
+
reporterUserId: number | null;
|
|
92
|
+
anonymous: boolean;
|
|
93
|
+
/** The control room working it - the DISPATCHER audience's first recipients. */
|
|
94
|
+
assigneeIds: number[];
|
|
95
|
+
}
|
|
96
|
+
/** One audience of a notification request: who, by which channels. */
|
|
97
|
+
export interface EmergencyNotificationAudienceSpec {
|
|
98
|
+
audience: EmergencyNotificationAudience;
|
|
99
|
+
channels: SlaNotificationChannel[];
|
|
100
|
+
/** Overrides the audience's default roles (Roles values). */
|
|
101
|
+
roles: string[];
|
|
102
|
+
/** Named contacts (a duty manager). */
|
|
103
|
+
contacts: IncidentSlaEscalationContact[];
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* `incident.emergency.notification-requested.v1` - a COMMAND to
|
|
107
|
+
* clarion-notification. The one emergency message that may carry contact
|
|
108
|
+
* details (a duty manager's number); it goes to one consumer, and its outbox
|
|
109
|
+
* copy is masked once published.
|
|
110
|
+
*/
|
|
111
|
+
export interface EmergencyNotificationRequestedV1 {
|
|
112
|
+
schemaVersion: 1;
|
|
113
|
+
/** The idempotency base: notification dedupes per (eventId, recipient, channel). */
|
|
114
|
+
eventId: string;
|
|
115
|
+
occurredAt: string;
|
|
116
|
+
incidentId: number;
|
|
117
|
+
organizationId: number;
|
|
118
|
+
controlCentreId: number | null;
|
|
119
|
+
event: EmergencyNotificationEvent;
|
|
120
|
+
audiences: EmergencyNotificationAudienceSpec[];
|
|
121
|
+
incident: EmergencyNotificationIncidentFacts;
|
|
122
|
+
sla: {
|
|
123
|
+
stage: IncidentSlaStage;
|
|
124
|
+
status: IncidentSlaStatus;
|
|
125
|
+
targetSeconds: number | null;
|
|
126
|
+
deadlineAt: string | null;
|
|
127
|
+
overdueSeconds: number | null;
|
|
128
|
+
} | null;
|
|
129
|
+
eta: {
|
|
130
|
+
status: EtaStatus;
|
|
131
|
+
etaSeconds: number | null;
|
|
132
|
+
predictedArrivalAt: string | null;
|
|
133
|
+
distanceMetres: number | null;
|
|
134
|
+
} | null;
|
|
135
|
+
unit: {
|
|
136
|
+
responseUnitId: number;
|
|
137
|
+
name: string | null;
|
|
138
|
+
} | null;
|
|
139
|
+
alternative: {
|
|
140
|
+
responseUnitId: number;
|
|
141
|
+
name: string | null;
|
|
142
|
+
distanceMetres: number | null;
|
|
143
|
+
etaSeconds: number | null;
|
|
144
|
+
} | null;
|
|
145
|
+
escalation: {
|
|
146
|
+
ruleKey: string;
|
|
147
|
+
trigger: SlaEscalationTrigger;
|
|
148
|
+
level: SlaEscalationLevel;
|
|
149
|
+
} | null;
|
|
150
|
+
workflowId: string | null;
|
|
151
|
+
correlationId: string | null;
|
|
152
|
+
}
|
|
153
|
+
/** Per audience x channel delivery counts. Counts only: no addresses. */
|
|
154
|
+
export interface EmergencyNotificationDelivery {
|
|
155
|
+
audience: EmergencyNotificationAudience;
|
|
156
|
+
channel: SlaNotificationChannel;
|
|
157
|
+
recipients: number;
|
|
158
|
+
sent: number;
|
|
159
|
+
failed: number;
|
|
160
|
+
}
|
|
161
|
+
/** `notification.emergency-incident.notification-result.v1` - what became of one request. */
|
|
162
|
+
export interface EmergencyNotificationResultV1 {
|
|
163
|
+
schemaVersion: 1;
|
|
164
|
+
eventId: string;
|
|
165
|
+
requestEventId: string;
|
|
166
|
+
incidentId: number;
|
|
167
|
+
organizationId: number;
|
|
168
|
+
event: EmergencyNotificationEvent;
|
|
169
|
+
status: EmergencyNotificationResultStatus;
|
|
170
|
+
deliveries: EmergencyNotificationDelivery[];
|
|
171
|
+
failureReason: string | null;
|
|
172
|
+
occurredAt: string;
|
|
173
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { IncidentEmergencyType } from '../../incident/enums/incident-emergency-type.enum';
|
|
2
|
+
import { IncidentPriority } from '../../incident/enums/incident-priority.enum';
|
|
3
|
+
import { EmergencyIncidentStage } from '../enums/emergency-incident-stage.enum';
|
|
4
|
+
import { IncidentSlaStage } from '../enums/incident-sla-stage.enum';
|
|
5
|
+
import { SlaEscalationAction, SlaEscalationLevel, SlaEscalationTrigger, SlaNotificationChannel } from '../enums/sla-escalation.enum';
|
|
6
|
+
import { SlaPolicyScope } from '../enums/sla-policy-scope.enum';
|
|
7
|
+
/** A named person outside the role directory an escalation may reach (a duty manager). */
|
|
8
|
+
export interface IncidentSlaEscalationContact {
|
|
9
|
+
name?: string | null;
|
|
10
|
+
/** E.164. */
|
|
11
|
+
phoneNumber?: string | null;
|
|
12
|
+
email?: string | null;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* One escalation rule: when `trigger` happens on one of `stages` (any, when
|
|
16
|
+
* empty) for one of `priorities` (any, when empty), wait `delaySeconds` and, if
|
|
17
|
+
* the situation still stands, reach `level` through `channels` and do `actions`.
|
|
18
|
+
*/
|
|
19
|
+
export interface IncidentSlaEscalationRule {
|
|
20
|
+
/** Stable within its policy; the workflow and the audit trail name rules by key. */
|
|
21
|
+
key: string;
|
|
22
|
+
trigger: SlaEscalationTrigger;
|
|
23
|
+
stages: IncidentSlaStage[];
|
|
24
|
+
priorities: IncidentPriority[];
|
|
25
|
+
level: SlaEscalationLevel;
|
|
26
|
+
channels: SlaNotificationChannel[];
|
|
27
|
+
actions: SlaEscalationAction[];
|
|
28
|
+
delaySeconds: number;
|
|
29
|
+
/** Overrides the level's default roles (Roles values). Empty = the level's default. */
|
|
30
|
+
recipientRoles: string[];
|
|
31
|
+
/** Extra named people (a duty manager). Never leaves clarion-incident except in the notification command. */
|
|
32
|
+
contacts: IncidentSlaEscalationContact[];
|
|
33
|
+
}
|
|
34
|
+
/** One stage's target for one priority. `targetSeconds: null` = the stage is not measured. */
|
|
35
|
+
export interface IncidentSlaTargetEntry {
|
|
36
|
+
stage: IncidentSlaStage;
|
|
37
|
+
priority: IncidentPriority;
|
|
38
|
+
targetSeconds: number | null;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Policy settings beside the targets. On a stored policy every field is
|
|
42
|
+
* optional - absent means "inherit from the less specific policy"; on a
|
|
43
|
+
* resolved policy every field is filled.
|
|
44
|
+
*/
|
|
45
|
+
export interface IncidentSlaPolicySettings {
|
|
46
|
+
/** % of the target at which an instance turns WARNING (default 75). */
|
|
47
|
+
warningThresholdPercent: number;
|
|
48
|
+
/** % of the target at which an instance turns AT_RISK (default 90). */
|
|
49
|
+
atRiskThresholdPercent: number;
|
|
50
|
+
/** Distance from the incident within which a unit counts as at the scene. */
|
|
51
|
+
arrivalRadiusMetres: number;
|
|
52
|
+
/** A unit inside the radius only leaves the scene beyond this (hysteresis). */
|
|
53
|
+
arrivalExitRadiusMetres: number;
|
|
54
|
+
/** How long a unit must stay inside the radius before arrival is inferred. */
|
|
55
|
+
arrivalDwellSeconds: number;
|
|
56
|
+
/** How many in-radius fixes that takes, at least. */
|
|
57
|
+
arrivalMinObservations: number;
|
|
58
|
+
/** A fix less accurate than this can never confirm an arrival. */
|
|
59
|
+
maxLocationAccuracyMetres: number;
|
|
60
|
+
/** A position older than this is not current: the ETA becomes UNCERTAIN. */
|
|
61
|
+
trackingStaleSeconds: number;
|
|
62
|
+
/** ETA within this % of the arrival target before the deadline = AT_RISK. */
|
|
63
|
+
etaAtRiskMarginPercent: number;
|
|
64
|
+
/** Speed assumed for an estimated ETA (urban, with stops). */
|
|
65
|
+
etaAssumedSpeedKph: number;
|
|
66
|
+
/** Straight line -> road distance factor for an estimated ETA. */
|
|
67
|
+
etaRoadFactor: number;
|
|
68
|
+
autoCloseEnabled: boolean;
|
|
69
|
+
/** Resolution -> automatic closure, default 24 h. */
|
|
70
|
+
autoCloseAfterSeconds: number;
|
|
71
|
+
/** May the workflow replace a unit by itself? Default false: the dispatcher decides. */
|
|
72
|
+
allowAutomaticReassignment: boolean;
|
|
73
|
+
/** Does a dispatcher's pause wait for a supervisor? Default true. */
|
|
74
|
+
pauseRequiresApproval: boolean;
|
|
75
|
+
/** Send the reporter the emergency progress messages (dispatched, arrived, resolved...). */
|
|
76
|
+
notifyReporter: boolean;
|
|
77
|
+
}
|
|
78
|
+
/** Floors an emergency type puts under the SLA priority (SOS alerts arrive as the column default, Medium). */
|
|
79
|
+
export type IncidentSlaPriorityFloors = Partial<Record<IncidentEmergencyType, IncidentPriority>>;
|
|
80
|
+
/** Which milestone starts each stage's clock (where configurable). */
|
|
81
|
+
export type IncidentSlaStartAnchors = Partial<Record<IncidentSlaStage, EmergencyIncidentStage>>;
|
|
82
|
+
/** The dimensions a policy may be scoped to. Null = any. */
|
|
83
|
+
export interface IncidentSlaPolicyScopeKeys {
|
|
84
|
+
organizationId: number | null;
|
|
85
|
+
controlCentreId: number | null;
|
|
86
|
+
categoryId: number | null;
|
|
87
|
+
typeId: number | null;
|
|
88
|
+
priority: IncidentPriority | null;
|
|
89
|
+
zoneId: number | null;
|
|
90
|
+
}
|
|
91
|
+
/** A stored policy version, as the API returns it. */
|
|
92
|
+
export interface IncidentSlaPolicyRecord extends IncidentSlaPolicyScopeKeys {
|
|
93
|
+
id: number;
|
|
94
|
+
/** The policy across its versions. */
|
|
95
|
+
policyKey: string;
|
|
96
|
+
version: number;
|
|
97
|
+
name: string;
|
|
98
|
+
description: string | null;
|
|
99
|
+
scope: SlaPolicyScope;
|
|
100
|
+
incidentClass: string;
|
|
101
|
+
effectiveFrom: string;
|
|
102
|
+
effectiveTo: string | null;
|
|
103
|
+
active: boolean;
|
|
104
|
+
settings: Partial<IncidentSlaPolicySettings>;
|
|
105
|
+
priorityFloors: IncidentSlaPriorityFloors | null;
|
|
106
|
+
startAnchors: IncidentSlaStartAnchors | null;
|
|
107
|
+
targets: IncidentSlaTargetEntry[];
|
|
108
|
+
/** Null = inherit the less specific policy's rules; [] = no escalation at all. */
|
|
109
|
+
escalationRules: IncidentSlaEscalationRule[] | null;
|
|
110
|
+
/** How many incidents froze this version (it is immutable once > 0). */
|
|
111
|
+
usageCount?: number;
|
|
112
|
+
createdBy: number | null;
|
|
113
|
+
updatedBy: number | null;
|
|
114
|
+
createdAt: string;
|
|
115
|
+
updatedAt: string;
|
|
116
|
+
}
|
|
117
|
+
/** One policy version that contributed to a resolution, least specific first. */
|
|
118
|
+
export interface IncidentSlaContributingPolicy {
|
|
119
|
+
policyId: number;
|
|
120
|
+
policyKey: string;
|
|
121
|
+
version: number;
|
|
122
|
+
name: string;
|
|
123
|
+
scope: SlaPolicyScope;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* The policy an incident runs under, resolved once when its SLA starts and
|
|
127
|
+
* frozen on the incident. A later policy change never touches it.
|
|
128
|
+
*/
|
|
129
|
+
export interface ResolvedIncidentSlaPolicy {
|
|
130
|
+
schemaVersion: 1;
|
|
131
|
+
/** The most specific contributing version; null when only the built-in defaults applied. */
|
|
132
|
+
policyId: number | null;
|
|
133
|
+
policyKey: string | null;
|
|
134
|
+
policyVersion: number | null;
|
|
135
|
+
policyName: string;
|
|
136
|
+
scope: SlaPolicyScope;
|
|
137
|
+
contributingPolicies: IncidentSlaContributingPolicy[];
|
|
138
|
+
/** The instant the policy was resolved for (the incident's creation time). */
|
|
139
|
+
effectiveAt: string;
|
|
140
|
+
resolvedAt: string;
|
|
141
|
+
/** Every stage x priority target, so a triaged priority needs no re-resolution. Seconds, null = not measured. */
|
|
142
|
+
targets: Record<IncidentPriority, Record<IncidentSlaStage, number | null>>;
|
|
143
|
+
startAnchors: Record<IncidentSlaStage, EmergencyIncidentStage>;
|
|
144
|
+
settings: IncidentSlaPolicySettings;
|
|
145
|
+
priorityFloors: IncidentSlaPriorityFloors;
|
|
146
|
+
escalationRules: IncidentSlaEscalationRule[];
|
|
147
|
+
}
|