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
@@ -0,0 +1,9 @@
1
+ /** What a candidate's distance (and duration, when present) measures. */
2
+ export var ResponseUnitDistanceBasis;
3
+ (function (ResponseUnitDistanceBasis) {
4
+ /** Great-circle distance. Always available, never a duration. */
5
+ ResponseUnitDistanceBasis["STRAIGHT_LINE"] = "STRAIGHT_LINE";
6
+ /** A road route from clarion-gis (Google Routes), with a travel time. */
7
+ ResponseUnitDistanceBasis["ROAD_ROUTE"] = "ROAD_ROUTE";
8
+ })(ResponseUnitDistanceBasis || (ResponseUnitDistanceBasis = {}));
9
+ //# 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,MAAM,CAAN,IAAY,yBAKX;AALD,WAAY,yBAAyB;IACjC,iEAAiE;IACjE,4DAA+B,CAAA;IAC/B,yEAAyE;IACzE,sDAAyB,CAAA;AAC7B,CAAC,EALW,yBAAyB,KAAzB,yBAAyB,QAKpC"}
@@ -0,0 +1,18 @@
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 var ResponseUnitLocationFreshness;
10
+ (function (ResponseUnitLocationFreshness) {
11
+ /** A live fix within the provider's stale threshold. */
12
+ ResponseUnitLocationFreshness["CURRENT"] = "CURRENT";
13
+ /** A live fix older than the stale threshold but not yet offline. */
14
+ ResponseUnitLocationFreshness["STALE"] = "STALE";
15
+ /** No live fix that can be relied on: offline, never tracked, or base-only. */
16
+ ResponseUnitLocationFreshness["UNKNOWN"] = "UNKNOWN";
17
+ })(ResponseUnitLocationFreshness || (ResponseUnitLocationFreshness = {}));
18
+ //# 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,MAAM,CAAN,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,KAA7B,6BAA6B,QAOxC"}
@@ -0,0 +1,14 @@
1
+ /** Where a candidate's position came from. */
2
+ export var ResponseUnitLocationSource;
3
+ (function (ResponseUnitLocationSource) {
4
+ /** A GPS fix from clarion-response-tracking. */
5
+ ResponseUnitLocationSource["LIVE"] = "LIVE";
6
+ /**
7
+ * The unit's configured base location in clarion-organization - used only
8
+ * for a unit that is not live-tracked at all, and always labelled as such.
9
+ */
10
+ ResponseUnitLocationSource["BASE"] = "BASE";
11
+ /** No usable position. */
12
+ ResponseUnitLocationSource["NONE"] = "NONE";
13
+ })(ResponseUnitLocationSource || (ResponseUnitLocationSource = {}));
14
+ //# 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,MAAM,CAAN,IAAY,0BAUX;AAVD,WAAY,0BAA0B;IAClC,gDAAgD;IAChD,2CAAa,CAAA;IACb;;;OAGG;IACH,2CAAa,CAAA;IACb,0BAA0B;IAC1B,2CAAa,CAAA;AACjB,CAAC,EAVW,0BAA0B,KAA1B,0BAA0B,QAUrC"}
@@ -0,0 +1,22 @@
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 var ResponseUnitRecommendationReason;
7
+ (function (ResponseUnitRecommendationReason) {
8
+ ResponseUnitRecommendationReason["AVAILABLE"] = "AVAILABLE";
9
+ ResponseUnitRecommendationReason["CAPABILITY_MATCH"] = "CAPABILITY_MATCH";
10
+ ResponseUnitRecommendationReason["NO_CAPABILITY_REQUIREMENT"] = "NO_CAPABILITY_REQUIREMENT";
11
+ ResponseUnitRecommendationReason["CAPABILITY_UNKNOWN"] = "CAPABILITY_UNKNOWN";
12
+ ResponseUnitRecommendationReason["SAME_CONTROL_CENTRE"] = "SAME_CONTROL_CENTRE";
13
+ ResponseUnitRecommendationReason["OTHER_CONTROL_CENTRE"] = "OTHER_CONTROL_CENTRE";
14
+ ResponseUnitRecommendationReason["LIVE_LOCATION_CURRENT"] = "LIVE_LOCATION_CURRENT";
15
+ ResponseUnitRecommendationReason["LIVE_LOCATION_STALE"] = "LIVE_LOCATION_STALE";
16
+ ResponseUnitRecommendationReason["BASE_LOCATION"] = "BASE_LOCATION";
17
+ /** Closest of the units that tie on everything above. */
18
+ ResponseUnitRecommendationReason["NEAREST"] = "NEAREST";
19
+ /** Quickest by road of the units that tie on everything above. */
20
+ ResponseUnitRecommendationReason["QUICKEST"] = "QUICKEST";
21
+ })(ResponseUnitRecommendationReason || (ResponseUnitRecommendationReason = {}));
22
+ //# 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,MAAM,CAAN,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,KAAhC,gCAAgC,QAc3C"}
@@ -0,0 +1,20 @@
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 var ResponseUnitRecommendationStatus;
8
+ (function (ResponseUnitRecommendationStatus) {
9
+ /** A unit is recommended. */
10
+ ResponseUnitRecommendationStatus["RECOMMENDED"] = "RECOMMENDED";
11
+ /** Some units can be dispatched by hand, but none qualifies for a recommendation. */
12
+ ResponseUnitRecommendationStatus["NO_RECOMMENDATION"] = "NO_RECOMMENDATION";
13
+ /** Units exist and none of them can be dispatched. */
14
+ ResponseUnitRecommendationStatus["NO_ELIGIBLE_UNITS"] = "NO_ELIGIBLE_UNITS";
15
+ /** The caller's scope holds no response units at all. */
16
+ ResponseUnitRecommendationStatus["NO_UNITS_CONFIGURED"] = "NO_UNITS_CONFIGURED";
17
+ /** The incident itself cannot take a dispatch (see the blockers). */
18
+ ResponseUnitRecommendationStatus["NOT_DISPATCHABLE"] = "NOT_DISPATCHABLE";
19
+ })(ResponseUnitRecommendationStatus || (ResponseUnitRecommendationStatus = {}));
20
+ //# 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,MAAM,CAAN,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,KAAhC,gCAAgC,QAW3C"}
@@ -0,0 +1,37 @@
1
+ // Enums
2
+ export * from './enums/response-unit-dispatch-status.enum';
3
+ export * from './enums/response-unit-dispatch-transition-source.enum';
4
+ export * from './enums/response-unit-capability-match.enum';
5
+ export * from './enums/response-capability-requirement-source.enum';
6
+ export * from './enums/response-unit-location-source.enum';
7
+ export * from './enums/response-unit-location-freshness.enum';
8
+ export * from './enums/response-unit-distance-basis.enum';
9
+ export * from './enums/response-unit-dispatch-constraint.enum';
10
+ export * from './enums/response-unit-recommendation-reason.enum';
11
+ export * from './enums/response-unit-recommendation-status.enum';
12
+ export * from './enums/incident-dispatch-blocker.enum';
13
+ export * from './enums/response-unit-dispatch-notification-status.enum';
14
+ export * from './enums/response-unit-dispatch-notification-failure.enum';
15
+ export * from './enums/response-unit-dispatch-error-code.enum';
16
+ // Interfaces
17
+ export * from './interfaces/response-unit-dispatch-profile';
18
+ export * from './interfaces/response-unit-proximity';
19
+ export * from './interfaces/response-unit-recommendation';
20
+ export * from './interfaces/incident-response-unit-dispatch';
21
+ export * from './interfaces/response-unit-dispatch-events';
22
+ // Constants
23
+ export * from './constants/response-unit-dispatch-kafka.const';
24
+ export * from './constants/response-unit-dispatch-defaults.const';
25
+ // DTOs
26
+ export * from './dtos/dispatch-response-unit.dto';
27
+ export * from './dtos/update-response-unit-dispatch-status.dto';
28
+ export * from './dtos/response-unit-nearby-query.dto';
29
+ export * from './dtos/response-unit-dispatch-profile-query.dto';
30
+ export * from './dtos/response-unit-dispatch-notification.dto';
31
+ // Utilities
32
+ export * from './utils/response-unit-dispatch-status.util';
33
+ export * from './utils/response-capability-match.util';
34
+ export * from './utils/incident-dispatchability.util';
35
+ export * from './utils/dispatch-geo.util';
36
+ export * from './utils/response-unit-dispatch-event.util';
37
+ //# 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,cAAc,4CAA4C,CAAC;AAC3D,cAAc,uDAAuD,CAAC;AACtE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,qDAAqD,CAAC;AACpE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,kDAAkD,CAAC;AACjE,cAAc,kDAAkD,CAAC;AACjE,cAAc,wCAAwC,CAAC;AACvD,cAAc,yDAAyD,CAAC;AACxE,cAAc,0DAA0D,CAAC;AACzE,cAAc,gDAAgD,CAAC;AAE/D,aAAa;AACb,cAAc,6CAA6C,CAAC;AAC5D,cAAc,sCAAsC,CAAC;AACrD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,4CAA4C,CAAC;AAE3D,YAAY;AACZ,cAAc,gDAAgD,CAAC;AAC/D,cAAc,mDAAmD,CAAC;AAElE,OAAO;AACP,cAAc,mCAAmC,CAAC;AAClD,cAAc,iDAAiD,CAAC;AAChE,cAAc,uCAAuC,CAAC;AACtD,cAAc,iDAAiD,CAAC;AAChE,cAAc,gDAAgD,CAAC;AAE/D,YAAY;AACZ,cAAc,4CAA4C,CAAC;AAC3D,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC;AACtD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2CAA2C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# 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,2 @@
1
+ export {};
2
+ //# 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,2 @@
1
+ export {};
2
+ //# 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,2 @@
1
+ export {};
2
+ //# 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,2 @@
1
+ export {};
2
+ //# 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,39 @@
1
+ /** Mean Earth radius (IUGG), the value clarion-response-tracking uses too. */
2
+ const EARTH_RADIUS_METRES = 6371008.8;
3
+ const toRadians = (degrees) => (degrees * Math.PI) / 180;
4
+ /** Great-circle distance in metres. */
5
+ export function haversineMetres(lat1, lng1, lat2, lng2) {
6
+ const dLat = toRadians(lat2 - lat1);
7
+ const dLng = toRadians(lng2 - lng1);
8
+ const a = Math.sin(dLat / 2) ** 2 +
9
+ Math.cos(toRadians(lat1)) * Math.cos(toRadians(lat2)) * Math.sin(dLng / 2) ** 2;
10
+ return 2 * EARTH_RADIUS_METRES * Math.asin(Math.min(1, Math.sqrt(a)));
11
+ }
12
+ /**
13
+ * A coordinate worth computing a distance from: finite, in range, and not the
14
+ * (0,0) a form leaves behind when nobody picked a point (Null Island, in the
15
+ * Gulf of Guinea, is where every unset location in the world quietly sits).
16
+ */
17
+ export function isUsableCoordinate(latitude, longitude) {
18
+ if (typeof latitude !== 'number' || typeof longitude !== 'number')
19
+ return false;
20
+ if (!Number.isFinite(latitude) || !Number.isFinite(longitude))
21
+ return false;
22
+ if (latitude < -90 || latitude > 90 || longitude < -180 || longitude > 180)
23
+ return false;
24
+ return !(latitude === 0 && longitude === 0);
25
+ }
26
+ /**
27
+ * Read a {lat,lng} / {latitude,longitude} / {lat,lon} shaped location - the
28
+ * platform stores all three - as a usable coordinate, or null.
29
+ */
30
+ export function readCoordinate(location) {
31
+ var _a, _b, _c;
32
+ if (!location || typeof location !== 'object')
33
+ return null;
34
+ const value = location;
35
+ const latitude = Number((_a = value['latitude']) !== null && _a !== void 0 ? _a : value['lat']);
36
+ const longitude = Number((_c = (_b = value['longitude']) !== null && _b !== void 0 ? _b : value['lng']) !== null && _c !== void 0 ? _c : value['lon']);
37
+ return isUsableCoordinate(latitude, longitude) ? { latitude, longitude } : null;
38
+ }
39
+ //# 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":"AAAA,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,MAAM,UAAU,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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
2
+ import { IncidentClass } from '../../incident/enums/incident-class.enum';
3
+ import { IncidentStatus } from '../../incident/enums/incident-status.enum';
4
+ import { IncidentDispatchBlocker } from '../enums/incident-dispatch-blocker.enum';
5
+ /** Incident statuses after which nothing is sent to it. */
6
+ export const INCIDENT_STATUSES_ENDING_DISPATCH = [
7
+ IncidentStatus.RESOLVED,
8
+ IncidentStatus.CLOSED,
9
+ IncidentStatus.UNRESOLVED,
10
+ IncidentStatus.ARCHIVED,
11
+ ];
12
+ /**
13
+ * Why this incident cannot take a dispatch - empty when it can. Every reason is
14
+ * returned, not just the first, so the admin can say all of it at once.
15
+ */
16
+ export function resolveIncidentDispatchBlockers(incident) {
17
+ var _a, _b;
18
+ const blockers = [];
19
+ if (incident.class && incident.class !== IncidentClass.INCIDENT) {
20
+ blockers.push(IncidentDispatchBlocker.NOT_AN_EMERGENCY_INCIDENT);
21
+ }
22
+ if (incident.status && INCIDENT_STATUSES_ENDING_DISPATCH.includes(incident.status)) {
23
+ blockers.push(IncidentDispatchBlocker.INCIDENT_ENDED);
24
+ }
25
+ if (!reachesControlRoom({
26
+ notifyServiceProvider: (_a = incident.notifyServiceProvider) !== null && _a !== void 0 ? _a : undefined,
27
+ entitlementTier: (_b = incident.entitlementTier) !== null && _b !== void 0 ? _b : undefined,
28
+ })) {
29
+ blockers.push(IncidentDispatchBlocker.PROVIDER_RESPONSE_NOT_REQUESTED);
30
+ }
31
+ return blockers;
32
+ }
33
+ /** Whether an incident status ends every dispatch still active on it. */
34
+ export function incidentStatusEndsDispatch(status) {
35
+ return !!status && INCIDENT_STATUSES_ENDING_DISPATCH.includes(status);
36
+ }
37
+ //# sourceMappingURL=incident-dispatchability.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"incident-dispatchability.util.js","sourceRoot":"","sources":["../../../../../src/modules/dispatch/utils/incident-dispatchability.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO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apabilities } from '../../response-unit/utils/response-capability.util';
2
+ import { ResponseCapabilityRequirementSource } from '../enums/response-capability-requirement-source.enum';
3
+ import { ResponseUnitCapabilityMatch } from '../enums/response-unit-capability-match.enum';
4
+ /**
5
+ * What an incident needs: its TYPE's list when the type names one, otherwise
6
+ * its CATEGORY's, otherwise nothing. A type's list replaces the category's
7
+ * rather than adding to it - "Road accident with casualties" under a "Traffic"
8
+ * category that asks for roadside assistance must be able to ask for an
9
+ * ambulance instead.
10
+ */
11
+ export function resolveResponseCapabilityRequirement(type, category) {
12
+ const fromType = normalizeResponseCapabilities(type === null || type === void 0 ? void 0 : type.responseCapabilities);
13
+ if (fromType.length > 0) {
14
+ return { capabilities: fromType, source: ResponseCapabilityRequirementSource.INCIDENT_TYPE };
15
+ }
16
+ const fromCategory = normalizeResponseCapabilities(category === null || category === void 0 ? void 0 : category.responseCapabilities);
17
+ if (fromCategory.length > 0) {
18
+ return { capabilities: fromCategory, source: ResponseCapabilityRequirementSource.INCIDENT_CATEGORY };
19
+ }
20
+ return { capabilities: [], source: ResponseCapabilityRequirementSource.NONE };
21
+ }
22
+ /**
23
+ * Compare a unit with a requirement. A unit qualifies with ANY required
24
+ * capability - a requirement is the set of services that would do, not a
25
+ * checklist one vehicle must tick.
26
+ */
27
+ export function matchResponseCapabilities(required, unitCapabilities) {
28
+ if (required.length === 0) {
29
+ return { match: ResponseUnitCapabilityMatch.NOT_REQUIRED, matched: [] };
30
+ }
31
+ if (unitCapabilities.length === 0) {
32
+ return { match: ResponseUnitCapabilityMatch.UNKNOWN, matched: [] };
33
+ }
34
+ const have = new Set(unitCapabilities);
35
+ const matched = required.filter((capability) => have.has(capability));
36
+ return matched.length > 0
37
+ ? { match: ResponseUnitCapabilityMatch.MATCH, matched: [...matched].sort() }
38
+ : { match: ResponseUnitCapabilityMatch.NOT_SUITED, matched: [] };
39
+ }
40
+ //# sourceMappingURL=response-capability-match.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-capability-match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CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACvE,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACvC,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;IACtE,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC;QACrB,CAAC,CAAC,EAAE,KAAK,EAAE,2BAA2B,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAC5E,CAAC,CAAC,EAAE,KAAK,EAAE,2BAA2B,CAAC,UAAU,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AACzE,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Deterministic event id: the same change always produces the same id, so a
3
+ * consumer that sees one twice (an outbox re-publish, a Kafka redelivery) knows
4
+ * it already handled it. `discriminator` separates changes of the same kind on
5
+ * one dispatch (the target status, the notification attempt number).
6
+ */
7
+ export function buildResponseUnitDispatchEventId(kind, dispatchId, discriminator) {
8
+ const suffix = discriminator === undefined || discriminator === null || discriminator === '' ? '' : `:${discriminator}`;
9
+ return `response-unit-dispatch:${dispatchId}:${kind}${suffix}`;
10
+ }
11
+ /** An incident as a control room quotes it: `#1234`. */
12
+ export function formatIncidentReference(incidentId) {
13
+ return `#${incidentId}`;
14
+ }
15
+ //# sourceMappingURL=response-unit-dispatch-event.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-unit-dispatch-event.util.js","sourceRoot":"","sources":["../../../../../src/modules/dispatch/utils/response-unit-dispatch-event.util.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,gCAAgC,CAC5C,IAAqF,EACrF,UAAkB,EAClB,aAA+B;IAE/B,MAAM,MAAM,GAAG,aAAa,KAAK,SAAS,IAAI,aAAa,KAAK,IAAI,IAAI,aAAa,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,aAAa,EAAE,CAAC;IACxH,OAAO,0BAA0B,UAAU,IAAI,IAAI,GAAG,MAAM,EAAE,CAAC;AACnE,CAAC;AAED,wDAAwD;AACxD,MAAM,UAAU,uBAAuB,CAAC,UAAkB;IACtD,OAAO,IAAI,UAAU,EAAE,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { ACTIVE_RESPONSE_UNIT_DISPATCH_STATUSES, TERMINAL_RESPONSE_UNIT_DISPATCH_STATUSES, } from '../constants/response-unit-dispatch-defaults.const';
2
+ import { ResponseUnitDispatchStatus } from '../enums/response-unit-dispatch-status.enum';
3
+ const S = ResponseUnitDispatchStatus;
4
+ /**
5
+ * Where a dispatch may go next. Forward only, and steps may be skipped: a crew
6
+ * that radios in "on scene" never said "en route", and refusing to record the
7
+ * truth because a step was missed would leave the record wrong. Nothing leaves
8
+ * COMPLETED or CANCELLED - a unit sent again is a new dispatch, with its own
9
+ * audit trail, not a resurrected one.
10
+ */
11
+ export const RESPONSE_UNIT_DISPATCH_TRANSITIONS = {
12
+ [S.DISPATCHED]: [S.ACKNOWLEDGED, S.EN_ROUTE, S.ON_SCENE, S.COMPLETED, S.CANCELLED],
13
+ [S.ACKNOWLEDGED]: [S.EN_ROUTE, S.ON_SCENE, S.COMPLETED, S.CANCELLED],
14
+ [S.EN_ROUTE]: [S.ON_SCENE, S.COMPLETED, S.CANCELLED],
15
+ [S.ON_SCENE]: [S.COMPLETED, S.CANCELLED],
16
+ [S.COMPLETED]: [],
17
+ [S.CANCELLED]: [],
18
+ };
19
+ export function isActiveResponseUnitDispatchStatus(status) {
20
+ return !!status && ACTIVE_RESPONSE_UNIT_DISPATCH_STATUSES.includes(status);
21
+ }
22
+ export function isTerminalResponseUnitDispatchStatus(status) {
23
+ return !!status && TERMINAL_RESPONSE_UNIT_DISPATCH_STATUSES.includes(status);
24
+ }
25
+ export function canTransitionResponseUnitDispatch(from, to) {
26
+ var _a;
27
+ return ((_a = RESPONSE_UNIT_DISPATCH_TRANSITIONS[from]) !== null && _a !== void 0 ? _a : []).includes(to);
28
+ }
29
+ /** The statuses a dispatch in `from` may be moved to. */
30
+ export function nextResponseUnitDispatchStatuses(from) {
31
+ var _a;
32
+ return [...((_a = RESPONSE_UNIT_DISPATCH_TRANSITIONS[from]) !== null && _a !== void 0 ? _a : [])];
33
+ }
34
+ /** The milestone column each status stamps, for the statuses that have one. */
35
+ export const RESPONSE_UNIT_DISPATCH_MILESTONE_FIELD = {
36
+ [S.ACKNOWLEDGED]: 'acknowledgedAt',
37
+ [S.EN_ROUTE]: 'enRouteAt',
38
+ [S.ON_SCENE]: 'onSceneAt',
39
+ [S.COMPLETED]: 'completedAt',
40
+ [S.CANCELLED]: 'cancelledAt',
41
+ };
42
+ //# sourceMappingURL=response-unit-dispatch-status.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-unit-dispatch-status.util.js","sourceRoot":"","sources":["../../../../../src/modules/dispatch/utils/response-unit-dispatch-status.util.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,sCAAsC,EACtC,wCAAwC,GAC3C,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AAEzF,MAAM,CAAC,GAAG,0BAA0B,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAwF;IACnI,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC;IAClF,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,CAA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,EAAE,aAAa;CAC/B,CAAC"}
@@ -7,7 +7,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
- import { IsNotEmpty, IsNumber, IsOptional, IsString, MaxLength } from "class-validator";
10
+ import { ArrayMaxSize, IsArray, IsEnum, IsNotEmpty, IsNumber, IsOptional, IsString, MaxLength } from "class-validator";
11
+ import { ResponseCapability } from "../../../response-unit/enums/response-unit/response-capability.enum";
12
+ import { MAX_RESPONSE_CAPABILITIES } from "../../../response-unit/utils/response-capability.util";
11
13
  import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
