grm-shared-library 1.1.235 → 1.1.237

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/README.md +24 -0
  2. package/dist/cjs/index.js +1 -0
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/kafka/topics.js +10 -0
  5. package/dist/cjs/kafka/topics.js.map +1 -1
  6. package/dist/cjs/modules/dispatch/constants/response-unit-dispatch-defaults.const.js +55 -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 +230 -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 +41 -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 +33 -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 +16 -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 +49 -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 +4 -0
  75. package/dist/cjs/modules/incident/enums/incident-actions.enum.js.map +1 -1
  76. package/dist/cjs/modules/notification/dtos/notification-analytics-query.dto.js +56 -0
  77. package/dist/cjs/modules/notification/dtos/notification-analytics-query.dto.js.map +1 -0
  78. package/dist/cjs/modules/notification/index.js +3 -0
  79. package/dist/cjs/modules/notification/index.js.map +1 -1
  80. package/dist/cjs/modules/notification/interfaces/notification-analytics.js +27 -0
  81. package/dist/cjs/modules/notification/interfaces/notification-analytics.js.map +1 -0
  82. package/dist/cjs/modules/permission/data/permissions.data.js +9 -0
  83. package/dist/cjs/modules/permission/data/permissions.data.js.map +1 -1
  84. package/dist/cjs/modules/permission/enums/permission-actions.enum.js +19 -0
  85. package/dist/cjs/modules/permission/enums/permission-actions.enum.js.map +1 -1
  86. package/dist/cjs/modules/permission/enums/permissions-module.enum.js +1 -0
  87. package/dist/cjs/modules/permission/enums/permissions-module.enum.js.map +1 -1
  88. package/dist/cjs/modules/response-unit/dtos/response-unit/base-response-unit.dto.js +9 -0
  89. package/dist/cjs/modules/response-unit/dtos/response-unit/base-response-unit.dto.js.map +1 -1
  90. package/dist/cjs/modules/response-unit/enums/response-unit/response-capability.enum.js +29 -0
  91. package/dist/cjs/modules/response-unit/enums/response-unit/response-capability.enum.js.map +1 -0
  92. package/dist/cjs/modules/response-unit/enums/response-unit/response-unit-availability.enum.js +27 -0
  93. package/dist/cjs/modules/response-unit/enums/response-unit/response-unit-availability.enum.js.map +1 -0
  94. package/dist/cjs/modules/response-unit/index.js +5 -0
  95. package/dist/cjs/modules/response-unit/index.js.map +1 -1
  96. package/dist/cjs/modules/response-unit/utils/response-capability.util.js +74 -0
  97. package/dist/cjs/modules/response-unit/utils/response-capability.util.js.map +1 -0
  98. package/dist/cjs/modules/response-unit/utils/response-unit-availability.util.js +46 -0
  99. package/dist/cjs/modules/response-unit/utils/response-unit-availability.util.js.map +1 -0
  100. package/dist/cjs/modules/role/data/roles.data.js +27 -0
  101. package/dist/cjs/modules/role/data/roles.data.js.map +1 -1
  102. package/dist/cjs/modules/sms/constants/sms-templates.config.js +18 -0
  103. package/dist/cjs/modules/sms/constants/sms-templates.config.js.map +1 -1
  104. package/dist/cjs/modules/sms/enums/sms-template.enum.js +1 -0
  105. package/dist/cjs/modules/sms/enums/sms-template.enum.js.map +1 -1
  106. package/dist/esm/index.js +1 -0
  107. package/dist/esm/index.js.map +1 -1
  108. package/dist/esm/kafka/topics.js +10 -0
  109. package/dist/esm/kafka/topics.js.map +1 -1
  110. package/dist/esm/modules/dispatch/constants/response-unit-dispatch-defaults.const.js +52 -0
  111. package/dist/esm/modules/dispatch/constants/response-unit-dispatch-defaults.const.js.map +1 -0
  112. package/dist/esm/modules/dispatch/constants/response-unit-dispatch-kafka.const.js +18 -0
  113. package/dist/esm/modules/dispatch/constants/response-unit-dispatch-kafka.const.js.map +1 -0
  114. package/dist/esm/modules/dispatch/dtos/dispatch-response-unit.dto.js +54 -0
  115. package/dist/esm/modules/dispatch/dtos/dispatch-response-unit.dto.js.map +1 -0
  116. package/dist/esm/modules/dispatch/dtos/response-unit-dispatch-notification.dto.js +223 -0
  117. package/dist/esm/modules/dispatch/dtos/response-unit-dispatch-notification.dto.js.map +1 -0
  118. package/dist/esm/modules/dispatch/dtos/response-unit-dispatch-profile-query.dto.js +57 -0
  119. package/dist/esm/modules/dispatch/dtos/response-unit-dispatch-profile-query.dto.js.map +1 -0
  120. package/dist/esm/modules/dispatch/dtos/response-unit-nearby-query.dto.js +62 -0
  121. package/dist/esm/modules/dispatch/dtos/response-unit-nearby-query.dto.js.map +1 -0
  122. package/dist/esm/modules/dispatch/dtos/update-response-unit-dispatch-status.dto.js +37 -0
  123. package/dist/esm/modules/dispatch/dtos/update-response-unit-dispatch-status.dto.js.map +1 -0
  124. package/dist/esm/modules/dispatch/enums/incident-dispatch-blocker.enum.js +18 -0
  125. package/dist/esm/modules/dispatch/enums/incident-dispatch-blocker.enum.js.map +1 -0
  126. package/dist/esm/modules/dispatch/enums/response-capability-requirement-source.enum.js +9 -0
  127. package/dist/esm/modules/dispatch/enums/response-capability-requirement-source.enum.js.map +1 -0
  128. package/dist/esm/modules/dispatch/enums/response-unit-capability-match.enum.js +21 -0
  129. package/dist/esm/modules/dispatch/enums/response-unit-capability-match.enum.js.map +1 -0
  130. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-constraint.enum.js +31 -0
  131. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-constraint.enum.js.map +1 -0
  132. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-error-code.enum.js +23 -0
  133. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-error-code.enum.js.map +1 -0
  134. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-notification-failure.enum.js +15 -0
  135. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-notification-failure.enum.js.map +1 -0
  136. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-notification-status.enum.js +13 -0
  137. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-notification-status.enum.js.map +1 -0
  138. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-status.enum.js +30 -0
  139. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-status.enum.js.map +1 -0
  140. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-transition-source.enum.js +13 -0
  141. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-transition-source.enum.js.map +1 -0
  142. package/dist/esm/modules/dispatch/enums/response-unit-distance-basis.enum.js +9 -0
  143. package/dist/esm/modules/dispatch/enums/response-unit-distance-basis.enum.js.map +1 -0
  144. package/dist/esm/modules/dispatch/enums/response-unit-location-freshness.enum.js +18 -0
  145. package/dist/esm/modules/dispatch/enums/response-unit-location-freshness.enum.js.map +1 -0
  146. package/dist/esm/modules/dispatch/enums/response-unit-location-source.enum.js +14 -0
  147. package/dist/esm/modules/dispatch/enums/response-unit-location-source.enum.js.map +1 -0
  148. package/dist/esm/modules/dispatch/enums/response-unit-recommendation-reason.enum.js +22 -0
  149. package/dist/esm/modules/dispatch/enums/response-unit-recommendation-reason.enum.js.map +1 -0
  150. package/dist/esm/modules/dispatch/enums/response-unit-recommendation-status.enum.js +20 -0
  151. package/dist/esm/modules/dispatch/enums/response-unit-recommendation-status.enum.js.map +1 -0
  152. package/dist/esm/modules/dispatch/index.js +37 -0
  153. package/dist/esm/modules/dispatch/index.js.map +1 -0
  154. package/dist/esm/modules/dispatch/interfaces/incident-response-unit-dispatch.js +2 -0
  155. package/dist/esm/modules/dispatch/interfaces/incident-response-unit-dispatch.js.map +1 -0
  156. package/dist/esm/modules/dispatch/interfaces/response-unit-dispatch-events.js +2 -0
  157. package/dist/esm/modules/dispatch/interfaces/response-unit-dispatch-events.js.map +1 -0
  158. package/dist/esm/modules/dispatch/interfaces/response-unit-dispatch-profile.js +2 -0
  159. package/dist/esm/modules/dispatch/interfaces/response-unit-dispatch-profile.js.map +1 -0
  160. package/dist/esm/modules/dispatch/interfaces/response-unit-proximity.js +2 -0
  161. package/dist/esm/modules/dispatch/interfaces/response-unit-proximity.js.map +1 -0
  162. package/dist/esm/modules/dispatch/interfaces/response-unit-recommendation.js +2 -0
  163. package/dist/esm/modules/dispatch/interfaces/response-unit-recommendation.js.map +1 -0
  164. package/dist/esm/modules/dispatch/utils/dispatch-geo.util.js +39 -0
  165. package/dist/esm/modules/dispatch/utils/dispatch-geo.util.js.map +1 -0
  166. package/dist/esm/modules/dispatch/utils/incident-dispatchability.util.js +37 -0
  167. package/dist/esm/modules/dispatch/utils/incident-dispatchability.util.js.map +1 -0
  168. package/dist/esm/modules/dispatch/utils/response-capability-match.util.js +40 -0
  169. package/dist/esm/modules/dispatch/utils/response-capability-match.util.js.map +1 -0
  170. package/dist/esm/modules/dispatch/utils/response-unit-dispatch-event.util.js +15 -0
  171. package/dist/esm/modules/dispatch/utils/response-unit-dispatch-event.util.js.map +1 -0
  172. package/dist/esm/modules/dispatch/utils/response-unit-dispatch-status.util.js +42 -0
  173. package/dist/esm/modules/dispatch/utils/response-unit-dispatch-status.util.js.map +1 -0
  174. package/dist/esm/modules/incident/dtos/category/create-incident-category.dto.js +10 -1
  175. package/dist/esm/modules/incident/dtos/category/create-incident-category.dto.js.map +1 -1
  176. package/dist/esm/modules/incident/dtos/type/create-incident-type.dto.js +10 -1
  177. package/dist/esm/modules/incident/dtos/type/create-incident-type.dto.js.map +1 -1
  178. package/dist/esm/modules/incident/enums/incident-actions.enum.js +4 -0
  179. package/dist/esm/modules/incident/enums/incident-actions.enum.js.map +1 -1
  180. package/dist/esm/modules/notification/dtos/notification-analytics-query.dto.js +52 -0
  181. package/dist/esm/modules/notification/dtos/notification-analytics-query.dto.js.map +1 -0
  182. package/dist/esm/modules/notification/index.js +3 -0
  183. package/dist/esm/modules/notification/index.js.map +1 -1
  184. package/dist/esm/modules/notification/interfaces/notification-analytics.js +26 -0
  185. package/dist/esm/modules/notification/interfaces/notification-analytics.js.map +1 -0
  186. package/dist/esm/modules/permission/data/permissions.data.js +9 -0
  187. package/dist/esm/modules/permission/data/permissions.data.js.map +1 -1
  188. package/dist/esm/modules/permission/enums/permission-actions.enum.js +19 -0
  189. package/dist/esm/modules/permission/enums/permission-actions.enum.js.map +1 -1
  190. package/dist/esm/modules/permission/enums/permissions-module.enum.js +1 -0
  191. package/dist/esm/modules/permission/enums/permissions-module.enum.js.map +1 -1
  192. package/dist/esm/modules/response-unit/dtos/response-unit/base-response-unit.dto.js +10 -1
  193. package/dist/esm/modules/response-unit/dtos/response-unit/base-response-unit.dto.js.map +1 -1
  194. package/dist/esm/modules/response-unit/enums/response-unit/response-capability.enum.js +26 -0
  195. package/dist/esm/modules/response-unit/enums/response-unit/response-capability.enum.js.map +1 -0
  196. package/dist/esm/modules/response-unit/enums/response-unit/response-unit-availability.enum.js +24 -0
  197. package/dist/esm/modules/response-unit/enums/response-unit/response-unit-availability.enum.js.map +1 -0
  198. package/dist/esm/modules/response-unit/index.js +5 -0
  199. package/dist/esm/modules/response-unit/index.js.map +1 -1
  200. package/dist/esm/modules/response-unit/utils/response-capability.util.js +68 -0
  201. package/dist/esm/modules/response-unit/utils/response-capability.util.js.map +1 -0
  202. package/dist/esm/modules/response-unit/utils/response-unit-availability.util.js +42 -0
  203. package/dist/esm/modules/response-unit/utils/response-unit-availability.util.js.map +1 -0
  204. package/dist/esm/modules/role/data/roles.data.js +27 -0
  205. package/dist/esm/modules/role/data/roles.data.js.map +1 -1
  206. package/dist/esm/modules/sms/constants/sms-templates.config.js +18 -0
  207. package/dist/esm/modules/sms/constants/sms-templates.config.js.map +1 -1
  208. package/dist/esm/modules/sms/enums/sms-template.enum.js +1 -0
  209. package/dist/esm/modules/sms/enums/sms-template.enum.js.map +1 -1
  210. package/dist/types/index.d.ts +1 -0
  211. package/dist/types/kafka/topics.d.ts +4 -0
  212. package/dist/types/modules/dispatch/constants/response-unit-dispatch-defaults.const.d.ts +43 -0
  213. package/dist/types/modules/dispatch/constants/response-unit-dispatch-kafka.const.d.ts +16 -0
  214. package/dist/types/modules/dispatch/dtos/dispatch-response-unit.dto.d.ts +20 -0
  215. package/dist/types/modules/dispatch/dtos/response-unit-dispatch-notification.dto.d.ts +47 -0
  216. package/dist/types/modules/dispatch/dtos/response-unit-dispatch-profile-query.dto.d.ts +13 -0
  217. package/dist/types/modules/dispatch/dtos/response-unit-nearby-query.dto.d.ts +15 -0
  218. package/dist/types/modules/dispatch/dtos/update-response-unit-dispatch-status.dto.d.ts +9 -0
  219. package/dist/types/modules/dispatch/enums/incident-dispatch-blocker.enum.d.ts +16 -0
  220. package/dist/types/modules/dispatch/enums/response-capability-requirement-source.enum.d.ts +7 -0
  221. package/dist/types/modules/dispatch/enums/response-unit-capability-match.enum.d.ts +19 -0
  222. package/dist/types/modules/dispatch/enums/response-unit-dispatch-constraint.enum.d.ts +27 -0
  223. package/dist/types/modules/dispatch/enums/response-unit-dispatch-error-code.enum.d.ts +21 -0
  224. package/dist/types/modules/dispatch/enums/response-unit-dispatch-notification-failure.enum.d.ts +13 -0
  225. package/dist/types/modules/dispatch/enums/response-unit-dispatch-notification-status.enum.d.ts +11 -0
  226. package/dist/types/modules/dispatch/enums/response-unit-dispatch-status.enum.d.ts +28 -0
  227. package/dist/types/modules/dispatch/enums/response-unit-dispatch-transition-source.enum.d.ts +11 -0
  228. package/dist/types/modules/dispatch/enums/response-unit-distance-basis.enum.d.ts +7 -0
  229. package/dist/types/modules/dispatch/enums/response-unit-location-freshness.enum.d.ts +16 -0
  230. package/dist/types/modules/dispatch/enums/response-unit-location-source.enum.d.ts +12 -0
  231. package/dist/types/modules/dispatch/enums/response-unit-recommendation-reason.enum.d.ts +20 -0
  232. package/dist/types/modules/dispatch/enums/response-unit-recommendation-status.enum.d.ts +18 -0
  233. package/dist/types/modules/dispatch/index.d.ts +31 -0
  234. package/dist/types/modules/dispatch/interfaces/incident-response-unit-dispatch.d.ts +121 -0
  235. package/dist/types/modules/dispatch/interfaces/response-unit-dispatch-events.d.ts +103 -0
  236. package/dist/types/modules/dispatch/interfaces/response-unit-dispatch-profile.d.ts +52 -0
  237. package/dist/types/modules/dispatch/interfaces/response-unit-proximity.d.ts +45 -0
  238. package/dist/types/modules/dispatch/interfaces/response-unit-recommendation.d.ts +130 -0
  239. package/dist/types/modules/dispatch/utils/dispatch-geo.util.d.ts +16 -0
  240. package/dist/types/modules/dispatch/utils/incident-dispatchability.util.d.ts +18 -0
  241. package/dist/types/modules/dispatch/utils/response-capability-match.util.d.ts +26 -0
  242. package/dist/types/modules/dispatch/utils/response-unit-dispatch-event.util.d.ts +9 -0
  243. package/dist/types/modules/dispatch/utils/response-unit-dispatch-status.util.d.ts +16 -0
  244. package/dist/types/modules/incident/dtos/category/create-incident-category.dto.d.ts +6 -0
  245. package/dist/types/modules/incident/dtos/type/create-incident-type.dto.d.ts +6 -0
  246. package/dist/types/modules/incident/enums/incident-actions.enum.d.ts +4 -0
  247. package/dist/types/modules/incident/intefaces/incident-category.d.ts +6 -0
  248. package/dist/types/modules/incident/intefaces/incident-type.d.ts +6 -0
  249. package/dist/types/modules/notification/dtos/notification-analytics-query.dto.d.ts +14 -0
  250. package/dist/types/modules/notification/index.d.ts +2 -0
  251. package/dist/types/modules/notification/interfaces/notification-analytics.d.ts +273 -0
  252. package/dist/types/modules/permission/enums/permission-actions.enum.d.ts +4 -0
  253. package/dist/types/modules/permission/enums/permissions-module.enum.d.ts +1 -0
  254. package/dist/types/modules/response-unit/dtos/response-unit/base-response-unit.dto.d.ts +7 -0
  255. package/dist/types/modules/response-unit/enums/response-unit/response-capability.enum.d.ts +24 -0
  256. package/dist/types/modules/response-unit/enums/response-unit/response-unit-availability.enum.d.ts +22 -0
  257. package/dist/types/modules/response-unit/index.d.ts +4 -0
  258. package/dist/types/modules/response-unit/interfaces/response-unit/response-unit.d.ts +3 -0
  259. package/dist/types/modules/response-unit/utils/response-capability.util.d.ts +31 -0
  260. package/dist/types/modules/response-unit/utils/response-unit-availability.util.d.ts +21 -0
  261. package/dist/types/modules/sms/enums/sms-template.enum.d.ts +1 -0
  262. package/package.json +1 -1
