grm-shared-library 1.1.181 → 1.1.183

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 (160) hide show
  1. package/README.md +72 -2
  2. package/dist/cjs/index.js +2 -0
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/modules/country/constants/country-defaults.const.js +20 -0
  5. package/dist/cjs/modules/country/constants/country-defaults.const.js.map +1 -0
  6. package/dist/cjs/modules/country/constants/supported-countries.const.js +64 -0
  7. package/dist/cjs/modules/country/constants/supported-countries.const.js.map +1 -0
  8. package/dist/cjs/modules/country/constants/supported-currencies.const.js +36 -0
  9. package/dist/cjs/modules/country/constants/supported-currencies.const.js.map +1 -0
  10. package/dist/cjs/modules/country/dtos/country-scope.dto.js +47 -0
  11. package/dist/cjs/modules/country/dtos/country-scope.dto.js.map +1 -0
  12. package/dist/cjs/modules/country/enums/calling-code.enum.js +19 -0
  13. package/dist/cjs/modules/country/enums/calling-code.enum.js.map +1 -0
  14. package/dist/cjs/modules/country/enums/country-code.enum.js +21 -0
  15. package/dist/cjs/modules/country/enums/country-code.enum.js.map +1 -0
  16. package/dist/cjs/modules/country/enums/currency-code.enum.js +20 -0
  17. package/dist/cjs/modules/country/enums/currency-code.enum.js.map +1 -0
  18. package/dist/cjs/modules/country/index.js +34 -0
  19. package/dist/cjs/modules/country/index.js.map +1 -0
  20. package/dist/cjs/modules/country/interfaces/geo-coordinates.js +3 -0
  21. package/dist/cjs/modules/country/interfaces/geo-coordinates.js.map +1 -0
  22. package/dist/cjs/modules/country/interfaces/map-bounds.js +3 -0
  23. package/dist/cjs/modules/country/interfaces/map-bounds.js.map +1 -0
  24. package/dist/cjs/modules/country/interfaces/supported-country-config.js +3 -0
  25. package/dist/cjs/modules/country/interfaces/supported-country-config.js.map +1 -0
  26. package/dist/cjs/modules/country/interfaces/supported-currency-config.js +3 -0
  27. package/dist/cjs/modules/country/interfaces/supported-currency-config.js.map +1 -0
  28. package/dist/cjs/modules/country/utils/country.util.js +60 -0
  29. package/dist/cjs/modules/country/utils/country.util.js.map +1 -0
  30. package/dist/cjs/modules/notification/enums/email-provider-name.enum.js +15 -0
  31. package/dist/cjs/modules/notification/enums/email-provider-name.enum.js.map +1 -0
  32. package/dist/cjs/modules/notification/enums/notification-channel.enum.js +15 -0
  33. package/dist/cjs/modules/notification/enums/notification-channel.enum.js.map +1 -0
  34. package/dist/cjs/modules/notification/enums/notification-overall-status.enum.js +16 -0
  35. package/dist/cjs/modules/notification/enums/notification-overall-status.enum.js.map +1 -0
  36. package/dist/cjs/modules/notification/enums/provider-failure-reason.enum.js +28 -0
  37. package/dist/cjs/modules/notification/enums/provider-failure-reason.enum.js.map +1 -0
  38. package/dist/cjs/modules/notification/enums/sms-provider-name.enum.js +14 -0
  39. package/dist/cjs/modules/notification/enums/sms-provider-name.enum.js.map +1 -0
  40. package/dist/cjs/modules/notification/index.js +32 -0
  41. package/dist/cjs/modules/notification/index.js.map +1 -0
  42. package/dist/cjs/modules/notification/interfaces/email-send-request.js +3 -0
  43. package/dist/cjs/modules/notification/interfaces/email-send-request.js.map +1 -0
  44. package/dist/cjs/modules/notification/interfaces/email-send-result.js +3 -0
  45. package/dist/cjs/modules/notification/interfaces/email-send-result.js.map +1 -0
  46. package/dist/cjs/modules/notification/interfaces/notification-dispatch-result.js +3 -0
  47. package/dist/cjs/modules/notification/interfaces/notification-dispatch-result.js.map +1 -0
  48. package/dist/cjs/modules/notification/interfaces/per-channel-result.js +3 -0
  49. package/dist/cjs/modules/notification/interfaces/per-channel-result.js.map +1 -0
  50. package/dist/cjs/modules/notification/interfaces/provider-attempt.js +3 -0
  51. package/dist/cjs/modules/notification/interfaces/provider-attempt.js.map +1 -0
  52. package/dist/cjs/modules/notification/interfaces/sms-send-request.js +3 -0
  53. package/dist/cjs/modules/notification/interfaces/sms-send-request.js.map +1 -0
  54. package/dist/cjs/modules/notification/interfaces/sms-send-result.js +3 -0
  55. package/dist/cjs/modules/notification/interfaces/sms-send-result.js.map +1 -0
  56. package/dist/cjs/modules/permission/data/permissions.data.js +66 -0
  57. package/dist/cjs/modules/permission/data/permissions.data.js.map +1 -1
  58. package/dist/cjs/modules/permission/enums/permission-actions.enum.js +58 -0
  59. package/dist/cjs/modules/permission/enums/permission-actions.enum.js.map +1 -1
  60. package/dist/cjs/modules/permission/enums/permissions-module.enum.js +2 -0
  61. package/dist/cjs/modules/permission/enums/permissions-module.enum.js.map +1 -1
  62. package/dist/cjs/modules/role/constants/roles-by-scope.js +3 -1
  63. package/dist/cjs/modules/role/constants/roles-by-scope.js.map +1 -1
  64. package/dist/cjs/modules/role/enums/role.enum.js +2 -0
  65. package/dist/cjs/modules/role/enums/role.enum.js.map +1 -1
  66. package/dist/esm/index.js +2 -0
  67. package/dist/esm/index.js.map +1 -1
  68. package/dist/esm/modules/country/constants/country-defaults.const.js +17 -0
  69. package/dist/esm/modules/country/constants/country-defaults.const.js.map +1 -0
  70. package/dist/esm/modules/country/constants/supported-countries.const.js +61 -0
  71. package/dist/esm/modules/country/constants/supported-countries.const.js.map +1 -0
  72. package/dist/esm/modules/country/constants/supported-currencies.const.js +33 -0
  73. package/dist/esm/modules/country/constants/supported-currencies.const.js.map +1 -0
  74. package/dist/esm/modules/country/dtos/country-scope.dto.js +43 -0
  75. package/dist/esm/modules/country/dtos/country-scope.dto.js.map +1 -0
  76. package/dist/esm/modules/country/enums/calling-code.enum.js +16 -0
  77. package/dist/esm/modules/country/enums/calling-code.enum.js.map +1 -0
  78. package/dist/esm/modules/country/enums/country-code.enum.js +18 -0
  79. package/dist/esm/modules/country/enums/country-code.enum.js.map +1 -0
  80. package/dist/esm/modules/country/enums/currency-code.enum.js +17 -0
  81. package/dist/esm/modules/country/enums/currency-code.enum.js.map +1 -0
  82. package/dist/esm/modules/country/index.js +18 -0
  83. package/dist/esm/modules/country/index.js.map +1 -0
  84. package/dist/esm/modules/country/interfaces/geo-coordinates.js +2 -0
  85. package/dist/esm/modules/country/interfaces/geo-coordinates.js.map +1 -0
  86. package/dist/esm/modules/country/interfaces/map-bounds.js +2 -0
  87. package/dist/esm/modules/country/interfaces/map-bounds.js.map +1 -0
  88. package/dist/esm/modules/country/interfaces/supported-country-config.js +2 -0
  89. package/dist/esm/modules/country/interfaces/supported-country-config.js.map +1 -0
  90. package/dist/esm/modules/country/interfaces/supported-currency-config.js +2 -0
  91. package/dist/esm/modules/country/interfaces/supported-currency-config.js.map +1 -0
  92. package/dist/esm/modules/country/utils/country.util.js +51 -0
  93. package/dist/esm/modules/country/utils/country.util.js.map +1 -0
  94. package/dist/esm/modules/notification/enums/email-provider-name.enum.js +12 -0
  95. package/dist/esm/modules/notification/enums/email-provider-name.enum.js.map +1 -0
  96. package/dist/esm/modules/notification/enums/notification-channel.enum.js +12 -0
  97. package/dist/esm/modules/notification/enums/notification-channel.enum.js.map +1 -0
  98. package/dist/esm/modules/notification/enums/notification-overall-status.enum.js +13 -0
  99. package/dist/esm/modules/notification/enums/notification-overall-status.enum.js.map +1 -0
  100. package/dist/esm/modules/notification/enums/provider-failure-reason.enum.js +25 -0
  101. package/dist/esm/modules/notification/enums/provider-failure-reason.enum.js.map +1 -0
  102. package/dist/esm/modules/notification/enums/sms-provider-name.enum.js +11 -0
  103. package/dist/esm/modules/notification/enums/sms-provider-name.enum.js.map +1 -0
  104. package/dist/esm/modules/notification/index.js +16 -0
  105. package/dist/esm/modules/notification/index.js.map +1 -0
  106. package/dist/esm/modules/notification/interfaces/email-send-request.js +2 -0
  107. package/dist/esm/modules/notification/interfaces/email-send-request.js.map +1 -0
  108. package/dist/esm/modules/notification/interfaces/email-send-result.js +2 -0
  109. package/dist/esm/modules/notification/interfaces/email-send-result.js.map +1 -0
  110. package/dist/esm/modules/notification/interfaces/notification-dispatch-result.js +2 -0
  111. package/dist/esm/modules/notification/interfaces/notification-dispatch-result.js.map +1 -0
  112. package/dist/esm/modules/notification/interfaces/per-channel-result.js +2 -0
  113. package/dist/esm/modules/notification/interfaces/per-channel-result.js.map +1 -0
  114. package/dist/esm/modules/notification/interfaces/provider-attempt.js +2 -0
  115. package/dist/esm/modules/notification/interfaces/provider-attempt.js.map +1 -0
  116. package/dist/esm/modules/notification/interfaces/sms-send-request.js +2 -0
  117. package/dist/esm/modules/notification/interfaces/sms-send-request.js.map +1 -0
  118. package/dist/esm/modules/notification/interfaces/sms-send-result.js +2 -0
  119. package/dist/esm/modules/notification/interfaces/sms-send-result.js.map +1 -0
  120. package/dist/esm/modules/permission/data/permissions.data.js +66 -0
  121. package/dist/esm/modules/permission/data/permissions.data.js.map +1 -1
  122. package/dist/esm/modules/permission/enums/permission-actions.enum.js +58 -0
  123. package/dist/esm/modules/permission/enums/permission-actions.enum.js.map +1 -1
  124. package/dist/esm/modules/permission/enums/permissions-module.enum.js +2 -0
  125. package/dist/esm/modules/permission/enums/permissions-module.enum.js.map +1 -1
  126. package/dist/esm/modules/role/constants/roles-by-scope.js +3 -1
  127. package/dist/esm/modules/role/constants/roles-by-scope.js.map +1 -1
  128. package/dist/esm/modules/role/enums/role.enum.js +2 -0
  129. package/dist/esm/modules/role/enums/role.enum.js.map +1 -1
  130. package/dist/types/index.d.ts +2 -0
  131. package/dist/types/modules/country/constants/country-defaults.const.d.ts +15 -0
  132. package/dist/types/modules/country/constants/supported-countries.const.d.ts +13 -0
  133. package/dist/types/modules/country/constants/supported-currencies.const.d.ts +11 -0
  134. package/dist/types/modules/country/dtos/country-scope.dto.d.ts +13 -0
  135. package/dist/types/modules/country/enums/calling-code.enum.d.ts +14 -0
  136. package/dist/types/modules/country/enums/country-code.enum.d.ts +16 -0
  137. package/dist/types/modules/country/enums/currency-code.enum.d.ts +15 -0
  138. package/dist/types/modules/country/index.d.ts +12 -0
  139. package/dist/types/modules/country/interfaces/geo-coordinates.d.ts +12 -0
  140. package/dist/types/modules/country/interfaces/map-bounds.d.ts +16 -0
  141. package/dist/types/modules/country/interfaces/supported-country-config.d.ts +39 -0
  142. package/dist/types/modules/country/interfaces/supported-currency-config.d.ts +19 -0
  143. package/dist/types/modules/country/utils/country.util.d.ts +27 -0
  144. package/dist/types/modules/notification/enums/email-provider-name.enum.d.ts +10 -0
  145. package/dist/types/modules/notification/enums/notification-channel.enum.d.ts +10 -0
  146. package/dist/types/modules/notification/enums/notification-overall-status.enum.d.ts +11 -0
  147. package/dist/types/modules/notification/enums/provider-failure-reason.enum.d.ts +23 -0
  148. package/dist/types/modules/notification/enums/sms-provider-name.enum.d.ts +9 -0
  149. package/dist/types/modules/notification/index.d.ts +12 -0
  150. package/dist/types/modules/notification/interfaces/email-send-request.d.ts +35 -0
  151. package/dist/types/modules/notification/interfaces/email-send-result.d.ts +22 -0
  152. package/dist/types/modules/notification/interfaces/notification-dispatch-result.d.ts +26 -0
  153. package/dist/types/modules/notification/interfaces/per-channel-result.d.ts +22 -0
  154. package/dist/types/modules/notification/interfaces/provider-attempt.d.ts +25 -0
  155. package/dist/types/modules/notification/interfaces/sms-send-request.d.ts +18 -0
  156. package/dist/types/modules/notification/interfaces/sms-send-result.d.ts +22 -0
  157. package/dist/types/modules/permission/enums/permission-actions.enum.d.ts +57 -1
  158. package/dist/types/modules/permission/enums/permissions-module.enum.d.ts +3 -1
  159. package/dist/types/modules/role/enums/role.enum.d.ts +2 -0
  160. package/package.json +4 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map-bounds.js","sourceRoot":"","sources":["../../../../../src/modules/country/interfaces/map-bounds.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=supported-country-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supported-country-config.js","sourceRoot":"","sources":["../../../../../src/modules/country/interfaces/supported-country-config.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=supported-currency-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supported-currency-config.js","sourceRoot":"","sources":["../../../../../src/modules/country/interfaces/supported-currency-config.ts"],"names":[],"mappings":""}