12
14
  export class CreateIncidentCategoryDto {
13
15
  }
@@ -42,4 +44,11 @@ __decorate([
42
44
  IsNotEmpty(),
43
45
  __metadata("design:type", Number)
44
46
  ], CreateIncidentCategoryDto.prototype, "organizationId", void 0);
47
+ __decorate([
48
+ IsOptional(),
49
+ IsArray(),
50
+ ArrayMaxSize(MAX_RESPONSE_CAPABILITIES),
51
+ IsEnum(ResponseCapability, { each: true }),
52
+ __metadata("design:type", Array)
53
+ ], CreateIncidentCategoryDto.prototype, "responseCapabilities", void 0);
45
54
  //# sourceMappingURL=create-incident-category.dto.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-incident-category.dto.js","sourceRoot":"","sources":["../../../../../../src/modules/incident/dtos/category/create-incident-category.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEnE,MAAM,OAAO,yBAAyB;CA4BrC;AAnBG;IARC,WAAW,CAAC;QACT,WAAW,EAAE,+BAA+B;QAC5C,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,gBAAgB;KAC5B,CAAC;IACD,QAAQ,EAAE;IACV,UAAU,EAAE;IACZ,SAAS,CAAC,EAAE,CAAC;;uDACA;AAUd;IARC,mBAAmB,CAAC;QACjB,WAAW,EAAE,+CAA+C;QAC5D,SAAS,EAAE,GAAG;QACd,OAAO,EAAE,mDAAmD;KAC/D,CAAC;IACD,QAAQ,EAAE;IACV,UAAU,EAAE;IACZ,SAAS,CAAC,GAAG,CAAC;;8DACM;AAQrB;IANC,WAAW,CAAC;QACT,WAAW,EAAE,iDAAiD;QAC9D,OAAO,EAAE,CAAC;KACb,CAAC;IACD,QAAQ,EAAE;IACV,UAAU,EAAE;;iEACW"}
