grm-shared-library 1.1.182 → 1.1.184

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 (127) 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/auth/dtos/login-mobile-user.dto.js +15 -3
  5. package/dist/cjs/modules/auth/dtos/login-mobile-user.dto.js.map +1 -1
  6. package/dist/cjs/modules/auth/dtos/register-mobile-user.dto.js +15 -3
  7. package/dist/cjs/modules/auth/dtos/register-mobile-user.dto.js.map +1 -1
  8. package/dist/cjs/modules/auth/dtos/register.dto.js +15 -3
  9. package/dist/cjs/modules/auth/dtos/register.dto.js.map +1 -1
  10. package/dist/cjs/modules/auth/dtos/resend-otp.dto.js +15 -3
  11. package/dist/cjs/modules/auth/dtos/resend-otp.dto.js.map +1 -1
  12. package/dist/cjs/modules/auth/dtos/send-otp.dto.js +15 -3
  13. package/dist/cjs/modules/auth/dtos/send-otp.dto.js.map +1 -1
  14. package/dist/cjs/modules/country/constants/country-defaults.const.js +20 -0
  15. package/dist/cjs/modules/country/constants/country-defaults.const.js.map +1 -0
  16. package/dist/cjs/modules/country/constants/supported-countries.const.js +64 -0
  17. package/dist/cjs/modules/country/constants/supported-countries.const.js.map +1 -0
  18. package/dist/cjs/modules/country/constants/supported-currencies.const.js +36 -0
  19. package/dist/cjs/modules/country/constants/supported-currencies.const.js.map +1 -0
  20. package/dist/cjs/modules/country/dtos/country-scope.dto.js +47 -0
  21. package/dist/cjs/modules/country/dtos/country-scope.dto.js.map +1 -0
  22. package/dist/cjs/modules/country/enums/calling-code.enum.js +19 -0
  23. package/dist/cjs/modules/country/enums/calling-code.enum.js.map +1 -0
  24. package/dist/cjs/modules/country/enums/country-code.enum.js +21 -0
  25. package/dist/cjs/modules/country/enums/country-code.enum.js.map +1 -0
  26. package/dist/cjs/modules/country/enums/currency-code.enum.js +20 -0
  27. package/dist/cjs/modules/country/enums/currency-code.enum.js.map +1 -0
  28. package/dist/cjs/modules/country/index.js +34 -0
  29. package/dist/cjs/modules/country/index.js.map +1 -0
  30. package/dist/cjs/modules/country/interfaces/geo-coordinates.js +3 -0
  31. package/dist/cjs/modules/country/interfaces/geo-coordinates.js.map +1 -0
  32. package/dist/cjs/modules/country/interfaces/map-bounds.js +3 -0
  33. package/dist/cjs/modules/country/interfaces/map-bounds.js.map +1 -0
  34. package/dist/cjs/modules/country/interfaces/supported-country-config.js +3 -0
  35. package/dist/cjs/modules/country/interfaces/supported-country-config.js.map +1 -0
  36. package/dist/cjs/modules/country/interfaces/supported-currency-config.js +3 -0
  37. package/dist/cjs/modules/country/interfaces/supported-currency-config.js.map +1 -0
  38. package/dist/cjs/modules/country/utils/country.util.js +60 -0
  39. package/dist/cjs/modules/country/utils/country.util.js.map +1 -0
  40. package/dist/cjs/modules/phone/index.js +23 -0
  41. package/dist/cjs/modules/phone/index.js.map +1 -0
  42. package/dist/cjs/modules/phone/interfaces/normalized-phone.js +3 -0
  43. package/dist/cjs/modules/phone/interfaces/normalized-phone.js.map +1 -0
  44. package/dist/cjs/modules/phone/phone.util.js +92 -0
  45. package/dist/cjs/modules/phone/phone.util.js.map +1 -0
  46. package/dist/cjs/modules/phone/validators/is-supported-phone-number.decorator.js +39 -0
  47. package/dist/cjs/modules/phone/validators/is-supported-phone-number.decorator.js.map +1 -0
  48. package/dist/cjs/modules/user/dtos/create-user.dto.js +15 -3
  49. package/dist/cjs/modules/user/dtos/create-user.dto.js.map +1 -1
  50. package/dist/cjs/modules/user/dtos/guardian.dto.js +15 -3
  51. package/dist/cjs/modules/user/dtos/guardian.dto.js.map +1 -1
  52. package/dist/esm/index.js +2 -0
  53. package/dist/esm/index.js.map +1 -1
  54. package/dist/esm/modules/auth/dtos/login-mobile-user.dto.js +17 -5
  55. package/dist/esm/modules/auth/dtos/login-mobile-user.dto.js.map +1 -1
  56. package/dist/esm/modules/auth/dtos/register-mobile-user.dto.js +17 -5
  57. package/dist/esm/modules/auth/dtos/register-mobile-user.dto.js.map +1 -1
  58. package/dist/esm/modules/auth/dtos/register.dto.js +16 -4
  59. package/dist/esm/modules/auth/dtos/register.dto.js.map +1 -1
  60. package/dist/esm/modules/auth/dtos/resend-otp.dto.js +16 -4
  61. package/dist/esm/modules/auth/dtos/resend-otp.dto.js.map +1 -1
  62. package/dist/esm/modules/auth/dtos/send-otp.dto.js +16 -4
  63. package/dist/esm/modules/auth/dtos/send-otp.dto.js.map +1 -1
  64. package/dist/esm/modules/country/constants/country-defaults.const.js +17 -0
  65. package/dist/esm/modules/country/constants/country-defaults.const.js.map +1 -0
  66. package/dist/esm/modules/country/constants/supported-countries.const.js +61 -0
  67. package/dist/esm/modules/country/constants/supported-countries.const.js.map +1 -0
  68. package/dist/esm/modules/country/constants/supported-currencies.const.js +33 -0
  69. package/dist/esm/modules/country/constants/supported-currencies.const.js.map +1 -0
  70. package/dist/esm/modules/country/dtos/country-scope.dto.js +43 -0
  71. package/dist/esm/modules/country/dtos/country-scope.dto.js.map +1 -0
  72. package/dist/esm/modules/country/enums/calling-code.enum.js +16 -0
  73. package/dist/esm/modules/country/enums/calling-code.enum.js.map +1 -0
  74. package/dist/esm/modules/country/enums/country-code.enum.js +18 -0
  75. package/dist/esm/modules/country/enums/country-code.enum.js.map +1 -0
  76. package/dist/esm/modules/country/enums/currency-code.enum.js +17 -0
  77. package/dist/esm/modules/country/enums/currency-code.enum.js.map +1 -0
  78. package/dist/esm/modules/country/index.js +18 -0
  79. package/dist/esm/modules/country/index.js.map +1 -0
  80. package/dist/esm/modules/country/interfaces/geo-coordinates.js +2 -0
  81. package/dist/esm/modules/country/interfaces/geo-coordinates.js.map +1 -0
  82. package/dist/esm/modules/country/interfaces/map-bounds.js +2 -0
  83. package/dist/esm/modules/country/interfaces/map-bounds.js.map +1 -0
  84. package/dist/esm/modules/country/interfaces/supported-country-config.js +2 -0
  85. package/dist/esm/modules/country/interfaces/supported-country-config.js.map +1 -0
  86. package/dist/esm/modules/country/interfaces/supported-currency-config.js +2 -0
  87. package/dist/esm/modules/country/interfaces/supported-currency-config.js.map +1 -0
  88. package/dist/esm/modules/country/utils/country.util.js +51 -0
  89. package/dist/esm/modules/country/utils/country.util.js.map +1 -0
  90. package/dist/esm/modules/phone/index.js +7 -0
  91. package/dist/esm/modules/phone/index.js.map +1 -0
  92. package/dist/esm/modules/phone/interfaces/normalized-phone.js +2 -0
  93. package/dist/esm/modules/phone/interfaces/normalized-phone.js.map +1 -0
  94. package/dist/esm/modules/phone/phone.util.js +86 -0
  95. package/dist/esm/modules/phone/phone.util.js.map +1 -0
  96. package/dist/esm/modules/phone/validators/is-supported-phone-number.decorator.js +36 -0
  97. package/dist/esm/modules/phone/validators/is-supported-phone-number.decorator.js.map +1 -0
  98. package/dist/esm/modules/user/dtos/create-user.dto.js +16 -4
  99. package/dist/esm/modules/user/dtos/create-user.dto.js.map +1 -1
  100. package/dist/esm/modules/user/dtos/guardian.dto.js +16 -4
  101. package/dist/esm/modules/user/dtos/guardian.dto.js.map +1 -1
  102. package/dist/types/index.d.ts +2 -0
  103. package/dist/types/modules/auth/dtos/login-mobile-user.dto.d.ts +2 -0
  104. package/dist/types/modules/auth/dtos/register-mobile-user.dto.d.ts +2 -0
  105. package/dist/types/modules/auth/dtos/register.dto.d.ts +2 -0
  106. package/dist/types/modules/auth/dtos/resend-otp.dto.d.ts +2 -0
  107. package/dist/types/modules/auth/dtos/send-otp.dto.d.ts +2 -0
  108. package/dist/types/modules/country/constants/country-defaults.const.d.ts +15 -0
  109. package/dist/types/modules/country/constants/supported-countries.const.d.ts +13 -0
  110. package/dist/types/modules/country/constants/supported-currencies.const.d.ts +11 -0
  111. package/dist/types/modules/country/dtos/country-scope.dto.d.ts +13 -0
  112. package/dist/types/modules/country/enums/calling-code.enum.d.ts +14 -0
  113. package/dist/types/modules/country/enums/country-code.enum.d.ts +16 -0
  114. package/dist/types/modules/country/enums/currency-code.enum.d.ts +15 -0
  115. package/dist/types/modules/country/index.d.ts +12 -0
  116. package/dist/types/modules/country/interfaces/geo-coordinates.d.ts +12 -0
  117. package/dist/types/modules/country/interfaces/map-bounds.d.ts +16 -0
  118. package/dist/types/modules/country/interfaces/supported-country-config.d.ts +39 -0
  119. package/dist/types/modules/country/interfaces/supported-currency-config.d.ts +19 -0
  120. package/dist/types/modules/country/utils/country.util.d.ts +27 -0
  121. package/dist/types/modules/phone/index.d.ts +3 -0
  122. package/dist/types/modules/phone/interfaces/normalized-phone.d.ts +22 -0
  123. package/dist/types/modules/phone/phone.util.d.ts +20 -0
  124. package/dist/types/modules/phone/validators/is-supported-phone-number.decorator.d.ts +12 -0
  125. package/dist/types/modules/user/dtos/create-user.dto.d.ts +2 -0
  126. package/dist/types/modules/user/dtos/guardian.dto.d.ts +2 -0
  127. package/package.json +5 -3
