grm-shared-library 1.1.236 → 1.1.237
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 +24 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/kafka/topics.js +10 -0
- package/dist/cjs/kafka/topics.js.map +1 -1
- package/dist/cjs/modules/dispatch/constants/response-unit-dispatch-defaults.const.js +55 -0
- package/dist/cjs/modules/dispatch/constants/response-unit-dispatch-defaults.const.js.map +1 -0
- package/dist/cjs/modules/dispatch/constants/response-unit-dispatch-kafka.const.js +21 -0
- package/dist/cjs/modules/dispatch/constants/response-unit-dispatch-kafka.const.js.map +1 -0
- package/dist/cjs/modules/dispatch/dtos/dispatch-response-unit.dto.js +58 -0
- package/dist/cjs/modules/dispatch/dtos/dispatch-response-unit.dto.js.map +1 -0
- package/dist/cjs/modules/dispatch/dtos/response-unit-dispatch-notification.dto.js +230 -0
- package/dist/cjs/modules/dispatch/dtos/response-unit-dispatch-notification.dto.js.map +1 -0
- package/dist/cjs/modules/dispatch/dtos/response-unit-dispatch-profile-query.dto.js +61 -0
- package/dist/cjs/modules/dispatch/dtos/response-unit-dispatch-profile-query.dto.js.map +1 -0
- package/dist/cjs/modules/dispatch/dtos/response-unit-nearby-query.dto.js +66 -0
- package/dist/cjs/modules/dispatch/dtos/response-unit-nearby-query.dto.js.map +1 -0
- package/dist/cjs/modules/dispatch/dtos/update-response-unit-dispatch-status.dto.js +41 -0
- package/dist/cjs/modules/dispatch/dtos/update-response-unit-dispatch-status.dto.js.map +1 -0
- package/dist/cjs/modules/dispatch/enums/incident-dispatch-blocker.enum.js +21 -0
- package/dist/cjs/modules/dispatch/enums/incident-dispatch-blocker.enum.js.map +1 -0
- package/dist/cjs/modules/dispatch/enums/response-capability-requirement-source.enum.js +12 -0
- package/dist/cjs/modules/dispatch/enums/response-capability-requirement-source.enum.js.map +1 -0
- package/dist/cjs/modules/dispatch/enums/response-unit-capability-match.enum.js +24 -0
- package/dist/cjs/modules/dispatch/enums/response-unit-capability-match.enum.js.map +1 -0
- package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-constraint.enum.js +34 -0
- package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-constraint.enum.js.map +1 -0
- package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-error-code.enum.js +26 -0
- package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-error-code.enum.js.map +1 -0
- package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-notification-failure.enum.js +18 -0
- package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-notification-failure.enum.js.map +1 -0
- package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-notification-status.enum.js +16 -0
- package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-notification-status.enum.js.map +1 -0
- package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-status.enum.js +33 -0
- package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-status.enum.js.map +1 -0
- package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-transition-source.enum.js +16 -0
- package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-transition-source.enum.js.map +1 -0
- package/dist/cjs/modules/dispatch/enums/response-unit-distance-basis.enum.js +12 -0
- package/dist/cjs/modules/dispatch/enums/response-unit-distance-basis.enum.js.map +1 -0
- package/dist/cjs/modules/dispatch/enums/response-unit-location-freshness.enum.js +21 -0
- package/dist/cjs/modules/dispatch/enums/response-unit-location-freshness.enum.js.map +1 -0
- package/dist/cjs/modules/dispatch/enums/response-unit-location-source.enum.js +17 -0
- package/dist/cjs/modules/dispatch/enums/response-unit-location-source.enum.js.map +1 -0
- package/dist/cjs/modules/dispatch/enums/response-unit-recommendation-reason.enum.js +25 -0
- package/dist/cjs/modules/dispatch/enums/response-unit-recommendation-reason.enum.js.map +1 -0
- package/dist/cjs/modules/dispatch/enums/response-unit-recommendation-status.enum.js +23 -0
- package/dist/cjs/modules/dispatch/enums/response-unit-recommendation-status.enum.js.map +1 -0
- package/dist/cjs/modules/dispatch/index.js +53 -0
- package/dist/cjs/modules/dispatch/index.js.map +1 -0
- package/dist/cjs/modules/dispatch/interfaces/incident-response-unit-dispatch.js +3 -0
- package/dist/cjs/modules/dispatch/interfaces/incident-response-unit-dispatch.js.map +1 -0
- package/dist/cjs/modules/dispatch/interfaces/response-unit-dispatch-events.js +3 -0
- package/dist/cjs/modules/dispatch/interfaces/response-unit-dispatch-events.js.map +1 -0
- package/dist/cjs/modules/dispatch/interfaces/response-unit-dispatch-profile.js +3 -0
- package/dist/cjs/modules/dispatch/interfaces/response-unit-dispatch-profile.js.map +1 -0
- package/dist/cjs/modules/dispatch/interfaces/response-unit-proximity.js +3 -0
- package/dist/cjs/modules/dispatch/interfaces/response-unit-proximity.js.map +1 -0
- package/dist/cjs/modules/dispatch/interfaces/response-unit-recommendation.js +3 -0
- package/dist/cjs/modules/dispatch/interfaces/response-unit-recommendation.js.map +1 -0
- package/dist/cjs/modules/dispatch/utils/dispatch-geo.util.js +44 -0
- package/dist/cjs/modules/dispatch/utils/dispatch-geo.util.js.map +1 -0
- package/dist/cjs/modules/dispatch/utils/incident-dispatchability.util.js +42 -0
- package/dist/cjs/modules/dispatch/utils/incident-dispatchability.util.js.map +1 -0
- package/dist/cjs/modules/dispatch/utils/response-capability-match.util.js +44 -0
- package/dist/cjs/modules/dispatch/utils/response-capability-match.util.js.map +1 -0
- package/dist/cjs/modules/dispatch/utils/response-unit-dispatch-event.util.js +19 -0
- package/dist/cjs/modules/dispatch/utils/response-unit-dispatch-event.util.js.map +1 -0
- package/dist/cjs/modules/dispatch/utils/response-unit-dispatch-status.util.js +49 -0
- package/dist/cjs/modules/dispatch/utils/response-unit-dispatch-status.util.js.map +1 -0
- package/dist/cjs/modules/incident/dtos/category/create-incident-category.dto.js +9 -0
- package/dist/cjs/modules/incident/dtos/category/create-incident-category.dto.js.map +1 -1
- package/dist/cjs/modules/incident/dtos/type/create-incident-type.dto.js +9 -0
- package/dist/cjs/modules/incident/dtos/type/create-incident-type.dto.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/permission/data/permissions.data.js +8 -0
- package/dist/cjs/modules/permission/data/permissions.data.js.map +1 -1
- package/dist/cjs/modules/permission/enums/permission-actions.enum.js +13 -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/response-unit/dtos/response-unit/base-response-unit.dto.js +9 -0
- package/dist/cjs/modules/response-unit/dtos/response-unit/base-response-unit.dto.js.map +1 -1
- package/dist/cjs/modules/response-unit/enums/response-unit/response-capability.enum.js +29 -0
- package/dist/cjs/modules/response-unit/enums/response-unit/response-capability.enum.js.map +1 -0
- package/dist/cjs/modules/response-unit/enums/response-unit/response-unit-availability.enum.js +27 -0
- package/dist/cjs/modules/response-unit/enums/response-unit/response-unit-availability.enum.js.map +1 -0
- package/dist/cjs/modules/response-unit/index.js +5 -0
- package/dist/cjs/modules/response-unit/index.js.map +1 -1
- package/dist/cjs/modules/response-unit/utils/response-capability.util.js +74 -0
- package/dist/cjs/modules/response-unit/utils/response-capability.util.js.map +1 -0
- package/dist/cjs/modules/response-unit/utils/response-unit-availability.util.js +46 -0
- package/dist/cjs/modules/response-unit/utils/response-unit-availability.util.js.map +1 -0
- package/dist/cjs/modules/role/data/roles.data.js +24 -0
- package/dist/cjs/modules/role/data/roles.data.js.map +1 -1
- package/dist/cjs/modules/sms/constants/sms-templates.config.js +18 -0
- package/dist/cjs/modules/sms/constants/sms-templates.config.js.map +1 -1
- package/dist/cjs/modules/sms/enums/sms-template.enum.js +1 -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 +10 -0
- package/dist/esm/kafka/topics.js.map +1 -1
- package/dist/esm/modules/dispatch/constants/response-unit-dispatch-defaults.const.js +52 -0
- package/dist/esm/modules/dispatch/constants/response-unit-dispatch-defaults.const.js.map +1 -0
- package/dist/esm/modules/dispatch/constants/response-unit-dispatch-kafka.const.js +18 -0
- package/dist/esm/modules/dispatch/constants/response-unit-dispatch-kafka.const.js.map +1 -0
- package/dist/esm/modules/dispatch/dtos/dispatch-response-unit.dto.js +54 -0
- package/dist/esm/modules/dispatch/dtos/dispatch-response-unit.dto.js.map +1 -0
- package/dist/esm/modules/dispatch/dtos/response-unit-dispatch-notification.dto.js +223 -0
- package/dist/esm/modules/dispatch/dtos/response-unit-dispatch-notification.dto.js.map +1 -0
- package/dist/esm/modules/dispatch/dtos/response-unit-dispatch-profile-query.dto.js +57 -0
- package/dist/esm/modules/dispatch/dtos/response-unit-dispatch-profile-query.dto.js.map +1 -0
- package/dist/esm/modules/dispatch/dtos/response-unit-nearby-query.dto.js +62 -0
- package/dist/esm/modules/dispatch/dtos/response-unit-nearby-query.dto.js.map +1 -0
- package/dist/esm/modules/dispatch/dtos/update-response-unit-dispatch-status.dto.js +37 -0
- package/dist/esm/modules/dispatch/dtos/update-response-unit-dispatch-status.dto.js.map +1 -0
- package/dist/esm/modules/dispatch/enums/incident-dispatch-blocker.enum.js +18 -0
- package/dist/esm/modules/dispatch/enums/incident-dispatch-blocker.enum.js.map +1 -0
- package/dist/esm/modules/dispatch/enums/response-capability-requirement-source.enum.js +9 -0
- package/dist/esm/modules/dispatch/enums/response-capability-requirement-source.enum.js.map +1 -0
- package/dist/esm/modules/dispatch/enums/response-unit-capability-match.enum.js +21 -0
- package/dist/esm/modules/dispatch/enums/response-unit-capability-match.enum.js.map +1 -0
- package/dist/esm/modules/dispatch/enums/response-unit-dispatch-constraint.enum.js +31 -0
- package/dist/esm/modules/dispatch/enums/response-unit-dispatch-constraint.enum.js.map +1 -0
- package/dist/esm/modules/dispatch/enums/response-unit-dispatch-error-code.enum.js +23 -0
- package/dist/esm/modules/dispatch/enums/response-unit-dispatch-error-code.enum.js.map +1 -0
- package/dist/esm/modules/dispatch/enums/response-unit-dispatch-notification-failure.enum.js +15 -0
- package/dist/esm/modules/dispatch/enums/response-unit-dispatch-notification-failure.enum.js.map +1 -0
- package/dist/esm/modules/dispatch/enums/response-unit-dispatch-notification-status.enum.js +13 -0
- package/dist/esm/modules/dispatch/enums/response-unit-dispatch-notification-status.enum.js.map +1 -0
- package/dist/esm/modules/dispatch/enums/response-unit-dispatch-status.enum.js +30 -0
- package/dist/esm/modules/dispatch/enums/response-unit-dispatch-status.enum.js.map +1 -0
- package/dist/esm/modules/dispatch/enums/response-unit-dispatch-transition-source.enum.js +13 -0
- package/dist/esm/modules/dispatch/enums/response-unit-dispatch-transition-source.enum.js.map +1 -0
- package/dist/esm/modules/dispatch/enums/response-unit-distance-basis.enum.js +9 -0
- package/dist/esm/modules/dispatch/enums/response-unit-distance-basis.enum.js.map +1 -0
- package/dist/esm/modules/dispatch/enums/response-unit-location-freshness.enum.js +18 -0
- package/dist/esm/modules/dispatch/enums/response-unit-location-freshness.enum.js.map +1 -0
- package/dist/esm/modules/dispatch/enums/response-unit-location-source.enum.js +14 -0
- package/dist/esm/modules/dispatch/enums/response-unit-location-source.enum.js.map +1 -0
- package/dist/esm/modules/dispatch/enums/response-unit-recommendation-reason.enum.js +22 -0
- package/dist/esm/modules/dispatch/enums/response-unit-recommendation-reason.enum.js.map +1 -0
- package/dist/esm/modules/dispatch/enums/response-unit-recommendation-status.enum.js +20 -0
- package/dist/esm/modules/dispatch/enums/response-unit-recommendation-status.enum.js.map +1 -0
- package/dist/esm/modules/dispatch/index.js +37 -0
- package/dist/esm/modules/dispatch/index.js.map +1 -0
- package/dist/esm/modules/dispatch/interfaces/incident-response-unit-dispatch.js +2 -0
- package/dist/esm/modules/dispatch/interfaces/incident-response-unit-dispatch.js.map +1 -0
- package/dist/esm/modules/dispatch/interfaces/response-unit-dispatch-events.js +2 -0
- package/dist/esm/modules/dispatch/interfaces/response-unit-dispatch-events.js.map +1 -0
- package/dist/esm/modules/dispatch/interfaces/response-unit-dispatch-profile.js +2 -0
- package/dist/esm/modules/dispatch/interfaces/response-unit-dispatch-profile.js.map +1 -0
- package/dist/esm/modules/dispatch/interfaces/response-unit-proximity.js +2 -0
- package/dist/esm/modules/dispatch/interfaces/response-unit-proximity.js.map +1 -0
- package/dist/esm/modules/dispatch/interfaces/response-unit-recommendation.js +2 -0
- package/dist/esm/modules/dispatch/interfaces/response-unit-recommendation.js.map +1 -0
- package/dist/esm/modules/dispatch/utils/dispatch-geo.util.js +39 -0
- package/dist/esm/modules/dispatch/utils/dispatch-geo.util.js.map +1 -0
- package/dist/esm/modules/dispatch/utils/incident-dispatchability.util.js +37 -0
- package/dist/esm/modules/dispatch/utils/incident-dispatchability.util.js.map +1 -0
- package/dist/esm/modules/dispatch/utils/response-capability-match.util.js +40 -0
- package/dist/esm/modules/dispatch/utils/response-capability-match.util.js.map +1 -0
- package/dist/esm/modules/dispatch/utils/response-unit-dispatch-event.util.js +15 -0
- package/dist/esm/modules/dispatch/utils/response-unit-dispatch-event.util.js.map +1 -0
- package/dist/esm/modules/dispatch/utils/response-unit-dispatch-status.util.js +42 -0
- package/dist/esm/modules/dispatch/utils/response-unit-dispatch-status.util.js.map +1 -0
- package/dist/esm/modules/incident/dtos/category/create-incident-category.dto.js +10 -1
- package/dist/esm/modules/incident/dtos/category/create-incident-category.dto.js.map +1 -1
- package/dist/esm/modules/incident/dtos/type/create-incident-type.dto.js +10 -1
- package/dist/esm/modules/incident/dtos/type/create-incident-type.dto.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/permission/data/permissions.data.js +8 -0
- package/dist/esm/modules/permission/data/permissions.data.js.map +1 -1
- package/dist/esm/modules/permission/enums/permission-actions.enum.js +13 -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/response-unit/dtos/response-unit/base-response-unit.dto.js +10 -1
- package/dist/esm/modules/response-unit/dtos/response-unit/base-response-unit.dto.js.map +1 -1
- package/dist/esm/modules/response-unit/enums/response-unit/response-capability.enum.js +26 -0
- package/dist/esm/modules/response-unit/enums/response-unit/response-capability.enum.js.map +1 -0
- package/dist/esm/modules/response-unit/enums/response-unit/response-unit-availability.enum.js +24 -0
- package/dist/esm/modules/response-unit/enums/response-unit/response-unit-availability.enum.js.map +1 -0
- package/dist/esm/modules/response-unit/index.js +5 -0
- package/dist/esm/modules/response-unit/index.js.map +1 -1
- package/dist/esm/modules/response-unit/utils/response-capability.util.js +68 -0
- package/dist/esm/modules/response-unit/utils/response-capability.util.js.map +1 -0
- package/dist/esm/modules/response-unit/utils/response-unit-availability.util.js +42 -0
- package/dist/esm/modules/response-unit/utils/response-unit-availability.util.js.map +1 -0
- package/dist/esm/modules/role/data/roles.data.js +24 -0
- package/dist/esm/modules/role/data/roles.data.js.map +1 -1
- package/dist/esm/modules/sms/constants/sms-templates.config.js +18 -0
- package/dist/esm/modules/sms/constants/sms-templates.config.js.map +1 -1
- package/dist/esm/modules/sms/enums/sms-template.enum.js +1 -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 +4 -0
- package/dist/types/modules/dispatch/constants/response-unit-dispatch-defaults.const.d.ts +43 -0
- package/dist/types/modules/dispatch/constants/response-unit-dispatch-kafka.const.d.ts +16 -0
- package/dist/types/modules/dispatch/dtos/dispatch-response-unit.dto.d.ts +20 -0
- package/dist/types/modules/dispatch/dtos/response-unit-dispatch-notification.dto.d.ts +47 -0
- package/dist/types/modules/dispatch/dtos/response-unit-dispatch-profile-query.dto.d.ts +13 -0
- package/dist/types/modules/dispatch/dtos/response-unit-nearby-query.dto.d.ts +15 -0
- package/dist/types/modules/dispatch/dtos/update-response-unit-dispatch-status.dto.d.ts +9 -0
- package/dist/types/modules/dispatch/enums/incident-dispatch-blocker.enum.d.ts +16 -0
- package/dist/types/modules/dispatch/enums/response-capability-requirement-source.enum.d.ts +7 -0
- package/dist/types/modules/dispatch/enums/response-unit-capability-match.enum.d.ts +19 -0
- package/dist/types/modules/dispatch/enums/response-unit-dispatch-constraint.enum.d.ts +27 -0
- package/dist/types/modules/dispatch/enums/response-unit-dispatch-error-code.enum.d.ts +21 -0
- package/dist/types/modules/dispatch/enums/response-unit-dispatch-notification-failure.enum.d.ts +13 -0
- package/dist/types/modules/dispatch/enums/response-unit-dispatch-notification-status.enum.d.ts +11 -0
- package/dist/types/modules/dispatch/enums/response-unit-dispatch-status.enum.d.ts +28 -0
- package/dist/types/modules/dispatch/enums/response-unit-dispatch-transition-source.enum.d.ts +11 -0
- package/dist/types/modules/dispatch/enums/response-unit-distance-basis.enum.d.ts +7 -0
- package/dist/types/modules/dispatch/enums/response-unit-location-freshness.enum.d.ts +16 -0
- package/dist/types/modules/dispatch/enums/response-unit-location-source.enum.d.ts +12 -0
- package/dist/types/modules/dispatch/enums/response-unit-recommendation-reason.enum.d.ts +20 -0
- package/dist/types/modules/dispatch/enums/response-unit-recommendation-status.enum.d.ts +18 -0
- package/dist/types/modules/dispatch/index.d.ts +31 -0
- package/dist/types/modules/dispatch/interfaces/incident-response-unit-dispatch.d.ts +121 -0
- package/dist/types/modules/dispatch/interfaces/response-unit-dispatch-events.d.ts +103 -0
- package/dist/types/modules/dispatch/interfaces/response-unit-dispatch-profile.d.ts +52 -0
- package/dist/types/modules/dispatch/interfaces/response-unit-proximity.d.ts +45 -0
- package/dist/types/modules/dispatch/interfaces/response-unit-recommendation.d.ts +130 -0
- package/dist/types/modules/dispatch/utils/dispatch-geo.util.d.ts +16 -0
- package/dist/types/modules/dispatch/utils/incident-dispatchability.util.d.ts +18 -0
- package/dist/types/modules/dispatch/utils/response-capability-match.util.d.ts +26 -0
- package/dist/types/modules/dispatch/utils/response-unit-dispatch-event.util.d.ts +9 -0
- package/dist/types/modules/dispatch/utils/response-unit-dispatch-status.util.d.ts +16 -0
- package/dist/types/modules/incident/dtos/category/create-incident-category.dto.d.ts +6 -0
- package/dist/types/modules/incident/dtos/type/create-incident-type.dto.d.ts +6 -0
- package/dist/types/modules/incident/enums/incident-actions.enum.d.ts +4 -0
- package/dist/types/modules/incident/intefaces/incident-category.d.ts +6 -0
- package/dist/types/modules/incident/intefaces/incident-type.d.ts +6 -0
- package/dist/types/modules/permission/enums/permission-actions.enum.d.ts +3 -0
- package/dist/types/modules/permission/enums/permissions-module.enum.d.ts +1 -0
- package/dist/types/modules/response-unit/dtos/response-unit/base-response-unit.dto.d.ts +7 -0
- package/dist/types/modules/response-unit/enums/response-unit/response-capability.enum.d.ts +24 -0
- package/dist/types/modules/response-unit/enums/response-unit/response-unit-availability.enum.d.ts +22 -0
- package/dist/types/modules/response-unit/index.d.ts +4 -0
- package/dist/types/modules/response-unit/interfaces/response-unit/response-unit.d.ts +3 -0
- package/dist/types/modules/response-unit/utils/response-capability.util.d.ts +31 -0
- package/dist/types/modules/response-unit/utils/response-unit-availability.util.d.ts +21 -0
- package/dist/types/modules/sms/enums/sms-template.enum.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { TrackingUnitOnlineStatus } from '../../tracking/enums/tracking-unit-online-status.enum';
|
|
2
|
+
/**
|
|
3
|
+
* One live-tracked unit near a point, as clarion-response-tracking answers
|
|
4
|
+
* `GET /tracking/response-units/nearby`.
|
|
5
|
+
*
|
|
6
|
+
* Found through the tracking service's Redis GEO index (maintained on every
|
|
7
|
+
* GPS fix), so the answer never involves reading every unit's state. The
|
|
8
|
+
* distance is great-circle, computed by Redis from the same position the live
|
|
9
|
+
* map shows.
|
|
10
|
+
*/
|
|
11
|
+
export interface ResponseUnitLivePosition {
|
|
12
|
+
responseUnitId: number;
|
|
13
|
+
organizationId: number;
|
|
14
|
+
controlCentreId: number | null;
|
|
15
|
+
latitude: number;
|
|
16
|
+
longitude: number;
|
|
17
|
+
/** Straight-line distance from the query point. */
|
|
18
|
+
distanceMetres: number;
|
|
19
|
+
/** The tracking service's own ONLINE / STALE / OFFLINE classification. */
|
|
20
|
+
status: TrackingUnitOnlineStatus;
|
|
21
|
+
/** When the fix was taken (provider time). */
|
|
22
|
+
eventTime: string;
|
|
23
|
+
/** Seconds between `eventTime` and the moment the answer was produced. */
|
|
24
|
+
ageSeconds: number;
|
|
25
|
+
accuracyMetres: number | null;
|
|
26
|
+
}
|
|
27
|
+
export interface ResponseUnitNearbyResult {
|
|
28
|
+
organizationId: number;
|
|
29
|
+
/** Set when the answer was confined to one control centre. */
|
|
30
|
+
controlCentreId: number | null;
|
|
31
|
+
latitude: number;
|
|
32
|
+
longitude: number;
|
|
33
|
+
radiusMetres: number;
|
|
34
|
+
limit: number;
|
|
35
|
+
generatedAt: string;
|
|
36
|
+
/** Nearest first. */
|
|
37
|
+
units: ResponseUnitLivePosition[];
|
|
38
|
+
/**
|
|
39
|
+
* Units in scope that ARE live-tracked but were not returned - beyond the
|
|
40
|
+
* radius or past the limit. Lets a consumer say "outside the search area"
|
|
41
|
+
* instead of falling back to a base location that would put a moving vehicle
|
|
42
|
+
* back in its depot.
|
|
43
|
+
*/
|
|
44
|
+
outsideSearchUnitIds: number[];
|
|
45
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { ResponseCapability } from '../../response-unit/enums/response-unit/response-capability.enum';
|
|
2
|
+
import { ResponseUnitAvailability } from '../../response-unit/enums/response-unit/response-unit-availability.enum';
|
|
3
|
+
import { IncidentDispatchBlocker } from '../enums/incident-dispatch-blocker.enum';
|
|
4
|
+
import { ResponseCapabilityRequirementSource } from '../enums/response-capability-requirement-source.enum';
|
|
5
|
+
import { ResponseUnitCapabilityMatch } from '../enums/response-unit-capability-match.enum';
|
|
6
|
+
import { ResponseUnitDispatchConstraint } from '../enums/response-unit-dispatch-constraint.enum';
|
|
7
|
+
import { ResponseUnitDistanceBasis } from '../enums/response-unit-distance-basis.enum';
|
|
8
|
+
import { ResponseUnitLocationFreshness } from '../enums/response-unit-location-freshness.enum';
|
|
9
|
+
import { ResponseUnitLocationSource } from '../enums/response-unit-location-source.enum';
|
|
10
|
+
import { ResponseUnitRecommendationReason } from '../enums/response-unit-recommendation-reason.enum';
|
|
11
|
+
import { ResponseUnitRecommendationStatus } from '../enums/response-unit-recommendation-status.enum';
|
|
12
|
+
import { IncidentResponseUnitDispatch } from './incident-response-unit-dispatch';
|
|
13
|
+
/** What the incident needs, and where that came from. */
|
|
14
|
+
export interface ResponseCapabilityRequirement {
|
|
15
|
+
/** A unit with ANY of these is suitable. Empty = no requirement. */
|
|
16
|
+
capabilities: ResponseCapability[];
|
|
17
|
+
source: ResponseCapabilityRequirementSource;
|
|
18
|
+
}
|
|
19
|
+
/** Where a candidate is, and how far that can be trusted. */
|
|
20
|
+
export interface ResponseUnitCandidateLocation {
|
|
21
|
+
source: ResponseUnitLocationSource;
|
|
22
|
+
freshness: ResponseUnitLocationFreshness;
|
|
23
|
+
latitude: number | null;
|
|
24
|
+
longitude: number | null;
|
|
25
|
+
/** When the position was recorded. Null for a base location. */
|
|
26
|
+
recordedAt: string | null;
|
|
27
|
+
/** Age of the position when the recommendation was produced. */
|
|
28
|
+
ageSeconds: number | null;
|
|
29
|
+
accuracyMetres: number | null;
|
|
30
|
+
}
|
|
31
|
+
/** How far, and - when road routing is on - how long. */
|
|
32
|
+
export interface ResponseUnitTravelEstimate {
|
|
33
|
+
distanceMetres: number;
|
|
34
|
+
/** Only for a road route; a straight line has no honest duration. */
|
|
35
|
+
durationSeconds: number | null;
|
|
36
|
+
basis: ResponseUnitDistanceBasis;
|
|
37
|
+
trafficAware: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* One unit, as the dispatcher sees it. The scoring that ordered the list is
|
|
41
|
+
* internal; what is exposed is the facts behind it (`reasons`, distance,
|
|
42
|
+
* freshness, match) - enough for the admin to say why, nothing to reverse-
|
|
43
|
+
* engineer weights from.
|
|
44
|
+
*/
|
|
45
|
+
export interface ResponseUnitCandidate {
|
|
46
|
+
responseUnitId: number;
|
|
47
|
+
name: string;
|
|
48
|
+
responseUnitType: string;
|
|
49
|
+
vehicleType: string | null;
|
|
50
|
+
registrationNumber: string | null;
|
|
51
|
+
controlCentreId: number | null;
|
|
52
|
+
/** The unit belongs to the incident's control centre. */
|
|
53
|
+
sameControlCentre: boolean;
|
|
54
|
+
operationalStatus: string | null;
|
|
55
|
+
availability: ResponseUnitAvailability;
|
|
56
|
+
/** The other incident this unit is out on, when it is ENGAGED by a dispatch. */
|
|
57
|
+
engagedIncidentId: number | null;
|
|
58
|
+
capabilities: ResponseCapability[];
|
|
59
|
+
capabilityMatch: ResponseUnitCapabilityMatch;
|
|
60
|
+
/** The required capabilities this unit has. */
|
|
61
|
+
matchedCapabilities: ResponseCapability[];
|
|
62
|
+
location: ResponseUnitCandidateLocation;
|
|
63
|
+
/** Straight-line distance to the incident; null without a usable position. */
|
|
64
|
+
distanceMetres: number | null;
|
|
65
|
+
/** A road estimate, for the top candidates when routing is enabled. */
|
|
66
|
+
travel: ResponseUnitTravelEstimate | null;
|
|
67
|
+
/** Whether a dispatch SMS could be sent. */
|
|
68
|
+
hasPhoneNumber: boolean;
|
|
69
|
+
/** The server would accept a dispatch of this unit now. */
|
|
70
|
+
dispatchable: boolean;
|
|
71
|
+
/** Dispatchable AND good enough to be suggested. */
|
|
72
|
+
recommendable: boolean;
|
|
73
|
+
/** Why it cannot be dispatched (blockers) and why it is not recommended (cautions). */
|
|
74
|
+
constraints: ResponseUnitDispatchConstraint[];
|
|
75
|
+
/** Why it ranks where it does. Empty for a unit that is not recommendable. */
|
|
76
|
+
reasons: ResponseUnitRecommendationReason[];
|
|
77
|
+
/** 1 = recommended. Null for units outside the recommendable ranking. */
|
|
78
|
+
rank: number | null;
|
|
79
|
+
}
|
|
80
|
+
export interface ResponseUnitRecommendationSummary {
|
|
81
|
+
/** Units in the caller's scope for this incident's organization. */
|
|
82
|
+
configuredUnits: number;
|
|
83
|
+
dispatchableUnits: number;
|
|
84
|
+
recommendableUnits: number;
|
|
85
|
+
engagedUnits: number;
|
|
86
|
+
/** Inactive or operationally unavailable. */
|
|
87
|
+
unavailableUnits: number;
|
|
88
|
+
/** Units with no usable position (offline, never tracked and no base). */
|
|
89
|
+
unitsWithoutLocation: number;
|
|
90
|
+
/** The unit list was capped; some units were not considered. */
|
|
91
|
+
truncated: boolean;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* `GET /incidents/:id/response-unit-recommendation`.
|
|
95
|
+
*
|
|
96
|
+
* Advisory and side-effect free: generating one assigns nothing and reserves
|
|
97
|
+
* nothing. The dispatch command re-evaluates everything when it arrives.
|
|
98
|
+
*/
|
|
99
|
+
export interface ResponseUnitRecommendation {
|
|
100
|
+
incidentId: number;
|
|
101
|
+
organizationId: number;
|
|
102
|
+
controlCentreId: number | null;
|
|
103
|
+
generatedAt: string;
|
|
104
|
+
status: ResponseUnitRecommendationStatus;
|
|
105
|
+
/** Why the incident cannot take a dispatch; empty unless NOT_DISPATCHABLE. */
|
|
106
|
+
incidentBlockers: IncidentDispatchBlocker[];
|
|
107
|
+
requirement: ResponseCapabilityRequirement;
|
|
108
|
+
recommended: ResponseUnitCandidate | null;
|
|
109
|
+
/** Further recommendable units, best first. */
|
|
110
|
+
alternatives: ResponseUnitCandidate[];
|
|
111
|
+
/** Everything else in scope: dispatchable-by-hand first, then blocked. Capped. */
|
|
112
|
+
otherUnits: ResponseUnitCandidate[];
|
|
113
|
+
/** Units already out on THIS incident. */
|
|
114
|
+
activeDispatches: IncidentResponseUnitDispatch[];
|
|
115
|
+
summary: ResponseUnitRecommendationSummary;
|
|
116
|
+
/**
|
|
117
|
+
* False when the incident has no usable location. Nothing can be "nearest"
|
|
118
|
+
* then, so nothing is recommended - every dispatchable unit is listed for the
|
|
119
|
+
* dispatcher to choose from.
|
|
120
|
+
*/
|
|
121
|
+
incidentLocationAvailable: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* False when clarion-response-tracking could not be asked. Live positions are
|
|
124
|
+
* then unknown, so nothing is recommended (a depot location would put moving
|
|
125
|
+
* vehicles back at base); units are listed by base location, labelled as such.
|
|
126
|
+
*/
|
|
127
|
+
liveTrackingAvailable: boolean;
|
|
128
|
+
/** True when road travel times were requested for the top candidates. */
|
|
129
|
+
travelTimeEnabled: boolean;
|
|
130
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Great-circle distance in metres. */
|
|
2
|
+
export declare function haversineMetres(lat1: number, lng1: number, lat2: number, lng2: number): number;
|
|
3
|
+
/**
|
|
4
|
+
* A coordinate worth computing a distance from: finite, in range, and not the
|
|
5
|
+
* (0,0) a form leaves behind when nobody picked a point (Null Island, in the
|
|
6
|
+
* Gulf of Guinea, is where every unset location in the world quietly sits).
|
|
7
|
+
*/
|
|
8
|
+
export declare function isUsableCoordinate(latitude: unknown, longitude: unknown): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Read a {lat,lng} / {latitude,longitude} / {lat,lon} shaped location - the
|
|
11
|
+
* platform stores all three - as a usable coordinate, or null.
|
|
12
|
+
*/
|
|
13
|
+
export declare function readCoordinate(location: unknown): {
|
|
14
|
+
latitude: number;
|
|
15
|
+
longitude: number;
|
|
16
|
+
} | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IncidentStatus } from '../../incident/enums/incident-status.enum';
|
|
2
|
+
import { IncidentDispatchBlocker } from '../enums/incident-dispatch-blocker.enum';
|
|
3
|
+
/** Incident statuses after which nothing is sent to it. */
|
|
4
|
+
export declare const INCIDENT_STATUSES_ENDING_DISPATCH: readonly IncidentStatus[];
|
|
5
|
+
/** The incident facts dispatchability reads. */
|
|
6
|
+
export interface DispatchableIncidentFacts {
|
|
7
|
+
class?: string | null;
|
|
8
|
+
status?: string | null;
|
|
9
|
+
notifyServiceProvider?: boolean | null;
|
|
10
|
+
entitlementTier?: string | null;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Why this incident cannot take a dispatch - empty when it can. Every reason is
|
|
14
|
+
* returned, not just the first, so the admin can say all of it at once.
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveIncidentDispatchBlockers(incident: DispatchableIncidentFacts): IncidentDispatchBlocker[];
|
|
17
|
+
/** Whether an incident status ends every dispatch still active on it. */
|
|
18
|
+
export declare function incidentStatusEndsDispatch(status: string | null | undefined): boolean;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ResponseCapability } from '../../response-unit/enums/response-unit/response-capability.enum';
|
|
2
|
+
import { ResponseUnitCapabilityMatch } from '../enums/response-unit-capability-match.enum';
|
|
3
|
+
import { ResponseCapabilityRequirement } from '../interfaces/response-unit-recommendation';
|
|
4
|
+
/**
|
|
5
|
+
* What an incident needs: its TYPE's list when the type names one, otherwise
|
|
6
|
+
* its CATEGORY's, otherwise nothing. A type's list replaces the category's
|
|
7
|
+
* rather than adding to it - "Road accident with casualties" under a "Traffic"
|
|
8
|
+
* category that asks for roadside assistance must be able to ask for an
|
|
9
|
+
* ambulance instead.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveResponseCapabilityRequirement(type: {
|
|
12
|
+
responseCapabilities?: unknown;
|
|
13
|
+
} | null | undefined, category: {
|
|
14
|
+
responseCapabilities?: unknown;
|
|
15
|
+
} | null | undefined): ResponseCapabilityRequirement;
|
|
16
|
+
export interface ResponseCapabilityMatchResult {
|
|
17
|
+
match: ResponseUnitCapabilityMatch;
|
|
18
|
+
/** The required capabilities the unit has. */
|
|
19
|
+
matched: ResponseCapability[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Compare a unit with a requirement. A unit qualifies with ANY required
|
|
23
|
+
* capability - a requirement is the set of services that would do, not a
|
|
24
|
+
* checklist one vehicle must tick.
|
|
25
|
+
*/
|
|
26
|
+
export declare function matchResponseCapabilities(required: readonly ResponseCapability[], unitCapabilities: readonly ResponseCapability[]): ResponseCapabilityMatchResult;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deterministic event id: the same change always produces the same id, so a
|
|
3
|
+
* consumer that sees one twice (an outbox re-publish, a Kafka redelivery) knows
|
|
4
|
+
* it already handled it. `discriminator` separates changes of the same kind on
|
|
5
|
+
* one dispatch (the target status, the notification attempt number).
|
|
6
|
+
*/
|
|
7
|
+
export declare function buildResponseUnitDispatchEventId(kind: 'created' | 'status-changed' | 'notification-requested' | 'notification-result', dispatchId: number, discriminator?: string | number): string;
|
|
8
|
+
/** An incident as a control room quotes it: `#1234`. */
|
|
9
|
+
export declare function formatIncidentReference(incidentId: number): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ResponseUnitDispatchStatus } from '../enums/response-unit-dispatch-status.enum';
|
|
2
|
+
/**
|
|
3
|
+
* Where a dispatch may go next. Forward only, and steps may be skipped: a crew
|
|
4
|
+
* that radios in "on scene" never said "en route", and refusing to record the
|
|
5
|
+
* truth because a step was missed would leave the record wrong. Nothing leaves
|
|
6
|
+
* COMPLETED or CANCELLED - a unit sent again is a new dispatch, with its own
|
|
7
|
+
* audit trail, not a resurrected one.
|
|
8
|
+
*/
|
|
9
|
+
export declare const RESPONSE_UNIT_DISPATCH_TRANSITIONS: Readonly<Record<ResponseUnitDispatchStatus, readonly ResponseUnitDispatchStatus[]>>;
|
|
10
|
+
export declare function isActiveResponseUnitDispatchStatus(status: string | null | undefined): boolean;
|
|
11
|
+
export declare function isTerminalResponseUnitDispatchStatus(status: string | null | undefined): boolean;
|
|
12
|
+
export declare function canTransitionResponseUnitDispatch(from: ResponseUnitDispatchStatus, to: ResponseUnitDispatchStatus): boolean;
|
|
13
|
+
/** The statuses a dispatch in `from` may be moved to. */
|
|
14
|
+
export declare function nextResponseUnitDispatchStatuses(from: ResponseUnitDispatchStatus): ResponseUnitDispatchStatus[];
|
|
15
|
+
/** The milestone column each status stamps, for the statuses that have one. */
|
|
16
|
+
export declare const RESPONSE_UNIT_DISPATCH_MILESTONE_FIELD: Readonly<Partial<Record<ResponseUnitDispatchStatus, 'acknowledgedAt' | 'enRouteAt' | 'onSceneAt' | 'completedAt' | 'cancelledAt'>>>;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import { ResponseCapability } from "../../../response-unit/enums/response-unit/response-capability.enum";
|
|
1
2
|
export declare class CreateIncidentCategoryDto {
|
|
2
3
|
name: string;
|
|
3
4
|
description?: string;
|
|
4
5
|
organizationId: number;
|
|
6
|
+
/**
|
|
7
|
+
* Response capabilities an incident in this category needs, unless its type names its own; a unit with ANY of them is suitable.
|
|
8
|
+
* Empty or absent = no requirement, so every available unit is suitable.
|
|
9
|
+
*/
|
|
10
|
+
responseCapabilities?: ResponseCapability[];
|
|
5
11
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import { ResponseCapability } from "../../../response-unit/enums/response-unit/response-capability.enum";
|
|
1
2
|
export declare class CreateIncidentTypeDto {
|
|
2
3
|
name: string;
|
|
3
4
|
description?: string;
|
|
4
5
|
categoryId?: number;
|
|
5
6
|
organizationId: number;
|
|
7
|
+
/**
|
|
8
|
+
* Response capabilities an incident of this type needs; a unit with ANY of them is suitable. Overrides the category's requirement.
|
|
9
|
+
* Empty or absent = no requirement, so every available unit is suitable.
|
|
10
|
+
*/
|
|
11
|
+
responseCapabilities?: ResponseCapability[];
|
|
6
12
|
}
|
|
@@ -8,6 +8,10 @@ export declare enum IncidentActions {
|
|
|
8
8
|
AUTO_STOPPED = "Auto-Stopped",
|
|
9
9
|
ASSIGNED = "Assigned",
|
|
10
10
|
RESPONSE_UNIT_ASSIGNED = "Response Unit Assigned",
|
|
11
|
+
/** A unit was dispatched through the dispatch command (recommend + dispatch). */
|
|
12
|
+
RESPONSE_UNIT_DISPATCHED = "Response Unit Dispatched",
|
|
13
|
+
/** A dispatch moved on (acknowledged, en route, on scene, completed, stood down) or its message was reported on. */
|
|
14
|
+
RESPONSE_UNIT_DISPATCH_UPDATED = "Response Unit Dispatch Updated",
|
|
11
15
|
REOPENED = "Reopened",
|
|
12
16
|
REPORT_CREATED = "Report Created",
|
|
13
17
|
COMMENTED = "Commented",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ResponseCapability } from "../../response-unit/enums/response-unit/response-capability.enum";
|
|
1
2
|
import { IncidentType } from "./incident-type";
|
|
2
3
|
export interface IncidentCategory {
|
|
3
4
|
id?: number;
|
|
@@ -14,5 +15,10 @@ export interface IncidentCategory {
|
|
|
14
15
|
* sheet and from package configuration, and not editable or deletable.
|
|
15
16
|
*/
|
|
16
17
|
isSystem?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Response capabilities this kind of incident needs (a unit with ANY of them
|
|
20
|
+
* is suitable). A type's list overrides its category's; empty = no requirement.
|
|
21
|
+
*/
|
|
22
|
+
responseCapabilities?: ResponseCapability[];
|
|
17
23
|
types?: IncidentType[];
|
|
18
24
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ResponseCapability } from "../../response-unit/enums/response-unit/response-capability.enum";
|
|
1
2
|
import { IncidentCategory } from "./incident-category";
|
|
2
3
|
export interface IncidentType {
|
|
3
4
|
id?: number;
|
|
@@ -15,5 +16,10 @@ export interface IncidentType {
|
|
|
15
16
|
* sheet and from package configuration, and not editable or deletable.
|
|
16
17
|
*/
|
|
17
18
|
isSystem?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Response capabilities this kind of incident needs (a unit with ANY of them
|
|
21
|
+
* is suitable). A type's list overrides its category's; empty = no requirement.
|
|
22
|
+
*/
|
|
23
|
+
responseCapabilities?: ResponseCapability[];
|
|
18
24
|
category?: IncidentCategory;
|
|
19
25
|
}
|
|
@@ -95,6 +95,9 @@ export declare enum PermissionActions {
|
|
|
95
95
|
READ_TRACKING_HISTORY = "read:tracking-history",
|
|
96
96
|
READ_TRACKING_OPERATIONS = "read:tracking-operations",
|
|
97
97
|
MANAGE_TRACKING_OPERATIONS = "manage:tracking-operations",
|
|
98
|
+
READ_RESPONSE_UNIT_DISPATCH = "read:response-unit-dispatch",
|
|
99
|
+
CREATE_RESPONSE_UNIT_DISPATCH = "create:response-unit-dispatch",
|
|
100
|
+
UPDATE_RESPONSE_UNIT_DISPATCH = "update:response-unit-dispatch",
|
|
98
101
|
CREATE_BENEFICIARY = "create:beneficiary",
|
|
99
102
|
READ_BENEFICIARY = "read:beneficiary",
|
|
100
103
|
UPDATE_BENEFICIARY = "update:beneficiary",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ResponseUnitType } from "../../enums/response-unit/response-unit-type.enum";
|
|
2
|
+
import { ResponseCapability } from "../../enums/response-unit/response-capability.enum";
|
|
2
3
|
import { MapLocationDto } from "../../../common";
|
|
3
4
|
import { StationDto } from "./station.dto";
|
|
4
5
|
export declare class BaseResponseUnitDto {
|
|
@@ -9,6 +10,12 @@ export declare class BaseResponseUnitDto {
|
|
|
9
10
|
isActive: boolean;
|
|
10
11
|
location: MapLocationDto;
|
|
11
12
|
station: StationDto;
|
|
13
|
+
/**
|
|
14
|
+
* What this unit can respond to. Optional: empty means "whatever the unit's
|
|
15
|
+
* type implies" (an ambulance is MEDICAL_RESPONSE), so a unit only needs
|
|
16
|
+
* this when it differs from its type - see effectiveResponseCapabilities.
|
|
17
|
+
*/
|
|
18
|
+
capabilities?: ResponseCapability[];
|
|
12
19
|
controlCentreId: number;
|
|
13
20
|
organizationId: number;
|
|
14
21
|
createdAt?: Date;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What kind of emergency a response unit can answer.
|
|
3
|
+
*
|
|
4
|
+
* Deliberately the platform's existing vocabulary and nothing more: each value
|
|
5
|
+
* is what one {@link VehicleUnitType} already says about a vehicle (Ambulance,
|
|
6
|
+
* Security, Fire, Road Rescue), named the way {@link PartnerServiceCapability}
|
|
7
|
+
* names the same services for third-party responders. A unit with no explicit
|
|
8
|
+
* capabilities gets these derived from its vehicle type (or a person unit from
|
|
9
|
+
* its category) - see `deriveResponseCapabilities` - so every existing unit is
|
|
10
|
+
* classified on day one without anybody configuring anything.
|
|
11
|
+
*
|
|
12
|
+
* Stored as plain strings (varchar[]) wherever it is persisted, so adding a
|
|
13
|
+
* value here never needs a database migration.
|
|
14
|
+
*/
|
|
15
|
+
export declare enum ResponseCapability {
|
|
16
|
+
/** Ambulances and medical officers. */
|
|
17
|
+
MEDICAL_RESPONSE = "MEDICAL_RESPONSE",
|
|
18
|
+
/** Security response vehicles, patrols and police officers. */
|
|
19
|
+
SECURITY_RESPONSE = "SECURITY_RESPONSE",
|
|
20
|
+
/** Fire and rescue appliances. */
|
|
21
|
+
FIRE_RESPONSE = "FIRE_RESPONSE",
|
|
22
|
+
/** Breakdown, recovery and towing. */
|
|
23
|
+
ROADSIDE_ASSISTANCE = "ROADSIDE_ASSISTANCE"
|
|
24
|
+
}
|
package/dist/types/modules/response-unit/enums/response-unit/response-unit-availability.enum.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Can this unit be sent to an incident right now?
|
|
3
|
+
*
|
|
4
|
+
* Two sources decide it and neither is enough alone:
|
|
5
|
+
*
|
|
6
|
+
* - clarion-organization's MANUAL statuses (`isActive`, `vehicleStatus`,
|
|
7
|
+
* `personStatus`, `teamStatus`) - what somebody set on the unit. Read by
|
|
8
|
+
* `resolveResponseUnitAvailability`.
|
|
9
|
+
* - clarion-incident's ACTIVE DISPATCHES - the authoritative record of a unit
|
|
10
|
+
* being out on a job. A unit with one is ENGAGED whatever its manual status
|
|
11
|
+
* says, and that is enforced by a unique index, not by this enum.
|
|
12
|
+
*/
|
|
13
|
+
export declare enum ResponseUnitAvailability {
|
|
14
|
+
/** On duty / operational, enabled, and not out on a job. */
|
|
15
|
+
AVAILABLE = "AVAILABLE",
|
|
16
|
+
/** Out on a job: an active dispatch, or a manual Engaged / On Mission status. */
|
|
17
|
+
ENGAGED = "ENGAGED",
|
|
18
|
+
/** Enabled but not able to respond: non-operational, off duty, on leave, training. */
|
|
19
|
+
UNAVAILABLE = "UNAVAILABLE",
|
|
20
|
+
/** Switched off in the organization (`isActive = false`). */
|
|
21
|
+
INACTIVE = "INACTIVE"
|
|
22
|
+
}
|
|
@@ -65,3 +65,7 @@ export * from './enums/vehicle-unit/vehicle-type/fire-vehicle-type.enum';
|
|
|
65
65
|
export * from './enums/vehicle-unit/vehicle-crew/fire-vehicle-role.enum';
|
|
66
66
|
export * from './enums/vehicle-unit/vehicle-type/road-rescue-vehicle-type.enum';
|
|
67
67
|
export * from './enums/vehicle-unit/vehicle-crew/road-rescue-vehicle-role.enum';
|
|
68
|
+
export * from './enums/response-unit/response-capability.enum';
|
|
69
|
+
export * from './enums/response-unit/response-unit-availability.enum';
|
|
70
|
+
export * from './utils/response-capability.util';
|
|
71
|
+
export * from './utils/response-unit-availability.util';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { MapAddressDto, MapLocation } from "../../../common";
|
|
2
2
|
import { ResponseUnitType } from "../../enums/response-unit/response-unit-type.enum";
|
|
3
|
+
import { ResponseCapability } from "../../enums/response-unit/response-capability.enum";
|
|
3
4
|
export interface ResponseUnit {
|
|
4
5
|
id: number;
|
|
5
6
|
name: string;
|
|
@@ -11,6 +12,8 @@ export interface ResponseUnit {
|
|
|
11
12
|
name: string;
|
|
12
13
|
address: MapAddressDto;
|
|
13
14
|
};
|
|
15
|
+
/** Configured capabilities; empty means "derived from the unit's type". */
|
|
16
|
+
capabilities?: ResponseCapability[];
|
|
14
17
|
controlCentreId: number;
|
|
15
18
|
organizationId: number;
|
|
16
19
|
createdAt?: Date;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ResponseCapability } from '../enums/response-unit/response-capability.enum';
|
|
2
|
+
/** The most capabilities one unit or one incident type may carry. */
|
|
3
|
+
export declare const MAX_RESPONSE_CAPABILITIES = 10;
|
|
4
|
+
/**
|
|
5
|
+
* Keep only known capabilities, once each, in a stable order.
|
|
6
|
+
*
|
|
7
|
+
* Accepts anything because it reads values back from jsonb, varchar[] and
|
|
8
|
+
* request bodies alike; an unknown value is dropped rather than thrown, so a
|
|
9
|
+
* capability retired from the enum can never make a stored unit unreadable.
|
|
10
|
+
*/
|
|
11
|
+
export declare function normalizeResponseCapabilities(values: unknown): ResponseCapability[];
|
|
12
|
+
/** The parts of a response unit that say what it is. */
|
|
13
|
+
export interface ResponseCapabilitySource {
|
|
14
|
+
/** Configured on the unit. When non-empty it is the whole answer. */
|
|
15
|
+
capabilities?: unknown;
|
|
16
|
+
vehicleType?: string | null;
|
|
17
|
+
/** A person unit's category. */
|
|
18
|
+
category?: string | null;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* What a unit's TYPE says it can do - ignoring anything configured on it.
|
|
22
|
+
* Empty when the type says nothing (a team, a volunteer).
|
|
23
|
+
*/
|
|
24
|
+
export declare function deriveResponseCapabilities(source: ResponseCapabilitySource): ResponseCapability[];
|
|
25
|
+
/**
|
|
26
|
+
* The capabilities a unit is treated as having: what was configured on it when
|
|
27
|
+
* anything was, otherwise what its type implies. Configured capabilities
|
|
28
|
+
* REPLACE the derived ones rather than adding to them - an ambulance that has
|
|
29
|
+
* been re-equipped as a patient-transport-only vehicle must be able to say so.
|
|
30
|
+
*/
|
|
31
|
+
export declare function effectiveResponseCapabilities(source: ResponseCapabilitySource): ResponseCapability[];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ResponseUnitAvailability } from '../enums/response-unit/response-unit-availability.enum';
|
|
2
|
+
/** The manual status fields of a response unit, whichever subtype it is. */
|
|
3
|
+
export interface ResponseUnitStatusSource {
|
|
4
|
+
isActive?: boolean | null;
|
|
5
|
+
vehicleStatus?: string | null;
|
|
6
|
+
personStatus?: string | null;
|
|
7
|
+
teamStatus?: string | null;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Availability from the unit's own MANUAL status - not from dispatches, which
|
|
11
|
+
* clarion-incident layers on top (a unit with an active dispatch is ENGAGED
|
|
12
|
+
* whatever this returns).
|
|
13
|
+
*
|
|
14
|
+
* A missing status is AVAILABLE: a person unit's `personStatus` is nullable and
|
|
15
|
+
* every unit created before statuses existed has none, and refusing to dispatch
|
|
16
|
+
* a unit because nobody filled a field in would make the feature useless for
|
|
17
|
+
* the organizations that configured least.
|
|
18
|
+
*/
|
|
19
|
+
export declare function resolveResponseUnitAvailability(unit: ResponseUnitStatusSource): ResponseUnitAvailability;
|
|
20
|
+
/** The unit's manual operational status as one string, whichever field holds it. */
|
|
21
|
+
export declare function responseUnitOperationalStatus(unit: ResponseUnitStatusSource): string | null;
|
|
@@ -10,6 +10,7 @@ export declare enum SmsTemplateType {
|
|
|
10
10
|
SAFETY_CHECK_GUARDIAN_ENDED = "safety_check_guardian_ended",
|
|
11
11
|
FOLLOW_ME_GUARDIAN_REQUEST = "follow_me_guardian_request",
|
|
12
12
|
FOLLOW_ME_GUARDIAN_ENDED = "follow_me_guardian_ended",
|
|
13
|
+
RESPONSE_UNIT_DISPATCH = "response_unit_dispatch",
|
|
13
14
|
APPOINTMENT_REMINDER = "appointment_reminder",
|
|
14
15
|
GENERAL_NOTIFICATION = "general_notification"
|
|
15
16
|
}
|