@@ -0,0 +1,51 @@
1
+ import { SUPPORTED_COUNTRIES, SUPPORTED_COUNTRIES_BY_CODE } from '../constants/supported-countries.const';
2
+ import { SUPPORTED_CURRENCIES_BY_CODE } from '../constants/supported-currencies.const';
3
+ /**
4
+ * Country / currency helper utilities.
5
+ *
6
+ * These are intentionally simple, synchronous and dependency-free so they can
7
+ * be reused across every backend microservice without pulling in extra deps.
8
+ */
9
+ /** Type guard: is `value` a supported ISO 3166-1 alpha-2 country code? */
10
+ export function isSupportedCountryCode(value) {
11
+ return (typeof value === 'string' &&
12
+ Object.prototype.hasOwnProperty.call(SUPPORTED_COUNTRIES_BY_CODE, value));
13
+ }
14
+ /** Type guard: is `value` a supported ISO 4217 currency code? */
15
+ export function isSupportedCurrencyCode(value) {
16
+ return (typeof value === 'string' &&
17
+ Object.prototype.hasOwnProperty.call(SUPPORTED_CURRENCIES_BY_CODE, value));
18
+ }
19
+ /** Get the full config for a supported country, or `undefined` if unsupported. */
20
+ export function getSupportedCountryConfig(countryCode) {
21
+ return isSupportedCountryCode(countryCode)
22
+ ? SUPPORTED_COUNTRIES_BY_CODE[countryCode]
23
+ : undefined;
24
+ }
25
+ /** Get the full config for a supported currency, or `undefined` if unsupported. */
26
+ export function getSupportedCurrencyConfig(currencyCode) {
27
+ return isSupportedCurrencyCode(currencyCode)
28
+ ? SUPPORTED_CURRENCIES_BY_CODE[currencyCode]
29
+ : undefined;
30
+ }
31
+ /** Resolve the currency used by a supported country, or `undefined`. */
32
+ export function getCurrencyForCountry(countryCode) {
33
+ var _a;
34
+ return (_a = getSupportedCountryConfig(countryCode)) === null || _a === void 0 ? void 0 : _a.currencyCode;
35
+ }
36
+ /** Resolve the E.164 calling code (e.g. '+254') for a supported country, or `undefined`. */
37
+ export function getCallingCodeForCountry(countryCode) {
38
+ var _a;
39
+ return (_a = getSupportedCountryConfig(countryCode)) === null || _a === void 0 ? void 0 : _a.callingCode;
40
+ }
41
+ /**
42
+ * Reverse lookup: find the supported country whose E.164 calling code matches
43
+ * `callingCode` (e.g. '+254' -> Kenya), or `undefined` if none match.
44
+ */
45
+ export function getCountryByCallingCode(callingCode) {
46
+ if (!callingCode) {
47
+ return undefined;
48
+ }
49
+ return SUPPORTED_COUNTRIES.find((country) => country.callingCode === callingCode);
50
+ }
51
+ //# sourceMappingURL=country.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"country.util.js","sourceRoot":"","sources":["../../../../../src/modules/country/utils/country.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAC1G,OAAO,EAAE,4BAA4B,EAAE,MAAM,yCAAyC,CAAC;AAMvF;;;;;GAKG;AAEH,0EAA0E;AAC1E,MAAM,UAAU,sBAAsB,CAAC,KAAc;IACjD,OAAO,CACH,OAAO,KAAK,KAAK,QAAQ;QACzB,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAC3E,CAAC;AACN,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,uBAAuB,CAAC,KAAc;IAClD,OAAO,CACH,OAAO,KAAK,KAAK,QAAQ;QACzB,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAC5E,CAAC;AACN,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,yBAAyB,CACrC,WAAsC;IAEtC,OAAO,sBAAsB,CAAC,WAAW,CAAC;QACtC,CAAC,CAAC,2BAA2B,CAAC,WAAW,CAAC;QAC1C,CAAC,CAAC,SAAS,CAAC;AACpB,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,0BAA0B,CACtC,YAAuC;IAEvC,OAAO,uBAAuB,CAAC,YAAY,CAAC;QACxC,CAAC,CAAC,4BAA4B,CAAC,YAAY,CAAC;QAC5C,CAAC,CAAC,SAAS,CAAC;AACpB,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,qBAAqB,CACjC,WAAsC;;IAEtC,OAAO,MAAA,yBAAyB,CAAC,WAAW,CAAC,0CAAE,YAAY,CAAC;AAChE,CAAC;AAED,4FAA4F;AAC5F,MAAM,UAAU,wBAAwB,CACpC,WAAsC;;IAEtC,OAAO,MAAA,yBAAyB,CAAC,WAAW,CAAC,0CAAE,WAAW,CAAC;AAC/D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CACnC,WAAsC;IAEtC,IAAI,CAAC,WAAW,EAAE,CAAC;QACf,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,KAAK,WAAW,CAAC,CAAC;AACtF,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Identifiers for the email providers the notification service can dispatch through.
3
+ * TWILIO_SENDGRID is the Twilio email provider (SendGrid API).
4
+ * Provider order/fallback is configuration-driven; new providers can be appended.
5
+ */
6
+ export var EmailProviderName;
7
+ (function (EmailProviderName) {
8
+ EmailProviderName["TWILIO_SENDGRID"] = "twilio_sendgrid";
9
+ EmailProviderName["MAILGUN"] = "mailgun";
10
+ EmailProviderName["SES"] = "ses";
11
+ })(EmailProviderName || (EmailProviderName = {}));
12
+ //# sourceMappingURL=email-provider-name.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-provider-name.enum.js","sourceRoot":"","sources":["../../../../../src/modules/notification/enums/email-provider-name.enum.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IACzB,wDAAmC,CAAA;IACnC,wCAAmB,CAAA;IACnB,gCAAW,CAAA;AACf,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Delivery channels supported by the clarion-notification service.
3
+ * Used to key per-channel dispatch results.
4
+ */
5
+ export var NotificationChannel;
6
+ (function (NotificationChannel) {
7
+ NotificationChannel["SMS"] = "SMS";
8
+ NotificationChannel["EMAIL"] = "EMAIL";
9
+ NotificationChannel["PUSH"] = "PUSH";
10
+ NotificationChannel["WEB"] = "WEB";
11
+ })(NotificationChannel || (NotificationChannel = {}));
12
+ //# sourceMappingURL=notification-channel.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-channel.enum.js","sourceRoot":"","sources":["../../../../../src/modules/notification/enums/notification-channel.enum.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAN,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC3B,kCAAW,CAAA;IACX,sCAAe,CAAA;IACf,oCAAa,CAAA;IACb,kCAAW,CAAA;AACf,CAAC,EALW,mBAAmB,KAAnB,mBAAmB,QAK9B"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Aggregate status for a multi-channel notification dispatch.
3
+ * - SUCCESS: every attempted channel succeeded.
4
+ * - PARTIAL_SUCCESS: at least one channel succeeded and at least one failed.
5
+ * - FAILED: no attempted channel succeeded.
6
+ */
7
+ export var NotificationOverallStatus;
8
+ (function (NotificationOverallStatus) {
9
+ NotificationOverallStatus["SUCCESS"] = "SUCCESS";
10
+ NotificationOverallStatus["PARTIAL_SUCCESS"] = "PARTIAL_SUCCESS";
11
+ NotificationOverallStatus["FAILED"] = "FAILED";
12
+ })(NotificationOverallStatus || (NotificationOverallStatus = {}));
13
+ //# sourceMappingURL=notification-overall-status.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-overall-status.enum.js","sourceRoot":"","sources":["../../../../../src/modules/notification/enums/notification-overall-status.enum.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAN,IAAY,yBAIX;AAJD,WAAY,yBAAyB;IACjC,gDAAmB,CAAA;IACnB,gEAAmC,CAAA;IACnC,8CAAiB,CAAA;AACrB,CAAC,EAJW,yBAAyB,KAAzB,yBAAyB,QAIpC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Normalized classification of why a provider attempt failed.
3
+ * Drives fallback behaviour: VALIDATION / CONFIG_MISSING are non-retryable
4
+ * (no fallback), the remainder are provider-level failures that trigger fallback.
5
+ */
6
+ export var ProviderFailureReason;
7
+ (function (ProviderFailureReason) {
8
+ /** Malformed/invalid request (bad recipient, missing body/subject). Do not fall back. */
9
+ ProviderFailureReason["VALIDATION"] = "VALIDATION";
10
+ /** Provider is not configured/enabled. Skip provider (try next), not a send failure. */
11
+ ProviderFailureReason["CONFIG_MISSING"] = "CONFIG_MISSING";
12
+ /** Authentication/authorization failure with the provider. */
13
+ ProviderFailureReason["AUTH"] = "AUTH";
14
+ /** Provider rate limited the request. */
15
+ ProviderFailureReason["RATE_LIMIT"] = "RATE_LIMIT";
16
+ /** Request timed out. */
17
+ ProviderFailureReason["TIMEOUT"] = "TIMEOUT";
18
+ /** Network/connection error reaching the provider. */
19
+ ProviderFailureReason["NETWORK"] = "NETWORK";
20
+ /** Provider returned a server-side/processing error. */
21
+ ProviderFailureReason["PROVIDER_ERROR"] = "PROVIDER_ERROR";
22
+ /** Unclassified failure. */
23
+ ProviderFailureReason["UNKNOWN"] = "UNKNOWN";
24
+ })(ProviderFailureReason || (ProviderFailureReason = {}));
25
+ //# sourceMappingURL=provider-failure-reason.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-failure-reason.enum.js","sourceRoot":"","sources":["../../../../../src/modules/notification/enums/provider-failure-reason.enum.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAN,IAAY,qBAiBX;AAjBD,WAAY,qBAAqB;IAC7B,yFAAyF;IACzF,kDAAyB,CAAA;IACzB,wFAAwF;IACxF,0DAAiC,CAAA;IACjC,8DAA8D;IAC9D,sCAAa,CAAA;IACb,yCAAyC;IACzC,kDAAyB,CAAA;IACzB,yBAAyB;IACzB,4CAAmB,CAAA;IACnB,sDAAsD;IACtD,4CAAmB,CAAA;IACnB,wDAAwD;IACxD,0DAAiC,CAAA;IACjC,4BAA4B;IAC5B,4CAAmB,CAAA;AACvB,CAAC,EAjBW,qBAAqB,KAArB,qBAAqB,QAiBhC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Identifiers for the SMS providers the notification service can dispatch through.
3
+ * Provider order/fallback is configuration-driven; new providers can be appended.
4
+ */
5
+ export var SmsProviderName;
6
+ (function (SmsProviderName) {
7
+ SmsProviderName["TWILIO"] = "twilio";
8
+ SmsProviderName["UWAZII"] = "uwazii";
9
+ SmsProviderName["AFRICASTALKING"] = "africastalking";
10
+ })(SmsProviderName || (SmsProviderName = {}));
11
+ //# sourceMappingURL=sms-provider-name.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sms-provider-name.enum.js","sourceRoot":"","sources":["../../../../../src/modules/notification/enums/sms-provider-name.enum.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAN,IAAY,eAIX;AAJD,WAAY,eAAe;IACvB,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;IACjB,oDAAiC,CAAA;AACrC,CAAC,EAJW,eAAe,KAAf,eAAe,QAI1B"}
@@ -0,0 +1,16 @@
1
+ // Enums
2
+ export * from './enums/notification-channel.enum';
3
+ export * from './enums/sms-provider-name.enum';
4
+ export * from './enums/email-provider-name.enum';
5
+ export * from './enums/notification-overall-status.enum';
6
+ export * from './enums/provider-failure-reason.enum';
7
+ // Result/interface contracts (display-safe)
8
+ export * from './interfaces/provider-attempt';
9
+ export * from './interfaces/per-channel-result';
10
+ export * from './interfaces/sms-send-result';
11
+ export * from './interfaces/email-send-result';
12
+ export * from './interfaces/notification-dispatch-result';
13
+ // Backend/service-level request contracts
14
+ export * from './interfaces/sms-send-request';
15
+ export * from './interfaces/email-send-request';
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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,CAAC;AACzD,cAAc,sCAAsC,CAAC;AAErD,4CAA4C;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2CAA2C,CAAC;AAE1D,0CAA0C;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=email-send-request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-send-request.js","sourceRoot":"","sources":["../../../../../src/modules/notification/interfaces/email-send-request.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=email-send-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-send-result.js","sourceRoot":"","sources":["../../../../../src/modules/notification/interfaces/email-send-result.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=notification-dispatch-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-dispatch-result.js","sourceRoot":"","sources":["../../../../../src/modules/notification/interfaces/notification-dispatch-result.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=per-channel-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"per-channel-result.js","sourceRoot":"","sources":["../../../../../src/modules/notification/interfaces/per-channel-result.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=provider-attempt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-attempt.js","sourceRoot":"","sources":["../../../../../src/modules/notification/interfaces/provider-attempt.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=sms-send-request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sms-send-request.js","sourceRoot":"","sources":["../../../../../src/modules/notification/interfaces/sms-send-request.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=sms-send-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sms-send-result.js","sourceRoot":"","sources":["../../../../../src/modules/notification/interfaces/sms-send-result.ts"],"names":[],"mappings":""}
@@ -67,6 +67,72 @@ export const PERMISSIONS_DATA = [
67
67
  PermissionActions.UPDATE_RESPONSE_UNIT,
68
68
  PermissionActions.DELETE_RESPONSE_UNIT
69
69
  ]
70
+ },
71
+ {
72
+ module: PermissionsModule.BILLING,
73
+ actions: [
74
+ PermissionActions.CREATE_BENEFICIARY,
75
+ PermissionActions.READ_BENEFICIARY,
76
+ PermissionActions.UPDATE_BENEFICIARY,
77
+ PermissionActions.DELETE_BENEFICIARY,
78
+ PermissionActions.CREATE_BILLING_CONFIG,
79
+ PermissionActions.READ_BILLING_CONFIG,
80
+ PermissionActions.UPDATE_BILLING_CONFIG,
81
+ PermissionActions.DELETE_BILLING_CONFIG,
82
+ PermissionActions.CREATE_CORPORATE_CLIENT,
83
+ PermissionActions.READ_CORPORATE_CLIENT,
84
+ PermissionActions.UPDATE_CORPORATE_CLIENT,
85
+ PermissionActions.DELETE_CORPORATE_CLIENT,
86
+ PermissionActions.CREATE_CORPORATE_CLIENT_MEMBER,
87
+ PermissionActions.READ_CORPORATE_CLIENT_MEMBER,
88
+ PermissionActions.UPDATE_CORPORATE_CLIENT_MEMBER,
89
+ PermissionActions.DELETE_CORPORATE_CLIENT_MEMBER,
90
+ PermissionActions.CREATE_INDIVIDUAL_CLIENT,
91
+ PermissionActions.READ_INDIVIDUAL_CLIENT,
92
+ PermissionActions.UPDATE_INDIVIDUAL_CLIENT,
93
+ PermissionActions.DELETE_INDIVIDUAL_CLIENT,
94
+ PermissionActions.READ_ENTITLEMENT,
95
+ PermissionActions.CREATE_INVOICE,
96
+ PermissionActions.READ_INVOICE,
97
+ PermissionActions.MARK_INVOICE_PAID,
98
+ PermissionActions.CREATE_ORDER,
99
+ PermissionActions.READ_ORDER,
100
+ PermissionActions.CONFIRM_ORDER,
101
+ PermissionActions.CREATE_RECEIPT,
102
+ PermissionActions.READ_RECEIPT,
103
+ PermissionActions.CREATE_PACKAGE,
104
+ PermissionActions.READ_PACKAGE,
105
+ PermissionActions.UPDATE_PACKAGE,
106
+ PermissionActions.ACTIVATE_PACKAGE,
107
+ PermissionActions.DEACTIVATE_PACKAGE,
108
+ PermissionActions.DELETE_PACKAGE,
109
+ PermissionActions.INITIALIZE_PAYMENT,
110
+ PermissionActions.VERIFY_PAYMENT,
111
+ PermissionActions.READ_PAYMENT,
112
+ PermissionActions.INITIALIZE_INDIVIDUAL_SUBSCRIPTION,
113
+ PermissionActions.READ_INDIVIDUAL_SUBSCRIPTION,
114
+ PermissionActions.APPROVE_INDIVIDUAL_SUBSCRIPTION_MANUALLY,
115
+ PermissionActions.CANCEL_INDIVIDUAL_SUBSCRIPTION,
116
+ PermissionActions.INITIALIZE_CORPORATE_SUBSCRIPTION,
117
+ PermissionActions.READ_CORPORATE_SUBSCRIPTION,
118
+ PermissionActions.APPROVE_CORPORATE_SUBSCRIPTION_MANUALLY,
119
+ PermissionActions.CANCEL_CORPORATE_SUBSCRIPTION,
120
+ PermissionActions.CREATE_SETTLEMENT,
121
+ PermissionActions.READ_SETTLEMENT,
122
+ PermissionActions.SEND_SETTLEMENT_INVOICE,
123
+ PermissionActions.MARK_SETTLEMENT_PAID,
124
+ ]
125
+ },
126
+ {
127
+ module: PermissionsModule.NEWSFEED,
128
+ actions: [
129
+ PermissionActions.CREATE_NEWSFEED_POST,
130
+ PermissionActions.READ_NEWSFEED_POST,
131
+ PermissionActions.UPDATE_NEWSFEED_POST,
132
+ PermissionActions.PUBLISH_NEWSFEED_POST,
133
+ PermissionActions.ARCHIVE_NEWSFEED_POST,
134
+ PermissionActions.DELETE_NEWSFEED_POST
135
+ ]
70
136
  }
71
137
  ];
