grm-shared-library 1.1.125 → 1.1.127

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 (228) hide show
  1. package/dist/cjs/index.js +1 -0
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/modules/gis/dtos/batch-route-incidents.dto.js +40 -0
  4. package/dist/cjs/modules/gis/dtos/batch-route-incidents.dto.js.map +1 -0
  5. package/dist/cjs/modules/gis/dtos/batch-route-point.dto.js +23 -0
  6. package/dist/cjs/modules/gis/dtos/batch-route-point.dto.js.map +1 -0
  7. package/dist/cjs/modules/gis/dtos/batch-routing-result.dto.js +7 -0
  8. package/dist/cjs/modules/gis/dtos/batch-routing-result.dto.js.map +1 -0
  9. package/dist/cjs/modules/gis/dtos/bounding-box.dto.js +7 -0
  10. package/dist/cjs/modules/gis/dtos/bounding-box.dto.js.map +1 -0
  11. package/dist/cjs/modules/gis/dtos/bulk-point-query-result.dto.js +7 -0
  12. package/dist/cjs/modules/gis/dtos/bulk-point-query-result.dto.js.map +1 -0
  13. package/dist/cjs/modules/gis/dtos/bulk-point-query.dto.js +39 -0
  14. package/dist/cjs/modules/gis/dtos/bulk-point-query.dto.js.map +1 -0
  15. package/dist/cjs/modules/gis/dtos/control-centre-routing-result.dto.js +7 -0
  16. package/dist/cjs/modules/gis/dtos/control-centre-routing-result.dto.js.map +1 -0
  17. package/dist/cjs/modules/gis/dtos/coordinate.dto.js +29 -0
  18. package/dist/cjs/modules/gis/dtos/coordinate.dto.js.map +1 -0
  19. package/dist/cjs/modules/gis/dtos/create-buffer.dto.js +29 -0
  20. package/dist/cjs/modules/gis/dtos/create-buffer.dto.js.map +1 -0
  21. package/dist/cjs/modules/gis/dtos/create-zone.dto.js +82 -0
  22. package/dist/cjs/modules/gis/dtos/create-zone.dto.js.map +1 -0
  23. package/dist/cjs/modules/gis/dtos/find-zone-for-point.dto.js +36 -0
  24. package/dist/cjs/modules/gis/dtos/find-zone-for-point.dto.js.map +1 -0
  25. package/dist/cjs/modules/gis/dtos/find-zones-near-point.dto.js +24 -0
  26. package/dist/cjs/modules/gis/dtos/find-zones-near-point.dto.js.map +1 -0
  27. package/dist/cjs/modules/gis/dtos/geo-json-polygon.dto.js +30 -0
  28. package/dist/cjs/modules/gis/dtos/geo-json-polygon.dto.js.map +1 -0
  29. package/dist/cjs/modules/gis/dtos/incident-routing-result.dto.js +7 -0
  30. package/dist/cjs/modules/gis/dtos/incident-routing-result.dto.js.map +1 -0
  31. package/dist/cjs/modules/gis/dtos/point-containment-result.dto.js +7 -0
  32. package/dist/cjs/modules/gis/dtos/point-containment-result.dto.js.map +1 -0
  33. package/dist/cjs/modules/gis/dtos/point-location.dto.js +29 -0
  34. package/dist/cjs/modules/gis/dtos/point-location.dto.js.map +1 -0
  35. package/dist/cjs/modules/gis/dtos/post-gis-geometry.dto.js +31 -0
  36. package/dist/cjs/modules/gis/dtos/post-gis-geometry.dto.js.map +1 -0
  37. package/dist/cjs/modules/gis/dtos/route-incident.dto.js +38 -0
  38. package/dist/cjs/modules/gis/dtos/route-incident.dto.js.map +1 -0
  39. package/dist/cjs/modules/gis/dtos/routing-coverage-result.dto.js +7 -0
  40. package/dist/cjs/modules/gis/dtos/routing-coverage-result.dto.js.map +1 -0
  41. package/dist/cjs/modules/gis/dtos/simplify-polygon.dto.js +37 -0
  42. package/dist/cjs/modules/gis/dtos/simplify-polygon.dto.js.map +1 -0
  43. package/dist/cjs/modules/gis/dtos/update-zone.dto.js +9 -0
  44. package/dist/cjs/modules/gis/dtos/update-zone.dto.js.map +1 -0
  45. package/dist/cjs/modules/gis/dtos/zone-list-response.dto.js +7 -0
  46. package/dist/cjs/modules/gis/dtos/zone-list-response.dto.js.map +1 -0
  47. package/dist/cjs/modules/gis/dtos/zone-match-result.dto.js +7 -0
  48. package/dist/cjs/modules/gis/dtos/zone-match-result.dto.js.map +1 -0
  49. package/dist/cjs/modules/gis/dtos/zone-response.dto.js +7 -0
  50. package/dist/cjs/modules/gis/dtos/zone-response.dto.js.map +1 -0
  51. package/dist/cjs/modules/gis/dtos/zone-statistics-result.dto.js +7 -0
  52. package/dist/cjs/modules/gis/dtos/zone-statistics-result.dto.js.map +1 -0
  53. package/dist/cjs/modules/gis/dtos/zone-with-distance-result.dto.js +7 -0
  54. package/dist/cjs/modules/gis/dtos/zone-with-distance-result.dto.js.map +1 -0
  55. package/dist/cjs/modules/gis/enums/incident-routing-result-match-type.enum.js +11 -0
  56. package/dist/cjs/modules/gis/enums/incident-routing-result-match-type.enum.js.map +1 -0
  57. package/dist/cjs/modules/gis/enums/zone.enums.js +20 -0
  58. package/dist/cjs/modules/gis/enums/zone.enums.js.map +1 -0
  59. package/dist/cjs/modules/gis/index.js +54 -0
  60. package/dist/cjs/modules/gis/index.js.map +1 -0
  61. package/dist/cjs/modules/gis/interfaces/control-centre-routing-result.js +3 -0
  62. package/dist/cjs/modules/gis/interfaces/control-centre-routing-result.js.map +1 -0
  63. package/dist/cjs/modules/gis/interfaces/incident-routing-result.js +3 -0
  64. package/dist/cjs/modules/gis/interfaces/incident-routing-result.js.map +1 -0
  65. package/dist/cjs/modules/gis/interfaces/point-containment.js +3 -0
  66. package/dist/cjs/modules/gis/interfaces/point-containment.js.map +1 -0
  67. package/dist/cjs/modules/gis/interfaces/point-location.js +3 -0
  68. package/dist/cjs/modules/gis/interfaces/point-location.js.map +1 -0
  69. package/dist/cjs/modules/gis/interfaces/polygon-validation-result.js +3 -0
  70. package/dist/cjs/modules/gis/interfaces/polygon-validation-result.js.map +1 -0
  71. package/dist/cjs/modules/gis/interfaces/zone-for-point.js +3 -0
  72. package/dist/cjs/modules/gis/interfaces/zone-for-point.js.map +1 -0
  73. package/dist/cjs/modules/gis/interfaces/zone-match-result.js +3 -0
  74. package/dist/cjs/modules/gis/interfaces/zone-match-result.js.map +1 -0
  75. package/dist/cjs/modules/gis/interfaces/zone-near-point.js +3 -0
  76. package/dist/cjs/modules/gis/interfaces/zone-near-point.js.map +1 -0
  77. package/dist/cjs/modules/gis/interfaces/zone-statistics.js +3 -0
  78. package/dist/cjs/modules/gis/interfaces/zone-statistics.js.map +1 -0
  79. package/dist/cjs/modules/gis/interfaces/zone.js +7 -0
  80. package/dist/cjs/modules/gis/interfaces/zone.js.map +1 -0
  81. package/dist/cjs/modules/gis/validators/is-polygon.validator.js +34 -0
  82. package/dist/cjs/modules/gis/validators/is-polygon.validator.js.map +1 -0
  83. package/dist/cjs/modules/notification/enums/notification-priority.enum.js +11 -0
  84. package/dist/cjs/modules/notification/enums/notification-priority.enum.js.map +1 -0
  85. package/dist/cjs/modules/notification/enums/notification-type.enum.js +14 -0
  86. package/dist/cjs/modules/notification/enums/notification-type.enum.js.map +1 -0
  87. package/dist/cjs/modules/notification/index.js +19 -0
  88. package/dist/cjs/modules/notification/index.js.map +1 -0
  89. package/dist/cjs/modules/notification/interfaces/notification.js +3 -0
  90. package/dist/cjs/modules/notification/interfaces/notification.js.map +1 -0
  91. package/dist/esm/index.js +1 -0
  92. package/dist/esm/index.js.map +1 -1
  93. package/dist/esm/modules/gis/dtos/batch-route-incidents.dto.js +36 -0
  94. package/dist/esm/modules/gis/dtos/batch-route-incidents.dto.js.map +1 -0
  95. package/dist/esm/modules/gis/dtos/batch-route-point.dto.js +19 -0
  96. package/dist/esm/modules/gis/dtos/batch-route-point.dto.js.map +1 -0
  97. package/dist/esm/modules/gis/dtos/batch-routing-result.dto.js +3 -0
  98. package/dist/esm/modules/gis/dtos/batch-routing-result.dto.js.map +1 -0
  99. package/dist/esm/modules/gis/dtos/bounding-box.dto.js +3 -0
  100. package/dist/esm/modules/gis/dtos/bounding-box.dto.js.map +1 -0
  101. package/dist/esm/modules/gis/dtos/bulk-point-query-result.dto.js +3 -0
  102. package/dist/esm/modules/gis/dtos/bulk-point-query-result.dto.js.map +1 -0
  103. package/dist/esm/modules/gis/dtos/bulk-point-query.dto.js +35 -0
  104. package/dist/esm/modules/gis/dtos/bulk-point-query.dto.js.map +1 -0
  105. package/dist/esm/modules/gis/dtos/control-centre-routing-result.dto.js +3 -0
  106. package/dist/esm/modules/gis/dtos/control-centre-routing-result.dto.js.map +1 -0
  107. package/dist/esm/modules/gis/dtos/coordinate.dto.js +25 -0
  108. package/dist/esm/modules/gis/dtos/coordinate.dto.js.map +1 -0
  109. package/dist/esm/modules/gis/dtos/create-buffer.dto.js +25 -0
  110. package/dist/esm/modules/gis/dtos/create-buffer.dto.js.map +1 -0
  111. package/dist/esm/modules/gis/dtos/create-zone.dto.js +78 -0
  112. package/dist/esm/modules/gis/dtos/create-zone.dto.js.map +1 -0
  113. package/dist/esm/modules/gis/dtos/find-zone-for-point.dto.js +32 -0
  114. package/dist/esm/modules/gis/dtos/find-zone-for-point.dto.js.map +1 -0
  115. package/dist/esm/modules/gis/dtos/find-zones-near-point.dto.js +20 -0
  116. package/dist/esm/modules/gis/dtos/find-zones-near-point.dto.js.map +1 -0
  117. package/dist/esm/modules/gis/dtos/geo-json-polygon.dto.js +26 -0
  118. package/dist/esm/modules/gis/dtos/geo-json-polygon.dto.js.map +1 -0
  119. package/dist/esm/modules/gis/dtos/incident-routing-result.dto.js +3 -0
  120. package/dist/esm/modules/gis/dtos/incident-routing-result.dto.js.map +1 -0
  121. package/dist/esm/modules/gis/dtos/point-containment-result.dto.js +3 -0
  122. package/dist/esm/modules/gis/dtos/point-containment-result.dto.js.map +1 -0
  123. package/dist/esm/modules/gis/dtos/point-location.dto.js +25 -0
  124. package/dist/esm/modules/gis/dtos/point-location.dto.js.map +1 -0
  125. package/dist/esm/modules/gis/dtos/post-gis-geometry.dto.js +27 -0
  126. package/dist/esm/modules/gis/dtos/post-gis-geometry.dto.js.map +1 -0
  127. package/dist/esm/modules/gis/dtos/route-incident.dto.js +34 -0
  128. package/dist/esm/modules/gis/dtos/route-incident.dto.js.map +1 -0
  129. package/dist/esm/modules/gis/dtos/routing-coverage-result.dto.js +3 -0
  130. package/dist/esm/modules/gis/dtos/routing-coverage-result.dto.js.map +1 -0
  131. package/dist/esm/modules/gis/dtos/simplify-polygon.dto.js +33 -0
  132. package/dist/esm/modules/gis/dtos/simplify-polygon.dto.js.map +1 -0
  133. package/dist/esm/modules/gis/dtos/update-zone.dto.js +5 -0
  134. package/dist/esm/modules/gis/dtos/update-zone.dto.js.map +1 -0
  135. package/dist/esm/modules/gis/dtos/zone-list-response.dto.js +3 -0
  136. package/dist/esm/modules/gis/dtos/zone-list-response.dto.js.map +1 -0
  137. package/dist/esm/modules/gis/dtos/zone-match-result.dto.js +3 -0
  138. package/dist/esm/modules/gis/dtos/zone-match-result.dto.js.map +1 -0
  139. package/dist/esm/modules/gis/dtos/zone-response.dto.js +3 -0
  140. package/dist/esm/modules/gis/dtos/zone-response.dto.js.map +1 -0
  141. package/dist/esm/modules/gis/dtos/zone-statistics-result.dto.js +3 -0
  142. package/dist/esm/modules/gis/dtos/zone-statistics-result.dto.js.map +1 -0
  143. package/dist/esm/modules/gis/dtos/zone-with-distance-result.dto.js +3 -0
  144. package/dist/esm/modules/gis/dtos/zone-with-distance-result.dto.js.map +1 -0
  145. package/dist/esm/modules/gis/enums/incident-routing-result-match-type.enum.js +8 -0
  146. package/dist/esm/modules/gis/enums/incident-routing-result-match-type.enum.js.map +1 -0
  147. package/dist/esm/modules/gis/enums/zone.enums.js +17 -0
  148. package/dist/esm/modules/gis/enums/zone.enums.js.map +1 -0
  149. package/dist/esm/modules/gis/index.js +38 -0
  150. package/dist/esm/modules/gis/index.js.map +1 -0
  151. package/dist/esm/modules/gis/interfaces/control-centre-routing-result.js +2 -0
  152. package/dist/esm/modules/gis/interfaces/control-centre-routing-result.js.map +1 -0
  153. package/dist/esm/modules/gis/interfaces/incident-routing-result.js +2 -0
  154. package/dist/esm/modules/gis/interfaces/incident-routing-result.js.map +1 -0
  155. package/dist/esm/modules/gis/interfaces/point-containment.js +2 -0
  156. package/dist/esm/modules/gis/interfaces/point-containment.js.map +1 -0
  157. package/dist/esm/modules/gis/interfaces/point-location.js +2 -0
  158. package/dist/esm/modules/gis/interfaces/point-location.js.map +1 -0
  159. package/dist/esm/modules/gis/interfaces/polygon-validation-result.js +2 -0
  160. package/dist/esm/modules/gis/interfaces/polygon-validation-result.js.map +1 -0
  161. package/dist/esm/modules/gis/interfaces/zone-for-point.js +2 -0
  162. package/dist/esm/modules/gis/interfaces/zone-for-point.js.map +1 -0
  163. package/dist/esm/modules/gis/interfaces/zone-match-result.js +2 -0
  164. package/dist/esm/modules/gis/interfaces/zone-match-result.js.map +1 -0
  165. package/dist/esm/modules/gis/interfaces/zone-near-point.js +2 -0
  166. package/dist/esm/modules/gis/interfaces/zone-near-point.js.map +1 -0
  167. package/dist/esm/modules/gis/interfaces/zone-statistics.js +2 -0
  168. package/dist/esm/modules/gis/interfaces/zone-statistics.js.map +1 -0
  169. package/dist/esm/modules/gis/interfaces/zone.js +3 -0
  170. package/dist/esm/modules/gis/interfaces/zone.js.map +1 -0
  171. package/dist/esm/modules/gis/validators/is-polygon.validator.js +31 -0
  172. package/dist/esm/modules/gis/validators/is-polygon.validator.js.map +1 -0
  173. package/dist/esm/modules/notification/enums/notification-priority.enum.js +8 -0
  174. package/dist/esm/modules/notification/enums/notification-priority.enum.js.map +1 -0
  175. package/dist/esm/modules/notification/enums/notification-type.enum.js +11 -0
  176. package/dist/esm/modules/notification/enums/notification-type.enum.js.map +1 -0
  177. package/dist/esm/modules/notification/index.js +3 -0
  178. package/dist/esm/modules/notification/index.js.map +1 -0
  179. package/dist/esm/modules/notification/interfaces/notification.js +2 -0
  180. package/dist/esm/modules/notification/interfaces/notification.js.map +1 -0
  181. package/dist/types/index.d.ts +1 -0
  182. package/dist/types/interfaces/jwt-payload.d.ts +1 -0
  183. package/dist/types/interfaces/pagination.d.ts +3 -0
  184. package/dist/types/modules/gis/dtos/batch-route-incidents.dto.d.ts +7 -0
  185. package/dist/types/modules/gis/dtos/batch-route-point.dto.d.ts +4 -0
  186. package/dist/types/modules/gis/dtos/batch-routing-result.dto.d.ts +6 -0
  187. package/dist/types/modules/gis/dtos/bounding-box.dto.d.ts +6 -0
  188. package/dist/types/modules/gis/dtos/bulk-point-query-result.dto.d.ts +6 -0
  189. package/dist/types/modules/gis/dtos/bulk-point-query.dto.d.ts +6 -0
  190. package/dist/types/modules/gis/dtos/control-centre-routing-result.dto.d.ts +8 -0
  191. package/dist/types/modules/gis/dtos/coordinate.dto.d.ts +4 -0
  192. package/dist/types/modules/gis/dtos/create-buffer.dto.d.ts +5 -0
  193. package/dist/types/modules/gis/dtos/create-zone.dto.d.ts +15 -0
  194. package/dist/types/modules/gis/dtos/find-zone-for-point.dto.d.ts +6 -0
  195. package/dist/types/modules/gis/dtos/find-zones-near-point.dto.d.ts +4 -0
  196. package/dist/types/modules/gis/dtos/geo-json-polygon.dto.d.ts +11 -0
  197. package/dist/types/modules/gis/dtos/incident-routing-result.dto.d.ts +11 -0
  198. package/dist/types/modules/gis/dtos/point-containment-result.dto.d.ts +3 -0
  199. package/dist/types/modules/gis/dtos/point-location.dto.d.ts +4 -0
  200. package/dist/types/modules/gis/dtos/post-gis-geometry.dto.d.ts +5 -0
  201. package/dist/types/modules/gis/dtos/route-incident.dto.d.ts +6 -0
  202. package/dist/types/modules/gis/dtos/routing-coverage-result.dto.d.ts +5 -0
  203. package/dist/types/modules/gis/dtos/simplify-polygon.dto.d.ts +6 -0
  204. package/dist/types/modules/gis/dtos/update-zone.dto.d.ts +5 -0
  205. package/dist/types/modules/gis/dtos/zone-list-response.dto.d.ts +12 -0
  206. package/dist/types/modules/gis/dtos/zone-match-result.dto.d.ts +9 -0
  207. package/dist/types/modules/gis/dtos/zone-response.dto.d.ts +24 -0
  208. package/dist/types/modules/gis/dtos/zone-statistics-result.dto.d.ts +6 -0
  209. package/dist/types/modules/gis/dtos/zone-with-distance-result.dto.d.ts +9 -0
  210. package/dist/types/modules/gis/enums/incident-routing-result-match-type.enum.d.ts +6 -0
  211. package/dist/types/modules/gis/enums/zone.enums.d.ts +14 -0
  212. package/dist/types/modules/gis/index.d.ts +37 -0
  213. package/dist/types/modules/gis/interfaces/control-centre-routing-result.d.ts +8 -0
  214. package/dist/types/modules/gis/interfaces/incident-routing-result.d.ts +11 -0
  215. package/dist/types/modules/gis/interfaces/point-containment.d.ts +3 -0
  216. package/dist/types/modules/gis/interfaces/point-location.d.ts +4 -0
  217. package/dist/types/modules/gis/interfaces/polygon-validation-result.d.ts +9 -0
  218. package/dist/types/modules/gis/interfaces/zone-for-point.d.ts +7 -0
  219. package/dist/types/modules/gis/interfaces/zone-match-result.d.ts +9 -0
  220. package/dist/types/modules/gis/interfaces/zone-near-point.d.ts +8 -0
  221. package/dist/types/modules/gis/interfaces/zone-statistics.d.ts +6 -0
  222. package/dist/types/modules/gis/interfaces/zone.d.ts +24 -0
  223. package/dist/types/modules/gis/validators/is-polygon.validator.d.ts +2 -0
  224. package/dist/types/modules/notification/enums/notification-priority.enum.d.ts +6 -0
  225. package/dist/types/modules/notification/enums/notification-type.enum.d.ts +9 -0
  226. package/dist/types/modules/notification/index.d.ts +2 -0
  227. package/dist/types/modules/notification/interfaces/notification.d.ts +16 -0
  228. package/package.json +3 -1