1
+ {"version":3,"file":"create-incident-category.dto.js","sourceRoot":"","sources":["../../../../../../src/modules/incident/dtos/category/create-incident-category.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qEAAqE,CAAC;AACzG,OAAO,EAAE,yBAAyB,EAAE,MAAM,uDAAuD,CAAC;AAClG,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEnE,MAAM,OAAO,yBAAyB;CAsCrC;AA7BG;IARC,WAAW,CAAC;QACT,WAAW,EAAE,+BAA+B;QAC5C,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,gBAAgB;KAC5B,CAAC;IACD,QAAQ,EAAE;IACV,UAAU,EAAE;IACZ,SAAS,CAAC,EAAE,CAAC;;uDACA;AAUd;IARC,mBAAmB,CAAC;QACjB,WAAW,EAAE,+CAA+C;QAC5D,SAAS,EAAE,GAAG;QACd,OAAO,EAAE,mDAAmD;KAC/D,CAAC;IACD,QAAQ,EAAE;IACV,UAAU,EAAE;IACZ,SAAS,CAAC,GAAG,CAAC;;8DACM;AAQrB;IANC,WAAW,CAAC;QACT,WAAW,EAAE,iDAAiD;QAC9D,OAAO,EAAE,CAAC;KACb,CAAC;IACD,QAAQ,EAAE;IACV,UAAU,EAAE;;iEACW;AAUxB;IAJC,UAAU,EAAE;IACZ,OAAO,EAAE;IACT,YAAY,CAAC,yBAAyB,CAAC;IACvC,MAAM,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;uEACC"}
@@ -7,7 +7,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
- import { IsNotEmpty, IsNumber, IsOptional, IsString, MaxLength } from "class-validator";
10
+ import { ArrayMaxSize, IsArray, IsEnum, IsNotEmpty, IsNumber, IsOptional, IsString, MaxLength } from "class-validator";
11
+ import { ResponseCapability } from "../../../response-unit/enums/response-unit/response-capability.enum";
12
+ import { MAX_RESPONSE_CAPABILITIES } from "../../../response-unit/utils/response-capability.util";
11
13
  export class CreateIncidentTypeDto {
12
14
  }
13
15
  __decorate([
@@ -32,4 +34,11 @@ __decorate([
32
34
  IsNotEmpty(),
33
35
  __metadata("design:type", Number)
34
36
  ], CreateIncidentTypeDto.prototype, "organizationId", void 0);
37
+ __decorate([
38
+ IsOptional(),
39
+ IsArray(),
40
+ ArrayMaxSize(MAX_RESPONSE_CAPABILITIES),
41
+ IsEnum(ResponseCapability, { each: true }),
42
+ __metadata("design:type", Array)
43
+ ], CreateIncidentTypeDto.prototype, "responseCapabilities", void 0);
35
44
  //# sourceMappingURL=create-incident-type.dto.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-incident-type.dto.js","sourceRoot":"","sources":["../../../../../../src/modules/incident/dtos/type/create-incident-type.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAExF,MAAM,OAAO,qBAAqB;CAkBjC;AAdG;IAHC,QAAQ,EAAE;IACV,UAAU,EAAE;IACZ,SAAS,CAAC,EAAE,CAAC;;mDACA;AAKd;IAHC,QAAQ,EAAE;IACV,UAAU,EAAE;IACZ,SAAS,CAAC,GAAG,CAAC;;0DACM;AAIrB;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;yDACO;AAIpB;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;6DACW"}
1
+ {"version":3,"file":"create-incident-type.dto.js","sourceRoot":"","sources":["../../../../../../src/modules/incident/dtos/type/create-incident-type.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qEAAqE,CAAC;AACzG,OAAO,EAAE,yBAAyB,EAAE,MAAM,uDAAuD,CAAC;AAElG,MAAM,OAAO,qBAAqB;CA4BjC;AAxBG;IAHC,QAAQ,EAAE;IACV,UAAU,EAAE;IACZ,SAAS,CAAC,EAAE,CAAC;;mDACA;AAKd;IAHC,QAAQ,EAAE;IACV,UAAU,EAAE;IACZ,SAAS,CAAC,GAAG,CAAC;;0DACM;AAIrB;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;yDACO;AAIpB;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;6DACW;AAUxB;IAJC,UAAU,EAAE;IACZ,OAAO,EAAE;IACT,YAAY,CAAC,yBAAyB,CAAC;IACvC,MAAM,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;mEACC"}
@@ -9,6 +9,10 @@ export var IncidentActions;
9
9
  IncidentActions["AUTO_STOPPED"] = "Auto-Stopped";
10
10
  IncidentActions["ASSIGNED"] = "Assigned";
11
11
  IncidentActions["RESPONSE_UNIT_ASSIGNED"] = "Response Unit Assigned";
12
+ /** A unit was dispatched through the dispatch command (recommend + dispatch). */
13
+ IncidentActions["RESPONSE_UNIT_DISPATCHED"] = "Response Unit Dispatched";
14
+ /** A dispatch moved on (acknowledged, en route, on scene, completed, stood down) or its message was reported on. */
15
+ IncidentActions["RESPONSE_UNIT_DISPATCH_UPDATED"] = "Response Unit Dispatch Updated";
12
16
  IncidentActions["REOPENED"] = "Reopened";
13
17
  IncidentActions["REPORT_CREATED"] = "Report Created";
14
18
  IncidentActions["COMMENTED"] = "Commented";
@@ -1 +1 @@
1
- {"version":3,"file":"incident-actions.enum.js","sourceRoot":"","sources":["../../../../../src/modules/incident/enums/incident-actions.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,eAiBX;AAjBD,WAAY,eAAe;IACvB,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;IACnB,oDAAiC,CAAA;IACjC,0CAAuB,CAAA;IACvB,wCAAqB,CAAA;IACrB,sCAAmB,CAAA;IACnB,gDAA6B,CAAA;IAC7B,wCAAqB,CAAA;IACrB,oEAAiD,CAAA;IACjD,wCAAqB,CAAA;IACrB,oDAAiC,CAAA;IACjC,0CAAuB,CAAA;IACvB,wDAAqC,CAAA;IACrC,gDAA6B,CAAA;IAC7B,iEAA8C,CAAA;IAC9C,0CAAuB,CAAA;AAC3B,CAAC,EAjBW,eAAe,KAAf,eAAe,QAiB1B"}
1
+ {"version":3,"file":"incident-actions.enum.js","sourceRoot":"","sources":["../../../../../src/modules/incident/enums/incident-actions.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,eAqBX;AArBD,WAAY,eAAe;IACvB,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;IACnB,oDAAiC,CAAA;IACjC,0CAAuB,CAAA;IACvB,wCAAqB,CAAA;IACrB,sCAAmB,CAAA;IACnB,gDAA6B,CAAA;IAC7B,wCAAqB,CAAA;IACrB,oEAAiD,CAAA;IACjD,iFAAiF;IACjF,wEAAqD,CAAA;IACrD,oHAAoH;IACpH,oFAAiE,CAAA;IACjE,wCAAqB,CAAA;IACrB,oDAAiC,CAAA;IACjC,0CAAuB,CAAA;IACvB,wDAAqC,CAAA;IACrC,gDAA6B,CAAA;IAC7B,iEAA8C,CAAA;IAC9C,0CAAuB,CAAA;AAC3B,CAAC,EArBW,eAAe,KAAf,eAAe,QAqB1B"}
@@ -0,0 +1,52 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ 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;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { ApiPropertyOptional } from '@nestjs/swagger';
11
+ import { Type } from 'class-transformer';
12
+ import { IsEnum, IsInt, IsISO8601, IsOptional, IsPositive, IsTimeZone } from 'class-validator';
13
+ import { CountryCode } from '../../country/enums/country-code.enum';
14
+ /**
15
+ * The period a notification analytics read covers, and optionally one country. Both
16
+ * ends optional: no `from` is "forever", no `to` is now.
17
+ */
18
+ export class NotificationAnalyticsQueryDto {
19
+ }
20
+ __decorate([
21
+ ApiPropertyOptional({ example: '2026-09-01T00:00:00+03:00', description: 'Inclusive. Omit for "forever".' }),
22
+ IsISO8601({ strict: true }),
23
+ IsOptional(),
24
+ __metadata("design:type", String)
25
+ ], NotificationAnalyticsQueryDto.prototype, "from", void 0);
26
+ __decorate([
27
+ ApiPropertyOptional({ example: '2026-09-30T23:59:59+03:00', description: 'Exclusive. Omit for "now".' }),
28
+ IsISO8601({ strict: true }),
29
+ IsOptional(),
30
+ __metadata("design:type", String)
31
+ ], NotificationAnalyticsQueryDto.prototype, "to", void 0);
32
+ __decorate([
33
+ ApiPropertyOptional({ example: 'Africa/Nairobi', description: 'IANA time zone for the chart buckets and the hour-of-week grid.' }),
34
+ IsTimeZone(),
35
+ IsOptional(),
36
+ __metadata("design:type", String)
37
+ ], NotificationAnalyticsQueryDto.prototype, "timeZone", void 0);
38
+ __decorate([
39
+ ApiPropertyOptional({ description: 'Super-Admin only' }),
40
+ Type(() => Number),
41
+ IsInt(),
42
+ IsPositive(),
43
+ IsOptional(),
44
+ __metadata("design:type", Number)
45
+ ], NotificationAnalyticsQueryDto.prototype, "organizationId", void 0);
46
+ __decorate([
47
+ ApiPropertyOptional({ enum: CountryCode, description: "Narrow to one country's recipients (email is not narrowed)" }),
48
+ IsEnum(CountryCode),
49
+ IsOptional(),
50
+ __metadata("design:type", String)
51
+ ], NotificationAnalyticsQueryDto.prototype, "countryCode", void 0);
52
+ //# sourceMappingURL=notification-analytics-query.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-analytics-query.dto.js","sourceRoot":"","sources":["../../../../../src/modules/notification/dtos/notification-analytics-query.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAEpE;;;GAGG;AACH,MAAM,OAAO,6BAA6B;CAsBzC;AAnBG;IAFC,mBAAmB,CAAC,EAAE,OAAO,EAAE,2BAA2B,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;IAC5G,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAAE,UAAU,EAAE;;2DAC5B;AAId;IAFC,mBAAmB,CAAC,EAAE,OAAO,EAAE,2BAA2B,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;IACxG,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAAE,UAAU,EAAE;;yDAC9B;AAIZ;IAFC,mBAAmB,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,iEAAiE,EAAE,CAAC;IAClI,UAAU,EAAE;IAAE,UAAU,EAAE;;+DACT;AAKlB;IAFC,mBAAmB,CAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;IACxD,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IAAE,KAAK,EAAE;IAAE,UAAU,EAAE;IAAE,UAAU,EAAE;;qEAChC;AAKxB;IAFC,mBAAmB,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,4DAA4D,EAAE,CAAC;IACrH,MAAM,CAAC,WAAW,CAAC;IAAE,UAAU,EAAE;;kEACR"}
@@ -29,4 +29,7 @@ export * from './dtos/billing-notification.dto';
29
29
  export * from './interfaces/billing-notification-result';
30
30
  // clarion-alerts -> clarion-notification: acknowledge an alert to its sender (POST /alert-intake/notifications/sms)
31
31
  export * from './dtos/alert-acknowledgement.dto';
32
+ // Notification Analytics (GET /admin/analytics, through the gateway's /notifications/admin/analytics)
33
+ export * from './interfaces/notification-analytics';
34
+ export * from './dtos/notification-analytics-query.dto';
32
35
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/notification/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,0CAA0C,CAA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EAAkE;AAClE,cAAc,iDAAiD,CAAC;AAChE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,uCAAuC,CAAC;AACtD,cAAc,kCAAkC,CAAC;AAEjD,wFAAwF;AACxF,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,cAAc,0CAA0C,CAAC;AAEzD,oHAAoH;AACpH,cAAc,kCAAkC,CAAC;AAEjD,sGAAsG;AACtG,cAAc,qCAAqC,CAAC;AACpD,cAAc,yCAAyC,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Notification analytics (the admin's Notification Analytics): what Clarion sent people
3
+ * over a period, on every channel - push to the app, the console's in-app notifications,
4
+ * SMS and email - whether it got through, whether it was opened, and how many people a
5
+ * push can reach at all.
6
+ *
7
+ * One read, computed by clarion-notification from one consistent snapshot, with who each
8
+ * recipient is from clarion-authentication. Counts, rates and durations only: never a
9
+ * title, a message, a phone number or an address.
10
+ *
11
+ * DURATIONS ARE IN SECONDS, like every analytics contract.
12
+ *
13
+ * How it is counted:
14
+ * - Everything by when it was CREATED - the moment Clarion decided to tell somebody.
15
+ * - Whose it is: the organization recorded on it; for a push, the organization of the
16
+ * post it announces, then the recipient's; for an SMS, the recipient's. Older SMS and
17
+ * email (before 21 September 2026) recorded no organization and often no recipient:
18
+ * those are counted only in the platform view (`unattributed`).
19
+ * - Got through: accepted by the provider - Firebase for a push, the SMS gateway, the
20
+ * mail service - or, in the console, delivered. Nothing reports whether an SMS or an
21
+ * email was read, so only push (tapped) and in-app (read) have an open rate.
22
+ * - A country narrows push, in-app and devices by the recipient's country and SMS by
23
+ * the number's; email has no country and is never narrowed.
24
+ */
25
+ export {};
26
+ //# sourceMappingURL=notification-analytics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-analytics.js","sourceRoot":"","sources":["../../../../../src/modules/notification/interfaces/notification-analytics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG"}