72
138
  //# sourceMappingURL=permissions.data.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.data.js","sourceRoot":"","sources":["../../../../../src/modules/permission/data/permissions.data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAGrE,MAAM,CAAC,MAAM,gBAAgB,GAAiB;IAC1C;QACI,MAAM,EAAE,iBAAiB,CAAC,YAAY;QACtC,OAAO,EAAE;YACL,iBAAiB,CAAC,mBAAmB;YACrC,iBAAiB,CAAC,iBAAiB;YACnC,iBAAiB,CAAC,mBAAmB;YACrC,iBAAiB,CAAC,mBAAmB;SACxC;KACJ;IACD;QACI,MAAM,EAAE,iBAAiB,CAAC,OAAO;QACjC,OAAO,EAAE;YACL,iBAAiB,CAAC,cAAc;YAChC,iBAAiB,CAAC,YAAY;YAC9B,iBAAiB,CAAC,cAAc;YAChC,iBAAiB,CAAC,cAAc;SACnC;KACJ;IACD;QACI,MAAM,EAAE,iBAAiB,CAAC,cAAc;QACxC,OAAO,EAAE;YACL,iBAAiB,CAAC,qBAAqB;YACvC,iBAAiB,CAAC,mBAAmB;YACrC,iBAAiB,CAAC,qBAAqB;YACvC,iBAAiB,CAAC,qBAAqB;SAC1C;KACJ;IACD;QACI,MAAM,EAAE,iBAAiB,CAAC,IAAI;QAC9B,OAAO,EAAE;YACL,iBAAiB,CAAC,WAAW;YAC7B,iBAAiB,CAAC,SAAS;YAC3B,iBAAiB,CAAC,WAAW;YAC7B,iBAAiB,CAAC,WAAW;SAChC;KACJ;IACD;QACI,MAAM,EAAE,iBAAiB,CAAC,IAAI;QAC9B,OAAO,EAAE;YACL,iBAAiB,CAAC,WAAW;YAC7B,iBAAiB,CAAC,SAAS;YAC3B,iBAAiB,CAAC,WAAW;YAC7B,iBAAiB,CAAC,WAAW;SAChC;KACJ;IACD;QACI,MAAM,EAAE,iBAAiB,CAAC,QAAQ;QAClC,OAAO,EAAE;YACL,iBAAiB,CAAC,eAAe;YACjC,iBAAiB,CAAC,aAAa;YAC/B,iBAAiB,CAAC,eAAe;YACjC,iBAAiB,CAAC,eAAe;YACjC,iBAAiB,CAAC,6BAA6B;YAC/C,iBAAiB,CAAC,2BAA2B;YAC7C,iBAAiB,CAAC,6BAA6B;YAC/C,iBAAiB,CAAC,6BAA6B;SAClD;KACJ;IACD;QACI,MAAM,EAAE,iBAAiB,CAAC,aAAa;QACvC,OAAO,EAAE;YACL,iBAAiB,CAAC,oBAAoB;YACtC,iBAAiB,CAAC,kBAAkB;YACpC,iBAAiB,CAAC,oBAAoB;YACtC,iBAAiB,CAAC,oBAAoB;SACzC;KACJ;CACJ,CAAC"}
