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.
Files changed (407) hide show
  1. package/README.md +369 -345
  2. package/dist/cjs/index.js +2 -0
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/kafka/topics.js +21 -0
  5. package/dist/cjs/kafka/topics.js.map +1 -1
  6. package/dist/cjs/modules/dispatch/constants/response-unit-dispatch-defaults.const.js +56 -0
  7. package/dist/cjs/modules/dispatch/constants/response-unit-dispatch-defaults.const.js.map +1 -0
  8. package/dist/cjs/modules/dispatch/constants/response-unit-dispatch-kafka.const.js +21 -0
  9. package/dist/cjs/modules/dispatch/constants/response-unit-dispatch-kafka.const.js.map +1 -0
  10. package/dist/cjs/modules/dispatch/dtos/dispatch-response-unit.dto.js +58 -0
  11. package/dist/cjs/modules/dispatch/dtos/dispatch-response-unit.dto.js.map +1 -0
  12. package/dist/cjs/modules/dispatch/dtos/response-unit-dispatch-notification.dto.js +235 -0
  13. package/dist/cjs/modules/dispatch/dtos/response-unit-dispatch-notification.dto.js.map +1 -0
  14. package/dist/cjs/modules/dispatch/dtos/response-unit-dispatch-profile-query.dto.js +61 -0
  15. package/dist/cjs/modules/dispatch/dtos/response-unit-dispatch-profile-query.dto.js.map +1 -0
  16. package/dist/cjs/modules/dispatch/dtos/response-unit-nearby-query.dto.js +66 -0
  17. package/dist/cjs/modules/dispatch/dtos/response-unit-nearby-query.dto.js.map +1 -0
  18. package/dist/cjs/modules/dispatch/dtos/update-response-unit-dispatch-status.dto.js +42 -0
  19. package/dist/cjs/modules/dispatch/dtos/update-response-unit-dispatch-status.dto.js.map +1 -0
  20. package/dist/cjs/modules/dispatch/enums/incident-dispatch-blocker.enum.js +21 -0
  21. package/dist/cjs/modules/dispatch/enums/incident-dispatch-blocker.enum.js.map +1 -0
  22. package/dist/cjs/modules/dispatch/enums/response-capability-requirement-source.enum.js +12 -0
  23. package/dist/cjs/modules/dispatch/enums/response-capability-requirement-source.enum.js.map +1 -0
  24. package/dist/cjs/modules/dispatch/enums/response-unit-capability-match.enum.js +24 -0
  25. package/dist/cjs/modules/dispatch/enums/response-unit-capability-match.enum.js.map +1 -0
  26. package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-constraint.enum.js +34 -0
  27. package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-constraint.enum.js.map +1 -0
  28. package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-error-code.enum.js +26 -0
  29. package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-error-code.enum.js.map +1 -0
  30. package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-notification-failure.enum.js +18 -0
  31. package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-notification-failure.enum.js.map +1 -0
  32. package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-notification-status.enum.js +16 -0
  33. package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-notification-status.enum.js.map +1 -0
  34. package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-status.enum.js +39 -0
  35. package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-status.enum.js.map +1 -0
  36. package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-transition-source.enum.js +18 -0
  37. package/dist/cjs/modules/dispatch/enums/response-unit-dispatch-transition-source.enum.js.map +1 -0
  38. package/dist/cjs/modules/dispatch/enums/response-unit-distance-basis.enum.js +12 -0
  39. package/dist/cjs/modules/dispatch/enums/response-unit-distance-basis.enum.js.map +1 -0
  40. package/dist/cjs/modules/dispatch/enums/response-unit-location-freshness.enum.js +21 -0
  41. package/dist/cjs/modules/dispatch/enums/response-unit-location-freshness.enum.js.map +1 -0
  42. package/dist/cjs/modules/dispatch/enums/response-unit-location-source.enum.js +17 -0
  43. package/dist/cjs/modules/dispatch/enums/response-unit-location-source.enum.js.map +1 -0
  44. package/dist/cjs/modules/dispatch/enums/response-unit-recommendation-reason.enum.js +25 -0
  45. package/dist/cjs/modules/dispatch/enums/response-unit-recommendation-reason.enum.js.map +1 -0
  46. package/dist/cjs/modules/dispatch/enums/response-unit-recommendation-status.enum.js +23 -0
  47. package/dist/cjs/modules/dispatch/enums/response-unit-recommendation-status.enum.js.map +1 -0
  48. package/dist/cjs/modules/dispatch/index.js +53 -0
  49. package/dist/cjs/modules/dispatch/index.js.map +1 -0
  50. package/dist/cjs/modules/dispatch/interfaces/incident-response-unit-dispatch.js +3 -0
  51. package/dist/cjs/modules/dispatch/interfaces/incident-response-unit-dispatch.js.map +1 -0
  52. package/dist/cjs/modules/dispatch/interfaces/response-unit-dispatch-events.js +3 -0
  53. package/dist/cjs/modules/dispatch/interfaces/response-unit-dispatch-events.js.map +1 -0
  54. package/dist/cjs/modules/dispatch/interfaces/response-unit-dispatch-profile.js +3 -0
  55. package/dist/cjs/modules/dispatch/interfaces/response-unit-dispatch-profile.js.map +1 -0
  56. package/dist/cjs/modules/dispatch/interfaces/response-unit-proximity.js +3 -0
  57. package/dist/cjs/modules/dispatch/interfaces/response-unit-proximity.js.map +1 -0
  58. package/dist/cjs/modules/dispatch/interfaces/response-unit-recommendation.js +3 -0
  59. package/dist/cjs/modules/dispatch/interfaces/response-unit-recommendation.js.map +1 -0
  60. package/dist/cjs/modules/dispatch/utils/dispatch-geo.util.js +44 -0
  61. package/dist/cjs/modules/dispatch/utils/dispatch-geo.util.js.map +1 -0
  62. package/dist/cjs/modules/dispatch/utils/incident-dispatchability.util.js +42 -0
  63. package/dist/cjs/modules/dispatch/utils/incident-dispatchability.util.js.map +1 -0
  64. package/dist/cjs/modules/dispatch/utils/response-capability-match.util.js +44 -0
  65. package/dist/cjs/modules/dispatch/utils/response-capability-match.util.js.map +1 -0
  66. package/dist/cjs/modules/dispatch/utils/response-unit-dispatch-event.util.js +19 -0
  67. package/dist/cjs/modules/dispatch/utils/response-unit-dispatch-event.util.js.map +1 -0
  68. package/dist/cjs/modules/dispatch/utils/response-unit-dispatch-status.util.js +53 -0
  69. package/dist/cjs/modules/dispatch/utils/response-unit-dispatch-status.util.js.map +1 -0
  70. package/dist/cjs/modules/incident/dtos/category/create-incident-category.dto.js +9 -0
  71. package/dist/cjs/modules/incident/dtos/category/create-incident-category.dto.js.map +1 -1
  72. package/dist/cjs/modules/incident/dtos/type/create-incident-type.dto.js +9 -0
  73. package/dist/cjs/modules/incident/dtos/type/create-incident-type.dto.js.map +1 -1
  74. package/dist/cjs/modules/incident/enums/incident-actions.enum.js +8 -0
  75. package/dist/cjs/modules/incident/enums/incident-actions.enum.js.map +1 -1
  76. package/dist/cjs/modules/incident-sla/constants/emergency-incident-workflow.const.js +53 -0
  77. package/dist/cjs/modules/incident-sla/constants/emergency-incident-workflow.const.js.map +1 -0
  78. package/dist/cjs/modules/incident-sla/constants/incident-sla-defaults.const.js +258 -0
  79. package/dist/cjs/modules/incident-sla/constants/incident-sla-defaults.const.js.map +1 -0
  80. package/dist/cjs/modules/incident-sla/constants/incident-sla-kafka.const.js +27 -0
  81. package/dist/cjs/modules/incident-sla/constants/incident-sla-kafka.const.js.map +1 -0
  82. package/dist/cjs/modules/incident-sla/dtos/emergency-notification.dto.js +419 -0
  83. package/dist/cjs/modules/incident-sla/dtos/emergency-notification.dto.js.map +1 -0
  84. package/dist/cjs/modules/incident-sla/dtos/emergency-operations.dto.js +155 -0
  85. package/dist/cjs/modules/incident-sla/dtos/emergency-operations.dto.js.map +1 -0
  86. package/dist/cjs/modules/incident-sla/dtos/emergency-workflow.dto.js +216 -0
  87. package/dist/cjs/modules/incident-sla/dtos/emergency-workflow.dto.js.map +1 -0
  88. package/dist/cjs/modules/incident-sla/dtos/incident-sla-analytics-query.dto.js +86 -0
  89. package/dist/cjs/modules/incident-sla/dtos/incident-sla-analytics-query.dto.js.map +1 -0
  90. package/dist/cjs/modules/incident-sla/dtos/incident-sla-policy.dto.js +509 -0
  91. package/dist/cjs/modules/incident-sla/dtos/incident-sla-policy.dto.js.map +1 -0
  92. package/dist/cjs/modules/incident-sla/enums/emergency-incident-stage.enum.js +32 -0
  93. package/dist/cjs/modules/incident-sla/enums/emergency-incident-stage.enum.js.map +1 -0
  94. package/dist/cjs/modules/incident-sla/enums/emergency-notification.enum.js +44 -0
  95. package/dist/cjs/modules/incident-sla/enums/emergency-notification.enum.js.map +1 -0
  96. package/dist/cjs/modules/incident-sla/enums/eta-status.enum.js +32 -0
  97. package/dist/cjs/modules/incident-sla/enums/eta-status.enum.js.map +1 -0
  98. package/dist/cjs/modules/incident-sla/enums/incident-closure.enum.js +23 -0
  99. package/dist/cjs/modules/incident-sla/enums/incident-closure.enum.js.map +1 -0
  100. package/dist/cjs/modules/incident-sla/enums/incident-sla-actor.enum.js +46 -0
  101. package/dist/cjs/modules/incident-sla/enums/incident-sla-actor.enum.js.map +1 -0
  102. package/dist/cjs/modules/incident-sla/enums/incident-sla-error-code.enum.js +26 -0
  103. package/dist/cjs/modules/incident-sla/enums/incident-sla-error-code.enum.js.map +1 -0
  104. package/dist/cjs/modules/incident-sla/enums/incident-sla-event-type.enum.js +45 -0
  105. package/dist/cjs/modules/incident-sla/enums/incident-sla-event-type.enum.js.map +1 -0
  106. package/dist/cjs/modules/incident-sla/enums/incident-sla-stage.enum.js +26 -0
  107. package/dist/cjs/modules/incident-sla/enums/incident-sla-stage.enum.js.map +1 -0
  108. package/dist/cjs/modules/incident-sla/enums/incident-sla-status.enum.js +38 -0
  109. package/dist/cjs/modules/incident-sla/enums/incident-sla-status.enum.js.map +1 -0
  110. package/dist/cjs/modules/incident-sla/enums/sla-escalation.enum.js +50 -0
  111. package/dist/cjs/modules/incident-sla/enums/sla-escalation.enum.js.map +1 -0
  112. package/dist/cjs/modules/incident-sla/enums/sla-exception.enum.js +27 -0
  113. package/dist/cjs/modules/incident-sla/enums/sla-exception.enum.js.map +1 -0
  114. package/dist/cjs/modules/incident-sla/enums/sla-overall-state.enum.js +28 -0
  115. package/dist/cjs/modules/incident-sla/enums/sla-overall-state.enum.js.map +1 -0
  116. package/dist/cjs/modules/incident-sla/enums/sla-pause.enum.js +28 -0
  117. package/dist/cjs/modules/incident-sla/enums/sla-pause.enum.js.map +1 -0
  118. package/dist/cjs/modules/incident-sla/enums/sla-policy-scope.enum.js +19 -0
  119. package/dist/cjs/modules/incident-sla/enums/sla-policy-scope.enum.js.map +1 -0
  120. package/dist/cjs/modules/incident-sla/index.js +53 -0
  121. package/dist/cjs/modules/incident-sla/index.js.map +1 -0
  122. package/dist/cjs/modules/incident-sla/interfaces/emergency-workflow.js +3 -0
  123. package/dist/cjs/modules/incident-sla/interfaces/emergency-workflow.js.map +1 -0
  124. package/dist/cjs/modules/incident-sla/interfaces/incident-sla-analytics.js +3 -0
  125. package/dist/cjs/modules/incident-sla/interfaces/incident-sla-analytics.js.map +1 -0
  126. package/dist/cjs/modules/incident-sla/interfaces/incident-sla-events.js +3 -0
  127. package/dist/cjs/modules/incident-sla/interfaces/incident-sla-events.js.map +1 -0
  128. package/dist/cjs/modules/incident-sla/interfaces/incident-sla-policy.js +3 -0
  129. package/dist/cjs/modules/incident-sla/interfaces/incident-sla-policy.js.map +1 -0
  130. package/dist/cjs/modules/incident-sla/interfaces/incident-sla-views.js +3 -0
  131. package/dist/cjs/modules/incident-sla/interfaces/incident-sla-views.js.map +1 -0
  132. package/dist/cjs/modules/incident-sla/utils/incident-sla-eta.util.js +40 -0
  133. package/dist/cjs/modules/incident-sla/utils/incident-sla-eta.util.js.map +1 -0
  134. package/dist/cjs/modules/incident-sla/utils/incident-sla-event-id.util.js +18 -0
  135. package/dist/cjs/modules/incident-sla/utils/incident-sla-event-id.util.js.map +1 -0
  136. package/dist/cjs/modules/incident-sla/utils/incident-sla-priority.util.js +31 -0
  137. package/dist/cjs/modules/incident-sla/utils/incident-sla-priority.util.js.map +1 -0
  138. package/dist/cjs/modules/incident-sla/utils/incident-sla-time.util.js +129 -0
  139. package/dist/cjs/modules/incident-sla/utils/incident-sla-time.util.js.map +1 -0
  140. package/dist/cjs/modules/permission/data/permissions.data.js +19 -0
  141. package/dist/cjs/modules/permission/data/permissions.data.js.map +1 -1
  142. package/dist/cjs/modules/permission/enums/permission-actions.enum.js +34 -0
  143. package/dist/cjs/modules/permission/enums/permission-actions.enum.js.map +1 -1
  144. package/dist/cjs/modules/permission/enums/permissions-module.enum.js +2 -0
  145. package/dist/cjs/modules/permission/enums/permissions-module.enum.js.map +1 -1
  146. package/dist/cjs/modules/response-unit/dtos/response-unit/base-response-unit.dto.js +9 -0
  147. package/dist/cjs/modules/response-unit/dtos/response-unit/base-response-unit.dto.js.map +1 -1
  148. package/dist/cjs/modules/response-unit/enums/response-unit/response-capability.enum.js +29 -0
  149. package/dist/cjs/modules/response-unit/enums/response-unit/response-capability.enum.js.map +1 -0
  150. package/dist/cjs/modules/response-unit/enums/response-unit/response-unit-availability.enum.js +27 -0
  151. package/dist/cjs/modules/response-unit/enums/response-unit/response-unit-availability.enum.js.map +1 -0
  152. package/dist/cjs/modules/response-unit/index.js +5 -0
  153. package/dist/cjs/modules/response-unit/index.js.map +1 -1
  154. package/dist/cjs/modules/response-unit/utils/response-capability.util.js +74 -0
  155. package/dist/cjs/modules/response-unit/utils/response-capability.util.js.map +1 -0
  156. package/dist/cjs/modules/response-unit/utils/response-unit-availability.util.js +46 -0
  157. package/dist/cjs/modules/response-unit/utils/response-unit-availability.util.js.map +1 -0
  158. package/dist/cjs/modules/role/data/roles.data.js +61 -0
  159. package/dist/cjs/modules/role/data/roles.data.js.map +1 -1
  160. package/dist/cjs/modules/sms/constants/sms-templates.config.js +44 -0
  161. package/dist/cjs/modules/sms/constants/sms-templates.config.js.map +1 -1
  162. package/dist/cjs/modules/sms/enums/sms-template.enum.js +3 -0
  163. package/dist/cjs/modules/sms/enums/sms-template.enum.js.map +1 -1
  164. package/dist/esm/index.js +2 -0
  165. package/dist/esm/index.js.map +1 -1
  166. package/dist/esm/kafka/topics.js +21 -0
  167. package/dist/esm/kafka/topics.js.map +1 -1
  168. package/dist/esm/modules/dispatch/constants/response-unit-dispatch-defaults.const.js +53 -0
  169. package/dist/esm/modules/dispatch/constants/response-unit-dispatch-defaults.const.js.map +1 -0
  170. package/dist/esm/modules/dispatch/constants/response-unit-dispatch-kafka.const.js +18 -0
  171. package/dist/esm/modules/dispatch/constants/response-unit-dispatch-kafka.const.js.map +1 -0
  172. package/dist/esm/modules/dispatch/dtos/dispatch-response-unit.dto.js +54 -0
  173. package/dist/esm/modules/dispatch/dtos/dispatch-response-unit.dto.js.map +1 -0
  174. package/dist/esm/modules/dispatch/dtos/response-unit-dispatch-notification.dto.js +228 -0
  175. package/dist/esm/modules/dispatch/dtos/response-unit-dispatch-notification.dto.js.map +1 -0
  176. package/dist/esm/modules/dispatch/dtos/response-unit-dispatch-profile-query.dto.js +57 -0
  177. package/dist/esm/modules/dispatch/dtos/response-unit-dispatch-profile-query.dto.js.map +1 -0
  178. package/dist/esm/modules/dispatch/dtos/response-unit-nearby-query.dto.js +62 -0
  179. package/dist/esm/modules/dispatch/dtos/response-unit-nearby-query.dto.js.map +1 -0
  180. package/dist/esm/modules/dispatch/dtos/update-response-unit-dispatch-status.dto.js +38 -0
  181. package/dist/esm/modules/dispatch/dtos/update-response-unit-dispatch-status.dto.js.map +1 -0
  182. package/dist/esm/modules/dispatch/enums/incident-dispatch-blocker.enum.js +18 -0
  183. package/dist/esm/modules/dispatch/enums/incident-dispatch-blocker.enum.js.map +1 -0
  184. package/dist/esm/modules/dispatch/enums/response-capability-requirement-source.enum.js +9 -0
  185. package/dist/esm/modules/dispatch/enums/response-capability-requirement-source.enum.js.map +1 -0
  186. package/dist/esm/modules/dispatch/enums/response-unit-capability-match.enum.js +21 -0
  187. package/dist/esm/modules/dispatch/enums/response-unit-capability-match.enum.js.map +1 -0
  188. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-constraint.enum.js +31 -0
  189. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-constraint.enum.js.map +1 -0
  190. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-error-code.enum.js +23 -0
  191. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-error-code.enum.js.map +1 -0
  192. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-notification-failure.enum.js +15 -0
  193. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-notification-failure.enum.js.map +1 -0
  194. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-notification-status.enum.js +13 -0
  195. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-notification-status.enum.js.map +1 -0
  196. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-status.enum.js +36 -0
  197. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-status.enum.js.map +1 -0
  198. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-transition-source.enum.js +15 -0
  199. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-transition-source.enum.js.map +1 -0
  200. package/dist/esm/modules/dispatch/enums/response-unit-distance-basis.enum.js +9 -0
  201. package/dist/esm/modules/dispatch/enums/response-unit-distance-basis.enum.js.map +1 -0
  202. package/dist/esm/modules/dispatch/enums/response-unit-location-freshness.enum.js +18 -0
  203. package/dist/esm/modules/dispatch/enums/response-unit-location-freshness.enum.js.map +1 -0
  204. package/dist/esm/modules/dispatch/enums/response-unit-location-source.enum.js +14 -0
  205. package/dist/esm/modules/dispatch/enums/response-unit-location-source.enum.js.map +1 -0
  206. package/dist/esm/modules/dispatch/enums/response-unit-recommendation-reason.enum.js +22 -0
  207. package/dist/esm/modules/dispatch/enums/response-unit-recommendation-reason.enum.js.map +1 -0
  208. package/dist/esm/modules/dispatch/enums/response-unit-recommendation-status.enum.js +20 -0
  209. package/dist/esm/modules/dispatch/enums/response-unit-recommendation-status.enum.js.map +1 -0
  210. package/dist/esm/modules/dispatch/index.js +37 -0
  211. package/dist/esm/modules/dispatch/index.js.map +1 -0
  212. package/dist/esm/modules/dispatch/interfaces/incident-response-unit-dispatch.js +2 -0
  213. package/dist/esm/modules/dispatch/interfaces/incident-response-unit-dispatch.js.map +1 -0
  214. package/dist/esm/modules/dispatch/interfaces/response-unit-dispatch-events.js +2 -0
  215. package/dist/esm/modules/dispatch/interfaces/response-unit-dispatch-events.js.map +1 -0
  216. package/dist/esm/modules/dispatch/interfaces/response-unit-dispatch-profile.js +2 -0
  217. package/dist/esm/modules/dispatch/interfaces/response-unit-dispatch-profile.js.map +1 -0
  218. package/dist/esm/modules/dispatch/interfaces/response-unit-proximity.js +2 -0
  219. package/dist/esm/modules/dispatch/interfaces/response-unit-proximity.js.map +1 -0
  220. package/dist/esm/modules/dispatch/interfaces/response-unit-recommendation.js +2 -0
  221. package/dist/esm/modules/dispatch/interfaces/response-unit-recommendation.js.map +1 -0
  222. package/dist/esm/modules/dispatch/utils/dispatch-geo.util.js +39 -0
  223. package/dist/esm/modules/dispatch/utils/dispatch-geo.util.js.map +1 -0
  224. package/dist/esm/modules/dispatch/utils/incident-dispatchability.util.js +37 -0
  225. package/dist/esm/modules/dispatch/utils/incident-dispatchability.util.js.map +1 -0
  226. package/dist/esm/modules/dispatch/utils/response-capability-match.util.js +40 -0
  227. package/dist/esm/modules/dispatch/utils/response-capability-match.util.js.map +1 -0
  228. package/dist/esm/modules/dispatch/utils/response-unit-dispatch-event.util.js +15 -0
  229. package/dist/esm/modules/dispatch/utils/response-unit-dispatch-event.util.js.map +1 -0
  230. package/dist/esm/modules/dispatch/utils/response-unit-dispatch-status.util.js +46 -0
  231. package/dist/esm/modules/dispatch/utils/response-unit-dispatch-status.util.js.map +1 -0
  232. package/dist/esm/modules/incident/dtos/category/create-incident-category.dto.js +10 -1
  233. package/dist/esm/modules/incident/dtos/category/create-incident-category.dto.js.map +1 -1
  234. package/dist/esm/modules/incident/dtos/type/create-incident-type.dto.js +10 -1
  235. package/dist/esm/modules/incident/dtos/type/create-incident-type.dto.js.map +1 -1
  236. package/dist/esm/modules/incident/enums/incident-actions.enum.js +8 -0
  237. package/dist/esm/modules/incident/enums/incident-actions.enum.js.map +1 -1
  238. package/dist/esm/modules/incident-sla/constants/emergency-incident-workflow.const.js +49 -0
  239. package/dist/esm/modules/incident-sla/constants/emergency-incident-workflow.const.js.map +1 -0
  240. package/dist/esm/modules/incident-sla/constants/incident-sla-defaults.const.js +255 -0
  241. package/dist/esm/modules/incident-sla/constants/incident-sla-defaults.const.js.map +1 -0
  242. package/dist/esm/modules/incident-sla/constants/incident-sla-kafka.const.js +24 -0
  243. package/dist/esm/modules/incident-sla/constants/incident-sla-kafka.const.js.map +1 -0
  244. package/dist/esm/modules/incident-sla/dtos/emergency-notification.dto.js +405 -0
  245. package/dist/esm/modules/incident-sla/dtos/emergency-notification.dto.js.map +1 -0
  246. package/dist/esm/modules/incident-sla/dtos/emergency-operations.dto.js +144 -0
  247. package/dist/esm/modules/incident-sla/dtos/emergency-operations.dto.js.map +1 -0
  248. package/dist/esm/modules/incident-sla/dtos/emergency-workflow.dto.js +206 -0
  249. package/dist/esm/modules/incident-sla/dtos/emergency-workflow.dto.js.map +1 -0
  250. package/dist/esm/modules/incident-sla/dtos/incident-sla-analytics-query.dto.js +82 -0
  251. package/dist/esm/modules/incident-sla/dtos/incident-sla-analytics-query.dto.js.map +1 -0
  252. package/dist/esm/modules/incident-sla/dtos/incident-sla-policy.dto.js +495 -0
  253. package/dist/esm/modules/incident-sla/dtos/incident-sla-policy.dto.js.map +1 -0
  254. package/dist/esm/modules/incident-sla/enums/emergency-incident-stage.enum.js +29 -0
  255. package/dist/esm/modules/incident-sla/enums/emergency-incident-stage.enum.js.map +1 -0
  256. package/dist/esm/modules/incident-sla/enums/emergency-notification.enum.js +41 -0
  257. package/dist/esm/modules/incident-sla/enums/emergency-notification.enum.js.map +1 -0
  258. package/dist/esm/modules/incident-sla/enums/eta-status.enum.js +29 -0
  259. package/dist/esm/modules/incident-sla/enums/eta-status.enum.js.map +1 -0
  260. package/dist/esm/modules/incident-sla/enums/incident-closure.enum.js +20 -0
  261. package/dist/esm/modules/incident-sla/enums/incident-closure.enum.js.map +1 -0
  262. package/dist/esm/modules/incident-sla/enums/incident-sla-actor.enum.js +43 -0
  263. package/dist/esm/modules/incident-sla/enums/incident-sla-actor.enum.js.map +1 -0
  264. package/dist/esm/modules/incident-sla/enums/incident-sla-error-code.enum.js +23 -0
  265. package/dist/esm/modules/incident-sla/enums/incident-sla-error-code.enum.js.map +1 -0
  266. package/dist/esm/modules/incident-sla/enums/incident-sla-event-type.enum.js +42 -0
  267. package/dist/esm/modules/incident-sla/enums/incident-sla-event-type.enum.js.map +1 -0
  268. package/dist/esm/modules/incident-sla/enums/incident-sla-stage.enum.js +23 -0
  269. package/dist/esm/modules/incident-sla/enums/incident-sla-stage.enum.js.map +1 -0
  270. package/dist/esm/modules/incident-sla/enums/incident-sla-status.enum.js +35 -0
  271. package/dist/esm/modules/incident-sla/enums/incident-sla-status.enum.js.map +1 -0
  272. package/dist/esm/modules/incident-sla/enums/sla-escalation.enum.js +47 -0
  273. package/dist/esm/modules/incident-sla/enums/sla-escalation.enum.js.map +1 -0
  274. package/dist/esm/modules/incident-sla/enums/sla-exception.enum.js +24 -0
  275. package/dist/esm/modules/incident-sla/enums/sla-exception.enum.js.map +1 -0
  276. package/dist/esm/modules/incident-sla/enums/sla-overall-state.enum.js +25 -0
  277. package/dist/esm/modules/incident-sla/enums/sla-overall-state.enum.js.map +1 -0
  278. package/dist/esm/modules/incident-sla/enums/sla-pause.enum.js +25 -0
  279. package/dist/esm/modules/incident-sla/enums/sla-pause.enum.js.map +1 -0
  280. package/dist/esm/modules/incident-sla/enums/sla-policy-scope.enum.js +16 -0
  281. package/dist/esm/modules/incident-sla/enums/sla-policy-scope.enum.js.map +1 -0
  282. package/dist/esm/modules/incident-sla/index.js +37 -0
  283. package/dist/esm/modules/incident-sla/index.js.map +1 -0
  284. package/dist/esm/modules/incident-sla/interfaces/emergency-workflow.js +2 -0
  285. package/dist/esm/modules/incident-sla/interfaces/emergency-workflow.js.map +1 -0
  286. package/dist/esm/modules/incident-sla/interfaces/incident-sla-analytics.js +2 -0
  287. package/dist/esm/modules/incident-sla/interfaces/incident-sla-analytics.js.map +1 -0
  288. package/dist/esm/modules/incident-sla/interfaces/incident-sla-events.js +2 -0
  289. package/dist/esm/modules/incident-sla/interfaces/incident-sla-events.js.map +1 -0
  290. package/dist/esm/modules/incident-sla/interfaces/incident-sla-policy.js +2 -0
  291. package/dist/esm/modules/incident-sla/interfaces/incident-sla-policy.js.map +1 -0
  292. package/dist/esm/modules/incident-sla/interfaces/incident-sla-views.js +2 -0
  293. package/dist/esm/modules/incident-sla/interfaces/incident-sla-views.js.map +1 -0
  294. package/dist/esm/modules/incident-sla/utils/incident-sla-eta.util.js +35 -0
  295. package/dist/esm/modules/incident-sla/utils/incident-sla-eta.util.js.map +1 -0
  296. package/dist/esm/modules/incident-sla/utils/incident-sla-event-id.util.js +14 -0
  297. package/dist/esm/modules/incident-sla/utils/incident-sla-event-id.util.js.map +1 -0
  298. package/dist/esm/modules/incident-sla/utils/incident-sla-priority.util.js +25 -0
  299. package/dist/esm/modules/incident-sla/utils/incident-sla-priority.util.js.map +1 -0
  300. package/dist/esm/modules/incident-sla/utils/incident-sla-time.util.js +119 -0
  301. package/dist/esm/modules/incident-sla/utils/incident-sla-time.util.js.map +1 -0
  302. package/dist/esm/modules/permission/data/permissions.data.js +19 -0
  303. package/dist/esm/modules/permission/data/permissions.data.js.map +1 -1
  304. package/dist/esm/modules/permission/enums/permission-actions.enum.js +34 -0
  305. package/dist/esm/modules/permission/enums/permission-actions.enum.js.map +1 -1
  306. package/dist/esm/modules/permission/enums/permissions-module.enum.js +2 -0
  307. package/dist/esm/modules/permission/enums/permissions-module.enum.js.map +1 -1
  308. package/dist/esm/modules/response-unit/dtos/response-unit/base-response-unit.dto.js +10 -1
  309. package/dist/esm/modules/response-unit/dtos/response-unit/base-response-unit.dto.js.map +1 -1
  310. package/dist/esm/modules/response-unit/enums/response-unit/response-capability.enum.js +26 -0
  311. package/dist/esm/modules/response-unit/enums/response-unit/response-capability.enum.js.map +1 -0
  312. package/dist/esm/modules/response-unit/enums/response-unit/response-unit-availability.enum.js +24 -0
  313. package/dist/esm/modules/response-unit/enums/response-unit/response-unit-availability.enum.js.map +1 -0
  314. package/dist/esm/modules/response-unit/index.js +5 -0
  315. package/dist/esm/modules/response-unit/index.js.map +1 -1
  316. package/dist/esm/modules/response-unit/utils/response-capability.util.js +68 -0
  317. package/dist/esm/modules/response-unit/utils/response-capability.util.js.map +1 -0
  318. package/dist/esm/modules/response-unit/utils/response-unit-availability.util.js +42 -0
  319. package/dist/esm/modules/response-unit/utils/response-unit-availability.util.js.map +1 -0
  320. package/dist/esm/modules/role/data/roles.data.js +61 -0
  321. package/dist/esm/modules/role/data/roles.data.js.map +1 -1
  322. package/dist/esm/modules/sms/constants/sms-templates.config.js +44 -0
  323. package/dist/esm/modules/sms/constants/sms-templates.config.js.map +1 -1
  324. package/dist/esm/modules/sms/enums/sms-template.enum.js +3 -0
  325. package/dist/esm/modules/sms/enums/sms-template.enum.js.map +1 -1
  326. package/dist/types/index.d.ts +2 -0
  327. package/dist/types/kafka/topics.d.ts +9 -0
  328. package/dist/types/modules/dispatch/constants/response-unit-dispatch-defaults.const.d.ts +43 -0
  329. package/dist/types/modules/dispatch/constants/response-unit-dispatch-kafka.const.d.ts +16 -0
  330. package/dist/types/modules/dispatch/dtos/dispatch-response-unit.dto.d.ts +20 -0
  331. package/dist/types/modules/dispatch/dtos/response-unit-dispatch-notification.dto.d.ts +48 -0
  332. package/dist/types/modules/dispatch/dtos/response-unit-dispatch-profile-query.dto.d.ts +13 -0
  333. package/dist/types/modules/dispatch/dtos/response-unit-nearby-query.dto.d.ts +15 -0
  334. package/dist/types/modules/dispatch/dtos/update-response-unit-dispatch-status.dto.d.ts +9 -0
  335. package/dist/types/modules/dispatch/enums/incident-dispatch-blocker.enum.d.ts +16 -0
  336. package/dist/types/modules/dispatch/enums/response-capability-requirement-source.enum.d.ts +7 -0
  337. package/dist/types/modules/dispatch/enums/response-unit-capability-match.enum.d.ts +19 -0
  338. package/dist/types/modules/dispatch/enums/response-unit-dispatch-constraint.enum.d.ts +27 -0
  339. package/dist/types/modules/dispatch/enums/response-unit-dispatch-error-code.enum.d.ts +21 -0
  340. package/dist/types/modules/dispatch/enums/response-unit-dispatch-notification-failure.enum.d.ts +13 -0
  341. package/dist/types/modules/dispatch/enums/response-unit-dispatch-notification-status.enum.d.ts +11 -0
  342. package/dist/types/modules/dispatch/enums/response-unit-dispatch-status.enum.d.ts +34 -0
  343. package/dist/types/modules/dispatch/enums/response-unit-dispatch-transition-source.enum.d.ts +13 -0
  344. package/dist/types/modules/dispatch/enums/response-unit-distance-basis.enum.d.ts +7 -0
  345. package/dist/types/modules/dispatch/enums/response-unit-location-freshness.enum.d.ts +16 -0
  346. package/dist/types/modules/dispatch/enums/response-unit-location-source.enum.d.ts +12 -0
  347. package/dist/types/modules/dispatch/enums/response-unit-recommendation-reason.enum.d.ts +20 -0
  348. package/dist/types/modules/dispatch/enums/response-unit-recommendation-status.enum.d.ts +18 -0
  349. package/dist/types/modules/dispatch/index.d.ts +31 -0
  350. package/dist/types/modules/dispatch/interfaces/incident-response-unit-dispatch.d.ts +126 -0
  351. package/dist/types/modules/dispatch/interfaces/response-unit-dispatch-events.d.ts +105 -0
  352. package/dist/types/modules/dispatch/interfaces/response-unit-dispatch-profile.d.ts +52 -0
  353. package/dist/types/modules/dispatch/interfaces/response-unit-proximity.d.ts +45 -0
  354. package/dist/types/modules/dispatch/interfaces/response-unit-recommendation.d.ts +130 -0
  355. package/dist/types/modules/dispatch/utils/dispatch-geo.util.d.ts +16 -0
  356. package/dist/types/modules/dispatch/utils/incident-dispatchability.util.d.ts +18 -0
  357. package/dist/types/modules/dispatch/utils/response-capability-match.util.d.ts +26 -0
  358. package/dist/types/modules/dispatch/utils/response-unit-dispatch-event.util.d.ts +9 -0
  359. package/dist/types/modules/dispatch/utils/response-unit-dispatch-status.util.d.ts +16 -0
  360. package/dist/types/modules/incident/dtos/category/create-incident-category.dto.d.ts +6 -0
  361. package/dist/types/modules/incident/dtos/type/create-incident-type.dto.d.ts +6 -0
  362. package/dist/types/modules/incident/enums/incident-actions.enum.d.ts +8 -0
  363. package/dist/types/modules/incident/intefaces/incident-category.d.ts +6 -0
  364. package/dist/types/modules/incident/intefaces/incident-type.d.ts +6 -0
  365. package/dist/types/modules/incident-sla/constants/emergency-incident-workflow.const.d.ts +46 -0
  366. package/dist/types/modules/incident-sla/constants/incident-sla-defaults.const.d.ts +81 -0
  367. package/dist/types/modules/incident-sla/constants/incident-sla-kafka.const.d.ts +22 -0
  368. package/dist/types/modules/incident-sla/dtos/emergency-notification.dto.d.ts +99 -0
  369. package/dist/types/modules/incident-sla/dtos/emergency-operations.dto.d.ts +52 -0
  370. package/dist/types/modules/incident-sla/dtos/emergency-workflow.dto.d.ts +55 -0
  371. package/dist/types/modules/incident-sla/dtos/incident-sla-analytics-query.dto.d.ts +15 -0
  372. package/dist/types/modules/incident-sla/dtos/incident-sla-policy.dto.d.ts +104 -0
  373. package/dist/types/modules/incident-sla/enums/emergency-incident-stage.enum.d.ts +27 -0
  374. package/dist/types/modules/incident-sla/enums/emergency-notification.enum.d.ts +37 -0
  375. package/dist/types/modules/incident-sla/enums/eta-status.enum.d.ts +26 -0
  376. package/dist/types/modules/incident-sla/enums/incident-closure.enum.d.ts +17 -0
  377. package/dist/types/modules/incident-sla/enums/incident-sla-actor.enum.d.ts +40 -0
  378. package/dist/types/modules/incident-sla/enums/incident-sla-error-code.enum.d.ts +21 -0
  379. package/dist/types/modules/incident-sla/enums/incident-sla-event-type.enum.d.ts +36 -0
  380. package/dist/types/modules/incident-sla/enums/incident-sla-stage.enum.d.ts +21 -0
  381. package/dist/types/modules/incident-sla/enums/incident-sla-status.enum.d.ts +33 -0
  382. package/dist/types/modules/incident-sla/enums/sla-escalation.enum.d.ts +42 -0
  383. package/dist/types/modules/incident-sla/enums/sla-exception.enum.d.ts +21 -0
  384. package/dist/types/modules/incident-sla/enums/sla-overall-state.enum.d.ts +22 -0
  385. package/dist/types/modules/incident-sla/enums/sla-pause.enum.d.ts +22 -0
  386. package/dist/types/modules/incident-sla/enums/sla-policy-scope.enum.d.ts +14 -0
  387. package/dist/types/modules/incident-sla/index.d.ts +31 -0
  388. package/dist/types/modules/incident-sla/interfaces/emergency-workflow.d.ts +131 -0
  389. package/dist/types/modules/incident-sla/interfaces/incident-sla-analytics.d.ts +35 -0
  390. package/dist/types/modules/incident-sla/interfaces/incident-sla-events.d.ts +173 -0
  391. package/dist/types/modules/incident-sla/interfaces/incident-sla-policy.d.ts +147 -0
  392. package/dist/types/modules/incident-sla/interfaces/incident-sla-views.d.ts +224 -0
  393. package/dist/types/modules/incident-sla/utils/incident-sla-eta.util.d.ts +15 -0
  394. package/dist/types/modules/incident-sla/utils/incident-sla-event-id.util.d.ts +8 -0
  395. package/dist/types/modules/incident-sla/utils/incident-sla-priority.util.d.ts +14 -0
  396. package/dist/types/modules/incident-sla/utils/incident-sla-time.util.d.ts +65 -0
  397. package/dist/types/modules/permission/enums/permission-actions.enum.d.ts +9 -0
  398. package/dist/types/modules/permission/enums/permissions-module.enum.d.ts +3 -1
  399. package/dist/types/modules/response-unit/dtos/response-unit/base-response-unit.dto.d.ts +7 -0
  400. package/dist/types/modules/response-unit/enums/response-unit/response-capability.enum.d.ts +24 -0
  401. package/dist/types/modules/response-unit/enums/response-unit/response-unit-availability.enum.d.ts +22 -0
  402. package/dist/types/modules/response-unit/index.d.ts +4 -0
  403. package/dist/types/modules/response-unit/interfaces/response-unit/response-unit.d.ts +3 -0
  404. package/dist/types/modules/response-unit/utils/response-capability.util.d.ts +31 -0
  405. package/dist/types/modules/response-unit/utils/response-unit-availability.util.d.ts +21 -0
  406. package/dist/types/modules/sms/enums/sms-template.enum.d.ts +3 -0
  407. package/package.json +72 -72