@@ -0,0 +1,3 @@
1
+ export class Zone {
2
+ }
3
+ //# sourceMappingURL=zone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zone.js","sourceRoot":"","sources":["../../../../../src/modules/gis/interfaces/zone.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,IAAI;CAsBhB"}
@@ -0,0 +1,31 @@
1
+ import { registerDecorator } from 'class-validator';
2
+ export function IsPolygon(validationOptions) {
3
+ return function (object, propertyName) {
4
+ registerDecorator({
5
+ name: 'isPolygon',
6
+ target: object.constructor,
7
+ propertyName: propertyName,
8
+ options: validationOptions,
9
+ validator: {
10
+ validate(value, args) {
11
+ if (!value || typeof value !== 'object')
12
+ return false;
13
+ if (value.type !== 'Polygon')
14
+ return false;
15
+ if (!Array.isArray(value.coordinates))
16
+ return false;
17
+ if (value.coordinates.length === 0)
18
+ return false;
19
+ // Validate each ring is an array of coordinate pairs
20
+ return value.coordinates.every((ring) => Array.isArray(ring) &&
21
+ ring.length >= 4 && // Minimum 4 points for closed polygon
22
+ ring.every((coord) => Array.isArray(coord) && coord.length >= 2));
23
+ },
24
+ defaultMessage(args) {
25
+ return `${args.property} must be a valid GeoJSON Polygon`;
26
+ }
27
+ }
28
+ });
29
+ };
30
+ }
31
+ //# sourceMappingURL=is-polygon.validator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-polygon.validator.js","sourceRoot":"","sources":["../../../../../src/modules/gis/validators/is-polygon.validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA0C,MAAM,iBAAiB,CAAC;AAE5F,MAAM,UAAU,SAAS,CAAC,iBAAqC;IAC3D,OAAO,UAAU,MAAc,EAAE,YAAoB;QACjD,iBAAiB,CAAC;YACd,IAAI,EAAE,WAAW;YACjB,MAAM,EAAE,MAAM,CAAC,WAAW;YAC1B,YAAY,EAAE,YAAY;YAC1B,OAAO,EAAE,iBAAiB;YAC1B,SAAS,EAAE;gBACP,QAAQ,CAAC,KAAU,EAAE,IAAyB;oBAC1C,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;wBAAE,OAAO,KAAK,CAAC;oBACtD,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;wBAAE,OAAO,KAAK,CAAC;oBAC3C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC;wBAAE,OAAO,KAAK,CAAC;oBACpD,IAAI,KAAK,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC;wBAAE,OAAO,KAAK,CAAC;oBAEjD,qDAAqD;oBACrD,OAAO,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,IAAS,EAAE,EAAE,CACzC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;wBACnB,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,sCAAsC;wBAC1D,IAAI,CAAC,KAAK,CAAC,CAAC,KAAU,EAAE,EAAE,CACtB,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,CAC5C,CACJ,CAAC;gBACN,CAAC;gBACD,cAAc,CAAC,IAAyB;oBACpC,OAAO,GAAG,IAAI,CAAC,QAAQ,kCAAkC,CAAC;gBAC9D,CAAC;aACJ;SACJ,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC"}
@@ -0,0 +1,8 @@
1
+ export var NotificationPriority;
2
+ (function (NotificationPriority) {
3
+ NotificationPriority["LOW"] = "Low";
4
+ NotificationPriority["MEDIUM"] = "Medium";
5
+ NotificationPriority["HIGH"] = "High";
6
+ NotificationPriority["CRITICAL"] = "Critical";
7
+ })(NotificationPriority || (NotificationPriority = {}));
8
+ //# sourceMappingURL=notification-priority.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-priority.enum.js","sourceRoot":"","sources":["../../../../../src/modules/notification/enums/notification-priority.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,mCAAW,CAAA;IACX,yCAAiB,CAAA;IACjB,qCAAa,CAAA;IACb,6CAAqB,CAAA;AACvB,CAAC,EALW,oBAAoB,KAApB,oBAAoB,QAK/B"}
@@ -0,0 +1,11 @@
1
+ export var NotificationType;
2
+ (function (NotificationType) {
3
+ NotificationType["INCIDENT_CREATED"] = "INCIDENT_CREATED";
4
+ NotificationType["INCIDENT_UPDATED"] = "INCIDENT_UPDATED";
5
+ NotificationType["INCIDENT_ASSIGNED"] = "INCIDENT_ASSIGNED";
6
+ NotificationType["INCIDENT_STATUS_CHANGED"] = "INCIDENT_STATUS_CHANGED";
7
+ NotificationType["INCIDENT_RESPONSE_UNIT_ASSIGNED"] = "INCIDENT_RESPONSE_UNIT_ASSIGNED";
8
+ NotificationType["INCIDENT_REPORT_CREATED"] = "INCIDENT_REPORT_CREATED";
9
+ NotificationType["INCIDENT_WITHDRAWN"] = "INCIDENT_WITHDRAWN";
10
+ })(NotificationType || (NotificationType = {}));
11
+ //# sourceMappingURL=notification-type.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-type.enum.js","sourceRoot":"","sources":["../../../../../src/modules/notification/enums/notification-type.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,gBAQX;AARD,WAAY,gBAAgB;IAC1B,yDAAqC,CAAA;IACrC,yDAAqC,CAAA;IACrC,2DAAuC,CAAA;IACvC,uEAAmD,CAAA;IACnD,uFAAmE,CAAA;IACnE,uEAAmD,CAAA;IACnD,6DAAyC,CAAA;AAC3C,CAAC,EARW,gBAAgB,KAAhB,gBAAgB,QAQ3B"}
@@ -0,0 +1,3 @@
1
+ export * from './enums/notification-type.enum';
2
+ export * from './enums/notification-type.enum';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/notification/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=notification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification.js","sourceRoot":"","sources":["../../../../../src/modules/notification/interfaces/notification.ts"],"names":[],"mappings":""}
@@ -11,6 +11,7 @@ export * from './modules/incident/index';
11
11
  export * from './modules/workflow/index';