1
+ {"version":3,"file":"permissions.data.js","sourceRoot":"","sources":["../../../../../src/modules/permission/data/permissions.data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAGrE,MAAM,CAAC,MAAM,gBAAgB,GAAiB;IAC1C;QACI,MAAM,EAAE,iBAAiB,CAAC,YAAY;QACtC,OAAO,EAAE;YACL,iBAAiB,CAAC,mBAAmB;YACrC,iBAAiB,CAAC,iBAAiB;YACnC,iBAAiB,CAAC,mBAAmB;YACrC,iBAAiB,CAAC,mBAAmB;SACxC;KACJ;IACD;QACI,MAAM,EAAE,iBAAiB,CAAC,OAAO;QACjC,OAAO,EAAE;YACL,iBAAiB,CAAC,cAAc;YAChC,iBAAiB,CAAC,YAAY;YAC9B,iBAAiB,CAAC,cAAc;YAChC,iBAAiB,CAAC,cAAc;SACnC;KACJ;IACD;QACI,MAAM,EAAE,iBAAiB,CAAC,cAAc;QACxC,OAAO,EAAE;YACL,iBAAiB,CAAC,qBAAqB;YACvC,i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EAAE,iBAAiB,CAAC,QAAQ;QAClC,OAAO,EAAE;YACL,iBAAiB,CAAC,oBAAoB;YACtC,iBAAiB,CAAC,kBAAkB;YACpC,iBAAiB,CAAC,oBAAoB;YACtC,iBAAiB,CAAC,qBAAqB;YACvC,iBAAiB,CAAC,qBAAqB;YACvC,iBAAiB,CAAC,oBAAoB;SACzC;KACJ;CACJ,CAAC"}
@@ -44,5 +44,63 @@ export var PermissionActions;
44
44
  PermissionActions["READ_RESPONSE_UNIT"] = "read:response-unit";
45
45
  PermissionActions["UPDATE_RESPONSE_UNIT"] = "update:response-unit";
46
46
  PermissionActions["DELETE_RESPONSE_UNIT"] = "delete:response-unit";
47
+ // Module: Billing
48
+ PermissionActions["CREATE_BENEFICIARY"] = "create:beneficiary";
49
+ PermissionActions["READ_BENEFICIARY"] = "read:beneficiary";
50
+ PermissionActions["UPDATE_BENEFICIARY"] = "update:beneficiary";
51
+ PermissionActions["DELETE_BENEFICIARY"] = "delete:beneficiary";
52
+ PermissionActions["CREATE_BILLING_CONFIG"] = "create:billing-config";
53
+ PermissionActions["READ_BILLING_CONFIG"] = "read:billing-config";
54
+ PermissionActions["UPDATE_BILLING_CONFIG"] = "update:billing-config";
55
+ PermissionActions["DELETE_BILLING_CONFIG"] = "delete:billing-config";
56
+ PermissionActions["CREATE_CORPORATE_CLIENT"] = "create:corporate-client";
57
+ PermissionActions["READ_CORPORATE_CLIENT"] = "read:corporate-client";
58
+ PermissionActions["UPDATE_CORPORATE_CLIENT"] = "update:corporate-client";
59
+ PermissionActions["DELETE_CORPORATE_CLIENT"] = "delete:corporate-client";
60
+ PermissionActions["CREATE_CORPORATE_CLIENT_MEMBER"] = "create:corporate-client-member";
61
+ PermissionActions["READ_CORPORATE_CLIENT_MEMBER"] = "read:corporate-client-member";
62
+ PermissionActions["UPDATE_CORPORATE_CLIENT_MEMBER"] = "update:corporate-client-member";
63
+ PermissionActions["DELETE_CORPORATE_CLIENT_MEMBER"] = "delete:corporate-client-member";
64
+ PermissionActions["CREATE_INDIVIDUAL_CLIENT"] = "create:individual-client";
65
+ PermissionActions["READ_INDIVIDUAL_CLIENT"] = "read:individual-client";
66
+ PermissionActions["UPDATE_INDIVIDUAL_CLIENT"] = "update:individual-client";
67
+ PermissionActions["DELETE_INDIVIDUAL_CLIENT"] = "delete:individual-client";
68
+ PermissionActions["READ_ENTITLEMENT"] = "read:entitlement";
69
+ PermissionActions["CREATE_INVOICE"] = "create:invoice";
70
+ PermissionActions["READ_INVOICE"] = "read:invoice";
71
+ PermissionActions["MARK_INVOICE_PAID"] = "mark:invoice-paid";
72
+ PermissionActions["CREATE_ORDER"] = "create:order";
73
+ PermissionActions["READ_ORDER"] = "read:order";
74
+ PermissionActions["CONFIRM_ORDER"] = "confirm:order";
75
+ PermissionActions["CREATE_RECEIPT"] = "create:receipt";
76
+ PermissionActions["READ_RECEIPT"] = "read:receipt";
77
+ PermissionActions["CREATE_PACKAGE"] = "create:package";
78
+ PermissionActions["READ_PACKAGE"] = "read:package";
79
+ PermissionActions["UPDATE_PACKAGE"] = "update:package";
80
+ PermissionActions["ACTIVATE_PACKAGE"] = "activate:package";
81
+ PermissionActions["DEACTIVATE_PACKAGE"] = "deactivate:package";
82
+ PermissionActions["DELETE_PACKAGE"] = "delete:package";
83
+ PermissionActions["INITIALIZE_PAYMENT"] = "initialize:payment";
84
+ PermissionActions["VERIFY_PAYMENT"] = "verify:payment";
85
+ PermissionActions["READ_PAYMENT"] = "read:payment";
86
+ PermissionActions["INITIALIZE_INDIVIDUAL_SUBSCRIPTION"] = "initialize:individual-subscription";
87
+ PermissionActions["READ_INDIVIDUAL_SUBSCRIPTION"] = "read:individual-subscription";
88
+ PermissionActions["APPROVE_INDIVIDUAL_SUBSCRIPTION_MANUALLY"] = "approve:individual-subscription-manually";
89
+ PermissionActions["CANCEL_INDIVIDUAL_SUBSCRIPTION"] = "cancel:individual-subscription";
90
+ PermissionActions["INITIALIZE_CORPORATE_SUBSCRIPTION"] = "initialize:corporate-subscription";
91
+ PermissionActions["READ_CORPORATE_SUBSCRIPTION"] = "read:corporate-subscription";
92
+ PermissionActions["APPROVE_CORPORATE_SUBSCRIPTION_MANUALLY"] = "approve:corporate-subscription-manually";
93
+ PermissionActions["CANCEL_CORPORATE_SUBSCRIPTION"] = "cancel:corporate-subscription";
94
+ PermissionActions["CREATE_SETTLEMENT"] = "create:settlement";
95
+ PermissionActions["READ_SETTLEMENT"] = "read:settlement";
96
+ PermissionActions["SEND_SETTLEMENT_INVOICE"] = "send:settlement-invoice";
97
+ PermissionActions["MARK_SETTLEMENT_PAID"] = "mark:settlement-paid";
98
+ // Module: Newsfeed
99
+ PermissionActions["CREATE_NEWSFEED_POST"] = "create:newsfeed-post";
100
+ PermissionActions["READ_NEWSFEED_POST"] = "read:newsfeed-post";
101
+ PermissionActions["UPDATE_NEWSFEED_POST"] = "update:newsfeed-post";
102
+ PermissionActions["PUBLISH_NEWSFEED_POST"] = "publish:newsfeed-post";
103
+ PermissionActions["ARCHIVE_NEWSFEED_POST"] = "archive:newsfeed-post";
104
+ PermissionActions["DELETE_NEWSFEED_POST"] = "delete:newsfeed-post";
47
105
  })(PermissionActions || (PermissionActions = {}));
