grm-shared-library 1.1.236 → 1.1.237

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (247) 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/permission/data/permissions.data.js +8 -0
  77. package/dist/cjs/modules/permission/data/permissions.data.js.map +1 -1
  78. package/dist/cjs/modules/permission/enums/permission-actions.enum.js +13 -0
  79. package/dist/cjs/modules/permission/enums/permission-actions.enum.js.map +1 -1
  80. package/dist/cjs/modules/permission/enums/permissions-module.enum.js +1 -0
  81. package/dist/cjs/modules/permission/enums/permissions-module.enum.js.map +1 -1
  82. package/dist/cjs/modules/response-unit/dtos/response-unit/base-response-unit.dto.js +9 -0
  83. package/dist/cjs/modules/response-unit/dtos/response-unit/base-response-unit.dto.js.map +1 -1
  84. package/dist/cjs/modules/response-unit/enums/response-unit/response-capability.enum.js +29 -0
  85. package/dist/cjs/modules/response-unit/enums/response-unit/response-capability.enum.js.map +1 -0
  86. package/dist/cjs/modules/response-unit/enums/response-unit/response-unit-availability.enum.js +27 -0
  87. package/dist/cjs/modules/response-unit/enums/response-unit/response-unit-availability.enum.js.map +1 -0
  88. package/dist/cjs/modules/response-unit/index.js +5 -0
  89. package/dist/cjs/modules/response-unit/index.js.map +1 -1
  90. package/dist/cjs/modules/response-unit/utils/response-capability.util.js +74 -0
  91. package/dist/cjs/modules/response-unit/utils/response-capability.util.js.map +1 -0
  92. package/dist/cjs/modules/response-unit/utils/response-unit-availability.util.js +46 -0
  93. package/dist/cjs/modules/response-unit/utils/response-unit-availability.util.js.map +1 -0
  94. package/dist/cjs/modules/role/data/roles.data.js +24 -0
  95. package/dist/cjs/modules/role/data/roles.data.js.map +1 -1
  96. package/dist/cjs/modules/sms/constants/sms-templates.config.js +18 -0
  97. package/dist/cjs/modules/sms/constants/sms-templates.config.js.map +1 -1
  98. package/dist/cjs/modules/sms/enums/sms-template.enum.js +1 -0
  99. package/dist/cjs/modules/sms/enums/sms-template.enum.js.map +1 -1
  100. package/dist/esm/index.js +1 -0
  101. package/dist/esm/index.js.map +1 -1
  102. package/dist/esm/kafka/topics.js +10 -0
  103. package/dist/esm/kafka/topics.js.map +1 -1
  104. package/dist/esm/modules/dispatch/constants/response-unit-dispatch-defaults.const.js +52 -0
  105. package/dist/esm/modules/dispatch/constants/response-unit-dispatch-defaults.const.js.map +1 -0
  106. package/dist/esm/modules/dispatch/constants/response-unit-dispatch-kafka.const.js +18 -0
  107. package/dist/esm/modules/dispatch/constants/response-unit-dispatch-kafka.const.js.map +1 -0
  108. package/dist/esm/modules/dispatch/dtos/dispatch-response-unit.dto.js +54 -0
  109. package/dist/esm/modules/dispatch/dtos/dispatch-response-unit.dto.js.map +1 -0
  110. package/dist/esm/modules/dispatch/dtos/response-unit-dispatch-notification.dto.js +223 -0
  111. package/dist/esm/modules/dispatch/dtos/response-unit-dispatch-notification.dto.js.map +1 -0
  112. package/dist/esm/modules/dispatch/dtos/response-unit-dispatch-profile-query.dto.js +57 -0
  113. package/dist/esm/modules/dispatch/dtos/response-unit-dispatch-profile-query.dto.js.map +1 -0
  114. package/dist/esm/modules/dispatch/dtos/response-unit-nearby-query.dto.js +62 -0
  115. package/dist/esm/modules/dispatch/dtos/response-unit-nearby-query.dto.js.map +1 -0
  116. package/dist/esm/modules/dispatch/dtos/update-response-unit-dispatch-status.dto.js +37 -0
  117. package/dist/esm/modules/dispatch/dtos/update-response-unit-dispatch-status.dto.js.map +1 -0
  118. package/dist/esm/modules/dispatch/enums/incident-dispatch-blocker.enum.js +18 -0
  119. package/dist/esm/modules/dispatch/enums/incident-dispatch-blocker.enum.js.map +1 -0
  120. package/dist/esm/modules/dispatch/enums/response-capability-requirement-source.enum.js +9 -0
  121. package/dist/esm/modules/dispatch/enums/response-capability-requirement-source.enum.js.map +1 -0
  122. package/dist/esm/modules/dispatch/enums/response-unit-capability-match.enum.js +21 -0
  123. package/dist/esm/modules/dispatch/enums/response-unit-capability-match.enum.js.map +1 -0
  124. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-constraint.enum.js +31 -0
  125. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-constraint.enum.js.map +1 -0
  126. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-error-code.enum.js +23 -0
  127. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-error-code.enum.js.map +1 -0
  128. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-notification-failure.enum.js +15 -0
  129. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-notification-failure.enum.js.map +1 -0
  130. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-notification-status.enum.js +13 -0
  131. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-notification-status.enum.js.map +1 -0
  132. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-status.enum.js +30 -0
  133. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-status.enum.js.map +1 -0
  134. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-transition-source.enum.js +13 -0
  135. package/dist/esm/modules/dispatch/enums/response-unit-dispatch-transition-source.enum.js.map +1 -0
  136. package/dist/esm/modules/dispatch/enums/response-unit-distance-basis.enum.js +9 -0
  137. package/dist/esm/modules/dispatch/enums/response-unit-distance-basis.enum.js.map +1 -0
  138. package/dist/esm/modules/dispatch/enums/response-unit-location-freshness.enum.js +18 -0
  139. package/dist/esm/modules/dispatch/enums/response-unit-location-freshness.enum.js.map +1 -0
  140. package/dist/esm/modules/dispatch/enums/response-unit-location-source.enum.js +14 -0
  141. package/dist/esm/modules/dispatch/enums/response-unit-location-source.enum.js.map +1 -0
  142. package/dist/esm/modules/dispatch/enums/response-unit-recommendation-reason.enum.js +22 -0
  143. package/dist/esm/modules/dispatch/enums/response-unit-recommendation-reason.enum.js.map +1 -0
  144. package/dist/esm/modules/dispatch/enums/response-unit-recommendation-status.enum.js +20 -0
  145. package/dist/esm/modules/dispatch/enums/response-unit-recommendation-status.enum.js.map +1 -0
  146. package/dist/esm/modules/dispatch/index.js +37 -0
  147. package/dist/esm/modules/dispatch/index.js.map +1 -0
  148. package/dist/esm/modules/dispatch/interfaces/incident-response-unit-dispatch.js +2 -0
  149. package/dist/esm/modules/dispatch/interfaces/incident-response-unit-dispatch.js.map +1 -0
  150. package/dist/esm/modules/dispatch/interfaces/response-unit-dispatch-events.js +2 -0
  151. package/dist/esm/modules/dispatch/interfaces/response-unit-dispatch-events.js.map +1 -0
  152. package/dist/esm/modules/dispatch/interfaces/response-unit-dispatch-profile.js +2 -0
  153. package/dist/esm/modules/dispatch/interfaces/response-unit-dispatch-profile.js.map +1 -0
  154. package/dist/esm/modules/dispatch/interfaces/response-unit-proximity.js +2 -0
  155. package/dist/esm/modules/dispatch/interfaces/response-unit-proximity.js.map +1 -0
  156. package/dist/esm/modules/dispatch/interfaces/response-unit-recommendation.js +2 -0
  157. package/dist/esm/modules/dispatch/interfaces/response-unit-recommendation.js.map +1 -0
  158. package/dist/esm/modules/dispatch/utils/dispatch-geo.util.js +39 -0
  159. package/dist/esm/modules/dispatch/utils/dispatch-geo.util.js.map +1 -0
  160. package/dist/esm/modules/dispatch/utils/incident-dispatchability.util.js +37 -0
  161. package/dist/esm/modules/dispatch/utils/incident-dispatchability.util.js.map +1 -0
  162. package/dist/esm/modules/dispatch/utils/response-capability-match.util.js +40 -0
  163. package/dist/esm/modules/dispatch/utils/response-capability-match.util.js.map +1 -0
  164. package/dist/esm/modules/dispatch/utils/response-unit-dispatch-event.util.js +15 -0
  165. package/dist/esm/modules/dispatch/utils/response-unit-dispatch-event.util.js.map +1 -0
  166. package/dist/esm/modules/dispatch/utils/response-unit-dispatch-status.util.js +42 -0
  167. package/dist/esm/modules/dispatch/utils/response-unit-dispatch-status.util.js.map +1 -0
  168. package/dist/esm/modules/incident/dtos/category/create-incident-category.dto.js +10 -1
  169. package/dist/esm/modules/incident/dtos/category/create-incident-category.dto.js.map +1 -1
  170. package/dist/esm/modules/incident/dtos/type/create-incident-type.dto.js +10 -1
  171. package/dist/esm/modules/incident/dtos/type/create-incident-type.dto.js.map +1 -1
  172. package/dist/esm/modules/incident/enums/incident-actions.enum.js +4 -0
  173. package/dist/esm/modules/incident/enums/incident-actions.enum.js.map +1 -1
  174. package/dist/esm/modules/permission/data/permissions.data.js +8 -0
  175. package/dist/esm/modules/permission/data/permissions.data.js.map +1 -1
  176. package/dist/esm/modules/permission/enums/permission-actions.enum.js +13 -0
  177. package/dist/esm/modules/permission/enums/permission-actions.enum.js.map +1 -1
  178. package/dist/esm/modules/permission/enums/permissions-module.enum.js +1 -0
  179. package/dist/esm/modules/permission/enums/permissions-module.enum.js.map +1 -1
  180. package/dist/esm/modules/response-unit/dtos/response-unit/base-response-unit.dto.js +10 -1
  181. package/dist/esm/modules/response-unit/dtos/response-unit/base-response-unit.dto.js.map +1 -1
  182. package/dist/esm/modules/response-unit/enums/response-unit/response-capability.enum.js +26 -0
  183. package/dist/esm/modules/response-unit/enums/response-unit/response-capability.enum.js.map +1 -0
  184. package/dist/esm/modules/response-unit/enums/response-unit/response-unit-availability.enum.js +24 -0
  185. package/dist/esm/modules/response-unit/enums/response-unit/response-unit-availability.enum.js.map +1 -0
  186. package/dist/esm/modules/response-unit/index.js +5 -0
  187. package/dist/esm/modules/response-unit/index.js.map +1 -1
  188. package/dist/esm/modules/response-unit/utils/response-capability.util.js +68 -0
  189. package/dist/esm/modules/response-unit/utils/response-capability.util.js.map +1 -0
  190. package/dist/esm/modules/response-unit/utils/response-unit-availability.util.js +42 -0
  191. package/dist/esm/modules/response-unit/utils/response-unit-availability.util.js.map +1 -0
  192. package/dist/esm/modules/role/data/roles.data.js +24 -0
  193. package/dist/esm/modules/role/data/roles.data.js.map +1 -1
  194. package/dist/esm/modules/sms/constants/sms-templates.config.js +18 -0
  195. package/dist/esm/modules/sms/constants/sms-templates.config.js.map +1 -1
  196. package/dist/esm/modules/sms/enums/sms-template.enum.js +1 -0
  197. package/dist/esm/modules/sms/enums/sms-template.enum.js.map +1 -1
  198. package/dist/types/index.d.ts +1 -0
  199. package/dist/types/kafka/topics.d.ts +4 -0
  200. package/dist/types/modules/dispatch/constants/response-unit-dispatch-defaults.const.d.ts +43 -0
  201. package/dist/types/modules/dispatch/constants/response-unit-dispatch-kafka.const.d.ts +16 -0
  202. package/dist/types/modules/dispatch/dtos/dispatch-response-unit.dto.d.ts +20 -0
  203. package/dist/types/modules/dispatch/dtos/response-unit-dispatch-notification.dto.d.ts +47 -0
  204. package/dist/types/modules/dispatch/dtos/response-unit-dispatch-profile-query.dto.d.ts +13 -0
  205. package/dist/types/modules/dispatch/dtos/response-unit-nearby-query.dto.d.ts +15 -0
  206. package/dist/types/modules/dispatch/dtos/update-response-unit-dispatch-status.dto.d.ts +9 -0
  207. package/dist/types/modules/dispatch/enums/incident-dispatch-blocker.enum.d.ts +16 -0
  208. package/dist/types/modules/dispatch/enums/response-capability-requirement-source.enum.d.ts +7 -0
  209. package/dist/types/modules/dispatch/enums/response-unit-capability-match.enum.d.ts +19 -0
  210. package/dist/types/modules/dispatch/enums/response-unit-dispatch-constraint.enum.d.ts +27 -0
  211. package/dist/types/modules/dispatch/enums/response-unit-dispatch-error-code.enum.d.ts +21 -0
  212. package/dist/types/modules/dispatch/enums/response-unit-dispatch-notification-failure.enum.d.ts +13 -0
  213. package/dist/types/modules/dispatch/enums/response-unit-dispatch-notification-status.enum.d.ts +11 -0
  214. package/dist/types/modules/dispatch/enums/response-unit-dispatch-status.enum.d.ts +28 -0
  215. package/dist/types/modules/dispatch/enums/response-unit-dispatch-transition-source.enum.d.ts +11 -0
  216. package/dist/types/modules/dispatch/enums/response-unit-distance-basis.enum.d.ts +7 -0
  217. package/dist/types/modules/dispatch/enums/response-unit-location-freshness.enum.d.ts +16 -0
  218. package/dist/types/modules/dispatch/enums/response-unit-location-source.enum.d.ts +12 -0
  219. package/dist/types/modules/dispatch/enums/response-unit-recommendation-reason.enum.d.ts +20 -0
  220. package/dist/types/modules/dispatch/enums/response-unit-recommendation-status.enum.d.ts +18 -0
  221. package/dist/types/modules/dispatch/index.d.ts +31 -0
  222. package/dist/types/modules/dispatch/interfaces/incident-response-unit-dispatch.d.ts +121 -0
  223. package/dist/types/modules/dispatch/interfaces/response-unit-dispatch-events.d.ts +103 -0
  224. package/dist/types/modules/dispatch/interfaces/response-unit-dispatch-profile.d.ts +52 -0
  225. package/dist/types/modules/dispatch/interfaces/response-unit-proximity.d.ts +45 -0
  226. package/dist/types/modules/dispatch/interfaces/response-unit-recommendation.d.ts +130 -0
  227. package/dist/types/modules/dispatch/utils/dispatch-geo.util.d.ts +16 -0
  228. package/dist/types/modules/dispatch/utils/incident-dispatchability.util.d.ts +18 -0
  229. package/dist/types/modules/dispatch/utils/response-capability-match.util.d.ts +26 -0
  230. package/dist/types/modules/dispatch/utils/response-unit-dispatch-event.util.d.ts +9 -0
  231. package/dist/types/modules/dispatch/utils/response-unit-dispatch-status.util.d.ts +16 -0
  232. package/dist/types/modules/incident/dtos/category/create-incident-category.dto.d.ts +6 -0
  233. package/dist/types/modules/incident/dtos/type/create-incident-type.dto.d.ts +6 -0
  234. package/dist/types/modules/incident/enums/incident-actions.enum.d.ts +4 -0
  235. package/dist/types/modules/incident/intefaces/incident-category.d.ts +6 -0
  236. package/dist/types/modules/incident/intefaces/incident-type.d.ts +6 -0
  237. package/dist/types/modules/permission/enums/permission-actions.enum.d.ts +3 -0
  238. package/dist/types/modules/permission/enums/permissions-module.enum.d.ts +1 -0
  239. package/dist/types/modules/response-unit/dtos/response-unit/base-response-unit.dto.d.ts +7 -0
  240. package/dist/types/modules/response-unit/enums/response-unit/response-capability.enum.d.ts +24 -0
  241. package/dist/types/modules/response-unit/enums/response-unit/response-unit-availability.enum.d.ts +22 -0
  242. package/dist/types/modules/response-unit/index.d.ts +4 -0
  243. package/dist/types/modules/response-unit/interfaces/response-unit/response-unit.d.ts +3 -0
  244. package/dist/types/modules/response-unit/utils/response-capability.util.d.ts +31 -0
  245. package/dist/types/modules/response-unit/utils/response-unit-availability.util.d.ts +21 -0
  246. package/dist/types/modules/sms/enums/sms-template.enum.d.ts +1 -0
  247. package/package.json +1 -1
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.UpdateResponseUnitDispatchStatusDto = exports.SETTABLE_RESPONSE_UNIT_DISPATCH_STATUSES = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ const response_unit_dispatch_defaults_const_1 = require("../constants/response-unit-dispatch-defaults.const");
16
+ const response_unit_dispatch_status_enum_1 = require("../enums/response-unit-dispatch-status.enum");
17
+ /** Every status a dispatch can be MOVED to (DISPATCHED is only ever its first). */
18
+ exports.SETTABLE_RESPONSE_UNIT_DISPATCH_STATUSES = [
19
+ response_unit_dispatch_status_enum_1.ResponseUnitDispatchStatus.ACKNOWLEDGED,
20
+ response_unit_dispatch_status_enum_1.ResponseUnitDispatchStatus.EN_ROUTE,
21
+ response_unit_dispatch_status_enum_1.ResponseUnitDispatchStatus.ON_SCENE,
22
+ response_unit_dispatch_status_enum_1.ResponseUnitDispatchStatus.COMPLETED,
23
+ response_unit_dispatch_status_enum_1.ResponseUnitDispatchStatus.CANCELLED,
24
+ ];
25
+ /** `POST /incidents/:id/response-unit-dispatches/:dispatchId/status`. */
26
+ class UpdateResponseUnitDispatchStatusDto {
27
+ }
28
+ exports.UpdateResponseUnitDispatchStatusDto = UpdateResponseUnitDispatchStatusDto;
29
+ __decorate([
30
+ (0, swagger_1.ApiProperty)({ enum: exports.SETTABLE_RESPONSE_UNIT_DISPATCH_STATUSES, example: response_unit_dispatch_status_enum_1.ResponseUnitDispatchStatus.ON_SCENE }),
31
+ (0, class_validator_1.IsIn)(exports.SETTABLE_RESPONSE_UNIT_DISPATCH_STATUSES),
32
+ __metadata("design:type", String)
33
+ ], UpdateResponseUnitDispatchStatusDto.prototype, "status", void 0);
34
+ __decorate([
35
+ (0, swagger_1.ApiPropertyOptional)({ maxLength: response_unit_dispatch_defaults_const_1.RESPONSE_UNIT_DISPATCH_FIELD_LIMITS.statusReason }),
36
+ (0, class_validator_1.IsOptional)(),
37
+ (0, class_validator_1.IsString)(),
38
+ (0, class_validator_1.MaxLength)(response_unit_dispatch_defaults_const_1.RESPONSE_UNIT_DISPATCH_FIELD_LIMITS.statusReason),
39
+ __metadata("design:type", String)
40
+ ], UpdateResponseUnitDispatchStatusDto.prototype, "reason", void 0);
41
+ //# sourceMappingURL=update-response-unit-dispatch-status.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-response-unit-dispatch-status.dto.js","sourceRoot":"","sources":["../../../../../src/modules/dispatch/dtos/update-response-unit-dispatch-status.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmE;AACnE,qDAAwE;AACxE,8GAAyG;AACzG,oGAAyF;AAEzF,mFAAmF;AACtE,QAAA,wCAAwC,GAA0C;IAC3F,+DAA0B,CAAC,YAAY;IACvC,+DAA0B,CAAC,QAAQ;IACnC,+DAA0B,CAAC,QAAQ;IACnC,+DAA0B,CAAC,SAAS;IACpC,+DAA0B,CAAC,SAAS;CACvC,CAAC;AAEF,yEAAyE;AACzE,MAAa,mCAAmC;CAW/C;AAXD,kFAWC;AARG;IAFC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,gDAAwC,EAAE,OAAO,EAAE,+DAA0B,CAAC,QAAQ,EAAE,CAAC;IAC7G,IAAA,sBAAI,EAAC,gDAAwE,CAAC;;mEAC3C;AAOpC;IAJC,IAAA,6BAAmB,EAAC,EAAE,SAAS,EAAE,2EAAmC,CAAC,YAAY,EAAE,CAAC;IACpF,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,2EAAmC,CAAC,YAAY,CAAC;;mEAC5C"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IncidentDispatchBlocker = void 0;
4
+ /** Why an INCIDENT cannot take a response-unit dispatch, whatever unit is chosen. */
5
+ var IncidentDispatchBlocker;
6
+ (function (IncidentDispatchBlocker) {
7
+ /** Resolved, closed, unresolved or archived. */
8
+ IncidentDispatchBlocker["INCIDENT_ENDED"] = "INCIDENT_ENDED";
9
+ /** A grievance, not an emergency. */
10
+ IncidentDispatchBlocker["NOT_AN_EMERGENCY_INCIDENT"] = "NOT_AN_EMERGENCY_INCIDENT";
11
+ /**
12
+ * The incident does not reach the control room: the reporter was not
13
+ * entitled to a provider response, or declined one. Sending a unit IS the
14
+ * provider response, so the rule that keeps the alert off the control room's
15
+ * screens also keeps it from being dispatched - see `reachesControlRoom`.
16
+ */
17
+ IncidentDispatchBlocker["PROVIDER_RESPONSE_NOT_REQUESTED"] = "PROVIDER_RESPONSE_NOT_REQUESTED";
18
+ /** Response-unit dispatch is switched off platform-wide. */
19
+ IncidentDispatchBlocker["DISPATCH_DISABLED"] = "DISPATCH_DISABLED";
20
+ })(IncidentDispatchBlocker || (exports.IncidentDispatchBlocker = IncidentDispatchBlocker = {}));
21
+ //# sourceMappingURL=incident-dispatch-blocker.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"incident-dispatch-blocker.enum.js","sourceRoot":"","sources":["../../../../../src/modules/dispatch/enums/incident-dispatch-blocker.enum.ts"],"names":[],"mappings":";;;AAAA,qFAAqF;AACrF,IAAY,uBAcX;AAdD,WAAY,uBAAuB;IAC/B,gDAAgD;IAChD,4DAAiC,CAAA;IACjC,qCAAqC;IACrC,kFAAuD,CAAA;IACvD;;;;;OAKG;IACH,8FAAmE,CAAA;IACnE,4DAA4D;IAC5D,kEAAuC,CAAA;AAC3C,CAAC,EAdW,uBAAuB,uCAAvB,uBAAuB,QAclC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResponseCapabilityRequirementSource = void 0;
4
+ /** Where an incident's capability requirement came from. */
5
+ var ResponseCapabilityRequirementSource;
6
+ (function (ResponseCapabilityRequirementSource) {
7
+ ResponseCapabilityRequirementSource["INCIDENT_TYPE"] = "INCIDENT_TYPE";
8
+ ResponseCapabilityRequirementSource["INCIDENT_CATEGORY"] = "INCIDENT_CATEGORY";
9
+ /** Neither the type nor the category names one. */
10
+ ResponseCapabilityRequirementSource["NONE"] = "NONE";
11
+ })(ResponseCapabilityRequirementSource || (exports.ResponseCapabilityRequirementSource = ResponseCapabilityRequirementSource = {}));
12
+ //# sourceMappingURL=response-capability-requirement-source.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-capability-requirement-source.enum.js","sourceRoot":"","sources":["../../../../../src/modules/dispatch/enums/response-capability-requirement-source.enum.ts"],"names":[],"mappings":";;;AAAA,4DAA4D;AAC5D,IAAY,mCAKX;AALD,WAAY,mCAAmC;IAC3C,sEAA+B,CAAA;IAC/B,8EAAuC,CAAA;IACvC,mDAAmD;IACnD,oDAAa,CAAA;AACjB,CAAC,EALW,mCAAmC,mDAAnC,mCAAmC,QAK9C"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResponseUnitCapabilityMatch = void 0;
4
+ /**
5
+ * How a unit's capabilities compare with what the incident needs.
6
+ *
7
+ * UNKNOWN and NOT_SUITED are deliberately different answers: UNKNOWN means
8
+ * nobody said what the unit does (it ranks below a match but stays
9
+ * recommendable), NOT_SUITED means somebody did and it is not this. Treating
10
+ * missing configuration as "not suitable" would hide every unit of an
11
+ * organization that has not configured capabilities yet.
12
+ */
13
+ var ResponseUnitCapabilityMatch;
14
+ (function (ResponseUnitCapabilityMatch) {
15
+ /** The incident needs a capability and the unit has one of them. */
16
+ ResponseUnitCapabilityMatch["MATCH"] = "MATCH";
17
+ /** The incident's type and category name no requirement - any unit fits. */
18
+ ResponseUnitCapabilityMatch["NOT_REQUIRED"] = "NOT_REQUIRED";
19
+ /** The incident needs a capability; the unit's capabilities are unknown. */
20
+ ResponseUnitCapabilityMatch["UNKNOWN"] = "UNKNOWN";
21
+ /** The unit's known capabilities do not include what the incident needs. */
22
+ ResponseUnitCapabilityMatch["NOT_SUITED"] = "NOT_SUITED";
23
+ })(ResponseUnitCapabilityMatch || (exports.ResponseUnitCapabilityMatch = ResponseUnitCapabilityMatch = {}));
24
+ //# sourceMappingURL=response-unit-capability-match.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-unit-capability-match.enum.js","sourceRoot":"","sources":["../../../../../src/modules/dispatch/enums/response-unit-capability-match.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;GAQG;AACH,IAAY,2BASX;AATD,WAAY,2BAA2B;IACnC,oEAAoE;IACpE,8CAAe,CAAA;IACf,4EAA4E;IAC5E,4DAA6B,CAAA;IAC7B,4EAA4E;IAC5E,kDAAmB,CAAA;IACnB,4EAA4E;IAC5E,wDAAyB,CAAA;AAC7B,CAAC,EATW,2BAA2B,2CAA3B,2BAA2B,QAStC"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResponseUnitDispatchConstraint = void 0;
4
+ /**
5
+ * Why a unit cannot be dispatched (a BLOCKER) or, while it can be dispatched by
6
+ * hand, is not recommended (a CAUTION). One vocabulary for both so the admin
7
+ * explains either with the same words.
8
+ */
9
+ var ResponseUnitDispatchConstraint;
10
+ (function (ResponseUnitDispatchConstraint) {
11
+ // ---- Blockers: the server refuses a dispatch of this unit ----
12
+ /** Switched off in the organization. */
13
+ ResponseUnitDispatchConstraint["INACTIVE"] = "INACTIVE";
14
+ /** Non-operational, off duty, on leave or in training. */
15
+ ResponseUnitDispatchConstraint["OPERATIONALLY_UNAVAILABLE"] = "OPERATIONALLY_UNAVAILABLE";
16
+ /** Out on another job (an active dispatch, or a manual Engaged / On Mission status). */
17
+ ResponseUnitDispatchConstraint["ENGAGED"] = "ENGAGED";
18
+ /** Already has an active dispatch to THIS incident. */
19
+ ResponseUnitDispatchConstraint["ALREADY_DISPATCHED"] = "ALREADY_DISPATCHED";
20
+ /** Belongs to another control centre and cross-control-centre dispatch is off. */
21
+ ResponseUnitDispatchConstraint["OTHER_CONTROL_CENTRE"] = "OTHER_CONTROL_CENTRE";
22
+ /** Not suited, and the platform is configured to require a capability match. */
23
+ ResponseUnitDispatchConstraint["CAPABILITY_REQUIRED"] = "CAPABILITY_REQUIRED";
24
+ // ---- Cautions: dispatchable by hand, never recommended ----
25
+ /** Its known capabilities do not include what the incident needs. */
26
+ ResponseUnitDispatchConstraint["NOT_SUITED"] = "NOT_SUITED";
27
+ /** No position at all, or the tracking service has it offline. */
28
+ ResponseUnitDispatchConstraint["NO_LOCATION"] = "NO_LOCATION";
29
+ /** A stale live fix, and stale positions are configured not to be recommended. */
30
+ ResponseUnitDispatchConstraint["LOCATION_STALE"] = "LOCATION_STALE";
31
+ /** Live-tracked, but outside the search radius. */
32
+ ResponseUnitDispatchConstraint["OUTSIDE_SEARCH_AREA"] = "OUTSIDE_SEARCH_AREA";
33
+ })(ResponseUnitDispatchConstraint || (exports.ResponseUnitDispatchConstraint = ResponseUnitDispatchConstraint = {}));
34
+ //# sourceMappingURL=response-unit-dispatch-constraint.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-unit-dispatch-constraint.enum.js","sourceRoot":"","sources":["../../../../../src/modules/dispatch/enums/response-unit-dispatch-constraint.enum.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,IAAY,8BAwBX;AAxBD,WAAY,8BAA8B;IACtC,iEAAiE;IACjE,wCAAwC;IACxC,uDAAqB,CAAA;IACrB,0DAA0D;IAC1D,yFAAuD,CAAA;IACvD,wFAAwF;IACxF,qDAAmB,CAAA;IACnB,uDAAuD;IACvD,2EAAyC,CAAA;IACzC,kFAAkF;IAClF,+EAA6C,CAAA;IAC7C,gFAAgF;IAChF,6EAA2C,CAAA;IAE3C,8DAA8D;IAC9D,qEAAqE;IACrE,2DAAyB,CAAA;IACzB,kEAAkE;IAClE,6DAA2B,CAAA;IAC3B,kFAAkF;IAClF,mEAAiC,CAAA;IACjC,mDAAmD;IACnD,6EAA2C,CAAA;AAC/C,CAAC,EAxBW,8BAA8B,8CAA9B,8BAA8B,QAwBzC"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResponseUnitDispatchErrorCode = void 0;
4
+ /**
5
+ * Machine-readable codes on a refused recommend/dispatch request (the `code` of
6
+ * the error body), so a client can react without parsing a sentence. A 409 says
7
+ * "the world changed since you looked - refresh"; other 4xx say "this was never
8
+ * going to work".
9
+ */
10
+ var ResponseUnitDispatchErrorCode;
11
+ (function (ResponseUnitDispatchErrorCode) {
12
+ ResponseUnitDispatchErrorCode["INCIDENT_NOT_DISPATCHABLE"] = "INCIDENT_NOT_DISPATCHABLE";
13
+ ResponseUnitDispatchErrorCode["RESPONSE_UNIT_NOT_FOUND"] = "RESPONSE_UNIT_NOT_FOUND";
14
+ ResponseUnitDispatchErrorCode["RESPONSE_UNIT_NOT_DISPATCHABLE"] = "RESPONSE_UNIT_NOT_DISPATCHABLE";
15
+ /** Another dispatcher got there first - the unit is out on a job. */
16
+ ResponseUnitDispatchErrorCode["RESPONSE_UNIT_ENGAGED"] = "RESPONSE_UNIT_ENGAGED";
17
+ ResponseUnitDispatchErrorCode["RESPONSE_UNIT_ALREADY_DISPATCHED"] = "RESPONSE_UNIT_ALREADY_DISPATCHED";
18
+ /** The same Idempotency-Key was used for a different unit. */
19
+ ResponseUnitDispatchErrorCode["IDEMPOTENCY_KEY_REUSED"] = "IDEMPOTENCY_KEY_REUSED";
20
+ ResponseUnitDispatchErrorCode["DISPATCH_NOT_FOUND"] = "DISPATCH_NOT_FOUND";
21
+ ResponseUnitDispatchErrorCode["INVALID_STATUS_TRANSITION"] = "INVALID_STATUS_TRANSITION";
22
+ ResponseUnitDispatchErrorCode["NOTIFICATION_NOT_RESENDABLE"] = "NOTIFICATION_NOT_RESENDABLE";
23
+ /** clarion-organization could not be reached: nothing can be verified, so nothing is sent. */
24
+ ResponseUnitDispatchErrorCode["ORGANIZATION_UNAVAILABLE"] = "ORGANIZATION_UNAVAILABLE";
25
+ })(ResponseUnitDispatchErrorCode || (exports.ResponseUnitDispatchErrorCode = ResponseUnitDispatchErrorCode = {}));
26
+ //# sourceMappingURL=response-unit-dispatch-error-code.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-unit-dispatch-error-code.enum.js","sourceRoot":"","sources":["../../../../../src/modules/dispatch/enums/response-unit-dispatch-error-code.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,IAAY,6BAcX;AAdD,WAAY,6BAA6B;IACrC,wFAAuD,CAAA;IACvD,oFAAmD,CAAA;IACnD,kGAAiE,CAAA;IACjE,qEAAqE;IACrE,gFAA+C,CAAA;IAC/C,sGAAqE,CAAA;IACrE,8DAA8D;IAC9D,kFAAiD,CAAA;IACjD,0EAAyC,CAAA;IACzC,wFAAuD,CAAA;IACvD,4FAA2D,CAAA;IAC3D,8FAA8F;IAC9F,sFAAqD,CAAA;AACzD,CAAC,EAdW,6BAA6B,6CAA7B,6BAA6B,QAcxC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResponseUnitDispatchNotificationFailure = void 0;
4
+ /** Why a dispatch message was not sent. */
5
+ var ResponseUnitDispatchNotificationFailure;
6
+ (function (ResponseUnitDispatchNotificationFailure) {
7
+ /** The unit has no phone number. */
8
+ ResponseUnitDispatchNotificationFailure["NO_PHONE_NUMBER"] = "NO_PHONE_NUMBER";
9
+ /** The number on the unit is not one any provider can send to. */
10
+ ResponseUnitDispatchNotificationFailure["INVALID_PHONE_NUMBER"] = "INVALID_PHONE_NUMBER";
11
+ /** Every provider in the country's chain failed. */
12
+ ResponseUnitDispatchNotificationFailure["PROVIDER_FAILURE"] = "PROVIDER_FAILURE";
13
+ /** No SMS provider is configured for the number's country. */
14
+ ResponseUnitDispatchNotificationFailure["NOT_CONFIGURED"] = "NOT_CONFIGURED";
15
+ /** clarion-notification never answered, so nobody knows. Sending again is the remedy. */
16
+ ResponseUnitDispatchNotificationFailure["NO_RESPONSE"] = "NO_RESPONSE";
17
+ })(ResponseUnitDispatchNotificationFailure || (exports.ResponseUnitDispatchNotificationFailure = ResponseUnitDispatchNotificationFailure = {}));
18
+ //# sourceMappingURL=response-unit-dispatch-notification-failure.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-unit-dispatch-notification-failure.enum.js","sourceRoot":"","sources":["../../../../../src/modules/dispatch/enums/response-unit-dispatch-notification-failure.enum.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAC3C,IAAY,uCAWX;AAXD,WAAY,uCAAuC;IAC/C,oCAAoC;IACpC,8EAAmC,CAAA;IACnC,kEAAkE;IAClE,wFAA6C,CAAA;IAC7C,oDAAoD;IACpD,gFAAqC,CAAA;IACrC,8DAA8D;IAC9D,4EAAiC,CAAA;IACjC,yFAAyF;IACzF,sEAA2B,CAAA;AAC/B,CAAC,EAXW,uCAAuC,uDAAvC,uCAAuC,QAWlD"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResponseUnitDispatchNotificationStatus = void 0;
4
+ /** What happened to the message telling the unit it was dispatched. */
5
+ var ResponseUnitDispatchNotificationStatus;
6
+ (function (ResponseUnitDispatchNotificationStatus) {
7
+ /** Requested from clarion-notification; no answer yet. */
8
+ ResponseUnitDispatchNotificationStatus["PENDING"] = "PENDING";
9
+ /** A provider accepted it. (Handset delivery is not tracked by the platform.) */
10
+ ResponseUnitDispatchNotificationStatus["SENT"] = "SENT";
11
+ /** Every provider refused or failed; it can be sent again. */
12
+ ResponseUnitDispatchNotificationStatus["FAILED"] = "FAILED";
13
+ /** Could never be sent - the unit has no usable phone number. The dispatch stands. */
14
+ ResponseUnitDispatchNotificationStatus["NOT_POSSIBLE"] = "NOT_POSSIBLE";
15
+ })(ResponseUnitDispatchNotificationStatus || (exports.ResponseUnitDispatchNotificationStatus = ResponseUnitDispatchNotificationStatus = {}));
16
+ //# sourceMappingURL=response-unit-dispatch-notification-status.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-unit-dispatch-notification-status.enum.js","sourceRoot":"","sources":["../../../../../src/modules/dispatch/enums/response-unit-dispatch-notification-status.enum.ts"],"names":[],"mappings":";;;AAAA,uEAAuE;AACvE,IAAY,sCASX;AATD,WAAY,sCAAsC;IAC9C,0DAA0D;IAC1D,6DAAmB,CAAA;IACnB,iFAAiF;IACjF,uDAAa,CAAA;IACb,8DAA8D;IAC9D,2DAAiB,CAAA;IACjB,sFAAsF;IACtF,uEAA6B,CAAA;AACjC,CAAC,EATW,sCAAsC,sDAAtC,sCAAsC,QASjD"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResponseUnitDispatchStatus = void 0;
4
+ /**
5
+ * Where one response unit is in answering one incident.
6
+ *
7
+ * Only DISPATCHED is set by the dispatch command itself. The middle states exist
8
+ * so the record can be advanced by whoever learns of progress - a dispatcher
9
+ * relaying a radio call today, the responder app or clarion-workflow later -
10
+ * without a schema change. Nothing in this platform advances them on a timer:
11
+ * escalation, reassignment and SLA belong to the workflow layer.
12
+ *
13
+ * ACTIVE = DISPATCHED, ACKNOWLEDGED, EN_ROUTE, ON_SCENE. A unit may hold at most
14
+ * ONE active dispatch across every incident - a partial unique index in
15
+ * clarion-incident enforces it, which is what stops two dispatchers sending the
16
+ * same unit to two emergencies.
17
+ */
18
+ var ResponseUnitDispatchStatus;
19
+ (function (ResponseUnitDispatchStatus) {
20
+ /** Sent: the command was accepted and the unit was asked to respond. */
21
+ ResponseUnitDispatchStatus["DISPATCHED"] = "DISPATCHED";
22
+ /** The unit confirmed it received the job. */
23
+ ResponseUnitDispatchStatus["ACKNOWLEDGED"] = "ACKNOWLEDGED";
24
+ /** On the way. */
25
+ ResponseUnitDispatchStatus["EN_ROUTE"] = "EN_ROUTE";
26
+ /** Arrived at the incident. */
27
+ ResponseUnitDispatchStatus["ON_SCENE"] = "ON_SCENE";
28
+ /** Finished - by the dispatcher, or because the incident itself ended. */
29
+ ResponseUnitDispatchStatus["COMPLETED"] = "COMPLETED";
30
+ /** Stood down before finishing. Frees the unit. */
31
+ ResponseUnitDispatchStatus["CANCELLED"] = "CANCELLED";
32
+ })(ResponseUnitDispatchStatus || (exports.ResponseUnitDispatchStatus = ResponseUnitDispatchStatus = {}));
33
+ //# sourceMappingURL=response-unit-dispatch-status.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-unit-dispatch-status.enum.js","sourceRoot":"","sources":["../../../../../src/modules/dispatch/enums/response-unit-dispatch-status.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;GAaG;AACH,IAAY,0BAaX;AAbD,WAAY,0BAA0B;IAClC,wEAAwE;IACxE,uDAAyB,CAAA;IACzB,8CAA8C;IAC9C,2DAA6B,CAAA;IAC7B,kBAAkB;IAClB,mDAAqB,CAAA;IACrB,+BAA+B;IAC/B,mDAAqB,CAAA;IACrB,0EAA0E;IAC1E,qDAAuB,CAAA;IACvB,mDAAmD;IACnD,qDAAuB,CAAA;AAC3B,CAAC,EAbW,0BAA0B,0CAA1B,0BAA0B,QAarC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResponseUnitDispatchTransitionSource = void 0;
4
+ /** Who moved a dispatch to its current status. Recorded for the audit trail. */
5
+ var ResponseUnitDispatchTransitionSource;
6
+ (function (ResponseUnitDispatchTransitionSource) {
7
+ /** A control-room user, through the admin or the API. */
8
+ ResponseUnitDispatchTransitionSource["DISPATCHER"] = "DISPATCHER";
9
+ /** The incident ended (resolved, closed...), so its active dispatches were completed. */
10
+ ResponseUnitDispatchTransitionSource["INCIDENT_LIFECYCLE"] = "INCIDENT_LIFECYCLE";
11
+ /** Reserved for the responder app. */
12
+ ResponseUnitDispatchTransitionSource["RESPONDER"] = "RESPONDER";
13
+ /** Reserved for clarion-workflow orchestration. */
14
+ ResponseUnitDispatchTransitionSource["WORKFLOW"] = "WORKFLOW";
15
+ })(ResponseUnitDispatchTransitionSource || (exports.ResponseUnitDispatchTransitionSource = ResponseUnitDispatchTransitionSource = {}));
16
+ //# sourceMappingURL=response-unit-dispatch-transition-source.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-unit-dispatch-transition-source.enum.js","sourceRoot":"","sources":["../../../../../src/modules/dispatch/enums/response-unit-dispatch-transition-source.enum.ts"],"names":[],"mappings":";;;AAAA,gFAAgF;AAChF,IAAY,oCASX;AATD,WAAY,oCAAoC;IAC5C,yDAAyD;IACzD,iEAAyB,CAAA;IACzB,yFAAyF;IACzF,iFAAyC,CAAA;IACzC,sCAAsC;IACtC,+DAAuB,CAAA;IACvB,mDAAmD;IACnD,6DAAqB,CAAA;AACzB,CAAC,EATW,oCAAoC,oDAApC,oCAAoC,QAS/C"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResponseUnitDistanceBasis = void 0;
4
+ /** What a candidate's distance (and duration, when present) measures. */
5
+ var ResponseUnitDistanceBasis;
6
+ (function (ResponseUnitDistanceBasis) {
7
+ /** Great-circle distance. Always available, never a duration. */
8
+ ResponseUnitDistanceBasis["STRAIGHT_LINE"] = "STRAIGHT_LINE";
9
+ /** A road route from clarion-gis (Google Routes), with a travel time. */
10
+ ResponseUnitDistanceBasis["ROAD_ROUTE"] = "ROAD_ROUTE";
11
+ })(ResponseUnitDistanceBasis || (exports.ResponseUnitDistanceBasis = ResponseUnitDistanceBasis = {}));
12
+ //# sourceMappingURL=response-unit-distance-basis.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-unit-distance-basis.enum.js","sourceRoot":"","sources":["../../../../../src/modules/dispatch/enums/response-unit-distance-basis.enum.ts"],"names":[],"mappings":";;;AAAA,yEAAyE;AACzE,IAAY,yBAKX;AALD,WAAY,yBAAyB;IACjC,iEAAiE;IACjE,4DAA+B,CAAA;IAC/B,yEAAyE;IACzE,sDAAyB,CAAA;AAC7B,CAAC,EALW,yBAAyB,yCAAzB,yBAAyB,QAKpC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResponseUnitLocationFreshness = void 0;
4
+ /**
5
+ * How far a candidate's position can be trusted.
6
+ *
7
+ * Not a new set of thresholds: CURRENT and STALE are clarion-response-tracking's
8
+ * own ONLINE / STALE status, which it evaluates against each provider
9
+ * connection's configured staleAfterSeconds / offlineAfterSeconds. A unit the
10
+ * tracking service calls OFFLINE has no usable position here (UNKNOWN).
11
+ */
12
+ var ResponseUnitLocationFreshness;
13
+ (function (ResponseUnitLocationFreshness) {
14
+ /** A live fix within the provider's stale threshold. */
15
+ ResponseUnitLocationFreshness["CURRENT"] = "CURRENT";
16
+ /** A live fix older than the stale threshold but not yet offline. */
17
+ ResponseUnitLocationFreshness["STALE"] = "STALE";
18
+ /** No live fix that can be relied on: offline, never tracked, or base-only. */
19
+ ResponseUnitLocationFreshness["UNKNOWN"] = "UNKNOWN";
20
+ })(ResponseUnitLocationFreshness || (exports.ResponseUnitLocationFreshness = ResponseUnitLocationFreshness = {}));
21
+ //# sourceMappingURL=response-unit-location-freshness.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-unit-location-freshness.enum.js","sourceRoot":"","sources":["../../../../../src/modules/dispatch/enums/response-unit-location-freshness.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,IAAY,6BAOX;AAPD,WAAY,6BAA6B;IACrC,wDAAwD;IACxD,oDAAmB,CAAA;IACnB,qEAAqE;IACrE,gDAAe,CAAA;IACf,+EAA+E;IAC/E,oDAAmB,CAAA;AACvB,CAAC,EAPW,6BAA6B,6CAA7B,6BAA6B,QAOxC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResponseUnitLocationSource = void 0;
4
+ /** Where a candidate's position came from. */
5
+ var ResponseUnitLocationSource;
6
+ (function (ResponseUnitLocationSource) {
7
+ /** A GPS fix from clarion-response-tracking. */
8
+ ResponseUnitLocationSource["LIVE"] = "LIVE";
9
+ /**
10
+ * The unit's configured base location in clarion-organization - used only
11
+ * for a unit that is not live-tracked at all, and always labelled as such.
12
+ */
13
+ ResponseUnitLocationSource["BASE"] = "BASE";
14
+ /** No usable position. */
15
+ ResponseUnitLocationSource["NONE"] = "NONE";
16
+ })(ResponseUnitLocationSource || (exports.ResponseUnitLocationSource = ResponseUnitLocationSource = {}));
17
+ //# sourceMappingURL=response-unit-location-source.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-unit-location-source.enum.js","sourceRoot":"","sources":["../../../../../src/modules/dispatch/enums/response-unit-location-source.enum.ts"],"names":[],"mappings":";;;AAAA,8CAA8C;AAC9C,IAAY,0BAUX;AAVD,WAAY,0BAA0B;IAClC,gDAAgD;IAChD,2CAAa,CAAA;IACb;;;OAGG;IACH,2CAAa,CAAA;IACb,0BAA0B;IAC1B,2CAAa,CAAA;AACjB,CAAC,EAVW,0BAA0B,0CAA1B,0BAA0B,QAUrC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResponseUnitRecommendationReason = void 0;
4
+ /**
5
+ * The facts a recommendation rests on, in the order the ranking weighs them.
6
+ * The admin turns these into the "Recommended because:" lines; the numbers
7
+ * behind them (distance, age) travel on the candidate itself.
8
+ */
9
+ var ResponseUnitRecommendationReason;
10
+ (function (ResponseUnitRecommendationReason) {
11
+ ResponseUnitRecommendationReason["AVAILABLE"] = "AVAILABLE";
12
+ ResponseUnitRecommendationReason["CAPABILITY_MATCH"] = "CAPABILITY_MATCH";
13
+ ResponseUnitRecommendationReason["NO_CAPABILITY_REQUIREMENT"] = "NO_CAPABILITY_REQUIREMENT";
14
+ ResponseUnitRecommendationReason["CAPABILITY_UNKNOWN"] = "CAPABILITY_UNKNOWN";
15
+ ResponseUnitRecommendationReason["SAME_CONTROL_CENTRE"] = "SAME_CONTROL_CENTRE";
16
+ ResponseUnitRecommendationReason["OTHER_CONTROL_CENTRE"] = "OTHER_CONTROL_CENTRE";
17
+ ResponseUnitRecommendationReason["LIVE_LOCATION_CURRENT"] = "LIVE_LOCATION_CURRENT";
18
+ ResponseUnitRecommendationReason["LIVE_LOCATION_STALE"] = "LIVE_LOCATION_STALE";
19
+ ResponseUnitRecommendationReason["BASE_LOCATION"] = "BASE_LOCATION";
20
+ /** Closest of the units that tie on everything above. */
21
+ ResponseUnitRecommendationReason["NEAREST"] = "NEAREST";
22
+ /** Quickest by road of the units that tie on everything above. */
23
+ ResponseUnitRecommendationReason["QUICKEST"] = "QUICKEST";
24
+ })(ResponseUnitRecommendationReason || (exports.ResponseUnitRecommendationReason = ResponseUnitRecommendationReason = {}));
25
+ //# sourceMappingURL=response-unit-recommendation-reason.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-unit-recommendation-reason.enum.js","sourceRoot":"","sources":["../../../../../src/modules/dispatch/enums/response-unit-recommendation-reason.enum.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,IAAY,gCAcX;AAdD,WAAY,gCAAgC;IACxC,2DAAuB,CAAA;IACvB,yEAAqC,CAAA;IACrC,2FAAuD,CAAA;IACvD,6EAAyC,CAAA;IACzC,+EAA2C,CAAA;IAC3C,iFAA6C,CAAA;IAC7C,mFAA+C,CAAA;IAC/C,+EAA2C,CAAA;IAC3C,mEAA+B,CAAA;IAC/B,yDAAyD;IACzD,uDAAmB,CAAA;IACnB,kEAAkE;IAClE,yDAAqB,CAAA;AACzB,CAAC,EAdW,gCAAgC,gDAAhC,gCAAgC,QAc3C"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResponseUnitRecommendationStatus = void 0;
4
+ /**
5
+ * The overall answer. NO_UNITS_CONFIGURED and NO_ELIGIBLE_UNITS are different
6
+ * operational facts and the admin treats them differently: the first hides the
7
+ * whole dispatch panel (this control room simply has no units), the second is
8
+ * an alarm (it has units and none can go).
9
+ */
10
+ var ResponseUnitRecommendationStatus;
11
+ (function (ResponseUnitRecommendationStatus) {
12
+ /** A unit is recommended. */
13
+ ResponseUnitRecommendationStatus["RECOMMENDED"] = "RECOMMENDED";
14
+ /** Some units can be dispatched by hand, but none qualifies for a recommendation. */
15
+ ResponseUnitRecommendationStatus["NO_RECOMMENDATION"] = "NO_RECOMMENDATION";
16
+ /** Units exist and none of them can be dispatched. */
17
+ ResponseUnitRecommendationStatus["NO_ELIGIBLE_UNITS"] = "NO_ELIGIBLE_UNITS";
18
+ /** The caller's scope holds no response units at all. */
19
+ ResponseUnitRecommendationStatus["NO_UNITS_CONFIGURED"] = "NO_UNITS_CONFIGURED";
20
+ /** The incident itself cannot take a dispatch (see the blockers). */
21
+ ResponseUnitRecommendationStatus["NOT_DISPATCHABLE"] = "NOT_DISPATCHABLE";
22
+ })(ResponseUnitRecommendationStatus || (exports.ResponseUnitRecommendationStatus = ResponseUnitRecommendationStatus = {}));
23
+ //# sourceMappingURL=response-unit-recommendation-status.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-unit-recommendation-status.enum.js","sourceRoot":"","sources":["../../../../../src/modules/dispatch/enums/response-unit-recommendation-status.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,IAAY,gCAWX;AAXD,WAAY,gCAAgC;IACxC,6BAA6B;IAC7B,+DAA2B,CAAA;IAC3B,qFAAqF;IACrF,2EAAuC,CAAA;IACvC,sDAAsD;IACtD,2EAAuC,CAAA;IACvC,yDAAyD;IACzD,+EAA2C,CAAA;IAC3C,qEAAqE;IACrE,yEAAqC,CAAA;AACzC,CAAC,EAXW,gCAAgC,gDAAhC,gCAAgC,QAW3C"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ // Enums
18
+ __exportStar(require("./enums/response-unit-dispatch-status.enum"), exports);
19
+ __exportStar(require("./enums/response-unit-dispatch-transition-source.enum"), exports);
20
+ __exportStar(require("./enums/response-unit-capability-match.enum"), exports);
21
+ __exportStar(require("./enums/response-capability-requirement-source.enum"), exports);
22
+ __exportStar(require("./enums/response-unit-location-source.enum"), exports);
23
+ __exportStar(require("./enums/response-unit-location-freshness.enum"), exports);
24
+ __exportStar(require("./enums/response-unit-distance-basis.enum"), exports);
25
+ __exportStar(require("./enums/response-unit-dispatch-constraint.enum"), exports);
26
+ __exportStar(require("./enums/response-unit-recommendation-reason.enum"), exports);
27
+ __exportStar(require("./enums/response-unit-recommendation-status.enum"), exports);
28
+ __exportStar(require("./enums/incident-dispatch-blocker.enum"), exports);
29
+ __exportStar(require("./enums/response-unit-dispatch-notification-status.enum"), exports);
30
+ __exportStar(require("./enums/response-unit-dispatch-notification-failure.enum"), exports);
31
+ __exportStar(require("./enums/response-unit-dispatch-error-code.enum"), exports);
32
+ // Interfaces
33
+ __exportStar(require("./interfaces/response-unit-dispatch-profile"), exports);
34
+ __exportStar(require("./interfaces/response-unit-proximity"), exports);
35
+ __exportStar(require("./interfaces/response-unit-recommendation"), exports);
36
+ __exportStar(require("./interfaces/incident-response-unit-dispatch"), exports);
37
+ __exportStar(require("./interfaces/response-unit-dispatch-events"), exports);
38
+ // Constants
39
+ __exportStar(require("./constants/response-unit-dispatch-kafka.const"), exports);
40
+ __exportStar(require("./constants/response-unit-dispatch-defaults.const"), exports);
41
+ // DTOs
42
+ __exportStar(require("./dtos/dispatch-response-unit.dto"), exports);
43
+ __exportStar(require("./dtos/update-response-unit-dispatch-status.dto"), exports);
44
+ __exportStar(require("./dtos/response-unit-nearby-query.dto"), exports);
45
+ __exportStar(require("./dtos/response-unit-dispatch-profile-query.dto"), exports);
46
+ __exportStar(require("./dtos/response-unit-dispatch-notification.dto"), exports);
47
+ // Utilities
48
+ __exportStar(require("./utils/response-unit-dispatch-status.util"), exports);
49
+ __exportStar(require("./utils/response-capability-match.util"), exports);
50
+ __exportStar(require("./utils/incident-dispatchability.util"), exports);
51
+ __exportStar(require("./utils/dispatch-geo.util"), exports);
52
+ __exportStar(require("./utils/response-unit-dispatch-event.util"), exports);
53
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/dispatch/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,QAAQ;AACR,6EAA2D;AAC3D,wFAAsE;AACtE,8EAA4D;AAC5D,sFAAoE;AACpE,6EAA2D;AAC3D,gFAA8D;AAC9D,4EAA0D;AAC1D,iFAA+D;AAC/D,mFAAiE;AACjE,mFAAiE;AACjE,yEAAuD;AACvD,0FAAwE;AACxE,2FAAyE;AACzE,iFAA+D;AAE/D,aAAa;AACb,8EAA4D;AAC5D,uEAAqD;AACrD,4EAA0D;AAC1D,+EAA6D;AAC7D,6EAA2D;AAE3D,YAAY;AACZ,iFAA+D;AAC/D,oFAAkE;AAElE,OAAO;AACP,oEAAkD;AAClD,kFAAgE;AAChE,wEAAsD;AACtD,kFAAgE;AAChE,iFAA+D;AAE/D,YAAY;AACZ,6EAA2D;AAC3D,yEAAuD;AACvD,wEAAsD;AACtD,4DAA0C;AAC1C,4EAA0D"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=incident-response-unit-dispatch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"incident-response-unit-dispatch.js","sourceRoot":"","sources":["../../../../../src/modules/dispatch/interfaces/incident-response-unit-dispatch.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=response-unit-dispatch-events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-unit-dispatch-events.js","sourceRoot":"","sources":["../../../../../src/modules/dispatch/interfaces/response-unit-dispatch-events.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=response-unit-dispatch-profile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-unit-dispatch-profile.js","sourceRoot":"","sources":["../../../../../src/modules/dispatch/interfaces/response-unit-dispatch-profile.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=response-unit-proximity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-unit-proximity.js","sourceRoot":"","sources":["../../../../../src/modules/dispatch/interfaces/response-unit-proximity.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=response-unit-recommendation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-unit-recommendation.js","sourceRoot":"","sources":["../../../../../src/modules/dispatch/interfaces/response-unit-recommendation.ts"],"names":[],"mappings":""}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.haversineMetres = haversineMetres;
4
+ exports.isUsableCoordinate = isUsableCoordinate;
5
+ exports.readCoordinate = readCoordinate;
6
+ /** Mean Earth radius (IUGG), the value clarion-response-tracking uses too. */
7
+ const EARTH_RADIUS_METRES = 6371008.8;
8
+ const toRadians = (degrees) => (degrees * Math.PI) / 180;
9
+ /** Great-circle distance in metres. */
10
+ function haversineMetres(lat1, lng1, lat2, lng2) {
11
+ const dLat = toRadians(lat2 - lat1);
12
+ const dLng = toRadians(lng2 - lng1);
13
+ const a = Math.sin(dLat / 2) ** 2 +
14
+ Math.cos(toRadians(lat1)) * Math.cos(toRadians(lat2)) * Math.sin(dLng / 2) ** 2;
15
+ return 2 * EARTH_RADIUS_METRES * Math.asin(Math.min(1, Math.sqrt(a)));
16
+ }
17
+ /**
18
+ * A coordinate worth computing a distance from: finite, in range, and not the
19
+ * (0,0) a form leaves behind when nobody picked a point (Null Island, in the
20
+ * Gulf of Guinea, is where every unset location in the world quietly sits).
21
+ */
22
+ function isUsableCoordinate(latitude, longitude) {
23
+ if (typeof latitude !== 'number' || typeof longitude !== 'number')
24
+ return false;
25
+ if (!Number.isFinite(latitude) || !Number.isFinite(longitude))
26
+ return false;
27
+ if (latitude < -90 || latitude > 90 || longitude < -180 || longitude > 180)
28
+ return false;
29
+ return !(latitude === 0 && longitude === 0);
30
+ }
31
+ /**
32
+ * Read a {lat,lng} / {latitude,longitude} / {lat,lon} shaped location - the
33
+ * platform stores all three - as a usable coordinate, or null.
34
+ */
35
+ function readCoordinate(location) {
36
+ var _a, _b, _c;
37
+ if (!location || typeof location !== 'object')
38
+ return null;
39
+ const value = location;
40
+ const latitude = Number((_a = value['latitude']) !== null && _a !== void 0 ? _a : value['lat']);
41
+ const longitude = Number((_c = (_b = value['longitude']) !== null && _b !== void 0 ? _b : value['lng']) !== null && _c !== void 0 ? _c : value['lon']);
42
+ return isUsableCoordinate(latitude, longitude) ? { latitude, longitude } : null;
43
+ }
44
+ //# sourceMappingURL=dispatch-geo.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dispatch-geo.util.js","sourceRoot":"","sources":["../../../../../src/modules/dispatch/utils/dispatch-geo.util.ts"],"names":[],"mappings":";;AAMA,0CAOC;AAOD,gDAKC;AAMD,wCAQC;AAvCD,8EAA8E;AAC9E,MAAM,mBAAmB,GAAG,SAAW,CAAC;AAExC,MAAM,SAAS,GAAG,CAAC,OAAe,EAAU,EAAE,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC;AAEzE,uCAAuC;AACvC,SAAgB,eAAe,CAAC,IAAY,EAAE,IAAY,EAAE,IAAY,EAAE,IAAY;IAClF,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IACpC,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IACpC,MAAM,CAAC,GACH,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC;QACvB,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;IACpF,OAAO,CAAC,GAAG,mBAAmB,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1E,CAAC;AAED;;;;GAIG;AACH,SAAgB,kBAAkB,CAAC,QAAiB,EAAE,SAAkB;IACpE,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,OAAO,SAAS,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAChF,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;QAAE,OAAO,KAAK,CAAC;IAC5E,IAAI,QAAQ,GAAG,CAAC,EAAE,IAAI,QAAQ,GAAG,EAAE,IAAI,SAAS,GAAG,CAAC,GAAG,IAAI,SAAS,GAAG,GAAG;QAAE,OAAO,KAAK,CAAC;IACzF,OAAO,CAAC,CAAC,QAAQ,KAAK,CAAC,IAAI,SAAS,KAAK,CAAC,CAAC,CAAC;AAChD,CAAC;AAED;;;GAGG;AACH,SAAgB,cAAc,CAC1B,QAAiB;;IAEjB,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC3D,MAAM,KAAK,GAAG,QAAmC,CAAC;IAClD,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAA,KAAK,CAAC,UAAU,CAAC,mCAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3D,MAAM,SAAS,GAAG,MAAM,CAAC,MAAA,MAAA,KAAK,CAAC,WAAW,CAAC,mCAAI,KAAK,CAAC,KAAK,CAAC,mCAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7E,OAAO,kBAAkB,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACpF,CAAC"}