@@ -0,0 +1,37 @@
1
+ /**
2
+ * The emergency (INCIDENT-class) notifications - a namespace of their own,
3
+ * never the grievance templates. Each value names one message, rendered per
4
+ * channel by clarion-notification (`templates/incident/`).
5
+ */
6
+ export declare enum EmergencyNotificationEvent {
7
+ EMERGENCY_CREATED = "emergency-created",
8
+ EMERGENCY_ACKNOWLEDGED = "emergency-acknowledged",
9
+ EMERGENCY_DISPATCHED = "emergency-dispatched",
10
+ EMERGENCY_UNIT_ASSIGNED = "emergency-unit-assigned",
11
+ EMERGENCY_UNIT_EN_ROUTE = "emergency-unit-en-route",
12
+ EMERGENCY_ARRIVED = "emergency-arrived",
13
+ EMERGENCY_AT_RISK = "emergency-at-risk",
14
+ EMERGENCY_SLA_BREACHED = "emergency-sla-breached",
15
+ EMERGENCY_ESCALATED = "emergency-escalated",
16
+ EMERGENCY_RESOLVED = "emergency-resolved",
17
+ EMERGENCY_CLOSED = "emergency-closed"
18
+ }
19
+ /** Who an emergency notification is addressed to. */
20
+ export declare enum EmergencyNotificationAudience {
21
+ REPORTER = "REPORTER",
22
+ DISPATCHER = "DISPATCHER",
23
+ SUPERVISOR = "SUPERVISOR",
24
+ DUTY_MANAGER = "DUTY_MANAGER",
25
+ ORGANIZATION_ADMIN = "ORGANIZATION_ADMIN"
26
+ }
27
+ /** clarion-notification's answer to one emergency notification request. */
28
+ export declare enum EmergencyNotificationResultStatus {
29
+ /** Every attempted delivery went out. */
30
+ SENT = "SENT",
31
+ /** Some deliveries went out, some failed. */
32
+ PARTIAL = "PARTIAL",
33
+ /** Nothing went out, though somebody should have received it. */
34
+ FAILED = "FAILED",
35
+ /** Nobody to deliver to (no recipients resolved, no contact configured). */
36
+ NOT_POSSIBLE = "NOT_POSSIBLE"
37
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Whether a dispatched unit is predicted to make the arrival deadline, from its
3
+ * live position. UNCERTAIN is a first-class answer: a stale or missing position
4
+ * must never produce confidence the data does not support.
5
+ */
6
+ export declare enum EtaStatus {
7
+ /** Predicted arrival comfortably before the deadline. */
8
+ ON_TRACK = "ON_TRACK",
9
+ /** Predicted arrival inside the at-risk margin before the deadline. */
10
+ AT_RISK = "AT_RISK",
11
+ /** Predicted arrival after the deadline. */
12
+ LIKELY_BREACH = "LIKELY_BREACH",
13
+ /** No current position (stale, offline, never tracked, poor accuracy). */
14
+ UNCERTAIN = "UNCERTAIN",
15
+ /** The incident has no arrival target to compare with. */
16
+ NO_TARGET = "NO_TARGET",
17
+ /** The unit is on scene. */
18
+ ARRIVED = "ARRIVED"
19
+ }
20
+ /** How an ETA was worked out. */
21
+ export declare enum EtaBasis {
22
+ /** Straight-line distance x road factor at an assumed urban speed (clarion-gis's ESTIMATE profile). */
23
+ ESTIMATE = "ESTIMATE",
24
+ /** A road route with traffic from clarion-gis. */
25
+ ROAD_ROUTE = "ROAD_ROUTE"
26
+ }
@@ -0,0 +1,17 @@
1
+ /** Why an emergency incident was closed. */
2
+ export declare enum IncidentClosureReason {
3
+ /** A control-room user closed it. */
4
+ MANUAL = "MANUAL",
5
+ /** The policy's resolution-to-closure period passed with nobody closing it. */
6
+ AUTO_CLOSED_AFTER_RESOLUTION_TIMEOUT = "AUTO_CLOSED_AFTER_RESOLUTION_TIMEOUT"
7
+ }
8
+ /**
9
+ * How a unit's arrival on scene came to be known. Kept apart on purpose: an
10
+ * arrival inferred from GPS is evidence, a responder's confirmation is a claim
11
+ * from the scene, and an auditor must be able to tell them apart.
12
+ */
13
+ export declare enum IncidentArrivalSource {
14
+ ARRIVAL_CONFIRMED_BY_RESPONDER = "ARRIVAL_CONFIRMED_BY_RESPONDER",
15
+ ARRIVAL_CONFIRMED_BY_CONTROL_CENTRE = "ARRIVAL_CONFIRMED_BY_CONTROL_CENTRE",
16
+ ARRIVAL_INFERRED_FROM_TRACKING = "ARRIVAL_INFERRED_FROM_TRACKING"
17
+ }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Who an operational event came from. The workflow contract never assumes the
3
+ * control room is the source: today almost everything is CONTROL_CENTRE, and a
4
+ * responder app will send the same events as RESPONDER without any redesign.
5
+ */
6
+ export declare enum IncidentActorType {
7
+ /** A control-room user (dispatcher, supervisor, administrator). */
8
+ CONTROL_CENTRE = "CONTROL_CENTRE",
9
+ /** A responder, through the future responder app. */
10
+ RESPONDER = "RESPONDER",
11
+ /** The platform itself - the workflow, a timer, a lifecycle rule. Uses the system user. */
12
+ SYSTEM = "SYSTEM",
13
+ /** Inferred from live tracking (e.g. arrival in the geofence). */
14
+ TRACKING = "TRACKING",
15
+ /** The person who raised the incident. */
16
+ REPORTER = "REPORTER",
17
+ /** A third-party partner (e.g. an ambulance provider) through its integration. */
18
+ PARTNER = "PARTNER"
19
+ }
20
+ /** The channel an SLA event arrived through - recorded beside the actor for the audit trail. */
21
+ export declare enum IncidentSlaEventSource {
22
+ /** The admin's incident view or the gateway API, by a control-room user. */
23
+ CONTROL_ROOM = "CONTROL_ROOM",
24
+ /** Reserved: the responder app. */
25
+ RESPONDER_APP = "RESPONDER_APP",
26
+ /** clarion-workflow-manager's emergency incident workflow (timers, escalation, auto-close). */
27
+ WORKFLOW = "WORKFLOW",
28
+ /** clarion-incident's evaluation of live tracking positions. */
29
+ TRACKING = "TRACKING",
30
+ /** A change of the incident's own status (resolved, closed...). */
31
+ INCIDENT_LIFECYCLE = "INCIDENT_LIFECYCLE",
32
+ /** A response-unit dispatch record (created, acknowledged, en route, on scene...). */
33
+ DISPATCH = "DISPATCH",
34
+ /** A third-party partner's progress (partner routing). */
35
+ PARTNER = "PARTNER",
36
+ /** clarion-notification reporting a delivery. */
37
+ NOTIFICATION = "NOTIFICATION",
38
+ /** Anything else the platform does on its own (initialisation, reconciliation). */
39
+ SYSTEM = "SYSTEM"
40
+ }
@@ -0,0 +1,21 @@
1
+ /** Machine-readable `code` on a refused SLA request. */
2
+ export declare enum IncidentSlaErrorCode {
3
+ /** Grievances, alerts that never reach the control room, and incidents with SLA switched off. */
4
+ SLA_NOT_TRACKED = "SLA_NOT_TRACKED",
5
+ SLA_INSTANCE_NOT_FOUND = "SLA_INSTANCE_NOT_FOUND",
6
+ SLA_PAUSE_NOT_FOUND = "SLA_PAUSE_NOT_FOUND",
7
+ SLA_POLICY_NOT_FOUND = "SLA_POLICY_NOT_FOUND",
8
+ /** The instance is not in a state that allows this (e.g. pausing a breached one). */
9
+ SLA_INVALID_STATE = "SLA_INVALID_STATE",
10
+ /** Approving needs a supervisor (Control-Centre:Admin, Organization Owner/Admin). */
11
+ SLA_APPROVER_REQUIRED = "SLA_APPROVER_REQUIRED",
12
+ /** Somebody may not approve their own request. */
13
+ SLA_SELF_APPROVAL = "SLA_SELF_APPROVAL",
14
+ SLA_POLICY_INVALID = "SLA_POLICY_INVALID",
15
+ /** Only Super-Admin manages platform policies; an organization manages its own. */
16
+ SLA_POLICY_FORBIDDEN = "SLA_POLICY_FORBIDDEN",
17
+ INCIDENT_NOT_EMERGENCY = "INCIDENT_NOT_EMERGENCY",
18
+ INCIDENT_ENDED = "INCIDENT_ENDED",
19
+ /** No escalation rule with that key in the incident's frozen policy. */
20
+ SLA_ESCALATION_RULE_NOT_FOUND = "SLA_ESCALATION_RULE_NOT_FOUND"
21
+ }
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Every entry in an incident's SLA history. The history is append-only: a
3
+ * transition is a new row, never an edit of an old one.
4
+ */
5
+ export declare enum IncidentSlaEventType {
6
+ SLA_STARTED = "SLA_STARTED",
7
+ SLA_WARNING = "SLA_WARNING",
8
+ SLA_AT_RISK = "SLA_AT_RISK",
9
+ SLA_BREACHED = "SLA_BREACHED",
10
+ SLA_MET = "SLA_MET",
11
+ /** The milestone was reached after the deadline: the breach stands, completedAt is recorded. */
12
+ SLA_COMPLETED_LATE = "SLA_COMPLETED_LATE",
13
+ SLA_CANCELLED = "SLA_CANCELLED",
14
+ SLA_EXPIRED = "SLA_EXPIRED",
15
+ SLA_WAIVED = "SLA_WAIVED",
16
+ SLA_PAUSE_REQUESTED = "SLA_PAUSE_REQUESTED",
17
+ SLA_PAUSE_REJECTED = "SLA_PAUSE_REJECTED",
18
+ SLA_PAUSED = "SLA_PAUSED",
19
+ SLA_RESUMED = "SLA_RESUMED",
20
+ SLA_EXCEPTION_REQUESTED = "SLA_EXCEPTION_REQUESTED",
21
+ SLA_EXCEPTION_APPROVED = "SLA_EXCEPTION_APPROVED",
22
+ SLA_EXCEPTION_REJECTED = "SLA_EXCEPTION_REJECTED",
23
+ MILESTONE_RECORDED = "MILESTONE_RECORDED",
24
+ PRIORITY_TRIAGED = "PRIORITY_TRIAGED",
25
+ ETA_CHANGED = "ETA_CHANGED",
26
+ ARRIVAL_INFERRED = "ARRIVAL_INFERRED",
27
+ ARRIVAL_CONFIRMED = "ARRIVAL_CONFIRMED",
28
+ UNIT_RECOMMENDED = "UNIT_RECOMMENDED",
29
+ UNIT_REASSIGNED = "UNIT_REASSIGNED",
30
+ ESCALATED = "ESCALATED",
31
+ NOTIFICATION_SENT = "NOTIFICATION_SENT",
32
+ NOTIFICATION_FAILED = "NOTIFICATION_FAILED",
33
+ AUTO_CLOSE_DEFERRED = "AUTO_CLOSE_DEFERRED",
34
+ INCIDENT_AUTO_CLOSED = "INCIDENT_AUTO_CLOSED",
35
+ INCIDENT_CLOSED = "INCIDENT_CLOSED"
36
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The milestones an emergency incident is measured against. Each is its own SLA
3
+ * instance with its own clock, so "acknowledged on time, arrived late" is a
4
+ * fact the record can state - one incident-wide deadline could not.
5
+ *
6
+ * RESPONSE_UNIT_ACCEPTANCE and MOBILIZATION are measured per dispatch (a unit
7
+ * that is stood down and replaced starts a new cycle); every other stage once
8
+ * per incident. ARRIVAL in particular never restarts on a reassignment - the
9
+ * person waiting does not get a new clock because a different unit is coming.
10
+ */
11
+ export declare enum IncidentSlaStage {
12
+ ACKNOWLEDGEMENT = "ACKNOWLEDGEMENT",
13
+ TRIAGE = "TRIAGE",
14
+ DISPATCH = "DISPATCH",
15
+ RESPONSE_UNIT_ACCEPTANCE = "RESPONSE_UNIT_ACCEPTANCE",
16
+ MOBILIZATION = "MOBILIZATION",
17
+ ARRIVAL = "ARRIVAL",
18
+ INITIAL_ASSESSMENT = "INITIAL_ASSESSMENT",
19
+ RESOLUTION = "RESOLUTION",
20
+ CLOSURE = "CLOSURE"
21
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Where one SLA instance stands.
3
+ *
4
+ * RUNNING -> WARNING -> AT_RISK -> BREACHED as its clock passes the policy's
5
+ * thresholds (75 % / 90 % / 100 % by default), and MET when its milestone is
6
+ * reached before the deadline. Whether an instance was met or breached is
7
+ * decided by timestamps (completedAt against deadlineAt), never by when a timer
8
+ * happened to fire.
9
+ *
10
+ * BREACHED is permanent: completing the milestone afterwards records
11
+ * completedAt but leaves the status BREACHED, and an approved exception changes
12
+ * only how the breach counts for compliance, not the record of it.
13
+ *
14
+ * - PAUSED: an approved pause (location inaccessible, waiting for the customer...).
15
+ * Only an unbreached instance can be paused; a pause never hides a breach.
16
+ * - WAIVED: an authorised supervisor declared the stage not applicable before it completed.
17
+ * - CANCELLED: made not applicable by an event (the unit rejected the dispatch,
18
+ * it was stood down, the incident ended before the stage ever started).
19
+ * - EXPIRED: the incident ended while the stage was still running, before its deadline.
20
+ * - NOT_STARTED: the stage's start milestone has not happened yet.
21
+ */
22
+ export declare enum IncidentSlaStatus {
23
+ NOT_STARTED = "NOT_STARTED",
24
+ RUNNING = "RUNNING",
25
+ WARNING = "WARNING",
26
+ AT_RISK = "AT_RISK",
27
+ PAUSED = "PAUSED",
28
+ BREACHED = "BREACHED",
29
+ MET = "MET",
30
+ WAIVED = "WAIVED",
31
+ CANCELLED = "CANCELLED",
32
+ EXPIRED = "EXPIRED"
33
+ }
@@ -0,0 +1,42 @@
1
+ /** Who an escalation reaches. Each level resolves to people within the incident's own tenancy. */
2
+ export declare enum SlaEscalationLevel {
3
+ /** The control room working the incident: its assignees and the control centre's users. */
4
+ DISPATCHER = "DISPATCHER",
5
+ /** The control centre's supervisors (Control-Centre:Admin). */
6
+ SUPERVISOR = "SUPERVISOR",
7
+ /** Contacts configured on the escalation rule - only "where configured". */
8
+ DUTY_MANAGER = "DUTY_MANAGER",
9
+ /** The organization's owners and administrators. */
10
+ ORGANIZATION_ADMIN = "ORGANIZATION_ADMIN"
11
+ }
12
+ /** What makes an escalation rule fire. */
13
+ export declare enum SlaEscalationTrigger {
14
+ SLA_WARNING = "SLA_WARNING",
15
+ SLA_AT_RISK = "SLA_AT_RISK",
16
+ SLA_BREACHED = "SLA_BREACHED",
17
+ /** The assigned unit's predicted arrival is close to the arrival deadline. */
18
+ ETA_AT_RISK = "ETA_AT_RISK",
19
+ /** The assigned unit is predicted to arrive after the arrival deadline. */
20
+ ETA_LIKELY_BREACH = "ETA_LIKELY_BREACH",
21
+ /** Tracking went quiet: no current position to predict an arrival from. */
22
+ ETA_UNCERTAIN = "ETA_UNCERTAIN",
23
+ /** A unit declined a dispatch. */
24
+ DISPATCH_REJECTED = "DISPATCH_REJECTED",
25
+ /** A unit was stood down before arriving (became unavailable, reassigned...). */
26
+ DISPATCH_CANCELLED = "DISPATCH_CANCELLED"
27
+ }
28
+ /** What an escalation does besides telling people. */
29
+ export declare enum SlaEscalationAction {
30
+ NOTIFY = "NOTIFY",
31
+ /** Re-evaluate the eligible units and put the best alternative in front of the dispatcher. */
32
+ RECOMMEND_ALTERNATIVE = "RECOMMEND_ALTERNATIVE"
33
+ }
34
+ /** How an escalation or emergency notification is delivered. */
35
+ export declare enum SlaNotificationChannel {
36
+ /** The admin's in-app notification (web notification + realtime toast). */
37
+ WEB = "WEB",
38
+ SMS = "SMS",
39
+ EMAIL = "EMAIL",
40
+ /** Mobile push (the reporter's app). */
41
+ PUSH = "PUSH"
42
+ }
@@ -0,0 +1,21 @@
1
+ /** Why a breach should be treated as excused for compliance reporting. */
2
+ export declare enum SlaExceptionReason {
3
+ ROAD_INACCESSIBLE = "ROAD_INACCESSIBLE",
4
+ SEVERE_WEATHER = "SEVERE_WEATHER",
5
+ CUSTOMER_UNREACHABLE = "CUSTOMER_UNREACHABLE",
6
+ INCORRECT_LOCATION = "INCORRECT_LOCATION",
7
+ EXTERNAL_AGENCY_DELAY = "EXTERNAL_AGENCY_DELAY",
8
+ SAFETY_HOLD = "SAFETY_HOLD",
9
+ SYSTEM_OUTAGE = "SYSTEM_OUTAGE",
10
+ OTHER = "OTHER"
11
+ }
12
+ /**
13
+ * An exception's state. Approval never changes the instance's timestamps or its
14
+ * BREACHED status - only how the breach is counted for compliance.
15
+ */
16
+ export declare enum SlaExceptionStatus {
17
+ NONE = "NONE",
18
+ REQUESTED = "REQUESTED",
19
+ APPROVED = "APPROVED",
20
+ REJECTED = "REJECTED"
21
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * One word for an incident's SLA right now, for the card's headline. Derived
3
+ * from its instances: the worst open one, else how the finished ones went.
4
+ */
5
+ export declare enum SlaOverallState {
6
+ NOT_TRACKED = "NOT_TRACKED",
7
+ ON_TRACK = "ON_TRACK",
8
+ WARNING = "WARNING",
9
+ AT_RISK = "AT_RISK",
10
+ BREACHED = "BREACHED",
11
+ PAUSED = "PAUSED",
12
+ MET = "MET",
13
+ /** Every breach on the incident has an approved exception. */
14
+ EXCEPTION = "EXCEPTION"
15
+ }
16
+ /** The emergency-desk names for incident priorities: P1 Critical ... P4 Low. */
17
+ export declare enum SlaPriorityLevel {
18
+ P1 = "P1",
19
+ P2 = "P2",
20
+ P3 = "P3",
21
+ P4 = "P4"
22
+ }
@@ -0,0 +1,22 @@
1
+ /** The only reasons an SLA clock may be paused. There is no free-form reason on purpose. */
2
+ export declare enum SlaPauseReason {
3
+ WAITING_FOR_CUSTOMER = "WAITING_FOR_CUSTOMER",
4
+ WAITING_FOR_EXTERNAL_AGENCY = "WAITING_FOR_EXTERNAL_AGENCY",
5
+ LOCATION_INACCESSIBLE = "LOCATION_INACCESSIBLE",
6
+ ENVIRONMENT_UNSAFE = "ENVIRONMENT_UNSAFE",
7
+ INCIDENT_DEESCALATED = "INCIDENT_DEESCALATED",
8
+ OTHER_APPROVED_REASON = "OTHER_APPROVED_REASON"
9
+ }
10
+ /**
11
+ * A pause request's life. REQUESTED pauses nothing - the clock keeps running
12
+ * until a supervisor approves, so asking for a pause can never be used to
13
+ * stop a clock retroactively.
14
+ */
15
+ export declare enum SlaPauseStatus {
16
+ REQUESTED = "REQUESTED",
17
+ ACTIVE = "ACTIVE",
18
+ ENDED = "ENDED",
19
+ REJECTED = "REJECTED",
20
+ /** The instance completed or the incident ended while the request was pending. */
21
+ WITHDRAWN = "WITHDRAWN"
22
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * How specific an SLA policy is - the most specific dimension it is scoped to.
3
+ * Resolution layers policies from PLATFORM (least specific) to ZONE (most), so
4
+ * an organization can override only the arrival target and inherit the rest.
5
+ */
6
+ export declare enum SlaPolicyScope {
7
+ PLATFORM = "PLATFORM",
8
+ ORGANIZATION = "ORGANIZATION",
9
+ CONTROL_CENTRE = "CONTROL_CENTRE",
10
+ INCIDENT_CATEGORY = "INCIDENT_CATEGORY",
11
+ INCIDENT_TYPE = "INCIDENT_TYPE",
12
+ PRIORITY = "PRIORITY",
13
+ ZONE = "ZONE"
14
+ }
@@ -0,0 +1,31 @@
1
+ export * from './enums/incident-sla-stage.enum';
2
+ export * from './enums/incident-sla-status.enum';
3
+ export * from './enums/emergency-incident-stage.enum';
4
+ export * from './enums/incident-sla-event-type.enum';
5
+ export * from './enums/incident-sla-actor.enum';
6
+ export * from './enums/sla-escalation.enum';
7
+ export * from './enums/sla-pause.enum';
8
+ export * from './enums/sla-exception.enum';
9
+ export * from './enums/sla-policy-scope.enum';
10
+ export * from './enums/incident-closure.enum';
11
+ export * from './enums/eta-status.enum';
12
+ export * from './enums/sla-overall-state.enum';
13
+ export * from './enums/incident-sla-error-code.enum';
14
+ export * from './enums/emergency-notification.enum';
15
+ export * from './interfaces/incident-sla-policy';
16
+ export * from './interfaces/incident-sla-views';
17
+ export * from './interfaces/incident-sla-events';
18
+ export * from './interfaces/emergency-workflow';
19
+ export * from './interfaces/incident-sla-analytics';
20
+ export * from './constants/incident-sla-defaults.const';
21
+ export * from './constants/incident-sla-kafka.const';
22
+ export * from './constants/emergency-incident-workflow.const';
23
+ export * from './dtos/emergency-operations.dto';
24
+ export * from './dtos/incident-sla-policy.dto';
25
+ export * from './dtos/emergency-workflow.dto';
26
+ export * from './dtos/emergency-notification.dto';
27
+ export * from './dtos/incident-sla-analytics-query.dto';
28
+ export * from './utils/incident-sla-priority.util';
29
+ export * from './utils/incident-sla-time.util';
30
+ export * from './utils/incident-sla-eta.util';
31
+ export * from './utils/incident-sla-event-id.util';
@@ -0,0 +1,131 @@
1
+ import { IncidentPriority } from '../../incident/enums/incident-priority.enum';
2
+ import { ResponseUnitDispatchStatus } from '../../dispatch/enums/response-unit-dispatch-status.enum';
3
+ import { EmergencyIncidentStage } from '../enums/emergency-incident-stage.enum';
4
+ import { EtaStatus } from '../enums/eta-status.enum';
5
+ import { IncidentSlaEventType } from '../enums/incident-sla-event-type.enum';
6
+ import { IncidentSlaStage } from '../enums/incident-sla-stage.enum';
7
+ import { IncidentSlaStatus } from '../enums/incident-sla-status.enum';
8
+ import { SlaEscalationAction, SlaEscalationLevel, SlaEscalationTrigger, SlaNotificationChannel } from '../enums/sla-escalation.enum';
9
+ /**
10
+ * The contract between clarion-workflow-manager's emergency workflow and
11
+ * clarion-incident's internal emergency routes. The workflow keeps no copy of
12
+ * the incident: every activity returns a fresh plan read from the database,
13
+ * and the workflow only decides WHEN to call next.
14
+ */
15
+ /** An open SLA instance the workflow times. */
16
+ export interface EmergencySlaPlanInstance {
17
+ instanceId: number;
18
+ stage: IncidentSlaStage;
19
+ cycle: number;
20
+ status: IncidentSlaStatus;
21
+ responseUnitDispatchId: number | null;
22
+ startedAt: string | null;
23
+ warningAt: string | null;
24
+ atRiskAt: string | null;
25
+ deadlineAt: string | null;
26
+ paused: boolean;
27
+ }
28
+ /** An escalation rule as the workflow sees it: no contact details. */
29
+ export interface EmergencyWorkflowEscalationRule {
30
+ key: string;
31
+ trigger: SlaEscalationTrigger;
32
+ stages: IncidentSlaStage[];
33
+ priorities: IncidentPriority[];
34
+ level: SlaEscalationLevel;
35
+ channels: SlaNotificationChannel[];
36
+ actions: SlaEscalationAction[];
37
+ delaySeconds: number;
38
+ }
39
+ export interface EmergencyPlanDispatch {
40
+ dispatchId: number;
41
+ responseUnitId: number;
42
+ status: ResponseUnitDispatchStatus;
43
+ etaStatus: EtaStatus | null;
44
+ }
45
+ /** `POST /incidents/internal/emergency/:id/plan` and every activity's answer. */
46
+ export interface EmergencySlaPlan {
47
+ incidentId: number;
48
+ organizationId: number;
49
+ controlCentreId: number | null;
50
+ /** False: not an emergency the SLA covers (grievance, never reaches the control room, SLA off). */
51
+ tracked: boolean;
52
+ notTrackedReason: string | null;
53
+ incidentStatus: string;
54
+ /** Resolved, Closed, Unresolved or Archived. */
55
+ ended: boolean;
56
+ /** Closed or Archived - the workflow is done. */
57
+ closed: boolean;
58
+ currentStage: EmergencyIncidentStage | null;
59
+ slaPriority: IncidentPriority | null;
60
+ serverTime: string;
61
+ openInstances: EmergencySlaPlanInstance[];
62
+ autoClose: {
63
+ enabled: boolean;
64
+ afterSeconds: number;
65
+ resolvedAt: string | null;
66
+ dueAt: string | null;
67
+ };
68
+ /** When to ask whether each en-route unit's tracking has gone quiet. */
69
+ trackingWatch: {
70
+ dispatchId: number;
71
+ responseUnitId: number;
72
+ checkAt: string;
73
+ }[];
74
+ activeDispatches: EmergencyPlanDispatch[];
75
+ escalationRules: EmergencyWorkflowEscalationRule[];
76
+ allowAutomaticReassignment: boolean;
77
+ policyId: number | null;
78
+ policyVersion: number | null;
79
+ }
80
+ export interface RecordSlaThresholdResult {
81
+ applied: boolean;
82
+ eventType: IncidentSlaEventType | null;
83
+ stage: IncidentSlaStage | null;
84
+ /** Why nothing happened: completed meanwhile, paused, deadline moved... */
85
+ reason: string | null;
86
+ plan: EmergencySlaPlan;
87
+ }
88
+ export interface EmergencyAlternativeRecommendation {
89
+ responseUnitId: number;
90
+ responseUnitName: string | null;
91
+ distanceMetres: number | null;
92
+ etaSeconds: number | null;
93
+ }
94
+ export interface EmergencyEscalationResult {
95
+ escalated: boolean;
96
+ skippedReason: string | null;
97
+ notificationRequested: boolean;
98
+ alternative: EmergencyAlternativeRecommendation | null;
99
+ plan: EmergencySlaPlan;
100
+ }
101
+ export interface EmergencyReassignmentResult {
102
+ reassigned: boolean;
103
+ reason: string | null;
104
+ newDispatchId: number | null;
105
+ cancelledDispatchId: number | null;
106
+ plan: EmergencySlaPlan;
107
+ }
108
+ export type EmergencyAutoCloseOutcome = 'CLOSED' | 'ALREADY_CLOSED' | 'NOT_RESOLVED' | 'DEFERRED' | 'RESCHEDULED' | 'DISABLED' | 'NOT_TRACKED';
109
+ export interface EmergencyAutoCloseResult {
110
+ outcome: EmergencyAutoCloseOutcome;
111
+ /** DEFERRED / RESCHEDULED: try again then. */
112
+ retryAt: string | null;
113
+ plan: EmergencySlaPlan;
114
+ }
115
+ export interface EmergencyTrackingFreshnessResult {
116
+ /** Dispatches whose ETA turned UNCERTAIN on this check. */
117
+ becameUncertain: number[];
118
+ plan: EmergencySlaPlan;
119
+ }
120
+ export interface EmergencyMilestoneResult {
121
+ recorded: boolean;
122
+ reason: string | null;
123
+ plan: EmergencySlaPlan;
124
+ }
125
+ /** `GET /incidents/internal/emergency/open` - the reconciler's view. */
126
+ export interface EmergencyOpenIncidentRef {
127
+ incidentId: number;
128
+ organizationId: number;
129
+ createdAt: string;
130
+ workflowId: string | null;
131
+ }
@@ -0,0 +1,35 @@
1
+ import { IncidentSlaStage } from '../enums/incident-sla-stage.enum';
2
+ /**
3
+ * Durations at percentiles, in seconds. Percentiles are the point: an average
4
+ * hides the slow tail, and the slow tail is the emergency that went wrong.
5
+ */
6
+ export interface IncidentSlaDurationPercentiles {
7
+ p50: number | null;
8
+ p75: number | null;
9
+ p90: number | null;
10
+ p95: number | null;
11
+ p99: number | null;
12
+ average: number | null;
13
+ }
14
+ export interface IncidentSlaStageAnalytics {
15
+ stage: IncidentSlaStage;
16
+ instances: number;
17
+ met: number;
18
+ breached: number;
19
+ breachedWithApprovedException: number;
20
+ compliancePercent: number | null;
21
+ complianceWithExceptionsPercent: number | null;
22
+ /** Start to milestone, pauses excluded, over the instances that reached it. */
23
+ duration: IncidentSlaDurationPercentiles;
24
+ }
25
+ /** `GET /incident-sla/analytics`. */
26
+ export interface IncidentSlaAnalyticsResult {
27
+ from: string;
28
+ to: string;
29
+ organizationId: number | null;
30
+ controlCentreId: number | null;
31
+ incidents: number;
32
+ breachedIncidents: number;
33
+ stages: IncidentSlaStageAnalytics[];
34
+ generatedAt: string;
35
+ }