48
106
  //# sourceMappingURL=permission-actions.enum.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"permission-actions.enum.js","sourceRoot":"","sources":["../../../../../src/modules/permission/enums/permission-actions.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,iBAoDX;AApDD,WAAY,iBAAiB;IACzB,uBAAuB;IACvB,gEAA2C,CAAA;IAC3C,4DAAuC,CAAA;IACvC,gEAA2C,CAAA;IAC3C,gEAA2C,CAAA;IAE3C,kBAAkB;IAClB,sDAAiC,CAAA;IACjC,kDAA6B,CAAA;IAC7B,sDAAiC,CAAA;IACjC,sDAAiC,CAAA;IAEjC,wBAAwB;IACxB,oEAA+C,CAAA;IAC/C,gEAA2C,CAAA;IAC3C,oEAA+C,CAAA;IAC/C,oEAA+C,CAAA;IAE/C,eAAe;IACf,gDAA2B,CAAA;IAC3B,4CAAuB,CAAA;IACvB,gDAA2B,CAAA;IAC3B,gDAA2B,CAAA;IAE3B,eAAe;IACf,gDAA2B,CAAA;IAC3B,4CAAuB,CAAA;IACvB,gDAA2B,CAAA;IAC3B,gDAA2B,CAAA;IAE3B,eAAe;IACf,gDAA2B,CAAA;IAC3B,4CAAuB,CAAA;IACvB,gDAA2B,CAAA;IAC3B,gDAA2B,CAAA;IAE3B,mBAAmB;IACnB,wDAAmC,CAAA;IACnC,oDAA+B,CAAA;IAC/B,wDAAmC,CAAA;IACnC,wDAAmC,CAAA;IACnC,oFAA+D,CAAA;IAC/D,gFAA2D,CAAA;IAC3D,oFAA+D,CAAA;IAC/D,oFAA+D,CAAA;IAE/D,uBAAuB;IACvB,kEAA6C,CAAA;IAC7C,8DAAyC,CAAA;IACzC,kEAA6C,CAAA;IAC7C,kEAA6C,CAAA;AACjD,CAAC,EApDW,iBAAiB,KAAjB,iBAAiB,QAoD5B"}
