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
@@ -8,20 +8,32 @@ var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
10
  import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
11
- import { IsEmail, IsEnum, IsNotEmpty, IsOptional, IsPhoneNumber } from "class-validator";
11
+ import { IsEmail, IsEnum, IsNotEmpty, IsOptional } from "class-validator";
12
12
  import { OtpAction } from "../enums/otp-action";
13
+ import { CountryCode } from "../../country/enums/country-code.enum";
14
+ import { IsSupportedPhoneNumber } from "../../phone/validators/is-supported-phone-number.decorator";
13
15
  export class SendOTPDto {
14
16
  }
15
17
  __decorate([
16
18
  ApiPropertyOptional({
17
- description: 'The phone number to send the OTP to (If email is not provided)',
18
- example: '+1234567890',
19
+ 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)',
20
+ example: '+254712345678',
19
21
  format: 'phone'
20
22
  }),
21
- IsPhoneNumber(),
23
+ IsSupportedPhoneNumber(),
22
24
  IsOptional(),
23
25
  __metadata("design:type", String)
24
26
  ], SendOTPDto.prototype, "phoneNumber", void 0);
27
+ __decorate([
28
+ ApiPropertyOptional({
29
+ 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.',
30
+ enum: CountryCode,
31
+ example: CountryCode.KE
32
+ }),
33
+ IsEnum(CountryCode),
34
+ IsOptional(),
35
+ __metadata("design:type", String)
36
+ ], SendOTPDto.prototype, "countryCode", void 0);
25
37
  __decorate([
26
38
  ApiPropertyOptional({
27
39
  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,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAY,MAAM,iBAAiB,CAAC;AACnG,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,MAAM,OAAO,UAAU;CA2BtB;AAnBG;IAPC,mBAAmB,CAAC;QACjB,WAAW,EAAE,gEAAgE;QAC7E,OAAO,EAAE,aAAa;QACtB,MAAM,EAAE,OAAO;KAClB,CAAC;IACD,aAAa,EAAE;IACf,UAAU,EAAE;;+CACQ;AASrB;IAPC,mBAAmB,CAAC;QACjB,WAAW,EAAE,wEAAwE;QACrF,OAAO,EAAE,kBAAkB;QAC3B,MAAM,EAAE,OAAO;KAClB,CAAC;IACD,OAAO,EAAE;IACT,UAAU,EAAE;;yCACE;AASf;IAPC,WAAW,CAAC;QACT,WAAW,EAAE,yCAAyC;QACtD,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,SAAS,CAAC,YAAY;KAClC,CAAC;IACD,MAAM,CAAC,SAAS,CAAC;IACjB,UAAU,EAAE;;0CACM"}
1
+ {"version":3,"file":"send-otp.dto.js","sourceRoot":"","sources":["../../../../../src/modules/auth/dtos/send-otp.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAY,MAAM,iBAAiB,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4DAA4D,CAAC;AAEpG,MAAM,OAAO,UAAU;CAoCtB;AA5BG;IAPC,mBAAmB,CAAC;QACjB,WAAW,EAAE,sJAAsJ;QACnK,OAAO,EAAE,eAAe;QACxB,MAAM,EAAE,OAAO;KAClB,CAAC;IACD,sBAAsB,EAAE;IACxB,UAAU,EAAE;;+CACQ;AASrB;IAPC,mBAAmB,CAAC;QACjB,WAAW,EAAE,qIAAqI;QAClJ,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,WAAW,CAAC,EAAE;KAC1B,CAAC;IACD,MAAM,CAAC,WAAW,CAAC;IACnB,UAAU,EAAE;;+CACa;AAS1B;IAPC,mBAAmB,CAAC;QACjB,WAAW,EAAE,wEAAwE;QACrF,OAAO,EAAE,kBAAkB;QAC3B,MAAM,EAAE,OAAO;KAClB,CAAC;IACD,OAAO,EAAE;IACT,UAAU,EAAE;;yCACE;AASf;IAPC,WAAW,CAAC;QACT,WAAW,EAAE,yCAAyC;QACtD,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,SAAS,CAAC,YAAY;KAClC,CAAC;IACD,MAAM,CAAC,SAAS,CAAC;IACjB,UAAU,EAAE;;0CACM"}
@@ -0,0 +1,17 @@
1
+ import { CallingCode } from '../enums/calling-code.enum';
2
+ import { CountryCode } from '../enums/country-code.enum';
3
+ import { CurrencyCode } from '../enums/currency-code.enum';
4
+ /**
5
+ * Platform defaults.
6
+ *
7
+ * Kenya remains the default / backward-compatible market: existing users,
8
+ * packages, posts, incidents, OTPs, notifications and billing flows continue
9
+ * to behave exactly as they did before multi-country support was introduced.
10
+ * Use these constants wherever a country/currency is not (yet) explicit.
11
+ */
12
+ export const DEFAULT_COUNTRY_CODE = CountryCode.KE;
13
+ export const DEFAULT_CURRENCY_CODE = CurrencyCode.KES;
14
+ export const DEFAULT_CALLING_CODE = CallingCode.KE;
15
+ export const DEFAULT_TIMEZONE = 'Africa/Nairobi';
16
+ export const DEFAULT_LOCALE = 'en-KE';
17
+ //# 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,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAgB,WAAW,CAAC,EAAE,CAAC;AAChE,MAAM,CAAC,MAAM,qBAAqB,GAAiB,YAAY,CAAC,GAAG,CAAC;AACpE,MAAM,CAAC,MAAM,oBAAoB,GAAW,WAAW,CAAC,EAAE,CAAC;AAC3D,MAAM,CAAC,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;AACjD,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC"}
@@ -0,0 +1,61 @@
1
+ import { CallingCode } from '../enums/calling-code.enum';
2
+ import { CountryCode } from '../enums/country-code.enum';
3
+ import { CurrencyCode } from '../enums/currency-code.enum';
4
+ /**
5
+ * Supported countries keyed by ISO 3166-1 alpha-2 code (source of truth,
6
+ * O(1) lookup).
7
+ *
8
+ * The `Record<CountryCode, ...>` typing enforces at compile time that every
9
+ * country code has a configuration entry. Map centers are the capital cities;
10
+ * bounds are approximate country bounding boxes and can be refined later.
11
+ */
12
+ export const SUPPORTED_COUNTRIES_BY_CODE = {
13
+ [CountryCode.KE]: {
14
+ code: CountryCode.KE,
15
+ name: 'Kenya',
16
+ callingCode: CallingCode.KE,
17
+ currencyCode: CurrencyCode.KES,
18
+ currencySymbol: 'KSh',
19
+ currencyDecimalPlaces: 2,
20
+ timezone: 'Africa/Nairobi',
21
+ defaultLocale: 'en-KE',
22
+ googleMapsRegion: 'KE',
23
+ defaultMapCenter: { lat: -1.2921, lng: 36.8219 }, // Nairobi
24
+ defaultMapZoom: 6,
25
+ mapBounds: { north: 5.019, south: -4.72, east: 41.899, west: 33.909 },
26
+ enabled: true,
27
+ },
28
+ [CountryCode.UG]: {
29
+ code: CountryCode.UG,
30
+ name: 'Uganda',
31
+ callingCode: CallingCode.UG,
32
+ currencyCode: CurrencyCode.UGX,
33
+ currencySymbol: 'USh',
34
+ currencyDecimalPlaces: 0,
35
+ timezone: 'Africa/Kampala',
36
+ defaultLocale: 'en-UG',
37
+ googleMapsRegion: 'UG',
38
+ defaultMapCenter: { lat: 0.3476, lng: 32.5825 }, // Kampala
39
+ defaultMapZoom: 6,
40
+ mapBounds: { north: 4.234, south: -1.482, east: 35.036, west: 29.573 },
41
+ enabled: true,
42
+ },
43
+ [CountryCode.TZ]: {
44
+ code: CountryCode.TZ,
45
+ name: 'Tanzania',
46
+ callingCode: CallingCode.TZ,
47
+ currencyCode: CurrencyCode.TZS,
48
+ currencySymbol: 'TSh',
49
+ currencyDecimalPlaces: 0,
50
+ timezone: 'Africa/Dar_es_Salaam',
51
+ defaultLocale: 'en-TZ',
52
+ googleMapsRegion: 'TZ',
53
+ defaultMapCenter: { lat: -6.7924, lng: 39.2083 }, // Dar es Salaam
54
+ defaultMapZoom: 6,
55
+ mapBounds: { north: -0.984, south: -11.761, east: 40.444, west: 29.327 },
56
+ enabled: true,
57
+ },
58
+ };
59
+ /** Supported countries as an array (convenient for iteration / pickers). */
60
+ export const SUPPORTED_COUNTRIES = Object.values(SUPPORTED_COUNTRIES_BY_CODE);
61
+ //# 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,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAG3D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAA0D;IAC9F,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;QACd,IAAI,EAAE,WAAW,CAAC,EAAE;QACpB,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,WAAW,CAAC,EAAE;QAC3B,YAAY,EAAE,YAAY,CAAC,GAAG;QAC9B,cAAc,EAAE,KAAK;QACrB,qBAAqB,EAAE,CAAC;QACxB,QAAQ,EAAE,gBAAgB;QAC1B,aAAa,EAAE,OAAO;QACtB,gBAAgB,EAAE,IAAI;QACtB,gBAAgB,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,UAAU;QAC5D,cAAc,EAAE,CAAC;QACjB,SAAS,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE;QACrE,OAAO,EAAE,IAAI;KAChB;IACD,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;QACd,IAAI,EAAE,WAAW,CAAC,EAAE;QACpB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,WAAW,CAAC,EAAE;QAC3B,YAAY,EAAE,YAAY,CAAC,GAAG;QAC9B,cAAc,EAAE,KAAK;QACrB,qBAAqB,EAAE,CAAC;QACxB,QAAQ,EAAE,gBAAgB;QAC1B,aAAa,EAAE,OAAO;QACtB,gBAAgB,EAAE,IAAI;QACtB,gBAAgB,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,UAAU;QAC3D,cAAc,EAAE,CAAC;QACjB,SAAS,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE;QACtE,OAAO,EAAE,IAAI;KAChB;IACD,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;QACd,IAAI,EAAE,WAAW,CAAC,EAAE;QACpB,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,WAAW,CAAC,EAAE;QAC3B,YAAY,EAAE,YAAY,CAAC,GAAG;QAC9B,cAAc,EAAE,KAAK;QACrB,qBAAqB,EAAE,CAAC;QACxB,QAAQ,EAAE,sBAAsB;QAChC,aAAa,EAAE,OAAO;QACtB,gBAAgB,EAAE,IAAI;QACtB,gBAAgB,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,GAAG,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;AAC5E,MAAM,CAAC,MAAM,mBAAmB,GAC5B,MAAM,CAAC,MAAM,CAAC,2BAA2B,CAAC,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { CurrencyCode } from '../enums/currency-code.enum';
2
+ /**
3
+ * Supported currencies keyed by ISO 4217 code (source of truth, O(1) lookup).
4
+ *
5
+ * The `Record<CurrencyCode, ...>` typing enforces at compile time that every
6
+ * currency code has a configuration entry.
7
+ */
8
+ export const SUPPORTED_CURRENCIES_BY_CODE = {
9
+ [CurrencyCode.KES]: {
10
+ code: CurrencyCode.KES,
11
+ name: 'Kenyan Shilling',
12
+ symbol: 'KSh',
13
+ decimalPlaces: 2,
14
+ enabled: true,
15
+ },
16
+ [CurrencyCode.UGX]: {
17
+ code: CurrencyCode.UGX,
18
+ name: 'Ugandan Shilling',
19
+ symbol: 'USh',
20
+ decimalPlaces: 0,
21
+ enabled: true,
22
+ },
23
+ [CurrencyCode.TZS]: {
24
+ code: CurrencyCode.TZS,
25
+ name: 'Tanzanian Shilling',
26
+ symbol: 'TSh',
27
+ decimalPlaces: 0,
28
+ enabled: true,
29
+ },
30
+ };
31
+ /** Supported currencies as an array (convenient for iteration / pickers). */
32
+ export const SUPPORTED_CURRENCIES = Object.values(SUPPORTED_CURRENCIES_BY_CODE);
33
+ //# 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,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAG3D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAA4D;IACjG,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE;QAChB,IAAI,EAAE,YAAY,CAAC,GAAG;QACtB,IAAI,EAAE,iBAAiB;QACvB,MAAM,EAAE,KAAK;QACb,aAAa,EAAE,CAAC;QAChB,OAAO,EAAE,IAAI;KAChB;IACD,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE;QAChB,IAAI,EAAE,YAAY,CAAC,GAAG;QACtB,IAAI,EAAE,kBAAkB;QACxB,MAAM,EAAE,KAAK;QACb,aAAa,EAAE,CAAC;QAChB,OAAO,EAAE,IAAI;KAChB;IACD,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE;QAChB,IAAI,EAAE,YAAY,CAAC,GAAG;QACtB,IAAI,EAAE,oBAAoB;QAC1B,MAAM,EAAE,KAAK;QACb,aAAa,EAAE,CAAC;QAChB,OAAO,EAAE,IAAI;KAChB;CACJ,CAAC;AAEF,6EAA6E;AAC7E,MAAM,CAAC,MAAM,oBAAoB,GAC7B,MAAM,CAAC,MAAM,CAAC,4BAA4B,CAAC,CAAC"}
@@ -0,0 +1,43 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { ApiPropertyOptional } from '@nestjs/swagger';
11
+ import { IsEnum, IsOptional } from 'class-validator';
12
+ import { CountryCode } from '../enums/country-code.enum';
13
+ import { CurrencyCode } from '../enums/currency-code.enum';
14
+ /**
15
+ * Reusable, optional country/currency scope for requests and queries.
16
+ *
17
+ * Compose or extend this into country-aware DTOs (newsfeed posts, service
18
+ * packages, billing queries, ...). Both fields are optional so existing
19
+ * single-country (Kenya) requests remain valid without any change.
20
+ */
21
+ export class CountryScopeDto {
22
+ }
23
+ __decorate([
24
+ ApiPropertyOptional({
25
+ description: 'ISO 3166-1 alpha-2 country code the request is scoped to',
26
+ enum: CountryCode,
27
+ example: CountryCode.KE,
28
+ }),
29
+ IsOptional(),
30
+ IsEnum(CountryCode),
31
+ __metadata("design:type", String)
32
+ ], CountryScopeDto.prototype, "countryCode", void 0);
33
+ __decorate([
34
+ ApiPropertyOptional({
35
+ description: 'ISO 4217 currency code the request is scoped to',
36
+ enum: CurrencyCode,
37
+ example: CurrencyCode.KES,
38
+ }),
39
+ IsOptional(),
40
+ IsEnum(CurrencyCode),
41
+ __metadata("design:type", String)
42
+ ], CountryScopeDto.prototype, "currencyCode", void 0);
43
+ //# 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,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D;;;;;;GAMG;AACH,MAAM,OAAO,eAAe;CAkB3B;AAVG;IAPC,mBAAmB,CAAC;QACjB,WAAW,EAAE,0DAA0D;QACvE,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,WAAW,CAAC,EAAE;KAC1B,CAAC;IACD,UAAU,EAAE;IACZ,MAAM,CAAC,WAAW,CAAC;;oDACM;AAS1B;IAPC,mBAAmB,CAAC;QACjB,WAAW,EAAE,iDAAiD;QAC9D,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,YAAY,CAAC,GAAG;KAC5B,CAAC;IACD,UAAU,EAAE;IACZ,MAAM,CAAC,YAAY,CAAC;;qDACO"}
@@ -0,0 +1,16 @@
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 var CallingCode;
8
+ (function (CallingCode) {
9
+ /** Kenya */
10
+ CallingCode["KE"] = "+254";
11
+ /** Uganda */
12
+ CallingCode["UG"] = "+256";
13
+ /** Tanzania */
14
+ CallingCode["TZ"] = "+255";
15
+ })(CallingCode || (CallingCode = {}));
16
+ //# 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,MAAM,CAAN,IAAY,WAOX;AAPD,WAAY,WAAW;IACnB,YAAY;IACZ,0BAAW,CAAA;IACX,aAAa;IACb,0BAAW,CAAA;IACX,eAAe;IACf,0BAAW,CAAA;AACf,CAAC,EAPW,WAAW,KAAX,WAAW,QAOtB"}
@@ -0,0 +1,18 @@
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 var CountryCode;
10
+ (function (CountryCode) {
11
+ /** Kenya */
12
+ CountryCode["KE"] = "KE";
13
+ /** Uganda */
14
+ CountryCode["UG"] = "UG";
15
+ /** Tanzania */
16
+ CountryCode["TZ"] = "TZ";
17
+ })(CountryCode || (CountryCode = {}));
18
+ //# 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,MAAM,CAAN,IAAY,WAOX;AAPD,WAAY,WAAW;IACnB,YAAY;IACZ,wBAAS,CAAA;IACT,aAAa;IACb,wBAAS,CAAA;IACT,eAAe;IACf,wBAAS,CAAA;AACb,CAAC,EAPW,WAAW,KAAX,WAAW,QAOtB"}
@@ -0,0 +1,17 @@
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 var CurrencyCode;
9
+ (function (CurrencyCode) {
10
+ /** Kenyan Shilling */
11
+ CurrencyCode["KES"] = "KES";
12
+ /** Ugandan Shilling */
13
+ CurrencyCode["UGX"] = "UGX";
14
+ /** Tanzanian Shilling */
15
+ CurrencyCode["TZS"] = "TZS";
16
+ })(CurrencyCode || (CurrencyCode = {}));
17
+ //# 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,MAAM,CAAN,IAAY,YAOX;AAPD,WAAY,YAAY;IACpB,sBAAsB;IACtB,2BAAW,CAAA;IACX,uBAAuB;IACvB,2BAAW,CAAA;IACX,yBAAyB;IACzB,2BAAW,CAAA;AACf,CAAC,EAPW,YAAY,KAAZ,YAAY,QAOvB"}
@@ -0,0 +1,18 @@
1
+ // Enums
2
+ export * from './enums/country-code.enum';
3
+ export * from './enums/currency-code.enum';
4
+ export * from './enums/calling-code.enum';
5
+ // Interfaces
6
+ export * from './interfaces/geo-coordinates';
7
+ export * from './interfaces/map-bounds';
8
+ export * from './interfaces/supported-currency-config';
9
+ export * from './interfaces/supported-country-config';
10
+ // Constants
11
+ export * from './constants/supported-currencies.const';
12
+ export * from './constants/supported-countries.const';
13
+ export * from './constants/country-defaults.const';
14
+ // DTOs
15
+ export * from './dtos/country-scope.dto';
16
+ // Utilities
17
+ export * from './utils/country.util';
18
+ //# 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,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAE1C,aAAa;AACb,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC;AAEtD,YAAY;AACZ,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC;AACtD,cAAc,oCAAoC,CAAC;AAEnD,OAAO;AACP,cAAc,0BAA0B,CAAC;AAEzC,YAAY;AACZ,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=geo-coordinates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geo-coordinates.js","sourceRoot":"","sources":["../../../../../src/modules/country/interfaces/geo-coordinates.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=map-bounds.js.map
@@ -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;;;;;G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,WAAW,KAAK,WAAW,CAAC,CAAC;AACtF,CAAC"}
@@ -0,0 +1,7 @@
1
+ // Interfaces
2
+ export * from './interfaces/normalized-phone';
3
+ // Utilities
4
+ export * from './phone.util';
5
+ // Validators
6
+ export * from './validators/is-supported-phone-number.decorator';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/phone/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,cAAc,+BAA+B,CAAC;AAE9C,YAAY;AACZ,cAAc,cAAc,CAAC;AAE7B,aAAa;AACb,cAAc,kDAAkD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=normalized-phone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalized-phone.js","sourceRoot":"","sources":["../../../../../src/modules/phone/interfaces/normalized-phone.ts"],"names":[],"mappings":""}
@@ -0,0 +1,86 @@
1
+ import { parsePhoneNumberFromString } from 'libphonenumber-js';
2
+ import { DEFAULT_COUNTRY_CODE } from '../country/constants/country-defaults.const';
3
+ import { isSupportedCountryCode } from '../country/utils/country.util';
4
+ /**
5
+ * Phone-number normalization for the platform's supported countries (KE/UG/TZ).
6
+ *
7
+ * Built on `libphonenumber-js` (robust parsing/validation — no bespoke regex)
8
+ * and the Phase 1 country primitives. The canonical stored/queried form is
9
+ * always E.164 (e.g. '+254712345678').
10
+ */
11
+ /** Digit strings of the supported E.164 calling codes, for the "code-without-plus" case. */
12
+ const SUPPORTED_CALLING_CODE_DIGITS = ['254', '256', '255'];
13
+ function toResult(phone) {
14
+ if (!phone || !phone.isValid()) {
15
+ return {
16
+ ok: false,
17
+ error: 'INVALID_PHONE_NUMBER',
18
+ message: 'The phone number is not a valid number.',
19
+ };
20
+ }
21
+ const country = phone.country;
22
+ if (!country || !isSupportedCountryCode(country)) {
23
+ return {
24
+ ok: false,
25
+ error: 'UNSUPPORTED_COUNTRY',
26
+ message: `Phone numbers from ${country !== null && country !== void 0 ? country : 'this country'} are not supported. Supported countries are Kenya (KE), Uganda (UG) and Tanzania (TZ).`,
27
+ };
28
+ }
29
+ return {
30
+ ok: true,
31
+ value: {
32
+ e164: phone.number,
33
+ countryCode: country,
34
+ nationalNumber: phone.nationalNumber,
35
+ },
36
+ };
37
+ }
38
+ /**
39
+ * Normalize a phone number to canonical E.164 for a supported country.
40
+ *
41
+ * Resolution order for a raw (non-`+`) input:
42
+ * 1. already international (`+254…`) — parsed as-is;
43
+ * 2. calling code without `+` (`254…`/`256…`/`255…`) — treated as international;
44
+ * 3. national/local (`0712…`, `712…`) — parsed using `defaultCountry`
45
+ * (the caller-supplied country, else Kenya for backward compatibility).
46
+ *
47
+ * @returns a discriminated result: `{ ok: true, value }` or `{ ok: false, error, message }`.
48
+ */
49
+ export function normalizeSupportedPhoneNumber(input, defaultCountry) {
50
+ if (input == null || String(input).trim() === '') {
51
+ return { ok: false, error: 'INVALID_PHONE_NUMBER', message: 'A phone number is required.' };
52
+ }
53
+ const raw = String(input).trim();
54
+ const region = isSupportedCountryCode(defaultCountry)
55
+ ? defaultCountry
56
+ : DEFAULT_COUNTRY_CODE;
57
+ // 1. Already international.
58
+ if (raw.startsWith('+')) {
59
+ return toResult(parsePhoneNumberFromString(raw));
60
+ }
61
+ const digits = raw.replace(/[^\d]/g, '');
62
+ // 2. Calling code supplied without the leading '+', e.g. '254712345678'.
63
+ if (SUPPORTED_CALLING_CODE_DIGITS.some((code) => digits.startsWith(code))) {
64
+ const international = parsePhoneNumberFromString('+' + digits);
65
+ if (international && international.isValid()) {
66
+ return toResult(international);
67
+ }
68
+ }
69
+ // 3. National/local format — resolve using the selected/default country.
70
+ return toResult(parsePhoneNumberFromString(raw, region));
71
+ }
72
+ /** Convenience: `true` if the input can be normalized to a supported-country E.164 number. */
73
+ export function isSupportedPhoneNumber(input, defaultCountry) {
74
+ return normalizeSupportedPhoneNumber(input, defaultCountry).ok;
75
+ }
76
+ /** Convenience: the canonical E.164 string, or `undefined` if the input cannot be normalized. */
77
+ export function toSupportedE164(input, defaultCountry) {
78
+ var _a;
79
+ return (_a = normalizeSupportedPhoneNumber(input, defaultCountry).value) === null || _a === void 0 ? void 0 : _a.e164;
80
+ }
81
+ /** Resolve the supported country a (normalizable) phone number belongs to, or `undefined`. */
82
+ export function getCountryForPhoneNumber(input, defaultCountry) {
83
+ var _a;
84
+ return (_a = normalizeSupportedPhoneNumber(input, defaultCountry).value) === null || _a === void 0 ? void 0 : _a.countryCode;
85
+ }
86
+ //# sourceMappingURL=phone.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phone.util.js","sourceRoot":"","sources":["../../../../src/modules/phone/phone.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAe,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAEnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAGvE;;;;;;GAMG;AAEH,4FAA4F;AAC5F,MAAM,6BAA6B,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAE5D,SAAS,QAAQ,CAAC,KAA8B;IAC5C,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;QAC7B,OAAO;YACH,EAAE,EAAE,KAAK;YACT,KAAK,EAAE,sBAAsB;YAC7B,OAAO,EAAE,yCAAyC;SACrD,CAAC;IACN,CAAC;IACD,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IAC9B,IAAI,CAAC,OAAO,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,EAAE,CAAC;QAC/C,OAAO;YACH,EAAE,EAAE,KAAK;YACT,KAAK,EAAE,qBAAqB;YAC5B,OAAO,EAAE,sBAAsB,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,cAAc,wFAAwF;SACnJ,CAAC;IACN,CAAC;IACD,OAAO;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Q,CAAC,0BAA0B,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;AAC7D,CAAC;AAED,8FAA8F;AAC9F,MAAM,UAAU,sBAAsB,CAClC,KAAgC,EAChC,cAA4C;IAE5C,OAAO,6BAA6B,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC;AACnE,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,eAAe,CAC3B,KAAgC,EAChC,cAA4C;;IAE5C,OAAO,MAAA,6BAA6B,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,KAAK,0CAAE,IAAI,CAAC;AAC5E,CAAC;AAED,8FAA8F;AAC9F,MAAM,UAAU,wBAAwB,CACpC,KAAgC,EAChC,cAA4C;;IAE5C,OAAO,MAAA,6BAA6B,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,KAAK,0CAAE,WAAW,CAAC;AACnF,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { registerDecorator } from 'class-validator';
2
+ import { isSupportedCountryCode } from '../../country/utils/country.util';
3
+ import { isSupportedPhoneNumber } from '../phone.util';
4
+ /**
5
+ * Validates that a property is a phone number for a supported country (KE/UG/TZ).
6
+ *
7
+ * Accepts either a full E.164 number (e.g. '+254712345678') OR a national/local
8
+ * number (e.g. '0712345678') when a sibling `countryCode` field is present. When
9
+ * no `countryCode` sibling is provided, Kenya is used as the default region for
10
+ * backward compatibility.
11
+ *
12
+ * Pairs with an optional `countryCode?: CountryCode` field on the same DTO.
13
+ */
14
+ export function IsSupportedPhoneNumber(validationOptions) {
15
+ return function (object, propertyName) {
16
+ registerDecorator({
17
+ name: 'isSupportedPhoneNumber',
18
+ target: object.constructor,
19
+ propertyName,
20
+ options: validationOptions,
21
+ validator: {
22
+ validate(value, args) {
23
+ if (typeof value !== 'string') {
24
+ return false;
25
+ }
26
+ const country = args.object['countryCode'];
27
+ return isSupportedPhoneNumber(value, isSupportedCountryCode(country) ? country : undefined);
28
+ },
29
+ defaultMessage(args) {
30
+ return `${args.property} must be a valid phone number for a supported country (KE, UG, TZ) — provide it in E.164 format (e.g. +254712345678), or in national format together with a countryCode.`;
31
+ },
32
+ },
33
+ });
34
+ };
35
+ }
36
+ //# sourceMappingURL=is-supported-phone-number.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-supported-phone-number.decorator.js","sourceRoot":"","sources":["../../../../../src/modules/phone/validators/is-supported-phone-number.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA0C,MAAM,iBAAiB,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEvD;;;;;;;;;GASG;AACH,MAAM,UAAU,sBAAsB,CAAC,iBAAqC;IACxE,OAAO,UAAU,MAAc,EAAE,YAAoB;QACjD,iBAAiB,CAAC;YACd,IAAI,EAAE,wBAAwB;YAC9B,MAAM,EAAE,MAAM,CAAC,WAAW;YAC1B,YAAY;YACZ,OAAO,EAAE,iBAAiB;YAC1B,SAAS,EAAE;gBACP,QAAQ,CAAC,KAAc,EAAE,IAAyB;oBAC9C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;wBAC5B,OAAO,KAAK,CAAC;oBACjB,CAAC;oBACD,MAAM,OAAO,GAAI,IAAI,CAAC,MAAkC,CAAC,aAAa,CAAC,CAAC;oBACxE,OAAO,sBAAsB,CACzB,KAAK,EACL,sBAAsB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CACxD,CAAC;gBACN,CAAC;gBACD,cAAc,CAAC,IAAyB;oBACpC,OAAO,GAAG,IAAI,CAAC,QAAQ,0KAA0K,CAAC;gBACtM,CAAC;aACJ;SACJ,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC"}
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
- import { ArrayNotEmpty, IsArray, IsBoolean, IsDate, IsEmail, IsEnum, IsNotEmpty, IsNumber, IsOptional, IsPhoneNumber, IsString, Matches, MaxLength, MinLength, ValidateNested, } from 'class-validator';
10
+ import { ArrayNotEmpty, IsArray, IsBoolean, IsDate, IsEmail, IsEnum, IsNotEmpty, IsNumber, IsOptional, IsString, Matches, MaxLength, MinLength, ValidateNested, } from 'class-validator';
11
11
  import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
12
12
  import { SentenceCase } from '../../../decorators/case-decorators';
13
13
  import { UserStatus } from '../enums/user-status.enum';
@@ -16,6 +16,8 @@ import { Roles } from '../../role';
16
16
  import { Type } from 'class-transformer';
17
17
  import { GuardianDto } from './guardian.dto';
18
18
  import { IncidentAppId } from '../../incident';
19
+ import { CountryCode } from '../../country/enums/country-code.enum';
20
+ import { IsSupportedPhoneNumber } from '../../phone/validators/is-supported-phone-number.decorator';
19
21
  export class CreateUserDto {
20
22
  }
21
23
  __decorate([
@@ -56,16 +58,26 @@ __decorate([
56
58
  ], CreateUserDto.prototype, "email", void 0);
57
59
  __decorate([
58
60
  ApiPropertyOptional({
59
- description: 'Phone number with country code',
60
- example: '+1234567890',
61
+ description: 'Phone number in E.164 format (e.g. +254712345678), or national format when countryCode is provided',
62
+ example: '+254712345678',
61
63
  format: 'phone',
62
64
  maxLength: 20
63
65
  }),
64
- IsPhoneNumber(),
66
+ IsSupportedPhoneNumber(),
65
67
  MaxLength(20),
66
68
  IsOptional(),
67
69
  __metadata("design:type", String)
68
70
  ], CreateUserDto.prototype, "phoneNumber", void 0);
71
+ __decorate([
72
+ ApiPropertyOptional({
73
+ 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.',
74
+ enum: CountryCode,
75
+ example: CountryCode.KE
76
+ }),
77
+ IsEnum(CountryCode),
78
+ IsOptional(),
79
+ __metadata("design:type", String)
80
+ ], CreateUserDto.prototype, "countryCode", void 0);
69
81
  __decorate([
70
82
  ApiProperty({
71
83
  description: 'User roles',
@@ -1 +1 @@
1
- {"version":3,"file":"create-user.dto.js","sourceRoot":"","sources":["../../../../../src/modules/user/dtos/create-user.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACH,aAAa,EACb,OAAO,EACP,SAAS,EACT,MAAM,EACN,OAAO,EACP,MAAM,EACN,UAAU,EACV,QAAQ,EACR,UAAU,EACV,aAAa,EACb,QAAQ,EACR,OAAO,EACP,SAAS,EACT,SAAS,EACT,cAAc,GACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AACrG,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,OAAO,aAAa;CAwGzB;AAhGG;IAPC,WAAW,CAAC;QACT,WAAW,EAAE,oCAAoC;QACjD,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,aAAa,CAAC,GAAG;KAC7B,CAAC;IACD,MAAM,CAAC,aAAa,CAAC;IACrB,UAAU,EAAE;;4CACS;AAatB;IAXC,WAAW,CAAC;QACT,WAAW,EAAE,uBAAuB;QACpC,OAAO,EAAE,UAAU;QACnB,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,EAAE;KAChB,CAAC;IACD,QAAQ,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CAAC;IACvB,UAAU,EAAE;;gDACa;AAK1B;IAHC,OAAO,EAAE;IACT,QAAQ,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC5B,UAAU,EAAE;;mDACW;AAIxB;IAFC,SAAS,EAAE;IACX,UAAU,EAAE;;sDACa;AAI1B;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;wDACc;AAI3B;IAFC,MAAM,EAAE;IACR,UAAU,EAAE;8BACgB,IAAI;iEAAC;AAIlC;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;sDACY;AAIzB;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;;qDACW"}
1
+ {"version":3,"file":"create-user.dto.js","sourceRoot":"","sources":["../../../../../src/modules/user/dtos/create-user.dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACH,aAAa,EACb,OAAO,EACP,SAAS,EACT,MAAM,EACN,OAAO,EACP,MAAM,EACN,UAAU,EACV,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,OAAO,EACP,SAAS,EACT,SAAS,EACT,cAAc,GACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AACrG,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4DA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