@@ -11,6 +11,7 @@ export var SmsTemplateType;
11
11
  SmsTemplateType["SAFETY_CHECK_GUARDIAN_ENDED"] = "safety_check_guardian_ended";
12
12
  SmsTemplateType["FOLLOW_ME_GUARDIAN_REQUEST"] = "follow_me_guardian_request";
13
13
  SmsTemplateType["FOLLOW_ME_GUARDIAN_ENDED"] = "follow_me_guardian_ended";
14
+ SmsTemplateType["RESPONSE_UNIT_DISPATCH"] = "response_unit_dispatch";
14
15
  SmsTemplateType["APPOINTMENT_REMINDER"] = "appointment_reminder";
15
16
  SmsTemplateType["GENERAL_NOTIFICATION"] = "general_notification";
16
17
  })(SmsTemplateType || (SmsTemplateType = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"sms-template.enum.js","sourceRoot":"","sources":["../../../../../src/modules/sms/enums/sms-template.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,eAcX;AAdD,WAAY,eAAe;IACvB,wDAAqC,CAAA;IACrC,oDAAiC,CAAA;IACjC,sCAAmB,CAAA;IACnB,4DAAyC,CAAA;IACzC,oDAAiC,CAAA;IACjC,kEAA+C,CAAA;IAC/C,oFAAiE,CAAA;IACjE,kFAA+D,CAAA;IAC/D,8EAA2D,CAAA;IAC3D,4EAAyD,CAAA;IACzD,wEAAqD,CAAA;IACrD,gEAA6C,CAAA;IAC7C,gEAA6C,CAAA;AACjD,CAAC,EAdW,eAAe,KAAf,eAAe,QAc1B"}
1
+ {"version":3,"file":"sms-template.enum.js","sourceRoot":"","sources":["../../../../../src/modules/sms/enums/sms-template.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,eAeX;AAfD,WAAY,eAAe;IACvB,wDAAqC,CAAA;IACrC,oDAAiC,CAAA;IACjC,sCAAmB,CAAA;IACnB,4DAAyC,CAAA;IACzC,oDAAiC,CAAA;IACjC,kEAA+C,CAAA;IAC/C,oFAAiE,CAAA;IACjE,kFAA+D,CAAA;IAC/D,8EAA2D,CAAA;IAC3D,4EAAyD,CAAA;IACzD,wEAAqD,CAAA;IACrD,oEAAiD,CAAA;IACjD,gEAA6C,CAAA;IAC7C,gEAA6C,CAAA;AACjD,CAAC,EAfW,eAAe,KAAf,eAAe,QAe1B"}
@@ -28,6 +28,7 @@ export * from './modules/alert-intake/index';
28
28
  export * from './modules/safety/index';
29
29
  export * from './modules/billing/index';
30
30
  export * from './modules/newsfeed/index';
31
+ export * from './modules/dispatch/index';
31
32
  export * from './interfaces/server-message';
32
33
  export * from './interfaces/i-request-with-user';
33
34
  export * from './interfaces/validated-user';
@@ -24,6 +24,10 @@ export declare const KAFKA_TOPICS: {
24
24
  INCIDENT_ASSIGNED: string;
25
25
  INCIDENT_ASSIGNMENT_CREATED: string;
26
26
  INCIDENT_RESPONSE_UNIT_ASSIGNMENT_CREATED: string;
27
+ INCIDENT_RESPONSE_UNIT_DISPATCH_CREATED: string;
28
+ INCIDENT_RESPONSE_UNIT_DISPATCH_STATUS_CHANGED: string;
29
+ INCIDENT_RESPONSE_UNIT_DISPATCH_NOTIFICATION_REQUESTED: string;
30
+ RESPONSE_UNIT_DISPATCH_NOTIFICATION_RESULT: string;
27
31
  CHAT_MESSAGE_CREATED: string;
28
32
  CHAT_CONVERSATION_CREATED: string;
29
33
  CHAT_PRESENCE_UPDATED: string;
@@ -0,0 +1,43 @@
1
+ import { ResponseUnitDispatchStatus } from '../enums/response-unit-dispatch-status.enum';
2
+ /**
3
+ * The statuses in which a unit is out on a job. Exactly the set the partial
4
+ * unique index in clarion-incident covers - a unit may hold one of these at a
5
+ * time, platform-wide. Change one, change the other (and write a migration).
6
+ */
7
+ export declare const ACTIVE_RESPONSE_UNIT_DISPATCH_STATUSES: readonly ResponseUnitDispatchStatus[];
8
+ export declare const TERMINAL_RESPONSE_UNIT_DISPATCH_STATUSES: readonly ResponseUnitDispatchStatus[];
9
+ /** Free-text lengths, shared by the DTOs and the columns that store them. */
10
+ export declare const RESPONSE_UNIT_DISPATCH_FIELD_LIMITS: {
11
+ readonly overrideReason: 500;
12
+ readonly notes: 1000;
13
+ readonly statusReason: 500;
14
+ /** The gateway drops a longer Idempotency-Key, so nothing longer ever arrives. */
15
+ readonly idempotencyKey: 200;
16
+ /** The incident description as quoted in a dispatch message. */
17
+ readonly messageSummary: 160;
18
+ readonly messageAddress: 160;
19
+ };
20
+ /**
21
+ * Defaults for the recommendation. Each is overridable by the consuming
22
+ * service's configuration; these are what an unconfigured deployment does.
23
+ */
24
+ export declare const RESPONSE_UNIT_RECOMMENDATION_DEFAULTS: {
25
+ /** Recommendable units shown after the recommended one. */
26
+ readonly maxAlternatives: 5;
27
+ /** The "every other unit" list for manual selection. */
28
+ readonly maxOtherUnits: 50;
29
+ /** How far the live GEO search looks. Country-scale: a control room covers a region. */
30
+ readonly searchRadiusMetres: 200000;
31
+ /** How many live units the GEO search returns, nearest first. */
32
+ readonly liveCandidateLimit: 100;
33
+ /** How many top candidates get a road travel time, when routing is enabled. */
34
+ readonly travelTimeCandidates: 3;
35
+ /** Units in one recommendation's catalogue before it is truncated. */
36
+ readonly maxCatalogueUnits: 2000;
37
+ };
38
+ /** Bounds a nearby query accepts. */
39
+ export declare const RESPONSE_UNIT_NEARBY_LIMITS: {
40
+ readonly minRadiusMetres: 100;
41
+ readonly maxRadiusMetres: 2000000;
42
+ readonly maxLimit: 500;
43
+ };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Grouped view of the response-unit dispatch topics. The strings live in
3
+ * {@link KAFKA_TOPICS} with every other domain's; this only references them.
4
+ *
5
+ * Producer clarion-incident (CREATED, STATUS_CHANGED, NOTIFICATION_REQUESTED),
6
+ * keyed by incident id so one incident's dispatch history stays in order.
7
+ * Producer clarion-notification (NOTIFICATION_RESULT), keyed by incident id.
8
+ */
9
+ export declare const RESPONSE_UNIT_DISPATCH_KAFKA_TOPICS: {
10
+ readonly CREATED: string;
11
+ readonly STATUS_CHANGED: string;
12
+ readonly NOTIFICATION_REQUESTED: string;
13
+ readonly NOTIFICATION_RESULT: string;
14
+ };
15
+ /** Current schema version of every response-unit dispatch event. */
16
+ export declare const RESPONSE_UNIT_DISPATCH_SCHEMA_VERSION: 1;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * `POST /incidents/:id/response-unit-dispatches` - send this unit.
3
+ *
4
+ * Only the unit is a decision. Organization, control centre and incident come
5
+ * from the server's own records, never from this body. Idempotent on the
6
+ * `Idempotency-Key` header: a repeated request returns the dispatch the first
7
+ * one created.
8
+ */
9
+ export declare class DispatchResponseUnitDto {
10
+ responseUnitId: number;
11
+ /**
12
+ * The unit the dispatcher's screen showed as recommended. Informational - the
13
+ * server recomputes its own recommendation and records both - but it lets
14
+ * the audit say what the dispatcher actually saw.
15
+ */
16
+ recommendedResponseUnitId?: number | null;
17
+ /** Optional, never required: why another unit than the recommended one. */
18
+ overrideReason?: string;
19
+ notes?: string;
20
+ }
@@ -0,0 +1,47 @@
1
+ import { ResponseUnitDispatchNotificationFailure } from '../enums/response-unit-dispatch-notification-failure.enum';
2
+ import { ResponseUnitDispatchNotificationStatus } from '../enums/response-unit-dispatch-notification-status.enum';
3
+ import { ResponseUnitDispatchMessageIncident, ResponseUnitDispatchNotificationRequestedEventV1, ResponseUnitDispatchNotificationResultEventV1 } from '../interfaces/response-unit-dispatch-events';
4
+ export declare class ResponseUnitDispatchMessageIncidentDto implements ResponseUnitDispatchMessageIncident {
5
+ reference: string;
6
+ typeName: string | null;
7
+ categoryName: string | null;
8
+ priority: string | null;
9
+ summary: string | null;
10
+ address: string | null;
11
+ latitude: number | null;
12
+ longitude: number | null;
13
+ reporterName: string | null;
14
+ reporterPhoneNumber: string | null;
15
+ anonymous: boolean;
16
+ }
17
+ export declare class ResponseUnitDispatchRecipientDto {
18
+ phoneNumber: string;
19
+ responseUnitName: string;
20
+ }
21
+ export declare class ResponseUnitDispatchNotificationRequestedDto implements ResponseUnitDispatchNotificationRequestedEventV1 {
22
+ schemaVersion: 1;
23
+ eventId: string;
24
+ occurredAt: string;
25
+ dispatchId: number;
26
+ dispatchReference: string;
27
+ incidentId: number;
28
+ organizationId: number;
29
+ controlCentreId: number | null;
30
+ responseUnitId: number;
31
+ attempt: number;
32
+ appId: string | null;
33
+ recipient: ResponseUnitDispatchRecipientDto;
34
+ incident: ResponseUnitDispatchMessageIncidentDto;
35
+ }
36
+ export declare class ResponseUnitDispatchNotificationResultDto implements ResponseUnitDispatchNotificationResultEventV1 {
37
+ schemaVersion: 1;
38
+ eventId: string;
39
+ occurredAt: string;
40
+ dispatchId: number;
41
+ incidentId: number;
42
+ organizationId: number;
43
+ attempt: number;
44
+ status: ResponseUnitDispatchNotificationStatus;
45
+ failureReason: ResponseUnitDispatchNotificationFailure | null;
46
+ providerCode: string | null;
47
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * `GET /response-units/dispatch-profiles` (clarion-organization, internal).
3
+ *
4
+ * Scoped by the forwarded user context; `organizationId` is honoured for a
5
+ * Super-Admin only. `includeContact` adds the unit's phone number and is used by
6
+ * the dispatch command alone - a recommendation never carries one.
7
+ */
8
+ export declare class ResponseUnitDispatchProfileQueryDto {
9
+ organizationId?: number;
10
+ controlCentreId?: number;
11
+ ids?: number[];
12
+ includeContact?: boolean;
13
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * `GET /tracking/response-units/nearby` (clarion-response-tracking).
3
+ *
4
+ * Tenancy is NOT in the query: the tracking service takes it from the forwarded
5
+ * user context. `organizationId` is honoured for a Super-Admin only and a
6
+ * control-centre caller is pinned to their own centre whatever they pass.
7
+ */
8
+ export declare class ResponseUnitNearbyQueryDto {
9
+ latitude: number;
10
+ longitude: number;
11
+ organizationId?: number;
12
+ controlCentreId?: number;
13
+ radiusMetres?: number;
14
+ limit?: number;
15
+ }
@@ -0,0 +1,9 @@
1
+ import { ResponseUnitDispatchStatus } from '../enums/response-unit-dispatch-status.enum';
2
+ /** Every status a dispatch can be MOVED to (DISPATCHED is only ever its first). */
3
+ export declare const SETTABLE_RESPONSE_UNIT_DISPATCH_STATUSES: readonly ResponseUnitDispatchStatus[];
4
+ /** `POST /incidents/:id/response-unit-dispatches/:dispatchId/status`. */
5
+ export declare class UpdateResponseUnitDispatchStatusDto {
6
+ status: ResponseUnitDispatchStatus;
7
+ /** Why - e.g. why a unit was stood down. */
8
+ reason?: string;
9
+ }
@@ -0,0 +1,16 @@
1
+ /** Why an INCIDENT cannot take a response-unit dispatch, whatever unit is chosen. */
2
+ export declare enum IncidentDispatchBlocker {
3
+ /** Resolved, closed, unresolved or archived. */
4
+ INCIDENT_ENDED = "INCIDENT_ENDED",
5
+ /** A grievance, not an emergency. */
6
+ NOT_AN_EMERGENCY_INCIDENT = "NOT_AN_EMERGENCY_INCIDENT",
7
+ /**
8
+ * The incident does not reach the control room: the reporter was not
9
+ * entitled to a provider response, or declined one. Sending a unit IS the
10
+ * provider response, so the rule that keeps the alert off the control room's
11
+ * screens also keeps it from being dispatched - see `reachesControlRoom`.
12
+ */
13
+ PROVIDER_RESPONSE_NOT_REQUESTED = "PROVIDER_RESPONSE_NOT_REQUESTED",
14
+ /** Response-unit dispatch is switched off platform-wide. */
15
+ DISPATCH_DISABLED = "DISPATCH_DISABLED"
16
+ }
@@ -0,0 +1,7 @@
1
+ /** Where an incident's capability requirement came from. */
2
+ export declare enum ResponseCapabilityRequirementSource {
3
+ INCIDENT_TYPE = "INCIDENT_TYPE",
4
+ INCIDENT_CATEGORY = "INCIDENT_CATEGORY",
5
+ /** Neither the type nor the category names one. */
6
+ NONE = "NONE"
7
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * How a unit's capabilities compare with what the incident needs.
3
+ *
4
+ * UNKNOWN and NOT_SUITED are deliberately different answers: UNKNOWN means
5
+ * nobody said what the unit does (it ranks below a match but stays
6
+ * recommendable), NOT_SUITED means somebody did and it is not this. Treating
7
+ * missing configuration as "not suitable" would hide every unit of an
8
+ * organization that has not configured capabilities yet.
9
+ */
10
+ export declare enum ResponseUnitCapabilityMatch {
11
+ /** The incident needs a capability and the unit has one of them. */
12
+ MATCH = "MATCH",
13
+ /** The incident's type and category name no requirement - any unit fits. */
14
+ NOT_REQUIRED = "NOT_REQUIRED",
15
+ /** The incident needs a capability; the unit's capabilities are unknown. */
16
+ UNKNOWN = "UNKNOWN",
17
+ /** The unit's known capabilities do not include what the incident needs. */
18
+ NOT_SUITED = "NOT_SUITED"
19
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Why a unit cannot be dispatched (a BLOCKER) or, while it can be dispatched by
3
+ * hand, is not recommended (a CAUTION). One vocabulary for both so the admin
4
+ * explains either with the same words.
5
+ */
6
+ export declare enum ResponseUnitDispatchConstraint {
7
+ /** Switched off in the organization. */
8
+ INACTIVE = "INACTIVE",
9
+ /** Non-operational, off duty, on leave or in training. */
10
+ OPERATIONALLY_UNAVAILABLE = "OPERATIONALLY_UNAVAILABLE",
11
+ /** Out on another job (an active dispatch, or a manual Engaged / On Mission status). */
12
+ ENGAGED = "ENGAGED",
13
+ /** Already has an active dispatch to THIS incident. */
14
+ ALREADY_DISPATCHED = "ALREADY_DISPATCHED",
15
+ /** Belongs to another control centre and cross-control-centre dispatch is off. */
16
+ OTHER_CONTROL_CENTRE = "OTHER_CONTROL_CENTRE",
17
+ /** Not suited, and the platform is configured to require a capability match. */
18
+ CAPABILITY_REQUIRED = "CAPABILITY_REQUIRED",
19
+ /** Its known capabilities do not include what the incident needs. */
20
+ NOT_SUITED = "NOT_SUITED",
21
+ /** No position at all, or the tracking service has it offline. */
22
+ NO_LOCATION = "NO_LOCATION",
23
+ /** A stale live fix, and stale positions are configured not to be recommended. */
24
+ LOCATION_STALE = "LOCATION_STALE",
25
+ /** Live-tracked, but outside the search radius. */
26
+ OUTSIDE_SEARCH_AREA = "OUTSIDE_SEARCH_AREA"
27
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Machine-readable codes on a refused recommend/dispatch request (the `code` of
3
+ * the error body), so a client can react without parsing a sentence. A 409 says
4
+ * "the world changed since you looked - refresh"; other 4xx say "this was never
5
+ * going to work".
6
+ */
7
+ export declare enum ResponseUnitDispatchErrorCode {
8
+ INCIDENT_NOT_DISPATCHABLE = "INCIDENT_NOT_DISPATCHABLE",
9
+ RESPONSE_UNIT_NOT_FOUND = "RESPONSE_UNIT_NOT_FOUND",
10
+ RESPONSE_UNIT_NOT_DISPATCHABLE = "RESPONSE_UNIT_NOT_DISPATCHABLE",
11
+ /** Another dispatcher got there first - the unit is out on a job. */
12
+ RESPONSE_UNIT_ENGAGED = "RESPONSE_UNIT_ENGAGED",
13
+ RESPONSE_UNIT_ALREADY_DISPATCHED = "RESPONSE_UNIT_ALREADY_DISPATCHED",
14
+ /** The same Idempotency-Key was used for a different unit. */
15
+ IDEMPOTENCY_KEY_REUSED = "IDEMPOTENCY_KEY_REUSED",
16
+ DISPATCH_NOT_FOUND = "DISPATCH_NOT_FOUND",
17
+ INVALID_STATUS_TRANSITION = "INVALID_STATUS_TRANSITION",
18
+ NOTIFICATION_NOT_RESENDABLE = "NOTIFICATION_NOT_RESENDABLE",
19
+ /** clarion-organization could not be reached: nothing can be verified, so nothing is sent. */
20
+ ORGANIZATION_UNAVAILABLE = "ORGANIZATION_UNAVAILABLE"
21
+ }
@@ -0,0 +1,13 @@
1
+ /** Why a dispatch message was not sent. */
2
+ export declare enum ResponseUnitDispatchNotificationFailure {
3
+ /** The unit has no phone number. */
4
+ NO_PHONE_NUMBER = "NO_PHONE_NUMBER",
5
+ /** The number on the unit is not one any provider can send to. */
6
+ INVALID_PHONE_NUMBER = "INVALID_PHONE_NUMBER",
7
+ /** Every provider in the country's chain failed. */
8
+ PROVIDER_FAILURE = "PROVIDER_FAILURE",
9
+ /** No SMS provider is configured for the number's country. */
10
+ NOT_CONFIGURED = "NOT_CONFIGURED",
11
+ /** clarion-notification never answered, so nobody knows. Sending again is the remedy. */
12
+ NO_RESPONSE = "NO_RESPONSE"
13
+ }
@@ -0,0 +1,11 @@
1
+ /** What happened to the message telling the unit it was dispatched. */
2
+ export declare enum ResponseUnitDispatchNotificationStatus {
3
+ /** Requested from clarion-notification; no answer yet. */
4
+ PENDING = "PENDING",
5
+ /** A provider accepted it. (Handset delivery is not tracked by the platform.) */
6
+ SENT = "SENT",
7
+ /** Every provider refused or failed; it can be sent again. */
8
+ FAILED = "FAILED",
9
+ /** Could never be sent - the unit has no usable phone number. The dispatch stands. */
10
+ NOT_POSSIBLE = "NOT_POSSIBLE"
11
+ }
@@ -0,0 +1,28 @@
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
+ }
@@ -0,0 +1,11 @@
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
+ /** Reserved for clarion-workflow orchestration. */
10
+ WORKFLOW = "WORKFLOW"
11
+ }
@@ -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,121 @@
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 { ResponseCapabilityRequirementSource } from '../enums/response-capability-requirement-source.enum';
4
+ import { ResponseUnitCapabilityMatch } from '../enums/response-unit-capability-match.enum';
5
+ import { ResponseUnitDispatchNotificationFailure } from '../enums/response-unit-dispatch-notification-failure.enum';
6
+ import { ResponseUnitDispatchNotificationStatus } from '../enums/response-unit-dispatch-notification-status.enum';
7
+ import { ResponseUnitDispatchStatus } from '../enums/response-unit-dispatch-status.enum';
8
+ import { ResponseUnitDispatchTransitionSource } from '../enums/response-unit-dispatch-transition-source.enum';
9
+ import { ResponseUnitLocationFreshness } from '../enums/response-unit-location-freshness.enum';
10
+ import { ResponseUnitLocationSource } from '../enums/response-unit-location-source.enum';
11
+ import { ResponseUnitRecommendationStatus } from '../enums/response-unit-recommendation-status.enum';
12
+ /** The selected unit as it stood when it was dispatched - frozen for the audit. */
13
+ export interface ResponseUnitDispatchUnitSnapshot {
14
+ availability: ResponseUnitAvailability;
15
+ operationalStatus: string | null;
16
+ capabilities: ResponseCapability[];
17
+ capabilityMatch: ResponseUnitCapabilityMatch;
18
+ sameControlCentre: boolean;
19
+ locationSource: ResponseUnitLocationSource;
20
+ locationFreshness: ResponseUnitLocationFreshness;
21
+ locationRecordedAt: string | null;
22
+ locationAgeSeconds: number | null;
23
+ distanceMetres: number | null;
24
+ hasPhoneNumber: boolean;
25
+ }
26
+ /** One ranked alternative, as it stood at dispatch time. */
27
+ export interface ResponseUnitDispatchSnapshotCandidate {
28
+ responseUnitId: number;
29
+ rank: number;
30
+ distanceMetres: number | null;
31
+ capabilityMatch: ResponseUnitCapabilityMatch;
32
+ locationFreshness: ResponseUnitLocationFreshness;
33
+ }
34
+ /**
35
+ * The recommendation the SERVER computed at the moment it accepted the
36
+ * dispatch. Recomputed rather than taken from the client, so "was the selected
37
+ * unit the recommended one?" is a fact, not a claim.
38
+ */
39
+ export interface ResponseUnitDispatchRecommendationSnapshot {
40
+ generatedAt: string;
41
+ status: ResponseUnitRecommendationStatus;
42
+ recommendedResponseUnitId: number | null;
43
+ /** The recommended unit first, then the alternatives, capped. */
44
+ ranked: ResponseUnitDispatchSnapshotCandidate[];
45
+ requiredCapabilities: ResponseCapability[];
46
+ requirementSource: ResponseCapabilityRequirementSource;
47
+ liveTrackingAvailable: boolean;
48
+ }
49
+ /** Where the dispatch message stands. */
50
+ export interface ResponseUnitDispatchNotificationState {
51
+ channel: 'SMS';
52
+ status: ResponseUnitDispatchNotificationStatus;
53
+ failureReason: ResponseUnitDispatchNotificationFailure | null;
54
+ /** Masked (+2547******78). The full number is never stored on the dispatch. */
55
+ recipient: string | null;
56
+ /** How many times it was requested (1 + resends). */
57
+ attempts: number;
58
+ requestedAt: string | null;
59
+ /** When clarion-notification last reported on it. */
60
+ resultAt: string | null;
61
+ providerCode: string | null;
62
+ }
63
+ /**
64
+ * One response unit sent to one incident. The authoritative dispatch record,
65
+ * owned by clarion-incident - and the engagement record: a unit is out on a job
66
+ * exactly while it has a dispatch in an ACTIVE status.
67
+ *
68
+ * Channel-neutral on purpose: the admin reads it today, the responder app and
69
+ * clarion-workflow can read the same record (and the events built from it)
70
+ * tomorrow.
71
+ */
72
+ export interface IncidentResponseUnitDispatch {
73
+ id: number;
74
+ /** Stable external identifier (uuid), safe to quote in a call or a ticket. */
75
+ reference: string;
76
+ incidentId: number;
77
+ organizationId: number;
78
+ /** The incident's control centre. */
79
+ controlCentreId: number | null;
80
+ responseUnitId: number;
81
+ /** Copied at dispatch time so the record survives the unit being renamed or deleted. */
82
+ responseUnitName: string;
83
+ responseUnitType: string | null;
84
+ responseUnitControlCentreId: number | null;
85
+ status: ResponseUnitDispatchStatus;
86
+ dispatchedByUserId: number;
87
+ dispatchedAt: string;
88
+ /** The server's recommendation at dispatch time named this unit. */
89
+ wasRecommended: boolean;
90
+ /** The unit the server would have recommended at dispatch time. */
91
+ recommendedResponseUnitId: number | null;
92
+ /** The unit the dispatcher's screen showed as recommended (as reported by the client). */
93
+ shownRecommendedResponseUnitId: number | null;
94
+ /** Optional words from a dispatcher who chose another unit. */
95
+ overrideReason: string | null;
96
+ notes: string | null;
97
+ distanceMetres: number | null;
98
+ unitSnapshot: ResponseUnitDispatchUnitSnapshot;
99
+ recommendationSnapshot: ResponseUnitDispatchRecommendationSnapshot | null;
100
+ statusChangedAt: string;
101
+ statusChangedByUserId: number | null;
102
+ statusSource: ResponseUnitDispatchTransitionSource;
103
+ statusReason: string | null;
104
+ acknowledgedAt: string | null;
105
+ enRouteAt: string | null;
106
+ onSceneAt: string | null;
107
+ completedAt: string | null;
108
+ cancelledAt: string | null;
109
+ notification: ResponseUnitDispatchNotificationState;
110
+ createdAt: string;
111
+ updatedAt: string;
112
+ }
113
+ /** `POST /incidents/:id/response-unit-dispatches`. */
114
+ export interface DispatchResponseUnitResult {
115
+ dispatch: IncidentResponseUnitDispatch;
116
+ /**
117
+ * True when this request repeated an earlier one (same Idempotency-Key) and
118
+ * the EXISTING dispatch is returned - nothing was dispatched or sent again.
119
+ */
120
+ replayed: boolean;
121
+ }