package/README.md CHANGED
@@ -1,2 +1,72 @@
1
- # grm-shared-library
2
- Common code for GRM
1
+ # grm-shared-library
2
+
3
+ Common code for GRM — shared types, enums, interfaces, DTOs and constants for the
4
+ Clarion / Upesy backend NestJS microservices.
5
+
6
+ ## Country & Currency (multi-country foundation)
7
+
8
+ Platform-level primitives for country-aware emergency response, newsfeed,
9
+ notifications, billing, maps and admin. This is the shared source of truth so
10
+ services stop hard-coding Kenya-specific values.
11
+
12
+ **Supported countries** (ISO 3166-1 alpha-2):
13
+
14
+ | Code | Country | Calling code | Currency | Symbol | Decimals | Timezone | Locale |
15
+ |------|----------|--------------|----------|--------|----------|------------------------|---------|
16
+ | `KE` | Kenya | `+254` | `KES` | `KSh` | 2 | `Africa/Nairobi` | `en-KE` |
17
+ | `UG` | Uganda | `+256` | `UGX` | `USh` | 0 | `Africa/Kampala` | `en-UG` |
18
+ | `TZ` | Tanzania | `+255` | `TZS` | `TSh` | 0 | `Africa/Dar_es_Salaam` | `en-TZ` |
19
+
20
+ **Supported currencies** (ISO 4217): `KES`, `UGX`, `TZS`.
21
+
22
+ ### Importing
23
+
24
+ Everything is re-exported from the package root:
25
+
26
+ ```ts
27
+ import {
28
+ CountryCode,
29
+ CurrencyCode,
30
+ CallingCode,
31
+ SupportedCountryConfig,
32
+ SupportedCurrencyConfig,
33
+ SUPPORTED_COUNTRIES, // readonly SupportedCountryConfig[]
34
+ SUPPORTED_COUNTRIES_BY_CODE, // Record<CountryCode, SupportedCountryConfig>
35
+ SUPPORTED_CURRENCIES,
36
+ SUPPORTED_CURRENCIES_BY_CODE,
37
+ DEFAULT_COUNTRY_CODE, // CountryCode.KE
38
+ DEFAULT_CURRENCY_CODE, // CurrencyCode.KES
39
+ CountryScopeDto, // optional { countryCode?, currencyCode? } request scope
40
+ getSupportedCountryConfig,
41
+ getSupportedCurrencyConfig,
42
+ getCurrencyForCountry,
43
+ getCallingCodeForCountry,
44
+ getCountryByCallingCode,
45
+ isSupportedCountryCode,
46
+ isSupportedCurrencyCode,
47
+ } from 'grm-shared-library';
48
+
49
+ getCurrencyForCountry(CountryCode.UG); // CurrencyCode.UGX
50
+ getCallingCodeForCountry(CountryCode.TZ); // '+255'
51
+ isSupportedCountryCode('US'); // false
52
+ ```
53
+
54
+ ### Backward compatibility
55
+
56
+ **Kenya (`KE` / `KES`) is the default market.** Wherever a country or currency is
57
+ not explicit, fall back to `DEFAULT_COUNTRY_CODE` / `DEFAULT_CURRENCY_CODE` /
58
+ `DEFAULT_TIMEZONE` / `DEFAULT_LOCALE`. Existing Kenyan users, packages, posts,
59
+ incidents, OTPs, notifications and billing flows are unaffected.
60
+
61
+ ### Scope
62
+
63
+ This package provides the country/currency **primitives only**. Country
64
+ detection (GPS / IP / phone-number inference) and country-aware business logic
65
+ (phone login, newsfeed filtering, multi-currency billing, SMS routing, map
66
+ filtering) are delivered in later phases and should build on top of these types.
67
+
68
+ ### Tests
69
+
70
+ ```bash
71
+ npm test # compiles src/modules/country and runs the country/currency suite
72
+ ```
package/dist/cjs/index.js CHANGED
@@ -33,6 +33,8 @@ __exportStar(require("./modules/socket/index"), exports);
33
33
  __exportStar(require("./modules/web-notification/index"), exports);
