grm-shared-library 1.1.236 → 1.1.238
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 -345
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/kafka/topics.js +21 -0
- package/dist/cjs/kafka/topics.js.map +1 -1
- package/dist/cjs/modules/dispatch/constants/response-unit-dispatch-defaults.const.js +56 -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 +235 -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 +42 -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 +39 -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 +18 -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 +53 -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 +8 -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 +86 -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 +19 -0
- package/dist/cjs/modules/permission/data/permissions.data.js.map +1 -1
- package/dist/cjs/modules/permission/enums/permission-actions.enum.js +34 -0
- package/dist/cjs/modules/permission/enums/permission-actions.enum.js.map +1 -1
- package/dist/cjs/modules/permission/enums/permissions-module.enum.js +2 -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 +61 -0
- package/dist/cjs/modules/role/data/roles.data.js.map +1 -1
- package/dist/cjs/modules/sms/constants/sms-templates.config.js +44 -0
- package/dist/cjs/modules/sms/constants/sms-templates.config.js.map +1 -1
- package/dist/cjs/modules/sms/enums/sms-template.enum.js +3 -0
- package/dist/cjs/modules/sms/enums/sms-template.enum.js.map +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/kafka/topics.js +21 -0
- package/dist/esm/kafka/topics.js.map +1 -1
- package/dist/esm/modules/dispatch/constants/response-unit-dispatch-defaults.const.js +53 -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 +228 -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 +38 -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 +36 -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 +15 -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 +46 -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 +8 -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 +82 -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 +19 -0
- package/dist/esm/modules/permission/data/permissions.data.js.map +1 -1
- package/dist/esm/modules/permission/enums/permission-actions.enum.js +34 -0
- package/dist/esm/modules/permission/enums/permission-actions.enum.js.map +1 -1
- package/dist/esm/modules/permission/enums/permissions-module.enum.js +2 -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 +61 -0
- package/dist/esm/modules/role/data/roles.data.js.map +1 -1
- package/dist/esm/modules/sms/constants/sms-templates.config.js +44 -0
- package/dist/esm/modules/sms/constants/sms-templates.config.js.map +1 -1
- package/dist/esm/modules/sms/enums/sms-template.enum.js +3 -0
- package/dist/esm/modules/sms/enums/sms-template.enum.js.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/kafka/topics.d.ts +9 -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 +48 -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 +34 -0
- package/dist/types/modules/dispatch/enums/response-unit-dispatch-transition-source.enum.d.ts +13 -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 +126 -0
- package/dist/types/modules/dispatch/interfaces/response-unit-dispatch-events.d.ts +105 -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 +8 -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/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 +15 -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 +35 -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 +9 -0
- package/dist/types/modules/permission/enums/permissions-module.enum.d.ts +3 -1
- 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 +3 -0
- package/package.json +72 -72
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where one response unit is in answering one incident.
|
|
3
|
+
*
|
|
4
|
+
* Only DISPATCHED is set by the dispatch command itself. The middle states exist
|
|
5
|
+
* so the record can be advanced by whoever learns of progress - a dispatcher
|
|
6
|
+
* relaying a radio call today, the responder app or clarion-workflow later -
|
|
7
|
+
* without a schema change. Nothing in this platform advances them on a timer:
|
|
8
|
+
* escalation, reassignment and SLA belong to the workflow layer.
|
|
9
|
+
*
|
|
10
|
+
* ACTIVE = DISPATCHED, ACKNOWLEDGED, EN_ROUTE, ON_SCENE. A unit may hold at most
|
|
11
|
+
* ONE active dispatch across every incident - a partial unique index in
|
|
12
|
+
* clarion-incident enforces it, which is what stops two dispatchers sending the
|
|
13
|
+
* same unit to two emergencies.
|
|
14
|
+
*/
|
|
15
|
+
export declare enum ResponseUnitDispatchStatus {
|
|
16
|
+
/** Sent: the command was accepted and the unit was asked to respond. */
|
|
17
|
+
DISPATCHED = "DISPATCHED",
|
|
18
|
+
/** The unit confirmed it received the job. */
|
|
19
|
+
ACKNOWLEDGED = "ACKNOWLEDGED",
|
|
20
|
+
/** On the way. */
|
|
21
|
+
EN_ROUTE = "EN_ROUTE",
|
|
22
|
+
/** Arrived at the incident. */
|
|
23
|
+
ON_SCENE = "ON_SCENE",
|
|
24
|
+
/** Finished - by the dispatcher, or because the incident itself ended. */
|
|
25
|
+
COMPLETED = "COMPLETED",
|
|
26
|
+
/** Stood down before finishing. Frees the unit. */
|
|
27
|
+
CANCELLED = "CANCELLED",
|
|
28
|
+
/**
|
|
29
|
+
* The unit declined the job (before or just after acknowledging it). Frees
|
|
30
|
+
* the unit, like CANCELLED, but says the unit said no - which is what the
|
|
31
|
+
* emergency workflow reacts to by recommending the next unit.
|
|
32
|
+
*/
|
|
33
|
+
REJECTED = "REJECTED"
|
|
34
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Who moved a dispatch to its current status. Recorded for the audit trail. */
|
|
2
|
+
export declare enum ResponseUnitDispatchTransitionSource {
|
|
3
|
+
/** A control-room user, through the admin or the API. */
|
|
4
|
+
DISPATCHER = "DISPATCHER",
|
|
5
|
+
/** The incident ended (resolved, closed...), so its active dispatches were completed. */
|
|
6
|
+
INCIDENT_LIFECYCLE = "INCIDENT_LIFECYCLE",
|
|
7
|
+
/** Reserved for the responder app. */
|
|
8
|
+
RESPONDER = "RESPONDER",
|
|
9
|
+
/** clarion-workflow-manager's emergency incident workflow (e.g. an automatic reassignment). */
|
|
10
|
+
WORKFLOW = "WORKFLOW",
|
|
11
|
+
/** Inferred from live tracking: the unit stayed inside the incident's arrival geofence. */
|
|
12
|
+
TRACKING = "TRACKING"
|
|
13
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** What a candidate's distance (and duration, when present) measures. */
|
|
2
|
+
export declare enum ResponseUnitDistanceBasis {
|
|
3
|
+
/** Great-circle distance. Always available, never a duration. */
|
|
4
|
+
STRAIGHT_LINE = "STRAIGHT_LINE",
|
|
5
|
+
/** A road route from clarion-gis (Google Routes), with a travel time. */
|
|
6
|
+
ROAD_ROUTE = "ROAD_ROUTE"
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How far a candidate's position can be trusted.
|
|
3
|
+
*
|
|
4
|
+
* Not a new set of thresholds: CURRENT and STALE are clarion-response-tracking's
|
|
5
|
+
* own ONLINE / STALE status, which it evaluates against each provider
|
|
6
|
+
* connection's configured staleAfterSeconds / offlineAfterSeconds. A unit the
|
|
7
|
+
* tracking service calls OFFLINE has no usable position here (UNKNOWN).
|
|
8
|
+
*/
|
|
9
|
+
export declare enum ResponseUnitLocationFreshness {
|
|
10
|
+
/** A live fix within the provider's stale threshold. */
|
|
11
|
+
CURRENT = "CURRENT",
|
|
12
|
+
/** A live fix older than the stale threshold but not yet offline. */
|
|
13
|
+
STALE = "STALE",
|
|
14
|
+
/** No live fix that can be relied on: offline, never tracked, or base-only. */
|
|
15
|
+
UNKNOWN = "UNKNOWN"
|
|
16
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Where a candidate's position came from. */
|
|
2
|
+
export declare enum ResponseUnitLocationSource {
|
|
3
|
+
/** A GPS fix from clarion-response-tracking. */
|
|
4
|
+
LIVE = "LIVE",
|
|
5
|
+
/**
|
|
6
|
+
* The unit's configured base location in clarion-organization - used only
|
|
7
|
+
* for a unit that is not live-tracked at all, and always labelled as such.
|
|
8
|
+
*/
|
|
9
|
+
BASE = "BASE",
|
|
10
|
+
/** No usable position. */
|
|
11
|
+
NONE = "NONE"
|
|
12
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The facts a recommendation rests on, in the order the ranking weighs them.
|
|
3
|
+
* The admin turns these into the "Recommended because:" lines; the numbers
|
|
4
|
+
* behind them (distance, age) travel on the candidate itself.
|
|
5
|
+
*/
|
|
6
|
+
export declare enum ResponseUnitRecommendationReason {
|
|
7
|
+
AVAILABLE = "AVAILABLE",
|
|
8
|
+
CAPABILITY_MATCH = "CAPABILITY_MATCH",
|
|
9
|
+
NO_CAPABILITY_REQUIREMENT = "NO_CAPABILITY_REQUIREMENT",
|
|
10
|
+
CAPABILITY_UNKNOWN = "CAPABILITY_UNKNOWN",
|
|
11
|
+
SAME_CONTROL_CENTRE = "SAME_CONTROL_CENTRE",
|
|
12
|
+
OTHER_CONTROL_CENTRE = "OTHER_CONTROL_CENTRE",
|
|
13
|
+
LIVE_LOCATION_CURRENT = "LIVE_LOCATION_CURRENT",
|
|
14
|
+
LIVE_LOCATION_STALE = "LIVE_LOCATION_STALE",
|
|
15
|
+
BASE_LOCATION = "BASE_LOCATION",
|
|
16
|
+
/** Closest of the units that tie on everything above. */
|
|
17
|
+
NEAREST = "NEAREST",
|
|
18
|
+
/** Quickest by road of the units that tie on everything above. */
|
|
19
|
+
QUICKEST = "QUICKEST"
|
|
20
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The overall answer. NO_UNITS_CONFIGURED and NO_ELIGIBLE_UNITS are different
|
|
3
|
+
* operational facts and the admin treats them differently: the first hides the
|
|
4
|
+
* whole dispatch panel (this control room simply has no units), the second is
|
|
5
|
+
* an alarm (it has units and none can go).
|
|
6
|
+
*/
|
|
7
|
+
export declare enum ResponseUnitRecommendationStatus {
|
|
8
|
+
/** A unit is recommended. */
|
|
9
|
+
RECOMMENDED = "RECOMMENDED",
|
|
10
|
+
/** Some units can be dispatched by hand, but none qualifies for a recommendation. */
|
|
11
|
+
NO_RECOMMENDATION = "NO_RECOMMENDATION",
|
|
12
|
+
/** Units exist and none of them can be dispatched. */
|
|
13
|
+
NO_ELIGIBLE_UNITS = "NO_ELIGIBLE_UNITS",
|
|
14
|
+
/** The caller's scope holds no response units at all. */
|
|
15
|
+
NO_UNITS_CONFIGURED = "NO_UNITS_CONFIGURED",
|
|
16
|
+
/** The incident itself cannot take a dispatch (see the blockers). */
|
|
17
|
+
NOT_DISPATCHABLE = "NOT_DISPATCHABLE"
|
|
18
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export * from './enums/response-unit-dispatch-status.enum';
|
|
2
|
+
export * from './enums/response-unit-dispatch-transition-source.enum';
|
|
3
|
+
export * from './enums/response-unit-capability-match.enum';
|
|
4
|
+
export * from './enums/response-capability-requirement-source.enum';
|
|
5
|
+
export * from './enums/response-unit-location-source.enum';
|
|
6
|
+
export * from './enums/response-unit-location-freshness.enum';
|
|
7
|
+
export * from './enums/response-unit-distance-basis.enum';
|
|
8
|
+
export * from './enums/response-unit-dispatch-constraint.enum';
|
|
9
|
+
export * from './enums/response-unit-recommendation-reason.enum';
|
|
10
|
+
export * from './enums/response-unit-recommendation-status.enum';
|
|
11
|
+
export * from './enums/incident-dispatch-blocker.enum';
|
|
12
|
+
export * from './enums/response-unit-dispatch-notification-status.enum';
|
|
13
|
+
export * from './enums/response-unit-dispatch-notification-failure.enum';
|
|
14
|
+
export * from './enums/response-unit-dispatch-error-code.enum';
|
|
15
|
+
export * from './interfaces/response-unit-dispatch-profile';
|
|
16
|
+
export * from './interfaces/response-unit-proximity';
|
|
17
|
+
export * from './interfaces/response-unit-recommendation';
|
|
18
|
+
export * from './interfaces/incident-response-unit-dispatch';
|
|
19
|
+
export * from './interfaces/response-unit-dispatch-events';
|
|
20
|
+
export * from './constants/response-unit-dispatch-kafka.const';
|
|
21
|
+
export * from './constants/response-unit-dispatch-defaults.const';
|
|
22
|
+
export * from './dtos/dispatch-response-unit.dto';
|
|
23
|
+
export * from './dtos/update-response-unit-dispatch-status.dto';
|
|
24
|
+
export * from './dtos/response-unit-nearby-query.dto';
|
|
25
|
+
export * from './dtos/response-unit-dispatch-profile-query.dto';
|
|
26
|
+
export * from './dtos/response-unit-dispatch-notification.dto';
|
|
27
|
+
export * from './utils/response-unit-dispatch-status.util';
|
|
28
|
+
export * from './utils/response-capability-match.util';
|
|
29
|
+
export * from './utils/incident-dispatchability.util';
|
|
30
|
+
export * from './utils/dispatch-geo.util';
|
|
31
|
+
export * from './utils/response-unit-dispatch-event.util';
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { IncidentArrivalSource } from '../../incident-sla/enums/incident-closure.enum';
|
|
2
|
+
import { ResponseCapability } from '../../response-unit/enums/response-unit/response-capability.enum';
|
|
3
|
+
import { ResponseUnitAvailability } from '../../response-unit/enums/response-unit/response-unit-availability.enum';
|
|
4
|
+
import { ResponseCapabilityRequirementSource } from '../enums/response-capability-requirement-source.enum';
|
|
5
|
+
import { ResponseUnitCapabilityMatch } from '../enums/response-unit-capability-match.enum';
|
|
6
|
+
import { ResponseUnitDispatchNotificationFailure } from '../enums/response-unit-dispatch-notification-failure.enum';
|
|
7
|
+
import { ResponseUnitDispatchNotificationStatus } from '../enums/response-unit-dispatch-notification-status.enum';
|
|
8
|
+
import { ResponseUnitDispatchStatus } from '../enums/response-unit-dispatch-status.enum';
|
|
9
|
+
import { ResponseUnitDispatchTransitionSource } from '../enums/response-unit-dispatch-transition-source.enum';
|
|
10
|
+
import { ResponseUnitLocationFreshness } from '../enums/response-unit-location-freshness.enum';
|
|
11
|
+
import { ResponseUnitLocationSource } from '../enums/response-unit-location-source.enum';
|
|
12
|
+
import { ResponseUnitRecommendationStatus } from '../enums/response-unit-recommendation-status.enum';
|
|
13
|
+
/** The selected unit as it stood when it was dispatched - frozen for the audit. */
|
|
14
|
+
export interface ResponseUnitDispatchUnitSnapshot {
|
|
15
|
+
availability: ResponseUnitAvailability;
|
|
16
|
+
operationalStatus: string | null;
|
|
17
|
+
capabilities: ResponseCapability[];
|
|
18
|
+
capabilityMatch: ResponseUnitCapabilityMatch;
|
|
19
|
+
sameControlCentre: boolean;
|
|
20
|
+
locationSource: ResponseUnitLocationSource;
|
|
21
|
+
locationFreshness: ResponseUnitLocationFreshness;
|
|
22
|
+
locationRecordedAt: string | null;
|
|
23
|
+
locationAgeSeconds: number | null;
|
|
24
|
+
distanceMetres: number | null;
|
|
25
|
+
hasPhoneNumber: boolean;
|
|
26
|
+
}
|
|
27
|
+
/** One ranked alternative, as it stood at dispatch time. */
|
|
28
|
+
export interface ResponseUnitDispatchSnapshotCandidate {
|
|
29
|
+
responseUnitId: number;
|
|
30
|
+
rank: number;
|
|
31
|
+
distanceMetres: number | null;
|
|
32
|
+
capabilityMatch: ResponseUnitCapabilityMatch;
|
|
33
|
+
locationFreshness: ResponseUnitLocationFreshness;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The recommendation the SERVER computed at the moment it accepted the
|
|
37
|
+
* dispatch. Recomputed rather than taken from the client, so "was the selected
|
|
38
|
+
* unit the recommended one?" is a fact, not a claim.
|
|
39
|
+
*/
|
|
40
|
+
export interface ResponseUnitDispatchRecommendationSnapshot {
|
|
41
|
+
generatedAt: string;
|
|
42
|
+
status: ResponseUnitRecommendationStatus;
|
|
43
|
+
recommendedResponseUnitId: number | null;
|
|
44
|
+
/** The recommended unit first, then the alternatives, capped. */
|
|
45
|
+
ranked: ResponseUnitDispatchSnapshotCandidate[];
|
|
46
|
+
requiredCapabilities: ResponseCapability[];
|
|
47
|
+
requirementSource: ResponseCapabilityRequirementSource;
|
|
48
|
+
liveTrackingAvailable: boolean;
|
|
49
|
+
}
|
|
50
|
+
/** Where the dispatch message stands. */
|
|
51
|
+
export interface ResponseUnitDispatchNotificationState {
|
|
52
|
+
channel: 'SMS';
|
|
53
|
+
status: ResponseUnitDispatchNotificationStatus;
|
|
54
|
+
failureReason: ResponseUnitDispatchNotificationFailure | null;
|
|
55
|
+
/** Masked (+2547******78). The full number is never stored on the dispatch. */
|
|
56
|
+
recipient: string | null;
|
|
57
|
+
/** How many times it was requested (1 + resends). */
|
|
58
|
+
attempts: number;
|
|
59
|
+
requestedAt: string | null;
|
|
60
|
+
/** When clarion-notification last reported on it. */
|
|
61
|
+
resultAt: string | null;
|
|
62
|
+
providerCode: string | null;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* One response unit sent to one incident. The authoritative dispatch record,
|
|
66
|
+
* owned by clarion-incident - and the engagement record: a unit is out on a job
|
|
67
|
+
* exactly while it has a dispatch in an ACTIVE status.
|
|
68
|
+
*
|
|
69
|
+
* Channel-neutral on purpose: the admin reads it today, the responder app and
|
|
70
|
+
* clarion-workflow can read the same record (and the events built from it)
|
|
71
|
+
* tomorrow.
|
|
72
|
+
*/
|
|
73
|
+
export interface IncidentResponseUnitDispatch {
|
|
74
|
+
id: number;
|
|
75
|
+
/** Stable external identifier (uuid), safe to quote in a call or a ticket. */
|
|
76
|
+
reference: string;
|
|
77
|
+
incidentId: number;
|
|
78
|
+
organizationId: number;
|
|
79
|
+
/** The incident's control centre. */
|
|
80
|
+
controlCentreId: number | null;
|
|
81
|
+
responseUnitId: number;
|
|
82
|
+
/** Copied at dispatch time so the record survives the unit being renamed or deleted. */
|
|
83
|
+
responseUnitName: string;
|
|
84
|
+
responseUnitType: string | null;
|
|
85
|
+
responseUnitControlCentreId: number | null;
|
|
86
|
+
status: ResponseUnitDispatchStatus;
|
|
87
|
+
dispatchedByUserId: number;
|
|
88
|
+
dispatchedAt: string;
|
|
89
|
+
/** The server's recommendation at dispatch time named this unit. */
|
|
90
|
+
wasRecommended: boolean;
|
|
91
|
+
/** The unit the server would have recommended at dispatch time. */
|
|
92
|
+
recommendedResponseUnitId: number | null;
|
|
93
|
+
/** The unit the dispatcher's screen showed as recommended (as reported by the client). */
|
|
94
|
+
shownRecommendedResponseUnitId: number | null;
|
|
95
|
+
/** Optional words from a dispatcher who chose another unit. */
|
|
96
|
+
overrideReason: string | null;
|
|
97
|
+
notes: string | null;
|
|
98
|
+
distanceMetres: number | null;
|
|
99
|
+
unitSnapshot: ResponseUnitDispatchUnitSnapshot;
|
|
100
|
+
recommendationSnapshot: ResponseUnitDispatchRecommendationSnapshot | null;
|
|
101
|
+
statusChangedAt: string;
|
|
102
|
+
statusChangedByUserId: number | null;
|
|
103
|
+
statusSource: ResponseUnitDispatchTransitionSource;
|
|
104
|
+
statusReason: string | null;
|
|
105
|
+
acknowledgedAt: string | null;
|
|
106
|
+
enRouteAt: string | null;
|
|
107
|
+
onSceneAt: string | null;
|
|
108
|
+
completedAt: string | null;
|
|
109
|
+
cancelledAt: string | null;
|
|
110
|
+
/** When the unit declined (REJECTED). */
|
|
111
|
+
rejectedAt: string | null;
|
|
112
|
+
/** How the arrival on scene came to be known; null until it did. */
|
|
113
|
+
arrivalSource: IncidentArrivalSource | null;
|
|
114
|
+
notification: ResponseUnitDispatchNotificationState;
|
|
115
|
+
createdAt: string;
|
|
116
|
+
updatedAt: string;
|
|
117
|
+
}
|
|
118
|
+
/** `POST /incidents/:id/response-unit-dispatches`. */
|
|
119
|
+
export interface DispatchResponseUnitResult {
|
|
120
|
+
dispatch: IncidentResponseUnitDispatch;
|
|
121
|
+
/**
|
|
122
|
+
* True when this request repeated an earlier one (same Idempotency-Key) and
|
|
123
|
+
* the EXISTING dispatch is returned - nothing was dispatched or sent again.
|
|
124
|
+
*/
|
|
125
|
+
replayed: boolean;
|
|
126
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { ResponseUnitDispatchNotificationFailure } from '../enums/response-unit-dispatch-notification-failure.enum';
|
|
2
|
+
import { ResponseUnitDispatchNotificationStatus } from '../enums/response-unit-dispatch-notification-status.enum';
|
|
3
|
+
import { ResponseUnitDispatchStatus } from '../enums/response-unit-dispatch-status.enum';
|
|
4
|
+
import { ResponseUnitDispatchTransitionSource } from '../enums/response-unit-dispatch-transition-source.enum';
|
|
5
|
+
/** Fields every dispatch event carries. */
|
|
6
|
+
export interface ResponseUnitDispatchEventBase {
|
|
7
|
+
schemaVersion: 1;
|
|
8
|
+
/** Deterministic per (dispatch, change) so a redelivery can be recognised. */
|
|
9
|
+
eventId: string;
|
|
10
|
+
occurredAt: string;
|
|
11
|
+
dispatchId: number;
|
|
12
|
+
dispatchReference: string;
|
|
13
|
+
incidentId: number;
|
|
14
|
+
organizationId: number;
|
|
15
|
+
controlCentreId: number | null;
|
|
16
|
+
responseUnitId: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* `incident.response-unit-dispatch.created.v1` - a unit was sent to an incident.
|
|
20
|
+
*
|
|
21
|
+
* Identifiers and decisions only: no names, numbers or addresses. Every future
|
|
22
|
+
* consumer (clarion-workflow, the responder app's backend, analytics, audit)
|
|
23
|
+
* reads it; the few that need the incident's details look them up by id with
|
|
24
|
+
* their own authorization.
|
|
25
|
+
*/
|
|
26
|
+
export interface IncidentResponseUnitDispatchedEventV1 extends ResponseUnitDispatchEventBase {
|
|
27
|
+
status: ResponseUnitDispatchStatus.DISPATCHED;
|
|
28
|
+
responseUnitControlCentreId: number | null;
|
|
29
|
+
dispatchedByUserId: number;
|
|
30
|
+
dispatchedAt: string;
|
|
31
|
+
wasRecommended: boolean;
|
|
32
|
+
recommendedResponseUnitId: number | null;
|
|
33
|
+
distanceMetres: number | null;
|
|
34
|
+
notificationStatus: ResponseUnitDispatchNotificationStatus;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* `incident.response-unit-dispatch.status-changed.v1` - acknowledged, en route,
|
|
38
|
+
* on scene, completed or stood down. Ordered per incident (keyed by incident id).
|
|
39
|
+
*/
|
|
40
|
+
export interface IncidentResponseUnitDispatchStatusChangedEventV1 extends ResponseUnitDispatchEventBase {
|
|
41
|
+
previousStatus: ResponseUnitDispatchStatus;
|
|
42
|
+
status: ResponseUnitDispatchStatus;
|
|
43
|
+
source: ResponseUnitDispatchTransitionSource;
|
|
44
|
+
changedByUserId: number | null;
|
|
45
|
+
reason: string | null;
|
|
46
|
+
}
|
|
47
|
+
/** The incident facts a dispatch message is written from. */
|
|
48
|
+
export interface ResponseUnitDispatchMessageIncident {
|
|
49
|
+
/** As the control room quotes it, e.g. `#1234`. */
|
|
50
|
+
reference: string;
|
|
51
|
+
typeName: string | null;
|
|
52
|
+
categoryName: string | null;
|
|
53
|
+
priority: string | null;
|
|
54
|
+
/** The description, clamped. */
|
|
55
|
+
summary: string | null;
|
|
56
|
+
address: string | null;
|
|
57
|
+
latitude: number | null;
|
|
58
|
+
longitude: number | null;
|
|
59
|
+
/** Null when the reporter is anonymous. */
|
|
60
|
+
reporterName: string | null;
|
|
61
|
+
/** Null when the reporter is anonymous or left none. */
|
|
62
|
+
reporterPhoneNumber: string | null;
|
|
63
|
+
anonymous: boolean;
|
|
64
|
+
/** When the incident was raised (ISO-8601). Optional: older producers do not send it. */
|
|
65
|
+
reportedAt?: string | null;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* `incident.response-unit-dispatch.notification-requested.v1` - a COMMAND to
|
|
69
|
+
* clarion-notification: tell this unit it has been dispatched.
|
|
70
|
+
*
|
|
71
|
+
* Kept apart from the domain event on purpose. It is the one message that needs
|
|
72
|
+
* the unit's phone number and the incident's details (an SMS cannot be written
|
|
73
|
+
* from identifiers), and it goes to one consumer; the domain event goes to
|
|
74
|
+
* everyone and carries neither. Self-contained so the message can be sent even
|
|
75
|
+
* when clarion-incident is down - an SMS that waits on a lookup is an SMS that
|
|
76
|
+
* arrives after the unit should have left.
|
|
77
|
+
*/
|
|
78
|
+
export interface ResponseUnitDispatchNotificationRequestedEventV1 extends ResponseUnitDispatchEventBase {
|
|
79
|
+
/** 1 for the dispatch itself, then 2, 3... for each "send again". */
|
|
80
|
+
attempt: number;
|
|
81
|
+
/** For organization branding and sender resolution. */
|
|
82
|
+
appId: string | null;
|
|
83
|
+
recipient: {
|
|
84
|
+
/** E.164. */
|
|
85
|
+
phoneNumber: string;
|
|
86
|
+
responseUnitName: string;
|
|
87
|
+
};
|
|
88
|
+
incident: ResponseUnitDispatchMessageIncident;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* `notification.response-unit-dispatch.notification-result.v1` - what became of
|
|
92
|
+
* one request. clarion-incident records it on the dispatch.
|
|
93
|
+
*/
|
|
94
|
+
export interface ResponseUnitDispatchNotificationResultEventV1 {
|
|
95
|
+
schemaVersion: 1;
|
|
96
|
+
eventId: string;
|
|
97
|
+
occurredAt: string;
|
|
98
|
+
dispatchId: number;
|
|
99
|
+
incidentId: number;
|
|
100
|
+
organizationId: number;
|
|
101
|
+
attempt: number;
|
|
102
|
+
status: ResponseUnitDispatchNotificationStatus;
|
|
103
|
+
failureReason: ResponseUnitDispatchNotificationFailure | null;
|
|
104
|
+
providerCode: string | null;
|
|
105
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
/**
|
|
4
|
+
* A response unit as dispatch sees it: the slim, authoritative row
|
|
5
|
+
* clarion-organization serves from `GET /response-units/dispatch-profiles`.
|
|
6
|
+
*
|
|
7
|
+
* Everything the recommendation engine needs to decide "could this unit go?"
|
|
8
|
+
* and nothing it does not - no crew, no device, no address book. The phone
|
|
9
|
+
* number is present ONLY when the caller asked for contact details (the
|
|
10
|
+
* dispatch command, never a recommendation), already in E.164 for the
|
|
11
|
+
* organization's country so clarion-notification can route it without
|
|
12
|
+
* guessing.
|
|
13
|
+
*/
|
|
14
|
+
export interface ResponseUnitDispatchProfile {
|
|
15
|
+
responseUnitId: number;
|
|
16
|
+
organizationId: number;
|
|
17
|
+
controlCentreId: number | null;
|
|
18
|
+
name: string;
|
|
19
|
+
/** `Vehicle` / `Person` / `Team`. */
|
|
20
|
+
responseUnitType: string;
|
|
21
|
+
/** `Ambulance` / `Security` / `Fire` / `Road Rescue` for vehicles; null otherwise. */
|
|
22
|
+
vehicleType: string | null;
|
|
23
|
+
registrationNumber: string | null;
|
|
24
|
+
isActive: boolean;
|
|
25
|
+
/** The manual status, whichever subtype field holds it (`Operational`, `On Duty`...). */
|
|
26
|
+
operationalStatus: string | null;
|
|
27
|
+
/** From the manual status only - clarion-incident layers active dispatches on top. */
|
|
28
|
+
availability: ResponseUnitAvailability;
|
|
29
|
+
/** The capabilities the unit is treated as having (configured, else derived from its type). */
|
|
30
|
+
capabilities: ResponseCapability[];
|
|
31
|
+
/** True when `capabilities` was configured on the unit rather than derived. */
|
|
32
|
+
capabilitiesConfigured: boolean;
|
|
33
|
+
/** The unit's configured base position; null when unset or obviously invalid (0,0). */
|
|
34
|
+
baseLocation: {
|
|
35
|
+
latitude: number;
|
|
36
|
+
longitude: number;
|
|
37
|
+
} | null;
|
|
38
|
+
stationName: string | null;
|
|
39
|
+
/** Whether a dispatch SMS could be sent at all. */
|
|
40
|
+
hasPhoneNumber: boolean;
|
|
41
|
+
/** E.164. Present only with `includeContact=true`. */
|
|
42
|
+
phoneNumber?: string | null;
|
|
43
|
+
}
|
|
44
|
+
/** One page of dispatch profiles - in practice the whole scope, capped. */
|
|
45
|
+
export interface ResponseUnitDispatchProfileList {
|
|
46
|
+
organizationId: number;
|
|
47
|
+
/** Every unit in the caller's scope, before the cap. */
|
|
48
|
+
total: number;
|
|
49
|
+
units: ResponseUnitDispatchProfile[];
|
|
50
|
+
/** True when `total` exceeded the cap and `units` is the first slice. */
|
|
51
|
+
truncated: boolean;
|
|
52
|
+
}
|
|
@@ -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;
|