12
12
  export * from './modules/dms/index';
13
13
  export * from './modules/sms/index';
14
+ export * from './modules/gis/index';
14
15
  export * from './interfaces/server-message';
15
16
  export * from './interfaces/i-request-with-user';
16
17
  export * from './interfaces/validated-user';
@@ -1,6 +1,7 @@
1
1
  export interface JWTPayload {
2
2
  sub: any;
3
3
  username: string;
4
+ roles: string[];
4
5
  controlCentreId: number;
5
6
  organizationId: number;
6
7
  }
@@ -1,4 +1,5 @@
1
1
  import { ControlCentre } from "../modules/control-centre";
2
+ import { Zone } from "../modules/gis/interfaces/zone";
2
3
  import { Incident, IncidentReport } from "../modules/incident";
3
4
  import { Organization } from "../modules/organization";
4
5
  import { ResponseUnit } from "../modules/response-unit";
@@ -33,3 +34,5 @@ export interface IncidentReportList extends PaginatedResponse<IncidentReport> {
33
34
  }
34
35
  export interface ResponseUnitList extends PaginatedResponse<ResponseUnit> {
35
36
  }
37
+ export interface ZoneList extends PaginatedResponse<Zone> {
38
+ }
@@ -0,0 +1,7 @@
1
+ import { BatchRoutePointDto } from "./batch-route-point.dto";
2
+ import { RouteIncidentDto } from "./route-incident.dto";
3
+ export declare class BatchRouteIncidentsDto {
4
+ points: BatchRoutePointDto[];
5
+ routingOptions?: Partial<RouteIncidentDto>;
6
+ concurrencyLimit: number;
7
+ }
@@ -0,0 +1,4 @@
1
+ import { PointLocationDto } from "./point-location.dto";
2
+ export declare class BatchRoutePointDto extends PointLocationDto {
3
+ id?: string;
4
+ }
@@ -0,0 +1,6 @@
1
+ import { BatchRoutePointDto } from "./batch-route-point.dto";
2
+ import { IncidentRoutingResultDto } from "./incident-routing-result.dto";
3
+ export declare class BatchRoutingResultDto {
4
+ point: BatchRoutePointDto;
5
+ result: IncidentRoutingResultDto;
6
+ }
@@ -0,0 +1,6 @@
1
+ export declare class BoundingBoxDto {
2
+ minLng: number;
3
+ minLat: number;
4
+ maxLng: number;
5
+ maxLat: number;
6
+ }
@@ -0,0 +1,6 @@
1
+ import { PointLocationDto } from "./point-location.dto";
2
+ import { ZoneMatchResultDto } from "./zone-match-result.dto";
3
+ export declare class BulkPointQueryResultDto {
4
+ point: PointLocationDto;
5
+ zones: ZoneMatchResultDto[];
6
+ }
@@ -0,0 +1,6 @@
1
+ import { PointLocationDto } from "./point-location.dto";
2
+ export declare class BulkPointQueryDto {
3
+ points: PointLocationDto[];
4
+ organizationId?: number;
5
+ activeOnly: boolean;
6
+ }
@@ -0,0 +1,8 @@
1
+ export declare class ControlCentreRoutingResultDto {
2
+ controlCentreId: number;
3
+ organizationId: number;
4
+ zoneName: string;
5
+ zoneId: number;
6
+ priority: number;
7
+ matchedAt: Date;
8
+ }
@@ -0,0 +1,4 @@
1
+ export declare class CoordinateDto {
2
+ lng: number;
3
+ lat: number;
4
+ }
@@ -0,0 +1,5 @@
1
+ import { Polygon } from "geojson";
2
+ export declare class CreateBufferDto {
3
+ polygon: Polygon;
4
+ radiusMeters: number;
5
+ }
@@ -0,0 +1,15 @@
1
+ import { ZoneStatus, ZoneType } from "../enums/zone.enums";
2
+ import { GeoJsonPolygonDto } from "./geo-json-polygon.dto";
3
+ export declare class CreateZoneDto {
4
+ name: string;
5
+ description?: string;
6
+ type: ZoneType;
7
+ status: ZoneStatus;
8
+ priority?: number;
9
+ controlCentreId: number;
10
+ organizationId: number;
11
+ geoJson: GeoJsonPolygonDto;
12
+ attributes?: Record<string, any>;
13
+ effectiveFrom?: Date;
14
+ effectiveUntil?: Date;
15
+ }
@@ -0,0 +1,6 @@
1
+ import { PointLocationDto } from "./point-location.dto";
2
+ export declare class FindZoneForPointDto extends PointLocationDto {
3
+ organizationId?: number;
4
+ activeOnly: boolean;
5
+ limit: number;
6
+ }
@@ -0,0 +1,4 @@
1
+ import { FindZoneForPointDto } from "./find-zone-for-point.dto";
2
+ export declare class FindZonesNearPointDto extends FindZoneForPointDto {
3
+ radiusMeters: number;
4
+ }
@@ -0,0 +1,11 @@
1
+ export declare class GeoJsonPolygonDto {
2
+ type: 'Polygon';
3
+ /**
4
+ * Coordinates array following GeoJSON format:
5
+ * - First array is the exterior ring
6
+ * - Subsequent arrays are holes (interior rings)
7
+ * - Each ring is an array of [longitude, latitude] pairs
8
+ * - First and last coordinates must be identical (closed polygon)
9
+ */
10
+ coordinates: number[][][];
11
+ }
@@ -0,0 +1,11 @@
1
+ import { IncidentRoutingResultMatchType } from "../enums/incident-routing-result-match-type.enum";
2
+ export declare class IncidentRoutingResultDto {
3
+ success: boolean;
4
+ controlCentreId?: number;
5
+ organizationId?: number;
6
+ zoneId?: number;
7
+ zoneName?: string;
8
+ matchType: IncidentRoutingResultMatchType;
9
+ distance?: number;
10
+ message?: string;
11
+ }
@@ -0,0 +1,3 @@
1
+ export declare class PointContainmentResultDto {
2
+ contained: boolean;
3
+ }
@@ -0,0 +1,4 @@
1
+ export declare class PointLocationDto {
2
+ lat: number;
3
+ lng: number;
4
+ }
@@ -0,0 +1,5 @@
1
+ import { Polygon } from "geojson";
2
+ export declare class PostGisGeometryDto {
3
+ polygon: Polygon;
4
+ srid: number;
5
+ }
@@ -0,0 +1,6 @@
1
+ import { PointLocationDto } from "./point-location.dto";
2
+ export declare class RouteIncidentDto extends PointLocationDto {
3
+ organizationId?: number;
4
+ fallbackRadiusMeters: number;
5
+ allowFallback: boolean;
6
+ }
@@ -0,0 +1,5 @@
1
+ export declare class RoutingCoverageResultDto {
2
+ totalZones: number;
3
+ activeZones: number;
4
+ totalControlCentres: number;
5
+ }
@@ -0,0 +1,6 @@
1
+ import { Polygon } from "geojson";
2
+ export declare class SimplifyPolygonDto {
3
+ polygon: Polygon;
4
+ tolerance: number;
5
+ highQuality: boolean;
6
+ }
@@ -0,0 +1,5 @@
1
+ import { CreateZoneDto } from "./create-zone.dto";
2
+ declare const UpdateZoneDto_base: import("@nestjs/mapped-types").MappedType<Partial<CreateZoneDto>>;
3
+ export declare class UpdateZoneDto extends UpdateZoneDto_base {
4
+ }
5
+ export {};
@@ -0,0 +1,12 @@
1
+ import { ZoneResponseDto } from "./zone-response.dto";
2
+ export declare class ZoneListResponseDto {
3
+ data: ZoneResponseDto[];
4
+ meta: {
5
+ total: number;
6
+ page: number;
7
+ limit: number;
8
+ totalPages: number;
9
+ hasNextPage?: boolean;
10
+ hasPreviousPage?: boolean;
11
+ };
12
+ }
@@ -0,0 +1,9 @@
1
+ export declare class ZoneMatchResultDto {
2
+ zoneId: number;
3
+ zoneName: string;
4
+ controlCentreId: number;
5
+ organizationId: number;
6
+ priority: number;
7
+ zoneType: string;
8
+ distance?: number;
9
+ }
@@ -0,0 +1,24 @@
1
+ import { ZoneStatus, ZoneType } from "../enums/zone.enums";
2
+ export declare class ZoneResponseDto {
3
+ id: number;
4
+ name: string;
5
+ description?: string;
6
+ type: ZoneType;
7
+ status: ZoneStatus;
8
+ priority: number;
9
+ controlCentreId: number;
10
+ organizationId: number;
11
+ geoJson: GeoJSON.Polygon;
12
+ areaSquareMeters?: number;
13
+ centroid?: {
14
+ lat: number;
15
+ lng: number;
16
+ };
17
+ attributes?: Record<string, any>;
18
+ effectiveFrom?: Date;
19
+ effectiveUntil?: Date;
20
+ createdAt: Date;
21
+ updatedAt: Date;
22
+ createdBy?: number;
23
+ updatedBy?: number;
24
+ }
@@ -0,0 +1,6 @@
1
+ export declare class ZoneStatisticsResultDto {
2
+ areaSquareMeters: number;
3
+ perimeterMeters: number;
4
+ centroidLat: number;
5
+ centroidLng: number;
6
+ }
@@ -0,0 +1,9 @@
1
+ export declare class ZoneWithDistanceResultDto {
2
+ zoneId: number;
3
+ zoneName: string;
4
+ controlCentreId: number;
5
+ organizationId: number;
6
+ priority: number;
7
+ zoneType: string;
8
+ distance: number;
9
+ }
@@ -0,0 +1,6 @@
1
+ export declare enum IncidentRoutingResultMatchType {
2
+ EXACT = "exact",
3
+ NEAREST = "nearest",
4
+ FALLBACK = "fallback",
5
+ NONE = "none"
6
+ }
@@ -0,0 +1,14 @@
1
+ export declare enum ZoneType {
2
+ PRIMARY = "PRIMARY",//Primary operational zone for the control centre
3
+ SECONDARY = "SECONDARY",// Secondary zone, used when primary zones overlap
4
+ BACKUP = "BACKUP",// Backup zone for overflow or contingency
5
+ TEMPORARY = "TEMPORARY",// Temporary zone for special events or situations
6
+ EXCLUSION = "EXCLUSION"
7
+ }
8
+ export declare enum ZoneStatus {
9
+ ACTIVE = "ACTIVE",// Zone is active and accepting incidents
10
+ INACTIVE = "INACTIVE",// Zone is temporarily inactive
11
+ DRAFT = "DRAFT",// Zone is in draft mode, not yet operational
12
+ ARCHIVED = "ARCHIVED",// Zone has been archived and is no longer in use
13
+ PENDING_APPROVAL = "PENDING_APPROVAL"
14
+ }
@@ -0,0 +1,37 @@
1
+ export * from './dtos/batch-route-incidents.dto';
2
+ export * from './dtos/batch-route-point.dto';
3
+ export * from './dtos/batch-routing-result.dto';
4
+ export * from './dtos/bounding-box.dto';
5
+ export * from './dtos/bulk-point-query.dto';
6
+ export * from './dtos/bulk-point-query-result.dto';
7
+ export * from './dtos/control-centre-routing-result.dto';
8
+ export * from './dtos/coordinate.dto';
9
+ export * from './dtos/create-buffer.dto';
10
+ export * from './dtos/create-zone.dto';
11
+ export * from './dtos/find-zone-for-point.dto';
12
+ export * from './dtos/find-zones-near-point.dto';
13
+ export * from './dtos/geo-json-polygon.dto';
14
+ export * from './dtos/point-containment-result.dto';
15
+ export * from './dtos/point-location.dto';
16
+ export * from './dtos/post-gis-geometry.dto';
17
+ export * from './dtos/route-incident.dto';
18
+ export * from './dtos/routing-coverage-result.dto';
19
+ export * from './dtos/simplify-polygon.dto';
20
+ export * from './dtos/update-zone.dto';
21
+ export * from './dtos/zone-list-response.dto';
22
+ export * from './dtos/zone-match-result.dto';
23
+ export * from './dtos/zone-response.dto';
24
+ export * from './dtos/zone-statistics-result.dto';
25
+ export * from './dtos/zone-with-distance-result.dto';
26
+ export * from './enums/incident-routing-result-match-type.enum';
27
+ export * from './enums/zone.enums';
28
+ export * from './interfaces/control-centre-routing-result';
29
+ export * from './interfaces/incident-routing-result';
30
+ export * from './interfaces/point-containment';
31
+ export * from './interfaces/point-location';
32
+ export * from './interfaces/polygon-validation-result';
33
+ export * from './interfaces/zone';
34
+ export * from './interfaces/zone-for-point';
35
+ export * from './interfaces/zone-match-result';
36
+ export * from './interfaces/zone-near-point';
37
+ export * from './interfaces/zone-statistics';
@@ -0,0 +1,8 @@
1
+ export interface ControlCentreRoutingResult {
2
+ controlCentreId: number;
3
+ organizationId: number;
4
+ zoneName: string;
5
+ zoneId: number;
6
+ priority: number;
7
+ matchedAt: Date;
8
+ }
@@ -0,0 +1,11 @@
1
+ import { IncidentRoutingResultMatchType } from "../enums/incident-routing-result-match-type.enum";
2
+ export interface IncidentRoutingResult {
3
+ success: boolean;
4
+ controlCentreId?: number;
5
+ organizationId?: number;
6
+ zoneId?: number;
7
+ zoneName?: string;
8
+ matchType: IncidentRoutingResultMatchType;
9
+ distance?: number;
10
+ message?: string;
11
+ }
@@ -0,0 +1,3 @@
1
+ export interface PointContainment {
2
+ contained: boolean;
3
+ }
@@ -0,0 +1,4 @@
1
+ export interface PointLocation {
2
+ lat: number;
3
+ lng: number;
4
+ }
@@ -0,0 +1,9 @@
1
+ import { PointLocation } from "./point-location";
2
+ export interface PolygonValidationResult {
3
+ isValid: boolean;
4
+ errors: string[];
5
+ warnings: string[];
6
+ sanitizedPolygon?: GeoJSON.Polygon;
7
+ centroid?: PointLocation;
8
+ areaSqMeters?: number;
9
+ }
@@ -0,0 +1,7 @@
1
+ export interface ZoneForPoint {
2
+ lat: number;
3
+ lng: number;
4
+ organizationId?: number;
5
+ activeOnly?: boolean;
6
+ limit?: number;
7
+ }
@@ -0,0 +1,9 @@
1
+ export interface ZoneMatchResult {
2
+ zoneId: number;
3
+ zoneName: string;
4
+ controlCentreId: number;
5
+ organizationId: number;
6
+ priority: number;
7
+ zoneType: string;
8
+ distance?: number;
9
+ }
@@ -0,0 +1,8 @@
1
+ export interface ZoneNearPoint {
2
+ lat: number;
3
+ lng: number;
4
+ organizationId?: number;
5
+ activeOnly?: boolean;
6
+ limit?: number;
7
+ radiusMeters: number;
8
+ }
@@ -0,0 +1,6 @@
1
+ export interface ZoneStatistics {
2
+ areaSquareMeters: number;
3
+ perimeterMeters: number;
4
+ centroidLat: number;
5
+ centroidLng: number;
6
+ }
@@ -0,0 +1,24 @@
1
+ import { ZoneStatus, ZoneType } from "../enums/zone.enums";
2
+ export declare class Zone {
3
+ id?: number;
4
+ name: string;
5
+ description?: string;
6
+ type: ZoneType;
7
+ status: ZoneStatus;
8
+ priority: number;
9
+ controlCentreId: number;
10
+ organizationId: number;
11
+ geoJson: GeoJSON.Polygon;
12
+ areaSquareMeters?: number;
13
+ centroid?: {
14
+ lat: number;
15
+ lng: number;
16
+ };
17
+ attributes?: Record<string, any>;
18
+ effectiveFrom?: string;
19
+ effectiveUntil?: string;
20
+ createdAt: string;
21
+ updatedAt: string;
22
+ createdBy?: number;
23
+ updatedBy?: number;
24
+ }
@@ -0,0 +1,2 @@
1
+ import { ValidationOptions } from 'class-validator';
2
+ export declare function IsPolygon(validationOptions?: ValidationOptions): (object: Object, propertyName: string) => void;
@@ -0,0 +1,6 @@
1
+ export declare enum NotificationPriority {
2
+ LOW = "Low",
3
+ MEDIUM = "Medium",
4
+ HIGH = "High",
5
+ CRITICAL = "Critical"
6
+ }
@@ -0,0 +1,9 @@
1
+ export declare enum NotificationType {
2
+ INCIDENT_CREATED = "INCIDENT_CREATED",
3
+ INCIDENT_UPDATED = "INCIDENT_UPDATED",
4
+ INCIDENT_ASSIGNED = "INCIDENT_ASSIGNED",
5
+ INCIDENT_STATUS_CHANGED = "INCIDENT_STATUS_CHANGED",
6
+ INCIDENT_RESPONSE_UNIT_ASSIGNED = "INCIDENT_RESPONSE_UNIT_ASSIGNED",
7
+ INCIDENT_REPORT_CREATED = "INCIDENT_REPORT_CREATED",
8
+ INCIDENT_WITHDRAWN = "INCIDENT_WITHDRAWN"
9
+ }
@@ -0,0 +1,2 @@
1
+ export * from './enums/notification-type.enum';
2
+ export * from './enums/notification-type.enum';
@@ -0,0 +1,16 @@
1
+ export interface Notification {
2
+ id: number;
3
+ userIds: number[];
4
+ type: string;
5
+ title: string;
6
+ message: string;
7
+ priority: string;
8
+ isRead: boolean;
9
+ readAt: Date | null;
10
+ incidentId: number;
11
+ controlCentreId: number;
12
+ organizationId: number;
13
+ actorUserId: number;
14
+ metadata?: Record<string, any>;
15
+ createdAt: Date;
16
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grm-shared-library",
3
- "version": "1.1.125",
3
+ "version": "1.1.127",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -37,6 +37,7 @@
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/express": "^5.0.3",
40
+ "@types/geojson": "^7946.0.14",
40
41
  "@types/node": "^22.10.5",
41
42
  "rimraf": "^5.0.5",
42
43
  "typescript": "^5.7.3"
@@ -51,6 +52,7 @@
51
52
  "class-transformer": "^0.5.0",
52
53
  "class-validator": "^0.14.0",
53
54
  "express": "^5.1.0",
55
+ "geojson": "^0.5.0",
54
56
  "grm-shared-library": "^1.1.101",
55
57
  "rxjs": "^7.8.2",
56
58
  "swagger-ui-express": "^5.0.1"