34
34
  __exportStar(require("./modules/notification/index"), exports);
35
35
  __exportStar(require("./modules/chat/index"), exports);
36
+ __exportStar(require("./modules/country/index"), exports);
37
+ __exportStar(require("./modules/phone/index"), exports);
36
38
  // Interfaces
37
39
  __exportStar(require("./interfaces/server-message"), exports);
38
40
  __exportStar(require("./interfaces/i-request-with-user"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,UAAU;AACV,uDAAqC;AACrC,+DAA6C;AAC7C,yDAAuC;AACvC,6DAA2C;AAC3C,uDAAqC;AACrC,uDAAqC;AACrC,iEAA+C;AAC/C,wDAAsC;AACtC,gEAA8C;AAC9C,2DAAyC;AACzC,2DAAyC;AACzC,sDAAoC;AACpC,sDAAoC;AACpC,sDAAoC;AACpC,yDAAuC;AACvC,mEAAiD;AACjD,+DAA6C;AAC7C,uDAAqC;AAErC,aAAa;AACb,8DAA4C;AAC5C,mEAAiD;AACjD,8DAA4C;AAC5C,2DAAyC;AACzC,0DAAwC;AAExC,YAAY;AACZ,2DAAyC;AAEzC,QAAQ;AACR,gDAA8B;AAE9B,YAAY;AACZ,+DAA6C;AAC7C,wFAAsE;AAEtE,aAAa;AACb,qDAAmC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,UAAU;AACV,uDAAqC;AACrC,+DAA6C;AAC7C,yDAAuC;AACvC,6DAA2C;AAC3C,uDAAqC;AACrC,uDAAqC;AACrC,iEAA+C;AAC/C,wDAAsC;AACtC,gEAA8C;AAC9C,2DAAyC;AACzC,2DAAyC;AACzC,sDAAoC;AACpC,sDAAoC;AACpC,sDAAoC;AACpC,yDAAuC;AACvC,mEAAiD;AACjD,+DAA6C;AAC7C,uDAAqC;AACrC,0DAAwC;AACxC,wDAAsC;AAEtC,aAAa;AACb,8DAA4C;AAC5C,mEAAiD;AACjD,8DAA4C;AAC5C,2DAAyC;AACzC,0DAAwC;AAExC,YAAY;AACZ,2DAAyC;AAEzC,QAAQ;AACR,gDAA8B;AAE9B,YAAY;AACZ,+DAA6C;AAC7C,wFAAsE;AAEtE,aAAa;AACb,qDAAmC"}
@@ -12,19 +12,31 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.LoginMobileUserDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
14
  const swagger_1 = require("@nestjs/swagger");
15
+ const country_code_enum_1 = require("../../country/enums/country-code.enum");
16
+ const is_supported_phone_number_decorator_1 = require("../../phone/validators/is-supported-phone-number.decorator");
15
17
  class LoginMobileUserDto {
16
18
  }
17
19
  exports.LoginMobileUserDto = LoginMobileUserDto;
18
20
  __decorate([
19
21
  (0, swagger_1.ApiProperty)({
20
- description: 'Mobile phone number with country code',
21
- example: '+1234567890',
22
+ description: 'Mobile phone number in E.164 format (e.g. +254712345678), or national format when countryCode is provided',
23
+ example: '+254712345678',
22
24
  format: 'phone'
23
25
  }),
24
- (0, class_validator_1.IsPhoneNumber)(),
26
+ (0, is_supported_phone_number_decorator_1.IsSupportedPhoneNumber)(),
25
27
  (0, class_validator_1.IsNotEmpty)(),
26
28
  __metadata("design:type", String)
27
29
  ], LoginMobileUserDto.prototype, "phoneNumber", void 0);
30
+ __decorate([
31
+ (0, swagger_1.ApiPropertyOptional)({
32
+ description: 'ISO 3166-1 alpha-2 country code for the phone number (KE, UG, TZ). Required when phoneNumber is in national format; defaults to KE.',
33
+ enum: country_code_enum_1.CountryCode,
34
+ example: country_code_enum_1.CountryCode.KE
35
+ }),
36
+ (0, class_validator_1.IsEnum)(country_code_enum_1.CountryCode),
37
+ (0, class_validator_1.IsOptional)(),
38
+ __metadata("design:type", String)
39
+ ], LoginMobileUserDto.prototype, "countryCode", void 0);
28
40
  __decorate([
29
41
  (0, swagger_1.ApiProperty)({
30
42
  description: 'Verification token received',
@@ -1 +1 @@
1
- {"version":3,"file":"login-mobile-user.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/login-mobile-user.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAsE;AACtE,6CAA8C;AAE9C,MAAa,kBAAkB;CAiB9B;AAjBD,gDAiBC;AATG;IAPC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,uCAAuC;QACpD,OAAO,EAAE,aAAa;QACtB,MAAM,EAAE,OAAO;KAClB,CAAC;IACD,IAAA,+BAAa,GAAE;IACf,IAAA,4BAAU,GAAE;;uDACQ;AAQrB;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,6BAA6B;QAC1C,OAAO,EAAE,cAAc;KAC1B,CAAC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;6DACc"}
1
+ {"version":3,"file":"login-mobile-user.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/login-mobile-user.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA2E;AAC3E,6CAAmE;AACnE,6EAAoE;AACpE,oHAAoG;AAEpG,MAAa,kBAAkB;CA0B9B;AA1BD,gDA0BC;AAlBG;IAPC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,2GAA2G;QACxH,OAAO,EAAE,eAAe;QACxB,MAAM,EAAE,OAAO;KAClB,CAAC;IACD,IAAA,4DAAsB,GAAE;IACxB,IAAA,4BAAU,GAAE;;uDACQ;AASrB;IAPC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EAAE,qIAAqI;QAClJ,IAAI,EAAE,+BAAW;QACjB,OAAO,EAAE,+BAAW,CAAC,EAAE;KAC1B,CAAC;IACD,IAAA,wBAAM,EAAC,+BAAW,CAAC;IACnB,IAAA,4BAAU,GAAE;;uDACa;AAQ1B;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,6BAA6B;QAC1C,OAAO,EAAE,cAAc;KAC1B,CAAC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;6DACc"}
@@ -13,6 +13,8 @@ exports.RegisterMobileUserDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
14
  const swagger_1 = require("@nestjs/swagger");
15
15
  const incident_1 = require("../../incident");
16
+ const country_code_enum_1 = require("../../country/enums/country-code.enum");
17
+ const is_supported_phone_number_decorator_1 = require("../../phone/validators/is-supported-phone-number.decorator");
16
18
  class RegisterMobileUserDto {
17
19
  }
18
20
  exports.RegisterMobileUserDto = RegisterMobileUserDto;
@@ -47,14 +49,24 @@ __decorate([
47
49
  ], RegisterMobileUserDto.prototype, "email", void 0);
48
50
  __decorate([
49
51
  (0, swagger_1.ApiProperty)({
50
- description: 'Phone number with country code',
51
- example: '+1234567890',
52
+ description: 'Phone number in E.164 format (e.g. +254712345678), or national format when countryCode is provided',
53
+ example: '+254712345678',
52
54
  format: 'phone'
53
55
  }),
54
- (0, class_validator_1.IsPhoneNumber)(),
56
+ (0, is_supported_phone_number_decorator_1.IsSupportedPhoneNumber)(),
55
57
  (0, class_validator_1.IsNotEmpty)(),
56
58
  __metadata("design:type", String)
57
59
  ], RegisterMobileUserDto.prototype, "phoneNumber", void 0);
60
+ __decorate([
61
+ (0, swagger_1.ApiPropertyOptional)({
62
+ description: 'ISO 3166-1 alpha-2 country code for the phone number (KE, UG, TZ). Required when phoneNumber is in national format; defaults to KE.',
63
+ enum: country_code_enum_1.CountryCode,
64
+ example: country_code_enum_1.CountryCode.KE
65
+ }),
66
+ (0, class_validator_1.IsEnum)(country_code_enum_1.CountryCode),
67
+ (0, class_validator_1.IsOptional)(),
68
+ __metadata("design:type", String)
69
+ ], RegisterMobileUserDto.prototype, "countryCode", void 0);
58
70
  __decorate([
59
71
  (0, swagger_1.ApiProperty)({
60
72
  description: 'ID of the control centre the user belongs to',
@@ -1 +1 @@
1
- {"version":3,"file":"register-mobile-user.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/register-mobile-user.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAiG;AACjG,6CAA8C;AAC9C,6CAA+C;AAE/C,MAAa,qBAAqB;CAmDjC;AAnDD,sDAmDC;AA3CG;IAPC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,mDAAmD;QAChE,IAAI,EAAE,wBAAa;QACnB,OAAO,EAAE,wBAAa,CAAC,KAAK;KAC/B,CAAC;IACD,IAAA,wBAAM,EAAC,wBAAa,CAAC;IACrB,IAAA,4BAAU,GAAE;;oDACS;AAQtB;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,8BAA8B;QAC3C,OAAO,EAAE,UAAU;KACtB,CAAC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;mDACC;AASd;IAPC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,kCAAkC;QAC/C,OAAO,EAAE,sBAAsB;QAC/B,MAAM,EAAE,OAAO;KAClB,CAAC;IACD,IAAA,yBAAO,GAAE;IACT,IAAA,4BAAU,GAAE;;oDACE;AASf;IAPC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,gCAAgC;QAC7C,OAAO,EAAE,aAAa;QACtB,MAAM,EAAE,OAAO;KAClB,CAAC;IACD,IAAA,+BAAa,GAAE;IACf,IAAA,4BAAU,GAAE;;0DACQ;AAQrB;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,8CAA8C;QAC3D,OAAO,EAAE,GAAG;KACf,CAAC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;8DACY;AAQzB;IANC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,4CAA4C;QACzD,OAAO,EAAE,GAAG;KACf,CAAC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;6DACW"}
1
+ {"version":3,"file":"register-mobile-user.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/register-mobile-user.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA8F;AAC9F,6CAAmE;AACnE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AC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;6DACW"}
@@ -19,6 +19,8 @@ const password_regex_const_1 = require("../../common/constants/password-regex.co
19
19
  const class_transformer_1 = require("class-transformer");
20
20
  const org_type_enum_1 = require("../../organization/enums/org-type.enum");
21
21
  const incident_1 = require("../../incident");
22
+ const country_code_enum_1 = require("../../country/enums/country-code.enum");
23
+ const is_supported_phone_number_decorator_1 = require("../../phone/validators/is-supported-phone-number.decorator");
22
24
  class RegisterDto {
23
25
  }
24
26
  exports.RegisterDto = RegisterDto;
@@ -70,16 +72,26 @@ __decorate([
70
72
  ], RegisterDto.prototype, "email", void 0);
71
73
  __decorate([
72
74
  (0, swagger_1.ApiProperty)({
73
- description: 'Phone number with country code',
74
- example: '+1234567890',
75
+ description: 'Phone number in E.164 format (e.g. +254712345678), or national format when countryCode is provided',
76
+ example: '+254712345678',
75
77
  format: 'phone',
76
78
  maxLength: 20
77
79
  }),
78
- (0, class_validator_1.IsPhoneNumber)(),
80
+ (0, is_supported_phone_number_decorator_1.IsSupportedPhoneNumber)(),
79
81
  (0, class_validator_1.MaxLength)(20),
80
82
  (0, class_validator_1.IsNotEmpty)(),
81
83
  __metadata("design:type", String)
82
84
  ], RegisterDto.prototype, "phoneNumber", void 0);
85
+ __decorate([
86
+ (0, swagger_1.ApiPropertyOptional)({
87
+ description: 'ISO 3166-1 alpha-2 country code for the phone number (KE, UG, TZ). Required when phoneNumber is in national format; defaults to KE.',
88
+ enum: country_code_enum_1.CountryCode,
89
+ example: country_code_enum_1.CountryCode.KE
90
+ }),
91
+ (0, class_validator_1.IsEnum)(country_code_enum_1.CountryCode),
92
+ (0, class_validator_1.IsOptional)(),
93
+ __metadata("design:type", String)
94
+ ], RegisterDto.prototype, "countryCode", void 0);
83
95
  __decorate([
84
96
  (0, swagger_1.ApiPropertyOptional)({
85
97
  description: 'User roles (optional)',
@@ -1 +1 @@
1
- {"version":3,"file":"register.dto.js","sourceRoot":"","sources":["../../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;IAPC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,sBAAsB;QACnC,IAAI,EAAE,sBAAa;KACtB,CAAC;IACD,IAAA,gCAAc,GAAE;IAChB,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,sBAAa,CAAC;IACzB,IAAA,4BAAU,GAAE;8BACA,sBAAa;+CAAC;AAS3B;IAPC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,0BAA0B;QACvC,OAAO,EAAE,mCAAmC;QAC5C,MAAM,EAAE,KAAK;KAChB,CAAC;IACD,IAAA,uBAAK,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,sDAAsD,EAAE,CAAC;IAC9E,IAAA,4BAAU,GAAE;;+CACO;AASpB;IAPC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,sBAAsB;QACnC,IAAI,EAAE,gCAAgB;QACtB,OAAO,EAAE,gCAAgB,CAAC,MAAM;KACnC,CAAC;IACD,IAAA,wBAAM,EAAC,gCAAgB,CAAC;IACxB,IAAA,4BAAU,GAAE;;4CACc"}
1
+ {"version":3,"file":"register.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/register.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmJ;AACnJ,6CAAmE;AACnE,yCAA6C;AAC7C,qCAAmC;AACnC,yEAAmE;AACnE,sFAAqG;AACrG,yDAAyC;AACzC,0EAA0E;AAC1E,6CAA8D;AAC9D,6EAAoE;AACpE,oHAAoG;AAEpG,MAAa,WAAW;CAoIvB;AApID,kCAoIC;AA5HG;IAPC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,4CAA4C;QACzD,IAAI,EAAE,wBAAa;QACnB,OAAO,EAAE,wBAAa,CAAC,GAAG;KAC7B,CAAC;IACD,IAAA,wBAAM,EAAC,wBAAa,CAAC;IACrB,IAAA,4BAAU,GAAE;;0CACS;AAStB;IAPC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,4CAA4C;QACzD,IAAI,EAA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QAC5C,MAAM,EAAE,KAAK;KAChB,CAAC;IACD,IAAA,uBAAK,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,sDAAsD,EAAE,CAAC;IAC9E,IAAA,4BAAU,GAAE;;+CACO;AASpB;IAPC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,sBAAsB;QACnC,IAAI,EAAE,gCAAgB;QACtB,OAAO,EAAE,gCAAgB,CAAC,MAAM;KACnC,CAAC;IACD,IAAA,wBAAM,EAAC,gCAAgB,CAAC;IACxB,IAAA,4BAAU,GAAE;;4CACc"}
@@ -13,6 +13,8 @@ exports.ResendOTPDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
14
  const swagger_1 = require("@nestjs/swagger");
15
15
  const otp_action_1 = require("../enums/otp-action");
16
+ const country_code_enum_1 = require("../../country/enums/country-code.enum");
17
+ const is_supported_phone_number_decorator_1 = require("../../phone/validators/is-supported-phone-number.decorator");
16
18
  class ResendOTPDto {
17
19
  }
18
20
  exports.ResendOTPDto = ResendOTPDto;
@@ -49,12 +51,22 @@ __decorate([
49
51
  ], ResendOTPDto.prototype, "email", void 0);
50
52
  __decorate([
51
53
  (0, swagger_1.ApiPropertyOptional)({
52
- description: 'Phone number of the user requesting OTP',
53
- example: '+1234567890',
54
+ description: 'Phone number of the user requesting OTP, in E.164 format (e.g. +254712345678) or national format when countryCode is provided',
55
+ example: '+254712345678',
54
56
  format: 'phone'
55
57
  }),
56
- (0, class_validator_1.IsPhoneNumber)(),
58
+ (0, is_supported_phone_number_decorator_1.IsSupportedPhoneNumber)(),
57
59
  (0, class_validator_1.IsOptional)(),
58
60
  __metadata("design:type", String)
59
61
  ], ResendOTPDto.prototype, "phoneNumber", void 0);
62
+ __decorate([
63
+ (0, swagger_1.ApiPropertyOptional)({
64
+ description: 'ISO 3166-1 alpha-2 country code for the phone number (KE, UG, TZ). Required when phoneNumber is in national format; defaults to KE.',
65
+ enum: country_code_enum_1.CountryCode,
66
+ example: country_code_enum_1.CountryCode.KE
67
+ }),
68
+ (0, class_validator_1.IsEnum)(country_code_enum_1.CountryCode),
69
+ (0, class_validator_1.IsOptional)(),
70
+ __metadata("design:type", String)
71
+ ], ResendOTPDto.prototype, "countryCode", void 0);
60
72
  //# sourceMappingURL=resend-otp.dto.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resend-otp.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/resend-otp.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmG;AACnG,6CAAmE;AACnE,oDAAgD;AAEhD,MAAa,YAAY;CAqCxB;AArCD,oCAqCC;AA5BG;IARC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,yCAAyC;QACtD,IAAI,EAAE,sBAAS;QACf,OAAO,EAAE,sBAAS,CAAC,KAAK;QACxB,MAAM,EAAE,QAAQ;KACnB,CAAC;IACD,IAAA,wBAAM,EAAC,sBAAS,CAAC;IACjB,IAAA,4BAAU,GAAE;;4CACM;AASnB;IAPC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EAAE,0CAA0C;QACvD,OAAO,EAAE,cAAc;QACvB,MAAM,EAAE,QAAQ;KACnB,CAAC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;uDACc;AAS3B;IAPC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EAAE,kCAAkC;QAC/C,OAAO,EAAE,kBAAkB;QAC3B,MAAM,EAAE,OAAO;KAClB,CAAC;IACD,IAAA,yBAAO,GAAE;IACT,IAAA,4BAAU,GAAE;;2CACE;AASf;IAPC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EAAE,yCAAyC;QACtD,OAAO,EAAE,aAAa;QACtB,MAAM,EAAE,OAAO;KAClB,CAAC;IACD,IAAA,+BAAa,GAAE;IACf,IAAA,4BAAU,GAAE;;iDACQ"}
1
+ {"version":3,"file":"resend-otp.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/resend-otp.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAoF;AACpF,6CAAmE;AACnE,oDAAgD;AAChD,6EAAoE;AACpE,oHAAoG;AAEpG,MAAa,YAAY;CA8CxB;AA9CD,oCA8CC;AArCG;IARC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,yCAAyC;QACtD,IAAI,EAAE,sBAAS;QACf,OAAO,EAAE,sBAAS,CAAC,KAAK;QACxB,MAAM,EAAE,QAAQ;KACnB,CAAC;IACD,IAAA,wBAAM,EAAC,sBAAS,CAAC;IACjB,IAAA,4BAAU,GAAE;;4CACM;AASnB;IAPC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EAAE,0CAA0C;QACvD,OAAO,EAAE,cAAc;QACvB,MAAM,EAAE,QAAQ;KACnB,CAAC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;uDACc;AAS3B;IAPC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EAAE,kCAAkC;QAC/C,OAAO,EAAE,kBAAkB;QAC3B,MAAM,EAAE,OAAO;KAClB,CAAC;IACD,IAAA,yBAAO,GAAE;IACT,IAAA,4BAAU,GAAE;;2CACE;AASf;IAPC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EAAE,+HAA+H;QAC5I,OAAO,EAAE,eAAe;QACxB,MAAM,EAAE,OAAO;KAClB,CAAC;IACD,IAAA,4DAAsB,GAAE;IACxB,IAAA,4BAAU,GAAE;;iDACQ;AASrB;IAPC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EAAE,qIAAqI;QAClJ,IAAI,EAAE,+BAAW;QACjB,OAAO,EAAE,+BAAW,CAAC,EAAE;KAC1B,CAAC;IACD,IAAA,wBAAM,EAAC,+BAAW,CAAC;IACnB,IAAA,4BAAU,GAAE;;iDACa"}
@@ -13,19 +13,31 @@ exports.SendOTPDto = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
14
  const class_validator_1 = require("class-validator");
15
15
  const otp_action_1 = require("../enums/otp-action");
16
+ const country_code_enum_1 = require("../../country/enums/country-code.enum");
17
+ const is_supported_phone_number_decorator_1 = require("../../phone/validators/is-supported-phone-number.decorator");
16
18
  class SendOTPDto {
17
19
  }
18
20
  exports.SendOTPDto = SendOTPDto;
19
21
  __decorate([
20
22
  (0, swagger_1.ApiPropertyOptional)({
21
- description: 'The phone number to send the OTP to (If email is not provided)',
22
- example: '+1234567890',
23
+ description: 'The phone number to send the OTP to, in E.164 format (e.g. +254712345678) or national format when countryCode is provided (If email is not provided)',
24
+ example: '+254712345678',
23
25
  format: 'phone'
24
26
  }),
25
- (0, class_validator_1.IsPhoneNumber)(),
27
+ (0, is_supported_phone_number_decorator_1.IsSupportedPhoneNumber)(),
26
28
  (0, class_validator_1.IsOptional)(),
27
29
  __metadata("design:type", String)
28
30
  ], SendOTPDto.prototype, "phoneNumber", void 0);
31
+ __decorate([
32
+ (0, swagger_1.ApiPropertyOptional)({
33
+ description: 'ISO 3166-1 alpha-2 country code for the phone number (KE, UG, TZ). Required when phoneNumber is in national format; defaults to KE.',
34
+ enum: country_code_enum_1.CountryCode,
35
+ example: country_code_enum_1.CountryCode.KE
36
+ }),
37
+ (0, class_validator_1.IsEnum)(country_code_enum_1.CountryCode),
38
+ (0, class_validator_1.IsOptional)(),
39
+ __metadata("design:type", String)
40
+ ], SendOTPDto.prototype, "countryCode", void 0);
29
41
  __decorate([
30
42
  (0, swagger_1.ApiPropertyOptional)({
31
43
  description: 'The email address to send the OTP to (If phone number is not provided)',
@@ -1 +1 @@
1
- {"version":3,"file":"send-otp.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/send-otp.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmE;AACnE,qDAAmG;AACnG,oDAAgD;AAEhD,MAAa,UAAU;CA2BtB;AA3BD,gCA2BC;AAnBG;IAPC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EAAE,gEAAgE;QAC7E,OAAO,EAAE,aAAa;QACtB,MAAM,EAAE,OAAO;KAClB,CAAC;IACD,IAAA,+BAAa,GAAE;IACf,IAAA,4BAAU,GAAE;;+CACQ;AASrB;IAPC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EAAE,wEAAwE;QACrF,OAAO,EAAE,kBAAkB;QAC3B,MAAM,EAAE,OAAO;KAClB,CAAC;IACD,IAAA,yBAAO,GAAE;IACT,IAAA,4BAAU,GAAE;;yCACE;AASf;IAPC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,yCAAyC;QACtD,IAAI,EAAE,sBAAS;QACf,OAAO,EAAE,sBAAS,CAAC,YAAY;KAClC,CAAC;IACD,IAAA,wBAAM,EAAC,sBAAS,CAAC;IACjB,IAAA,4BAAU,GAAE;;0CACM"}
1
+ {"version":3,"file":"send-otp.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/send-otp.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAmE;AACnE,qDAAoF;AACpF,oDAAgD;AAChD,6EAAoE;AACpE,oHAAoG;AAEpG,MAAa,UAAU;CAoCtB;AApCD,gCAoCC;AA5BG;IAPC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EAAE,sJAAsJ;QACnK,OAAO,EAAE,eAAe;QACxB,MAAM,EAAE,OAAO;KAClB,CAAC;IACD,IAAA,4DAAsB,GAAE;IACxB,IAAA,4BAAU,GAAE;;+CACQ;AASrB;IAPC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EAAE,qIAAqI;QAClJ,IAAI,EAAE,+BAAW;QACjB,OAAO,EAAE,+BAAW,CAAC,EAAE;KAC1B,CAAC;IACD,IAAA,wBAAM,EAAC,+BAAW,CAAC;IACnB,IAAA,4BAAU,GAAE;;+CACa;AAS1B;IAPC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EAAE,wEAAwE;QACrF,OAAO,EAAE,kBAAkB;QAC3B,MAAM,EAAE,OAAO;KAClB,CAAC;IACD,IAAA,yBAAO,GAAE;IACT,IAAA,4BAAU,GAAE;;yCACE;AASf;IAPC,IAAA,qBAAW,EAAC;QACT,WAAW,EAAE,yCAAyC;QACtD,IAAI,EAAE,sBAAS;QACf,OAAO,EAAE,sBAAS,CAAC,YAAY;KAClC,CAAC;IACD,IAAA,wBAAM,EAAC,sBAAS,CAAC;IACjB,IAAA,4BAAU,GAAE;;0CACM"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_LOCALE = exports.DEFAULT_TIMEZONE = exports.DEFAULT_CALLING_CODE = exports.DEFAULT_CURRENCY_CODE = exports.DEFAULT_COUNTRY_CODE = void 0;
4
+ const calling_code_enum_1 = require("../enums/calling-code.enum");
5
+ const country_code_enum_1 = require("../enums/country-code.enum");
6
+ const currency_code_enum_1 = require("../enums/currency-code.enum");
7
+ /**
8
+ * Platform defaults.
9
+ *
10
+ * Kenya remains the default / backward-compatible market: existing users,
11
+ * packages, posts, incidents, OTPs, notifications and billing flows continue
12
+ * to behave exactly as they did before multi-country support was introduced.
13
+ * Use these constants wherever a country/currency is not (yet) explicit.
14
+ */
15
+ exports.DEFAULT_COUNTRY_CODE = country_code_enum_1.CountryCode.KE;
16
+ exports.DEFAULT_CURRENCY_CODE = currency_code_enum_1.CurrencyCode.KES;
17
+ exports.DEFAULT_CALLING_CODE = calling_code_enum_1.CallingCode.KE;
18
+ exports.DEFAULT_TIMEZONE = 'Africa/Nairobi';
19
+ exports.DEFAULT_LOCALE = 'en-KE';
20
+ //# sourceMappingURL=country-defaults.const.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"country-defaults.const.js","sourceRoot":"","sources":["../../../../../src/modules/country/constants/country-defaults.const.ts"],"names":[],"mappings":";;;AAAA,kEAAyD;AACzD,kEAAyD;AACzD,oEAA2D;AAE3D;;;;;;;GAOG;AACU,QAAA,oBAAoB,GAAgB,+BAAW,CAAC,EAAE,CAAC;AACnD,QAAA,qBAAqB,GAAiB,iCAAY,CAAC,GAAG,CAAC;AACvD,QAAA,oBAAoB,GAAW,+BAAW,CAAC,EAAE,CAAC;AAC9C,QAAA,gBAAgB,GAAG,gBAAgB,CAAC;AACpC,QAAA,cAAc,GAAG,OAAO,CAAC"}
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SUPPORTED_COUNTRIES = exports.SUPPORTED_COUNTRIES_BY_CODE = void 0;
4
+ const calling_code_enum_1 = require("../enums/calling-code.enum");
5
+ const country_code_enum_1 = require("../enums/country-code.enum");
6
+ const currency_code_enum_1 = require("../enums/currency-code.enum");
7
+ /**
8
+ * Supported countries keyed by ISO 3166-1 alpha-2 code (source of truth,
9
+ * O(1) lookup).
10
+ *
11
+ * The `Record<CountryCode, ...>` typing enforces at compile time that every
12
+ * country code has a configuration entry. Map centers are the capital cities;
13
+ * bounds are approximate country bounding boxes and can be refined later.
14
+ */
15
+ exports.SUPPORTED_COUNTRIES_BY_CODE = {
16
+ [country_code_enum_1.CountryCode.KE]: {
17
+ code: country_code_enum_1.CountryCode.KE,
18
+ name: 'Kenya',
19
+ callingCode: calling_code_enum_1.CallingCode.KE,
20
+ currencyCode: currency_code_enum_1.CurrencyCode.KES,
21
+ currencySymbol: 'KSh',
22
+ currencyDecimalPlaces: 2,
23
+ timezone: 'Africa/Nairobi',
24
+ defaultLocale: 'en-KE',
25
+ googleMapsRegion: 'KE',
26
+ defaultMapCenter: { lat: -1.2921, lng: 36.8219 }, // Nairobi
27
+ defaultMapZoom: 6,
28
+ mapBounds: { north: 5.019, south: -4.72, east: 41.899, west: 33.909 },
29
+ enabled: true,
30
+ },
31
+ [country_code_enum_1.CountryCode.UG]: {
32
+ code: country_code_enum_1.CountryCode.UG,
33
+ name: 'Uganda',
34
+ callingCode: calling_code_enum_1.CallingCode.UG,
35
+ currencyCode: currency_code_enum_1.CurrencyCode.UGX,
36
+ currencySymbol: 'USh',
37
+ currencyDecimalPlaces: 0,
38
+ timezone: 'Africa/Kampala',
39
+ defaultLocale: 'en-UG',
40
+ googleMapsRegion: 'UG',
41
+ defaultMapCenter: { lat: 0.3476, lng: 32.5825 }, // Kampala
42
+ defaultMapZoom: 6,
43
+ mapBounds: { north: 4.234, south: -1.482, east: 35.036, west: 29.573 },
44
+ enabled: true,
45
+ },
46
+ [country_code_enum_1.CountryCode.TZ]: {
47
+ code: country_code_enum_1.CountryCode.TZ,
48
+ name: 'Tanzania',
49
+ callingCode: calling_code_enum_1.CallingCode.TZ,
50
+ currencyCode: currency_code_enum_1.CurrencyCode.TZS,
51
+ currencySymbol: 'TSh',
52
+ currencyDecimalPlaces: 0,
53
+ timezone: 'Africa/Dar_es_Salaam',
54
+ defaultLocale: 'en-TZ',
55
+ googleMapsRegion: 'TZ',
56
+ defaultMapCenter: { lat: -6.7924, lng: 39.2083 }, // Dar es Salaam
57
+ defaultMapZoom: 6,
58
+ mapBounds: { north: -0.984, south: -11.761, east: 40.444, west: 29.327 },
59
+ enabled: true,
60
+ },
61
+ };
62
+ /** Supported countries as an array (convenient for iteration / pickers). */
63
+ exports.SUPPORTED_COUNTRIES = Object.values(exports.SUPPORTED_COUNTRIES_BY_CODE);
64
+ //# sourceMappingURL=supported-countries.const.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supported-countries.const.js","sourceRoot":"","sources":["../../../../../src/modules/country/constants/supported-countries.const.ts"],"names":[],"mappings":";;;AAAA,kEAAyD;AACzD,kEAAyD;AACzD,oEAA2D;AAG3D;;;;;;;GAOG;AACU,QAAA,2BAA2B,GAA0D;IAC9F,CAAC,+BAAW,CAAC,EAAE,CAAC,EAAE;QACd,IAAI,EAAE,+BAAW,CAAC,EAAE;QACpB,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,+BAAW,CAAC,EAAE;QAC3B,YAAY,EAAE,iCAAY,CAAC,GAAG;QAC9B,cAAc,EAAE,KAAK;QACrB,qBAAqB,EAAE,CAAC;QACxB,QAAQ,EAAE,gBAAgB;QAC1B,aAAa,EAAE,OAAO;QACtB,gBAAgB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AG,EAAE,OAAO,EAAE,EAAE,gBAAgB;QAClE,cAAc,EAAE,CAAC;QACjB,SAAS,EAAE,EAAE,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE;QACxE,OAAO,EAAE,IAAI;KAChB;CACJ,CAAC;AAEF,4EAA4E;AAC/D,QAAA,mBAAmB,GAC5B,MAAM,CAAC,MAAM,CAAC,mCAA2B,CAAC,CAAC"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SUPPORTED_CURRENCIES = exports.SUPPORTED_CURRENCIES_BY_CODE = void 0;
4
+ const currency_code_enum_1 = require("../enums/currency-code.enum");
5
+ /**
6
+ * Supported currencies keyed by ISO 4217 code (source of truth, O(1) lookup).
7
+ *
8
+ * The `Record<CurrencyCode, ...>` typing enforces at compile time that every
9
+ * currency code has a configuration entry.
10
+ */
11
+ exports.SUPPORTED_CURRENCIES_BY_CODE = {
12
+ [currency_code_enum_1.CurrencyCode.KES]: {
13
+ code: currency_code_enum_1.CurrencyCode.KES,
14
+ name: 'Kenyan Shilling',
15
+ symbol: 'KSh',
16
+ decimalPlaces: 2,
17
+ enabled: true,
18
+ },
19
+ [currency_code_enum_1.CurrencyCode.UGX]: {
20
+ code: currency_code_enum_1.CurrencyCode.UGX,
21
+ name: 'Ugandan Shilling',
22
+ symbol: 'USh',
23
+ decimalPlaces: 0,
24
+ enabled: true,
25
+ },
26
+ [currency_code_enum_1.CurrencyCode.TZS]: {
27
+ code: currency_code_enum_1.CurrencyCode.TZS,
28
+ name: 'Tanzanian Shilling',
29
+ symbol: 'TSh',
30
+ decimalPlaces: 0,
31
+ enabled: true,
32
+ },
33
+ };
34
+ /** Supported currencies as an array (convenient for iteration / pickers). */
35
+ exports.SUPPORTED_CURRENCIES = Object.values(exports.SUPPORTED_CURRENCIES_BY_CODE);
36
+ //# sourceMappingURL=supported-currencies.const.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supported-currencies.const.js","sourceRoot":"","sources":["../../../../../src/modules/country/constants/supported-currencies.const.ts"],"names":[],"mappings":";;;AAAA,oEAA2D;AAG3D;;;;;GAKG;AACU,QAAA,4BAA4B,GAA4D;IACjG,CAAC,iCAAY,CAAC,GAAG,CAAC,EAAE;QAChB,IAAI,EAAE,iCAAY,CAAC,GAAG;QACtB,IAAI,EAAE,iBAAiB;QACvB,MAAM,EAAE,KAAK;QACb,aAAa,EAAE,CAAC;QAChB,OAAO,EAAE,IAAI;KAChB;IACD,CAAC,iCAAY,CAAC,GAAG,CAAC,EAAE;QAChB,IAAI,EAAE,iCAAY,CAAC,GAAG;QACtB,IAAI,EAAE,kBAAkB;QACxB,MAAM,EAAE,KAAK;QACb,aAAa,EAAE,CAAC;QAChB,OAAO,EAAE,IAAI;KAChB;IACD,CAAC,iCAAY,CAAC,GAAG,CAAC,EAAE;QAChB,IAAI,EAAE,iCAAY,CAAC,GAAG;QACtB,IAAI,EAAE,oBAAoB;QAC1B,MAAM,EAAE,KAAK;QACb,aAAa,EAAE,CAAC;QAChB,OAAO,EAAE,IAAI;KAChB;CACJ,CAAC;AAEF,6EAA6E;AAChE,QAAA,oBAAoB,GAC7B,MAAM,CAAC,MAAM,CAAC,oCAA4B,CAAC,CAAC"}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CountryScopeDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ const country_code_enum_1 = require("../enums/country-code.enum");
16
+ const currency_code_enum_1 = require("../enums/currency-code.enum");
17
+ /**
18
+ * Reusable, optional country/currency scope for requests and queries.
19
+ *
20
+ * Compose or extend this into country-aware DTOs (newsfeed posts, service
21
+ * packages, billing queries, ...). Both fields are optional so existing
22
+ * single-country (Kenya) requests remain valid without any change.
23
+ */
24
+ class CountryScopeDto {
25
+ }
26
+ exports.CountryScopeDto = CountryScopeDto;
27
+ __decorate([
28
+ (0, swagger_1.ApiPropertyOptional)({
29
+ description: 'ISO 3166-1 alpha-2 country code the request is scoped to',
30
+ enum: country_code_enum_1.CountryCode,
31
+ example: country_code_enum_1.CountryCode.KE,
32
+ }),
33
+ (0, class_validator_1.IsOptional)(),
34
+ (0, class_validator_1.IsEnum)(country_code_enum_1.CountryCode),
35
+ __metadata("design:type", String)
36
+ ], CountryScopeDto.prototype, "countryCode", void 0);
37
+ __decorate([
38
+ (0, swagger_1.ApiPropertyOptional)({
39
+ description: 'ISO 4217 currency code the request is scoped to',
40
+ enum: currency_code_enum_1.CurrencyCode,
41
+ example: currency_code_enum_1.CurrencyCode.KES,
42
+ }),
43
+ (0, class_validator_1.IsOptional)(),
44
+ (0, class_validator_1.IsEnum)(currency_code_enum_1.CurrencyCode),
45
+ __metadata("design:type", String)
46
+ ], CountryScopeDto.prototype, "currencyCode", void 0);
47
+ //# sourceMappingURL=country-scope.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"country-scope.dto.js","sourceRoot":"","sources":["../../../../../src/modules/country/dtos/country-scope.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAsD;AACtD,qDAAqD;AACrD,kEAAyD;AACzD,oEAA2D;AAE3D;;;;;;GAMG;AACH,MAAa,eAAe;CAkB3B;AAlBD,0CAkBC;AAVG;IAPC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EAAE,0DAA0D;QACvE,IAAI,EAAE,+BAAW;QACjB,OAAO,EAAE,+BAAW,CAAC,EAAE;KAC1B,CAAC;IACD,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,+BAAW,CAAC;;oDACM;AAS1B;IAPC,IAAA,6BAAmB,EAAC;QACjB,WAAW,EAAE,iDAAiD;QAC9D,IAAI,EAAE,iCAAY;QAClB,OAAO,EAAE,iCAAY,CAAC,GAAG;KAC5B,CAAC;IACD,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,iCAAY,CAAC;;qDACO"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CallingCode = void 0;
4
+ /**
5
+ * E.164 country calling codes, keyed by ISO 3166-1 alpha-2 country code.
6
+ *
7
+ * Kept as a string enum so the value (e.g. '+254') can be used directly when
8
+ * composing phone numbers, and the key (e.g. KE) aligns with {@link CountryCode}.
9
+ */
10
+ var CallingCode;
11
+ (function (CallingCode) {
12
+ /** Kenya */
13
+ CallingCode["KE"] = "+254";
14
+ /** Uganda */
15
+ CallingCode["UG"] = "+256";
16
+ /** Tanzania */
17
+ CallingCode["TZ"] = "+255";
18
+ })(CallingCode || (exports.CallingCode = CallingCode = {}));
19
+ //# sourceMappingURL=calling-code.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calling-code.enum.js","sourceRoot":"","sources":["../../../../../src/modules/country/enums/calling-code.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,IAAY,WAOX;AAPD,WAAY,WAAW;IACnB,YAAY;IACZ,0BAAW,CAAA;IACX,aAAa;IACb,0BAAW,CAAA;IACX,eAAe;IACf,0BAAW,CAAA;AACf,CAAC,EAPW,WAAW,2BAAX,WAAW,QAOtB"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CountryCode = void 0;
4
+ /**
5
+ * Supported country codes.
6
+ *
7
+ * ISO 3166-1 alpha-2 country codes. These are the platform-level identifiers
8
+ * for every country the Clarion / Upesy platform operates in.
9
+ *
10
+ * Kenya (KE) is the default/backward-compatible market.
11
+ */
12
+ var CountryCode;
13
+ (function (CountryCode) {
14
+ /** Kenya */
15
+ CountryCode["KE"] = "KE";
16
+ /** Uganda */
17
+ CountryCode["UG"] = "UG";
18
+ /** Tanzania */
19
+ CountryCode["TZ"] = "TZ";
20
+ })(CountryCode || (exports.CountryCode = CountryCode = {}));
21
+ //# sourceMappingURL=country-code.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"country-code.enum.js","sourceRoot":"","sources":["../../../../../src/modules/country/enums/country-code.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,IAAY,WAOX;AAPD,WAAY,WAAW;IACnB,YAAY;IACZ,wBAAS,CAAA;IACT,aAAa;IACb,wBAAS,CAAA;IACT,eAAe;IACf,wBAAS,CAAA;AACb,CAAC,EAPW,WAAW,2BAAX,WAAW,QAOtB"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CurrencyCode = void 0;
4
+ /**
5
+ * Supported currency codes.
6
+ *
7
+ * ISO 4217 currency codes for the markets the platform operates in.
8
+ *
9
+ * KES (Kenyan Shilling) is the default/backward-compatible currency.
10
+ */
11
+ var CurrencyCode;
12
+ (function (CurrencyCode) {
13
+ /** Kenyan Shilling */
14
+ CurrencyCode["KES"] = "KES";
15
+ /** Ugandan Shilling */
16
+ CurrencyCode["UGX"] = "UGX";
17
+ /** Tanzanian Shilling */
18
+ CurrencyCode["TZS"] = "TZS";
19
+ })(CurrencyCode || (exports.CurrencyCode = CurrencyCode = {}));
20
+ //# sourceMappingURL=currency-code.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"currency-code.enum.js","sourceRoot":"","sources":["../../../../../src/modules/country/enums/currency-code.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,IAAY,YAOX;AAPD,WAAY,YAAY;IACpB,sBAAsB;IACtB,2BAAW,CAAA;IACX,uBAAuB;IACvB,2BAAW,CAAA;IACX,yBAAyB;IACzB,2BAAW,CAAA;AACf,CAAC,EAPW,YAAY,4BAAZ,YAAY,QAOvB"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ // Enums
18
+ __exportStar(require("./enums/country-code.enum"), exports);
19
+ __exportStar(require("./enums/currency-code.enum"), exports);
20
+ __exportStar(require("./enums/calling-code.enum"), exports);
21
+ // Interfaces
22
+ __exportStar(require("./interfaces/geo-coordinates"), exports);
23
+ __exportStar(require("./interfaces/map-bounds"), exports);
24
+ __exportStar(require("./interfaces/supported-currency-config"), exports);
25
+ __exportStar(require("./interfaces/supported-country-config"), exports);
26
+ // Constants
27
+ __exportStar(require("./constants/supported-currencies.const"), exports);
28
+ __exportStar(require("./constants/supported-countries.const"), exports);
29
+ __exportStar(require("./constants/country-defaults.const"), exports);
30
+ // DTOs
31
+ __exportStar(require("./dtos/country-scope.dto"), exports);
32
+ // Utilities
33
+ __exportStar(require("./utils/country.util"), exports);
34
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/country/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,QAAQ;AACR,4DAA0C;AAC1C,6DAA2C;AAC3C,4DAA0C;AAE1C,aAAa;AACb,+DAA6C;AAC7C,0DAAwC;AACxC,yEAAuD;AACvD,wEAAsD;AAEtD,YAAY;AACZ,yEAAuD;AACvD,wEAAsD;AACtD,qEAAmD;AAEnD,OAAO;AACP,2DAAyC;AAEzC,YAAY;AACZ,uDAAqC"}