1
+ {"version":3,"file":"permission-actions.enum.js","sourceRoot":"","sources":["../../../../../src/modules/permission/enums/permission-actions.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,iBA6HX;AA7HD,WAAY,iBAAiB;IACzB,uBAAuB;IACvB,gEAA2C,CAAA;IAC3C,4DAAuC,CAAA;IACvC,gEAA2C,CAAA;IAC3C,gEAA2C,CAAA;IAE3C,kBAAkB;IAClB,sDAAiC,CAAA;IACjC,kDAA6B,CAAA;IAC7B,sDAAiC,CAAA;IACjC,sDAAiC,CAAA;IAEjC,wBAAwB;IACxB,oEAA+C,CAAA;IAC/C,gEAA2C,CAAA;IAC3C,oEAA+C,CAAA;IAC/C,oEAA+C,CAAA;IAE/C,eAAe;IACf,gDAA2B,CAAA;IAC3B,4CAAuB,CAAA;IACvB,gDAA2B,CAAA;IAC3B,gDAA2B,CAAA;IAE3B,eAAe;IACf,gDAA2B,CAAA;IAC3B,4CAAuB,CAAA;IACvB,gDAA2B,CA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,CAAA;IACzE,kFAA6D,CAAA;IAC7D,0GAAqF,CAAA;IACrF,sFAAiE,CAAA;IAEjE,4FAAuE,CAAA;IACvE,gFAA2D,CAAA;IAC3D,wGAAmF,CAAA;IACnF,oFAA+D,CAAA;IAE/D,4DAAuC,CAAA;IACvC,wDAAmC,CAAA;IACnC,wEAAmD,CAAA;IACnD,kEAA6C,CAAA;IAE7C,mBAAmB;IACnB,kEAA6C,CAAA;IAC7C,8DAAyC,CAAA;IACzC,kEAA6C,CAAA;IAC7C,oEAA+C,CAAA;IAC/C,oEAA+C,CAAA;IAC/C,kEAA6C,CAAA;AACjD,CAAC,EA7HW,iBAAiB,KAAjB,iBAAiB,QA6H5B"}
@@ -7,5 +7,7 @@ export var PermissionsModule;
7
7
  PermissionsModule["ROLE"] = "Role";
8
8
  PermissionsModule["INCIDENT"] = "Grievance";
9
9
  PermissionsModule["RESPONSE_UNIT"] = "Response Unit";
10
+ PermissionsModule["BILLING"] = "Billing";
11
+ PermissionsModule["NEWSFEED"] = "Newsfeed";
10
12
  })(PermissionsModule || (PermissionsModule = {}));
11
13
  //# sourceMappingURL=permissions-module.enum.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"permissions-module.enum.js","sourceRoot":"","sources":["../../../../../src/modules/permission/enums/permissions-module.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,iBAQX;AARD,WAAY,iBAAiB;IACzB,kDAA6B,CAAA;IAC7B,wCAAmB,CAAA;IACnB,sDAAiC,CAAA;IACjC,kCAAa,CAAA;IACb,kCAAa,CAAA;IACb,2CAAsB,CAAA;IACtB,oDAA+B,CAAA;AACnC,CAAC,EARW,iBAAiB,KAAjB,iBAAiB,QAQ5B"}
1
+ {"version":3,"file":"permissions-module.enum.js","sourceRoot":"","sources":["../../../../../src/modules/permission/enums/permissions-module.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,iBAUX;AAVD,WAAY,iBAAiB;IACzB,kDAA6B,CAAA;IAC7B,wCAAmB,CAAA;IACnB,sDAAiC,CAAA;IACjC,kCAAa,CAAA;IACb,kCAAa,CAAA;IACb,2CAAsB,CAAA;IACtB,oDAA+B,CAAA;IAC/B,wCAAmB,CAAA;IACnB,0CAAqB,CAAA;AACzB,CAAC,EAVW,iBAAiB,KAAjB,iBAAiB,QAU5B"}
@@ -2,7 +2,9 @@ import { Roles } from "../enums/role.enum";
2
2
  export const ORGANIZATION_ROLES = [
3
3
  Roles.ORGANIZATION_OWNER,
4
4
  Roles.ORGANIZATION_ADMIN,
5
- Roles.ORGANIZATION_USER
5
+ Roles.ORGANIZATION_USER,
6
+ Roles.ORGANIZATION_BILLING_ADMIN,
7
+ Roles.ORGANIZATION_NEWSFEED_ADMIN
6
8
  ];
7
9
  export const CONTROL_CENTRE_ROLES = [
8
10
  Roles.CONTROL_CENTRE_ADMIN,
@@ -1 +1 @@
1
- {"version":3,"file":"roles-by-scope.js","sourceRoot":"","sources":["../../../../../src/modules/role/constants/roles-by-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,MAAM,CAAC,MAAM,kBAAkB,GAAa;IACxC,KAAK,CAAC,kBAAkB;IACxB,KAAK,CAAC,kBAAkB;IACxB,KAAK,CAAC,iBAAiB;CAC1B,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAa;IAC1C,KAAK,CAAC,oBAAoB;IAC1B,KAAK,CAAC,mBAAmB;IACzB,KAAK,CAAC,SAAS;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAa;IAClC,KAAK,CAAC,WAAW;CACpB,CAAC"}
1
+ {"version":3,"file":"roles-by-scope.js","sourceRoot":"","sources":["../../../../../src/modules/role/constants/roles-by-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,MAAM,CAAC,MAAM,kBAAkB,GAAa;IACxC,KAAK,CAAC,kBAAkB;IACxB,KAAK,CAAC,kBAAkB;IACxB,KAAK,CAAC,iBAAiB;IACvB,KAAK,CAAC,0BAA0B;IAChC,KAAK,CAAC,2BAA2B;CACpC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAa;IAC1C,KAAK,CAAC,oBAAoB;IAC1B,KAAK,CAAC,mBAAmB;IACzB,KAAK,CAAC,SAAS;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAa;IAClC,KAAK,CAAC,WAAW;CACpB,CAAC"}
@@ -4,6 +4,8 @@ export var Roles;
4
4
  Roles["ORGANIZATION_OWNER"] = "Organization:Owner";
5
5
  Roles["ORGANIZATION_ADMIN"] = "Organization:Admin";
6
6
  Roles["ORGANIZATION_USER"] = "Organization:User";
7
+ Roles["ORGANIZATION_BILLING_ADMIN"] = "Organization:Billing-Admin";
8
+ Roles["ORGANIZATION_NEWSFEED_ADMIN"] = "Organization:Newsfeed-Admin";
7
9
  Roles["CONTROL_CENTRE_ADMIN"] = "Control-Centre:Admin";
8
10
  Roles["CONTROL_CENTRE_USER"] = "Control-Centre:User";
9
11
  Roles["RESPONDER"] = "Responder";
@@ -1 +1 @@
1
- {"version":3,"file":"role.enum.js","sourceRoot":"","sources":["../../../../../src/modules/role/enums/role.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,KASX;AATD,WAAY,KAAK;IACb,oCAA2B,CAAA;IAC3B,kDAAyC,CAAA;IACzC,kDAAyC,CAAA;IACzC,gDAAuC,CAAA;IACvC,sDAA6C,CAAA;IAC7C,oDAA2C,CAAA;IAC3C,gCAAuB,CAAA;IACvB,oCAA2B,CAAA;AAC/B,CAAC,EATW,KAAK,KAAL,KAAK,QAShB;AAED;;GAEG"}
1
+ {"version":3,"file":"role.enum.js","sourceRoot":"","sources":["../../../../../src/modules/role/enums/role.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,KAWX;AAXD,WAAY,KAAK;IACb,oCAA2B,CAAA;IAC3B,kDAAyC,CAAA;IACzC,kDAAyC,CAAA;IACzC,gDAAuC,CAAA;IACvC,kEAAyD,CAAA;IACzD,oEAA2D,CAAA;IAC3D,sDAA6C,CAAA;IAC7C,oDAA2C,CAAA;IAC3C,gCAAuB,CAAA;IACvB,oCAA2B,CAAA;AAC/B,CAAC,EAXW,KAAK,KAAL,KAAK,QAWhB;AAED;;GAEG"}
@@ -14,7 +14,9 @@ export * from './modules/sms/index';
14
14
  export * from './modules/gis/index';
15
15
  export * from './modules/socket/index';
16
16
  export * from './modules/web-notification/index';
17
+ export * from './modules/notification/index';
17
18
  export * from './modules/chat/index';
19
+ export * from './modules/country/index';
18
20
  export * from './interfaces/server-message';
19
21
  export * from './interfaces/i-request-with-user';
20
22
  export * from './interfaces/validated-user';
@@ -0,0 +1,15 @@
1
+ import { CountryCode } from '../enums/country-code.enum';
2
+ import { CurrencyCode } from '../enums/currency-code.enum';
3
+ /**
4
+ * Platform defaults.
5
+ *
6
+ * Kenya remains the default / backward-compatible market: existing users,
7
+ * packages, posts, incidents, OTPs, notifications and billing flows continue
8
+ * to behave exactly as they did before multi-country support was introduced.
9
+ * Use these constants wherever a country/currency is not (yet) explicit.
10
+ */
11
+ export declare const DEFAULT_COUNTRY_CODE: CountryCode;
12
+ export declare const DEFAULT_CURRENCY_CODE: CurrencyCode;
13
+ export declare const DEFAULT_CALLING_CODE: string;
14
+ export declare const DEFAULT_TIMEZONE = "Africa/Nairobi";
15
+ export declare const DEFAULT_LOCALE = "en-KE";
@@ -0,0 +1,13 @@
1
+ import { CountryCode } from '../enums/country-code.enum';
2
+ import { SupportedCountryConfig } from '../interfaces/supported-country-config';
3
+ /**
4
+ * Supported countries keyed by ISO 3166-1 alpha-2 code (source of truth,
5
+ * O(1) lookup).
6
+ *
7
+ * The `Record<CountryCode, ...>` typing enforces at compile time that every
8
+ * country code has a configuration entry. Map centers are the capital cities;
9
+ * bounds are approximate country bounding boxes and can be refined later.
10
+ */
11
+ export declare const SUPPORTED_COUNTRIES_BY_CODE: Readonly<Record<CountryCode, SupportedCountryConfig>>;
12
+ /** Supported countries as an array (convenient for iteration / pickers). */
13
+ export declare const SUPPORTED_COUNTRIES: readonly SupportedCountryConfig[];
@@ -0,0 +1,11 @@
1
+ import { CurrencyCode } from '../enums/currency-code.enum';
2
+ import { SupportedCurrencyConfig } from '../interfaces/supported-currency-config';
3
+ /**
4
+ * Supported currencies keyed by ISO 4217 code (source of truth, O(1) lookup).
5
+ *
6
+ * The `Record<CurrencyCode, ...>` typing enforces at compile time that every
7
+ * currency code has a configuration entry.
8
+ */
9
+ export declare const SUPPORTED_CURRENCIES_BY_CODE: Readonly<Record<CurrencyCode, SupportedCurrencyConfig>>;
10
+ /** Supported currencies as an array (convenient for iteration / pickers). */
11
+ export declare const SUPPORTED_CURRENCIES: readonly SupportedCurrencyConfig[];
@@ -0,0 +1,13 @@
1
+ import { CountryCode } from '../enums/country-code.enum';
2
+ import { CurrencyCode } from '../enums/currency-code.enum';
3
+ /**
4
+ * Reusable, optional country/currency scope for requests and queries.
5
+ *
6
+ * Compose or extend this into country-aware DTOs (newsfeed posts, service
7
+ * packages, billing queries, ...). Both fields are optional so existing
8
+ * single-country (Kenya) requests remain valid without any change.
9
+ */
10
+ export declare class CountryScopeDto {
11
+ countryCode?: CountryCode;
12
+ currencyCode?: CurrencyCode;
13
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * E.164 country calling codes, keyed by ISO 3166-1 alpha-2 country code.
3
+ *
4
+ * Kept as a string enum so the value (e.g. '+254') can be used directly when
5
+ * composing phone numbers, and the key (e.g. KE) aligns with {@link CountryCode}.
6
+ */
7
+ export declare enum CallingCode {
8
+ /** Kenya */
9
+ KE = "+254",
10
+ /** Uganda */
11
+ UG = "+256",
12
+ /** Tanzania */
13
+ TZ = "+255"
14
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Supported country codes.
3
+ *
4
+ * ISO 3166-1 alpha-2 country codes. These are the platform-level identifiers
5
+ * for every country the Clarion / Upesy platform operates in.
6
+ *
7
+ * Kenya (KE) is the default/backward-compatible market.
8
+ */
9
+ export declare enum CountryCode {
10
+ /** Kenya */
11
+ KE = "KE",
12
+ /** Uganda */
13
+ UG = "UG",
14
+ /** Tanzania */
15
+ TZ = "TZ"
16
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Supported currency codes.
3
+ *
4
+ * ISO 4217 currency codes for the markets the platform operates in.
5
+ *
6
+ * KES (Kenyan Shilling) is the default/backward-compatible currency.
7
+ */
8
+ export declare enum CurrencyCode {
9
+ /** Kenyan Shilling */
10
+ KES = "KES",
11
+ /** Ugandan Shilling */
12
+ UGX = "UGX",
13
+ /** Tanzanian Shilling */
14
+ TZS = "TZS"
15
+ }
@@ -0,0 +1,12 @@
1
+ export * from './enums/country-code.enum';
2
+ export * from './enums/currency-code.enum';
3
+ export * from './enums/calling-code.enum';
4
+ export * from './interfaces/geo-coordinates';
5
+ export * from './interfaces/map-bounds';
6
+ export * from './interfaces/supported-currency-config';
7
+ export * from './interfaces/supported-country-config';
8
+ export * from './constants/supported-currencies.const';
9
+ export * from './constants/supported-countries.const';
10
+ export * from './constants/country-defaults.const';
11
+ export * from './dtos/country-scope.dto';
12
+ export * from './utils/country.util';