@temboplus/frontend-core 0.4.3 → 1.0.1-beta.0

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 (452) hide show
  1. package/README.md +62 -173
  2. package/dist/coverage/coverage.types.d.ts +24 -0
  3. package/dist/coverage/index.d.ts +3 -0
  4. package/dist/coverage/tembo-coverage.d.ts +59 -0
  5. package/dist/domain/amount/amount.d.ts +476 -0
  6. package/dist/domain/amount/amount.helpers.d.ts +64 -0
  7. package/dist/domain/amount/amount.schema.d.ts +34 -0
  8. package/dist/domain/amount/index.d.ts +4 -0
  9. package/dist/domain/bank/bank.d.ts +59 -0
  10. package/dist/domain/bank/bank.helpers.d.ts +29 -0
  11. package/dist/domain/bank/bank.schema.d.ts +39 -0
  12. package/dist/domain/bank/bank.types.d.ts +9 -0
  13. package/dist/domain/bank/index.d.ts +4 -0
  14. package/dist/domain/channel/channel.d.ts +40 -0
  15. package/dist/domain/channel/channel.enums.d.ts +14 -0
  16. package/dist/domain/channel/channel.types.d.ts +12 -0
  17. package/dist/domain/channel/index.d.ts +3 -0
  18. package/dist/domain/country/country.d.ts +73 -0
  19. package/dist/domain/country/country.enums.d.ts +45 -0
  20. package/dist/domain/country/country.helpers.d.ts +6 -0
  21. package/dist/domain/country/country.schema.d.ts +73 -0
  22. package/{script/src/models/country/types.d.ts → dist/domain/country/country.types.d.ts} +18 -1
  23. package/dist/domain/country/index.d.ts +4 -0
  24. package/dist/domain/currency/currency.d.ts +62 -0
  25. package/dist/domain/currency/currency.helpers.d.ts +4 -0
  26. package/dist/domain/currency/currency.schema.d.ts +24 -0
  27. package/{script/src/models/currency/types.d.ts → dist/domain/currency/currency.types.d.ts} +7 -2
  28. package/dist/domain/currency/index.d.ts +4 -0
  29. package/{esm/src/models → dist/domain}/index.d.ts +3 -2
  30. package/dist/domain/mobile-money-provider/index.d.ts +4 -0
  31. package/dist/domain/mobile-money-provider/mobile-money-provider.d.ts +53 -0
  32. package/dist/domain/mobile-money-provider/mobile-money-provider.helpers.d.ts +5 -0
  33. package/dist/domain/mobile-money-provider/mobile-money-provider.schema.d.ts +22 -0
  34. package/dist/domain/mobile-money-provider/mobile-money-provider.types.d.ts +21 -0
  35. package/dist/domain/phone-number/index.d.ts +4 -0
  36. package/dist/domain/phone-number/phone-number.d.ts +57 -0
  37. package/dist/domain/phone-number/phone-number.helpers.d.ts +67 -0
  38. package/dist/domain/phone-number/phone-number.parser.d.ts +43 -0
  39. package/dist/domain/phone-number/phone-number.schema.d.ts +21 -0
  40. package/dist/domain/phone-number/phone-number.types.d.ts +72 -0
  41. package/dist/factories/amount.factory.d.ts +50 -0
  42. package/dist/factories/bank.factory.d.ts +47 -0
  43. package/dist/factories/country.factory.d.ts +40 -0
  44. package/dist/factories/currency.factory.d.ts +40 -0
  45. package/dist/factories/index.d.ts +7 -0
  46. package/dist/factories/mobile-money-provider.factory.d.ts +43 -0
  47. package/dist/factories/phone-number.factory.d.ts +31 -0
  48. package/dist/factories/transaction-limit.factory.d.ts +36 -0
  49. package/dist/index.cjs.js +2 -0
  50. package/dist/index.cjs.js.map +1 -0
  51. package/dist/index.d.ts +5 -0
  52. package/dist/index.esm.js +2 -0
  53. package/dist/index.esm.js.map +1 -0
  54. package/dist/registries/bank.registry.d.ts +36 -0
  55. package/dist/registries/country.registry.d.ts +45 -0
  56. package/dist/registries/currency.registry.d.ts +33 -0
  57. package/dist/registries/index.d.ts +5 -0
  58. package/dist/registries/mobile-money-provider.registry.d.ts +48 -0
  59. package/dist/registries/transaction-limit.registry.d.ts +30 -0
  60. package/dist/repositories/bank.repository.d.ts +30 -0
  61. package/dist/repositories/country.repository.d.ts +31 -0
  62. package/dist/repositories/currency.repository.d.ts +28 -0
  63. package/dist/repositories/index.d.ts +5 -0
  64. package/dist/repositories/mobile-money-provider.repository.d.ts +53 -0
  65. package/dist/repositories/transaction-limit.repository.d.ts +31 -0
  66. package/{script/src → dist}/utils/id.d.ts +7 -3
  67. package/{esm/src/utils/index.js → dist/utils/index.d.ts} +1 -0
  68. package/dist/utils/logger.d.ts +2 -0
  69. package/dist/utils/text.d.ts +103 -0
  70. package/{script/src → dist}/utils/time.d.ts +9 -4
  71. package/package.json +46 -23
  72. package/LICENSE +0 -7
  73. package/esm/_dnt.test_shims.d.ts.map +0 -1
  74. package/esm/deps/deno.land/std@0.217.0/assert/_constants.d.ts.map +0 -1
  75. package/esm/deps/deno.land/std@0.217.0/assert/_diff.d.ts.map +0 -1
  76. package/esm/deps/deno.land/std@0.217.0/assert/_format.d.ts.map +0 -1
  77. package/esm/deps/deno.land/std@0.217.0/assert/assert.d.ts.map +0 -1
  78. package/esm/deps/deno.land/std@0.217.0/assert/assert_almost_equals.d.ts.map +0 -1
  79. package/esm/deps/deno.land/std@0.217.0/assert/assert_array_includes.d.ts.map +0 -1
  80. package/esm/deps/deno.land/std@0.217.0/assert/assert_equals.d.ts.map +0 -1
  81. package/esm/deps/deno.land/std@0.217.0/assert/assert_exists.d.ts.map +0 -1
  82. package/esm/deps/deno.land/std@0.217.0/assert/assert_false.d.ts.map +0 -1
  83. package/esm/deps/deno.land/std@0.217.0/assert/assert_greater.d.ts.map +0 -1
  84. package/esm/deps/deno.land/std@0.217.0/assert/assert_greater_or_equal.d.ts.map +0 -1
  85. package/esm/deps/deno.land/std@0.217.0/assert/assert_instance_of.d.ts.map +0 -1
  86. package/esm/deps/deno.land/std@0.217.0/assert/assert_is_error.d.ts.map +0 -1
  87. package/esm/deps/deno.land/std@0.217.0/assert/assert_less.d.ts.map +0 -1
  88. package/esm/deps/deno.land/std@0.217.0/assert/assert_less_or_equal.d.ts.map +0 -1
  89. package/esm/deps/deno.land/std@0.217.0/assert/assert_match.d.ts.map +0 -1
  90. package/esm/deps/deno.land/std@0.217.0/assert/assert_not_equals.d.ts.map +0 -1
  91. package/esm/deps/deno.land/std@0.217.0/assert/assert_not_instance_of.d.ts.map +0 -1
  92. package/esm/deps/deno.land/std@0.217.0/assert/assert_not_match.d.ts.map +0 -1
  93. package/esm/deps/deno.land/std@0.217.0/assert/assert_not_strict_equals.d.ts.map +0 -1
  94. package/esm/deps/deno.land/std@0.217.0/assert/assert_object_match.d.ts.map +0 -1
  95. package/esm/deps/deno.land/std@0.217.0/assert/assert_rejects.d.ts.map +0 -1
  96. package/esm/deps/deno.land/std@0.217.0/assert/assert_strict_equals.d.ts.map +0 -1
  97. package/esm/deps/deno.land/std@0.217.0/assert/assert_string_includes.d.ts.map +0 -1
  98. package/esm/deps/deno.land/std@0.217.0/assert/assert_throws.d.ts.map +0 -1
  99. package/esm/deps/deno.land/std@0.217.0/assert/assertion_error.d.ts.map +0 -1
  100. package/esm/deps/deno.land/std@0.217.0/assert/equal.d.ts.map +0 -1
  101. package/esm/deps/deno.land/std@0.217.0/assert/fail.d.ts.map +0 -1
  102. package/esm/deps/deno.land/std@0.217.0/assert/mod.d.ts.map +0 -1
  103. package/esm/deps/deno.land/std@0.217.0/assert/unimplemented.d.ts.map +0 -1
  104. package/esm/deps/deno.land/std@0.217.0/assert/unreachable.d.ts.map +0 -1
  105. package/esm/deps/deno.land/std@0.217.0/fmt/colors.d.ts.map +0 -1
  106. package/esm/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts.map +0 -1
  107. package/esm/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts.map +0 -1
  108. package/esm/deps/jsr.io/@std/assert/1.0.10/assert.d.ts.map +0 -1
  109. package/esm/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts.map +0 -1
  110. package/esm/deps/jsr.io/@std/assert/1.0.10/equal.d.ts.map +0 -1
  111. package/esm/deps/jsr.io/@std/assert/1.0.10/equals.d.ts.map +0 -1
  112. package/esm/deps/jsr.io/@std/assert/1.0.10/exists.d.ts.map +0 -1
  113. package/esm/deps/jsr.io/@std/assert/1.0.10/fail.d.ts.map +0 -1
  114. package/esm/deps/jsr.io/@std/assert/1.0.10/false.d.ts.map +0 -1
  115. package/esm/deps/jsr.io/@std/assert/1.0.10/greater.d.ts.map +0 -1
  116. package/esm/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts.map +0 -1
  117. package/esm/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts.map +0 -1
  118. package/esm/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts.map +0 -1
  119. package/esm/deps/jsr.io/@std/assert/1.0.10/less.d.ts.map +0 -1
  120. package/esm/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts.map +0 -1
  121. package/esm/deps/jsr.io/@std/assert/1.0.10/match.d.ts.map +0 -1
  122. package/esm/deps/jsr.io/@std/assert/1.0.10/mod.d.ts.map +0 -1
  123. package/esm/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts.map +0 -1
  124. package/esm/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts.map +0 -1
  125. package/esm/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts.map +0 -1
  126. package/esm/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts.map +0 -1
  127. package/esm/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts.map +0 -1
  128. package/esm/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts.map +0 -1
  129. package/esm/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts.map +0 -1
  130. package/esm/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts.map +0 -1
  131. package/esm/deps/jsr.io/@std/assert/1.0.10/throws.d.ts.map +0 -1
  132. package/esm/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts.map +0 -1
  133. package/esm/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts.map +0 -1
  134. package/esm/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts.map +0 -1
  135. package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +0 -1
  136. package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +0 -1
  137. package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +0 -1
  138. package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +0 -1
  139. package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +0 -1
  140. package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +0 -1
  141. package/esm/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts.map +0 -1
  142. package/esm/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts.map +0 -1
  143. package/esm/mod.d.ts +0 -5
  144. package/esm/mod.d.ts.map +0 -1
  145. package/esm/mod.js +0 -4
  146. package/esm/package.json +0 -3
  147. package/esm/src/config/config_service.d.ts +0 -11
  148. package/esm/src/config/config_service.d.ts.map +0 -1
  149. package/esm/src/config/config_service.js +0 -19
  150. package/esm/src/config/index.d.ts +0 -2
  151. package/esm/src/config/index.d.ts.map +0 -1
  152. package/esm/src/config/index.js +0 -1
  153. package/esm/src/data/banks_tz.d.ts +0 -7
  154. package/esm/src/data/banks_tz.d.ts.map +0 -1
  155. package/esm/src/data/banks_tz.js +0 -197
  156. package/esm/src/data/countries.d.ts +0 -39
  157. package/esm/src/data/countries.d.ts.map +0 -1
  158. package/esm/src/data/countries.js +0 -2475
  159. package/esm/src/data/currencies.d.ts +0 -1901
  160. package/esm/src/data/currencies.d.ts.map +0 -1
  161. package/esm/src/data/currencies.js +0 -1073
  162. package/esm/src/data/phone_patterns.d.ts +0 -3809
  163. package/esm/src/data/phone_patterns.d.ts.map +0 -1
  164. package/esm/src/data/phone_patterns.js +0 -2325
  165. package/esm/src/models/amount/amount.d.ts +0 -53
  166. package/esm/src/models/amount/amount.d.ts.map +0 -1
  167. package/esm/src/models/amount/amount.js +0 -190
  168. package/esm/src/models/amount/amount.test.d.ts.map +0 -1
  169. package/esm/src/models/amount/antd_validator.d.ts +0 -40
  170. package/esm/src/models/amount/antd_validator.d.ts.map +0 -1
  171. package/esm/src/models/amount/antd_validator.js +0 -58
  172. package/esm/src/models/amount/antd_validator.test.d.ts.map +0 -1
  173. package/esm/src/models/amount/index.d.ts +0 -3
  174. package/esm/src/models/amount/index.d.ts.map +0 -1
  175. package/esm/src/models/amount/index.js +0 -2
  176. package/esm/src/models/bank/antd_validator.d.ts +0 -11
  177. package/esm/src/models/bank/antd_validator.d.ts.map +0 -1
  178. package/esm/src/models/bank/antd_validator.js +0 -26
  179. package/esm/src/models/bank/antd_validator.test.d.ts.map +0 -1
  180. package/esm/src/models/bank/bank.d.ts +0 -257
  181. package/esm/src/models/bank/bank.d.ts.map +0 -1
  182. package/esm/src/models/bank/bank.js +0 -450
  183. package/esm/src/models/bank/bank.test.d.ts.map +0 -1
  184. package/esm/src/models/bank/index.d.ts +0 -5
  185. package/esm/src/models/bank/index.d.ts.map +0 -1
  186. package/esm/src/models/bank/index.js +0 -4
  187. package/esm/src/models/bank/types.d.ts +0 -7
  188. package/esm/src/models/bank/types.d.ts.map +0 -1
  189. package/esm/src/models/bank/types.js +0 -45
  190. package/esm/src/models/bank/utils.d.ts +0 -8
  191. package/esm/src/models/bank/utils.d.ts.map +0 -1
  192. package/esm/src/models/bank/utils.js +0 -9
  193. package/esm/src/models/country/country.d.ts +0 -822
  194. package/esm/src/models/country/country.d.ts.map +0 -1
  195. package/esm/src/models/country/country.js +0 -737
  196. package/esm/src/models/country/country.test.d.ts.map +0 -1
  197. package/esm/src/models/country/index.d.ts +0 -4
  198. package/esm/src/models/country/index.d.ts.map +0 -1
  199. package/esm/src/models/country/index.js +0 -3
  200. package/esm/src/models/country/types.d.ts +0 -63
  201. package/esm/src/models/country/types.d.ts.map +0 -1
  202. package/esm/src/models/country/types.js +0 -105
  203. package/esm/src/models/country/utils.d.ts +0 -21
  204. package/esm/src/models/country/utils.d.ts.map +0 -1
  205. package/esm/src/models/country/utils.js +0 -25
  206. package/esm/src/models/currency/currency.d.ts +0 -465
  207. package/esm/src/models/currency/currency.d.ts.map +0 -1
  208. package/esm/src/models/currency/currency.js +0 -471
  209. package/esm/src/models/currency/currency.test.d.ts.map +0 -1
  210. package/esm/src/models/currency/index.d.ts +0 -4
  211. package/esm/src/models/currency/index.d.ts.map +0 -1
  212. package/esm/src/models/currency/index.js +0 -3
  213. package/esm/src/models/currency/types.d.ts +0 -21
  214. package/esm/src/models/currency/types.d.ts.map +0 -1
  215. package/esm/src/models/currency/types.js +0 -28
  216. package/esm/src/models/currency/utils.d.ts +0 -8
  217. package/esm/src/models/currency/utils.d.ts.map +0 -1
  218. package/esm/src/models/currency/utils.js +0 -9
  219. package/esm/src/models/index.d.ts.map +0 -1
  220. package/esm/src/models/index.js +0 -5
  221. package/esm/src/models/phone_number/format.d.ts +0 -13
  222. package/esm/src/models/phone_number/format.d.ts.map +0 -1
  223. package/esm/src/models/phone_number/format.js +0 -13
  224. package/esm/src/models/phone_number/global/phone_number.d.ts +0 -162
  225. package/esm/src/models/phone_number/global/phone_number.d.ts.map +0 -1
  226. package/esm/src/models/phone_number/global/phone_number.js +0 -459
  227. package/esm/src/models/phone_number/global/phone_number.test.d.ts.map +0 -1
  228. package/esm/src/models/phone_number/global/service.d.ts +0 -267
  229. package/esm/src/models/phone_number/global/service.d.ts.map +0 -1
  230. package/esm/src/models/phone_number/global/service.js +0 -498
  231. package/esm/src/models/phone_number/global/service.test.d.ts.map +0 -1
  232. package/esm/src/models/phone_number/index.d.ts +0 -6
  233. package/esm/src/models/phone_number/index.d.ts.map +0 -1
  234. package/esm/src/models/phone_number/index.js +0 -5
  235. package/esm/src/models/phone_number/tz/antd_validator.d.ts +0 -77
  236. package/esm/src/models/phone_number/tz/antd_validator.d.ts.map +0 -1
  237. package/esm/src/models/phone_number/tz/antd_validator.js +0 -90
  238. package/esm/src/models/phone_number/tz/antdvalidator.test.d.ts.map +0 -1
  239. package/esm/src/models/phone_number/tz/network_operator.d.ts +0 -30
  240. package/esm/src/models/phone_number/tz/network_operator.d.ts.map +0 -1
  241. package/esm/src/models/phone_number/tz/network_operator.js +0 -47
  242. package/esm/src/models/phone_number/tz/phone_number.d.ts +0 -141
  243. package/esm/src/models/phone_number/tz/phone_number.d.ts.map +0 -1
  244. package/esm/src/models/phone_number/tz/phone_number.js +0 -290
  245. package/esm/src/models/phone_number/tz/phone_number.test.d.ts.map +0 -1
  246. package/esm/src/reports/index.d.ts +0 -2
  247. package/esm/src/reports/index.d.ts.map +0 -1
  248. package/esm/src/reports/index.js +0 -1
  249. package/esm/src/reports/report_manager.d.ts +0 -146
  250. package/esm/src/reports/report_manager.d.ts.map +0 -1
  251. package/esm/src/reports/report_manager.js +0 -326
  252. package/esm/src/utils/id.d.ts +0 -12
  253. package/esm/src/utils/id.d.ts.map +0 -1
  254. package/esm/src/utils/id.js +0 -19
  255. package/esm/src/utils/index.d.ts +0 -4
  256. package/esm/src/utils/index.d.ts.map +0 -1
  257. package/esm/src/utils/text.d.ts +0 -32
  258. package/esm/src/utils/text.d.ts.map +0 -1
  259. package/esm/src/utils/text.js +0 -68
  260. package/esm/src/utils/text.test.d.ts.map +0 -1
  261. package/esm/src/utils/time.d.ts +0 -21
  262. package/esm/src/utils/time.d.ts.map +0 -1
  263. package/esm/src/utils/time.js +0 -34
  264. package/script/_dnt.test_shims.d.ts.map +0 -1
  265. package/script/deps/deno.land/std@0.217.0/assert/_constants.d.ts.map +0 -1
  266. package/script/deps/deno.land/std@0.217.0/assert/_diff.d.ts.map +0 -1
  267. package/script/deps/deno.land/std@0.217.0/assert/_format.d.ts.map +0 -1
  268. package/script/deps/deno.land/std@0.217.0/assert/assert.d.ts.map +0 -1
  269. package/script/deps/deno.land/std@0.217.0/assert/assert_almost_equals.d.ts.map +0 -1
  270. package/script/deps/deno.land/std@0.217.0/assert/assert_array_includes.d.ts.map +0 -1
  271. package/script/deps/deno.land/std@0.217.0/assert/assert_equals.d.ts.map +0 -1
  272. package/script/deps/deno.land/std@0.217.0/assert/assert_exists.d.ts.map +0 -1
  273. package/script/deps/deno.land/std@0.217.0/assert/assert_false.d.ts.map +0 -1
  274. package/script/deps/deno.land/std@0.217.0/assert/assert_greater.d.ts.map +0 -1
  275. package/script/deps/deno.land/std@0.217.0/assert/assert_greater_or_equal.d.ts.map +0 -1
  276. package/script/deps/deno.land/std@0.217.0/assert/assert_instance_of.d.ts.map +0 -1
  277. package/script/deps/deno.land/std@0.217.0/assert/assert_is_error.d.ts.map +0 -1
  278. package/script/deps/deno.land/std@0.217.0/assert/assert_less.d.ts.map +0 -1
  279. package/script/deps/deno.land/std@0.217.0/assert/assert_less_or_equal.d.ts.map +0 -1
  280. package/script/deps/deno.land/std@0.217.0/assert/assert_match.d.ts.map +0 -1
  281. package/script/deps/deno.land/std@0.217.0/assert/assert_not_equals.d.ts.map +0 -1
  282. package/script/deps/deno.land/std@0.217.0/assert/assert_not_instance_of.d.ts.map +0 -1
  283. package/script/deps/deno.land/std@0.217.0/assert/assert_not_match.d.ts.map +0 -1
  284. package/script/deps/deno.land/std@0.217.0/assert/assert_not_strict_equals.d.ts.map +0 -1
  285. package/script/deps/deno.land/std@0.217.0/assert/assert_object_match.d.ts.map +0 -1
  286. package/script/deps/deno.land/std@0.217.0/assert/assert_rejects.d.ts.map +0 -1
  287. package/script/deps/deno.land/std@0.217.0/assert/assert_strict_equals.d.ts.map +0 -1
  288. package/script/deps/deno.land/std@0.217.0/assert/assert_string_includes.d.ts.map +0 -1
  289. package/script/deps/deno.land/std@0.217.0/assert/assert_throws.d.ts.map +0 -1
  290. package/script/deps/deno.land/std@0.217.0/assert/assertion_error.d.ts.map +0 -1
  291. package/script/deps/deno.land/std@0.217.0/assert/equal.d.ts.map +0 -1
  292. package/script/deps/deno.land/std@0.217.0/assert/fail.d.ts.map +0 -1
  293. package/script/deps/deno.land/std@0.217.0/assert/mod.d.ts.map +0 -1
  294. package/script/deps/deno.land/std@0.217.0/assert/unimplemented.d.ts.map +0 -1
  295. package/script/deps/deno.land/std@0.217.0/assert/unreachable.d.ts.map +0 -1
  296. package/script/deps/deno.land/std@0.217.0/fmt/colors.d.ts.map +0 -1
  297. package/script/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts.map +0 -1
  298. package/script/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts.map +0 -1
  299. package/script/deps/jsr.io/@std/assert/1.0.10/assert.d.ts.map +0 -1
  300. package/script/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts.map +0 -1
  301. package/script/deps/jsr.io/@std/assert/1.0.10/equal.d.ts.map +0 -1
  302. package/script/deps/jsr.io/@std/assert/1.0.10/equals.d.ts.map +0 -1
  303. package/script/deps/jsr.io/@std/assert/1.0.10/exists.d.ts.map +0 -1
  304. package/script/deps/jsr.io/@std/assert/1.0.10/fail.d.ts.map +0 -1
  305. package/script/deps/jsr.io/@std/assert/1.0.10/false.d.ts.map +0 -1
  306. package/script/deps/jsr.io/@std/assert/1.0.10/greater.d.ts.map +0 -1
  307. package/script/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts.map +0 -1
  308. package/script/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts.map +0 -1
  309. package/script/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts.map +0 -1
  310. package/script/deps/jsr.io/@std/assert/1.0.10/less.d.ts.map +0 -1
  311. package/script/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts.map +0 -1
  312. package/script/deps/jsr.io/@std/assert/1.0.10/match.d.ts.map +0 -1
  313. package/script/deps/jsr.io/@std/assert/1.0.10/mod.d.ts.map +0 -1
  314. package/script/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts.map +0 -1
  315. package/script/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts.map +0 -1
  316. package/script/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts.map +0 -1
  317. package/script/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts.map +0 -1
  318. package/script/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts.map +0 -1
  319. package/script/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts.map +0 -1
  320. package/script/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts.map +0 -1
  321. package/script/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts.map +0 -1
  322. package/script/deps/jsr.io/@std/assert/1.0.10/throws.d.ts.map +0 -1
  323. package/script/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts.map +0 -1
  324. package/script/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts.map +0 -1
  325. package/script/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts.map +0 -1
  326. package/script/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +0 -1
  327. package/script/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +0 -1
  328. package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +0 -1
  329. package/script/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +0 -1
  330. package/script/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +0 -1
  331. package/script/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +0 -1
  332. package/script/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts.map +0 -1
  333. package/script/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts.map +0 -1
  334. package/script/mod.d.ts +0 -5
  335. package/script/mod.d.ts.map +0 -1
  336. package/script/mod.js +0 -20
  337. package/script/package.json +0 -3
  338. package/script/src/config/config_service.d.ts +0 -11
  339. package/script/src/config/config_service.d.ts.map +0 -1
  340. package/script/src/config/config_service.js +0 -23
  341. package/script/src/config/index.d.ts +0 -2
  342. package/script/src/config/index.d.ts.map +0 -1
  343. package/script/src/config/index.js +0 -17
  344. package/script/src/data/banks_tz.d.ts +0 -7
  345. package/script/src/data/banks_tz.d.ts.map +0 -1
  346. package/script/src/data/banks_tz.js +0 -199
  347. package/script/src/data/countries.d.ts +0 -39
  348. package/script/src/data/countries.d.ts.map +0 -1
  349. package/script/src/data/countries.js +0 -2477
  350. package/script/src/data/currencies.d.ts +0 -1901
  351. package/script/src/data/currencies.d.ts.map +0 -1
  352. package/script/src/data/currencies.js +0 -1075
  353. package/script/src/data/phone_patterns.d.ts +0 -3809
  354. package/script/src/data/phone_patterns.d.ts.map +0 -1
  355. package/script/src/data/phone_patterns.js +0 -2327
  356. package/script/src/models/amount/amount.d.ts +0 -53
  357. package/script/src/models/amount/amount.d.ts.map +0 -1
  358. package/script/src/models/amount/amount.js +0 -194
  359. package/script/src/models/amount/amount.test.d.ts.map +0 -1
  360. package/script/src/models/amount/antd_validator.d.ts +0 -40
  361. package/script/src/models/amount/antd_validator.d.ts.map +0 -1
  362. package/script/src/models/amount/antd_validator.js +0 -62
  363. package/script/src/models/amount/antd_validator.test.d.ts.map +0 -1
  364. package/script/src/models/amount/index.d.ts +0 -3
  365. package/script/src/models/amount/index.d.ts.map +0 -1
  366. package/script/src/models/amount/index.js +0 -18
  367. package/script/src/models/bank/antd_validator.d.ts +0 -11
  368. package/script/src/models/bank/antd_validator.d.ts.map +0 -1
  369. package/script/src/models/bank/antd_validator.js +0 -30
  370. package/script/src/models/bank/antd_validator.test.d.ts.map +0 -1
  371. package/script/src/models/bank/bank.d.ts +0 -257
  372. package/script/src/models/bank/bank.d.ts.map +0 -1
  373. package/script/src/models/bank/bank.js +0 -458
  374. package/script/src/models/bank/bank.test.d.ts.map +0 -1
  375. package/script/src/models/bank/index.d.ts +0 -5
  376. package/script/src/models/bank/index.d.ts.map +0 -1
  377. package/script/src/models/bank/index.js +0 -20
  378. package/script/src/models/bank/types.d.ts +0 -7
  379. package/script/src/models/bank/types.d.ts.map +0 -1
  380. package/script/src/models/bank/types.js +0 -48
  381. package/script/src/models/bank/utils.d.ts +0 -8
  382. package/script/src/models/bank/utils.d.ts.map +0 -1
  383. package/script/src/models/bank/utils.js +0 -12
  384. package/script/src/models/country/country.d.ts +0 -822
  385. package/script/src/models/country/country.d.ts.map +0 -1
  386. package/script/src/models/country/country.js +0 -745
  387. package/script/src/models/country/country.test.d.ts.map +0 -1
  388. package/script/src/models/country/index.d.ts +0 -4
  389. package/script/src/models/country/index.d.ts.map +0 -1
  390. package/script/src/models/country/index.js +0 -19
  391. package/script/src/models/country/types.d.ts.map +0 -1
  392. package/script/src/models/country/types.js +0 -108
  393. package/script/src/models/country/utils.d.ts +0 -21
  394. package/script/src/models/country/utils.d.ts.map +0 -1
  395. package/script/src/models/country/utils.js +0 -30
  396. package/script/src/models/currency/currency.d.ts +0 -465
  397. package/script/src/models/currency/currency.d.ts.map +0 -1
  398. package/script/src/models/currency/currency.js +0 -479
  399. package/script/src/models/currency/currency.test.d.ts.map +0 -1
  400. package/script/src/models/currency/index.d.ts +0 -4
  401. package/script/src/models/currency/index.d.ts.map +0 -1
  402. package/script/src/models/currency/index.js +0 -19
  403. package/script/src/models/currency/types.d.ts.map +0 -1
  404. package/script/src/models/currency/types.js +0 -31
  405. package/script/src/models/currency/utils.d.ts +0 -8
  406. package/script/src/models/currency/utils.d.ts.map +0 -1
  407. package/script/src/models/currency/utils.js +0 -12
  408. package/script/src/models/index.d.ts +0 -6
  409. package/script/src/models/index.d.ts.map +0 -1
  410. package/script/src/models/index.js +0 -21
  411. package/script/src/models/phone_number/format.d.ts +0 -13
  412. package/script/src/models/phone_number/format.d.ts.map +0 -1
  413. package/script/src/models/phone_number/format.js +0 -16
  414. package/script/src/models/phone_number/global/phone_number.d.ts +0 -162
  415. package/script/src/models/phone_number/global/phone_number.d.ts.map +0 -1
  416. package/script/src/models/phone_number/global/phone_number.js +0 -463
  417. package/script/src/models/phone_number/global/phone_number.test.d.ts.map +0 -1
  418. package/script/src/models/phone_number/global/service.d.ts +0 -267
  419. package/script/src/models/phone_number/global/service.d.ts.map +0 -1
  420. package/script/src/models/phone_number/global/service.js +0 -506
  421. package/script/src/models/phone_number/global/service.test.d.ts.map +0 -1
  422. package/script/src/models/phone_number/index.d.ts +0 -6
  423. package/script/src/models/phone_number/index.d.ts.map +0 -1
  424. package/script/src/models/phone_number/index.js +0 -21
  425. package/script/src/models/phone_number/tz/antd_validator.d.ts +0 -77
  426. package/script/src/models/phone_number/tz/antd_validator.d.ts.map +0 -1
  427. package/script/src/models/phone_number/tz/antd_validator.js +0 -94
  428. package/script/src/models/phone_number/tz/antdvalidator.test.d.ts.map +0 -1
  429. package/script/src/models/phone_number/tz/network_operator.d.ts +0 -30
  430. package/script/src/models/phone_number/tz/network_operator.d.ts.map +0 -1
  431. package/script/src/models/phone_number/tz/network_operator.js +0 -50
  432. package/script/src/models/phone_number/tz/phone_number.d.ts +0 -141
  433. package/script/src/models/phone_number/tz/phone_number.d.ts.map +0 -1
  434. package/script/src/models/phone_number/tz/phone_number.js +0 -294
  435. package/script/src/models/phone_number/tz/phone_number.test.d.ts.map +0 -1
  436. package/script/src/reports/index.d.ts +0 -2
  437. package/script/src/reports/index.d.ts.map +0 -1
  438. package/script/src/reports/index.js +0 -17
  439. package/script/src/reports/report_manager.d.ts +0 -146
  440. package/script/src/reports/report_manager.d.ts.map +0 -1
  441. package/script/src/reports/report_manager.js +0 -336
  442. package/script/src/utils/id.d.ts.map +0 -1
  443. package/script/src/utils/id.js +0 -23
  444. package/script/src/utils/index.d.ts +0 -4
  445. package/script/src/utils/index.d.ts.map +0 -1
  446. package/script/src/utils/index.js +0 -19
  447. package/script/src/utils/text.d.ts +0 -32
  448. package/script/src/utils/text.d.ts.map +0 -1
  449. package/script/src/utils/text.js +0 -75
  450. package/script/src/utils/text.test.d.ts.map +0 -1
  451. package/script/src/utils/time.d.ts.map +0 -1
  452. package/script/src/utils/time.js +0 -39
@@ -0,0 +1,57 @@
1
+ import type { ISO2CountryCode } from "@domain/country/country.types.js";
2
+ import type { PhoneNumber as LibPhoneNumberInstance } from "libphonenumber-js";
3
+ import { type ParsedPhoneNumber, PhoneNumberParser } from "./phone-number.parser.js";
4
+ import type { PhoneNumberJSON } from "./phone-number.schema.js";
5
+ import { PhoneNumberFormat, type PhoneNumberParseOptions, type PhoneNumberType } from "./phone-number.types.js";
6
+ /**
7
+ * Internal symbol used by PhoneNumberFactory to bypass the protected constructor.
8
+ * Importing this from outside the factory is unsupported.
9
+ */
10
+ export declare const PhoneNumberConstructorToken: unique symbol;
11
+ /**
12
+ * Plain-object representation of a PhoneNumber containing the full state.
13
+ */
14
+ export interface PhoneNumberObject {
15
+ e164Format: string;
16
+ countryCode: ISO2CountryCode;
17
+ compactNumber: string;
18
+ numberType?: PhoneNumberType;
19
+ }
20
+ /**
21
+ * Pure value object representing a validated international phone number.
22
+ * Parsing/formatting goes through libphonenumber-js via the internal parser;
23
+ * factories and validation live on PhoneNumberFactory.
24
+ */
25
+ export declare class PhoneNumber {
26
+ readonly countryCode: ISO2CountryCode;
27
+ readonly compactNumber: string;
28
+ readonly e164Format: string;
29
+ private readonly _parser;
30
+ private readonly _parsedInfo;
31
+ constructor(token: symbol, parsedInfo: ParsedPhoneNumber, parser: PhoneNumberParser);
32
+ /** Validates the phone number using the underlying library. */
33
+ validate(): boolean;
34
+ /** Formats the phone number using the requested style. */
35
+ getWithFormat(format: PhoneNumberFormat): string;
36
+ /** Returns the type of phone number (e.g. MOBILE, FIXED_LINE) when known. */
37
+ getNumberType(): PhoneNumberType | undefined;
38
+ /** Human-readable label, the international format. */
39
+ get label(): string;
40
+ /** Underlying instance from libphonenumber-js, exposed for advanced use. */
41
+ get underlyingInstance(): LibPhoneNumberInstance;
42
+ /** E.164 string. */
43
+ toString(): string;
44
+ /** Compact JSON identity for serialization. */
45
+ toJSON(): PhoneNumberJSON;
46
+ toJSONString(): string;
47
+ /** Full plain-object dump of all current state. */
48
+ toObject(): PhoneNumberObject;
49
+ /** Parses a phone number string into a validated PhoneNumber. */
50
+ static from(input: string, options?: PhoneNumberParseOptions): PhoneNumber | undefined;
51
+ /** Re-resolves a PhoneNumber from its compact JSON identity. */
52
+ static fromJSON(json: PhoneNumberJSON | string): PhoneNumber | undefined;
53
+ /** Re-resolves a PhoneNumber from a JSON string. */
54
+ static fromJSONString(jsonString: string): PhoneNumber | undefined;
55
+ /** Type guard delegating to PhoneNumberFactory.isPhoneNumber. */
56
+ static is(obj: unknown): obj is PhoneNumber;
57
+ }
@@ -0,0 +1,67 @@
1
+ import type { CountryCode } from "@domain/country/country.types.js";
2
+ export declare const phoneLogger: import("pino").Logger<never, boolean>;
3
+ export declare const PhoneNumberHelpers: {
4
+ /**
5
+ * Removes all whitespace characters from the given string.
6
+ *
7
+ * @param {string} input - The input string.
8
+ * @returns {string} String with whitespace removed.
9
+ *
10
+ * @example
11
+ * removeSpaces(" 0712 345 678 ") // "0712345678"
12
+ * removeSpaces(" +255 712 345 678") // "+255712345678"
13
+ */
14
+ removeSpaces: (input: string) => string;
15
+ /**
16
+ * Strips all formatting characters used to enhance readability in phone numbers.
17
+ * Preserves only digits and an optional leading '+' if present.
18
+ *
19
+ * Characters removed include:
20
+ * - Whitespace: space, tab, non-breaking space
21
+ * - Hyphens, dots, slashes: `-`, `.`, `/`
22
+ * - Brackets: `(`, `)`
23
+ * - URI prefix: `tel:`
24
+ * - Extensions like `ext.`, `x`, or `#` and following digits
25
+ *
26
+ * @param {string} input - The phone number string to strip.
27
+ * @returns {string} A cleaned string with only digits and optional '+' prefix.
28
+ *
29
+ * @example
30
+ * stripFormattingCharacters("tel:+255 (712) 345-678") // "+255712345678"
31
+ * stripFormattingCharacters("0712-345-678 x99") // "0712345678"
32
+ * stripFormattingCharacters("(+255) 712/345.678 ext. 9") // "+255712345678"
33
+ * stripFormattingCharacters("712abc345678") // "712abc345678"
34
+ */
35
+ stripFormattingCharacters: (input: string) => string;
36
+ /**
37
+ * Normalizes a phone number string by:
38
+ * - Removing all special characters and spaces
39
+ * - Preserving only digits and a leading '+'
40
+ * - Ensuring the result starts with a '+' wherever appropriate
41
+ * - Handling national numbers when default country is provided
42
+ * - Removing leading '0' when it's a national number prefix
43
+ *
44
+ * @param {string} input - The phone number string to normalize
45
+ * @param {CountryCode} [defaultCountry] - Optional default country code
46
+ * @returns {string} The normalized phone number string
47
+ * @throws {Error} If invalid country code provided
48
+ *
49
+ * @example
50
+ * normalizePhoneNumber("+255 (712) 345-678") // "+255712345678"
51
+ * normalizePhoneNumber("0712 345 678", "TZ") // "+255712345678"
52
+ * normalizePhoneNumber("255712345678") // "255712345678"
53
+ */
54
+ normalizePhoneNumber: (input: string, defaultCountry?: CountryCode) => string;
55
+ /**
56
+ * Checks if a string contains only digits or a `+` prefix followed by digits.
57
+ *
58
+ * @param {string} input - The input string.
59
+ * @returns {boolean} True if valid format, false otherwise.
60
+ *
61
+ * @example
62
+ * isOnlyDigitsOrPlus("+255712345678") // true
63
+ * isOnlyDigitsOrPlus("0712345678") // true
64
+ * isOnlyDigitsOrPlus("+255-712-345-678") // false
65
+ */
66
+ isOnlyDigitsOrPlus: (input: string) => boolean;
67
+ };
@@ -0,0 +1,43 @@
1
+ import { type NumberType, type PhoneNumber as LibPhoneNumber } from "libphonenumber-js/max";
2
+ import { PhoneNumberFormat } from "./phone-number.types.js";
3
+ import type { ISO2CountryCode } from "@domain/country/country.types.js";
4
+ export interface ParsedPhoneNumber {
5
+ libInstance: LibPhoneNumber;
6
+ countryCode: ISO2CountryCode | undefined;
7
+ compactNumber: string;
8
+ e164Format: string;
9
+ isValid: boolean;
10
+ numberType: NumberType | undefined;
11
+ }
12
+ /**
13
+ * Internal adapter around libphonenumber-js.
14
+ *
15
+ * This parser is intentionally not exported as a public domain service. The
16
+ * PhoneNumber model uses it to keep library-specific parsing and formatting
17
+ * details outside the value object.
18
+ */
19
+ export declare class PhoneNumberParser {
20
+ private static instance;
21
+ private constructor();
22
+ static getInstance(): PhoneNumberParser;
23
+ /**
24
+ * Parses a phone number string using libphonenumber-js.
25
+ * @param numberToParse The raw phone number string.
26
+ * @param defaultCountry Optional default country code.
27
+ * @returns A ParsedPhoneNumber object if successful, otherwise undefined.
28
+ */
29
+ parse(numberToParse: string, defaultCountry?: ISO2CountryCode): ParsedPhoneNumber | undefined;
30
+ /**
31
+ * Validates a previously parsed LibPhoneNumber instance.
32
+ * @param libInstance The LibPhoneNumber instance from libphonenumber-js.
33
+ * @returns True if the number is considered valid by the library.
34
+ */
35
+ isValid(libInstance: LibPhoneNumber | undefined): boolean;
36
+ /**
37
+ * Formats a previously parsed LibPhoneNumber instance.
38
+ * @param libInstance The LibPhoneNumber instance from libphonenumber-js.
39
+ * @param formatType Our local PhoneNumberFormat enum value.
40
+ * @returns The formatted string, or the E.164 format as fallback.
41
+ */
42
+ format(libInstance: LibPhoneNumber | undefined, formatType: PhoneNumberFormat): string;
43
+ }
@@ -0,0 +1,21 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Compact JSON identity for a PhoneNumber, sufficient to re-resolve the value
4
+ * via PhoneNumberFactory.
5
+ *
6
+ * E.164 validation rules:
7
+ * - Starts with '+'
8
+ * - Followed by country code (1-3 digits, first digit 1-9)
9
+ * - Total length 8-16 characters including '+'
10
+ */
11
+ export declare const PhoneNumberJSONSchema: z.ZodObject<{
12
+ e164Format: z.ZodString;
13
+ version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
14
+ }, "strip", z.ZodTypeAny, {
15
+ version: string;
16
+ e164Format: string;
17
+ }, {
18
+ e164Format: string;
19
+ version?: string | undefined;
20
+ }>;
21
+ export type PhoneNumberJSON = z.infer<typeof PhoneNumberJSONSchema>;
@@ -0,0 +1,72 @@
1
+ import { ISO2CountryCode } from "@domain/country/country.types.js";
2
+ /**
3
+ * Enumeration for various phone number formats used for display and processing.
4
+ */
5
+ export declare enum PhoneNumberFormat {
6
+ /**
7
+ * International format, typically used for display.
8
+ * Includes '+' and country code, may include spacing for readability.
9
+ * (e.g., +1 202 555 0123)
10
+ * Note: Exact spacing might vary based on library implementation or locale.
11
+ */
12
+ INTERNATIONAL = "INTERNATIONAL",
13
+ /**
14
+ * National format, typically including national prefix (like '0') and local spacing.
15
+ * Formatting varies significantly by country.
16
+ * (e.g., 0712 345 678 for TZ, (213) 373-4253 for US)
17
+ */
18
+ NATIONAL = "NATIONAL",
19
+ /**
20
+ * Compact national format (National Significant Number).
21
+ * Typically digits only, without country code or national prefix '0'.
22
+ * (e.g., 712345678 for TZ, 2133734253 for US)
23
+ */
24
+ COMPACT = "COMPACT",
25
+ /**
26
+ * RFC3966 URI format for telephone numbers.
27
+ * (e.g., tel:+1-202-555-0123 or tel:+255712345678)
28
+ */
29
+ RFC3966 = "RFC3966",
30
+ /**
31
+ * Strict E.164 format. Includes '+' and country code, followed only by digits
32
+ * with no spacing or formatting characters. Globally unique.
33
+ * (e.g., +12025550123, +255712345678)
34
+ */
35
+ E164 = "E164",
36
+ /**
37
+ * International numeric format without the '+' prefix.
38
+ * Includes country code followed by the National Significant Number (NSN),
39
+ * digits only, with no formatting characters or separators.
40
+ * Commonly used in storage, logging, or systems where '+' is unnecessary or undesirable.
41
+ * (e.g., 12025550123, 255712345678)
42
+ */
43
+ INTERNATIONAL_NUMERIC = "INTERNATIONAL_NUMERIC"
44
+ }
45
+ /**
46
+ * Represents the type of a phone number, mimicking the classification
47
+ * used by the underlying libphonenumber-js library.
48
+ */
49
+ export declare enum PhoneNumberType {
50
+ FIXED_LINE = "FIXED_LINE",
51
+ MOBILE = "MOBILE",
52
+ FIXED_LINE_OR_MOBILE = "FIXED_LINE_OR_MOBILE",// Indicates ambiguity between fixed line and mobile
53
+ TOLL_FREE = "TOLL_FREE",
54
+ PREMIUM_RATE = "PREMIUM_RATE",
55
+ SHARED_COST = "SHARED_COST",
56
+ VOIP = "VOIP",// Voice over IP
57
+ PERSONAL_NUMBER = "PERSONAL_NUMBER",
58
+ PAGER = "PAGER",
59
+ UAN = "UAN",// Universal Access Number
60
+ VOICEMAIL = "VOICEMAIL",
61
+ UNKNOWN = "UNKNOWN"
62
+ }
63
+ /**
64
+ * Options for parsing phone numbers
65
+ */
66
+ export interface PhoneNumberParseOptions {
67
+ /**
68
+ * Default country ISO code to use when parsing a non-international number,
69
+ * or when a dial code is shared by multiple countries.
70
+ */
71
+ defaultCountry?: ISO2CountryCode;
72
+ }
@@ -0,0 +1,50 @@
1
+ import { Amount } from "@domain/amount/amount.js";
2
+ import { type AmountJSON } from "@domain/amount/amount.schema.js";
3
+ import type { CurrencyCode } from "@domain/currency/currency.types.js";
4
+ /**
5
+ * Owns Amount construction, parsing, validation, and aggregate operations.
6
+ * Resolves currencies through CurrencyRegistry; never owns currency data itself.
7
+ */
8
+ export declare class AmountFactory {
9
+ private static instance;
10
+ private readonly currencyRegistry;
11
+ private constructor();
12
+ static getInstance(): AmountFactory;
13
+ /**
14
+ * Parses arbitrary input into a validated Amount. Accepts numeric values or
15
+ * strings (including currency-prefixed strings like "TZS1000").
16
+ */
17
+ create(input: string | number, currencyCode?: CurrencyCode | null): Amount | undefined;
18
+ /**
19
+ * Builds an Amount from a numeric value and currency code, rounding to the
20
+ * currency's native decimal precision.
21
+ */
22
+ createFromNumber(value: number, currencyCode: CurrencyCode): Amount | undefined;
23
+ /** Re-resolves an Amount from its compact JSON identity. */
24
+ createFromJSON(json: AmountJSON | string): Amount | undefined;
25
+ /** Re-resolves an Amount from a JSON string. */
26
+ createFromJSONString(jsonString: string): Amount | undefined;
27
+ /** Whether the input can be resolved to a valid Amount. */
28
+ canCreate(input?: string | number | null, currencyCode?: CurrencyCode): boolean;
29
+ /**
30
+ * Type guard that an unknown value is a valid Amount instance whose
31
+ * (value, currency) round-trips through `create`.
32
+ */
33
+ isAmount(obj: unknown): obj is Amount;
34
+ /** Type guard for the compact AmountJSON shape. */
35
+ isAmountJSON(obj: unknown): obj is AmountJSON;
36
+ /** Verifies that an Amount instance can still be reconstructed cleanly. */
37
+ validate(amount: Amount): boolean;
38
+ /** Sum of every Amount, requiring matching currencies. */
39
+ sum(amounts: Amount[]): Amount;
40
+ /** Mean of every Amount, requiring matching currencies and non-empty array. */
41
+ average(amounts: Amount[]): Amount;
42
+ /** Smallest Amount in the array (most negative wins). */
43
+ min(amounts: Amount[]): Amount;
44
+ /** Largest Amount in the array. */
45
+ max(amounts: Amount[]): Amount;
46
+ /** Builds an Amount by validating a numeric string and currency code. */
47
+ private createFromString;
48
+ /** Resolves a (possibly mixed-case) currency code to its canonical form. */
49
+ private normalizeCurrencyCode;
50
+ }
@@ -0,0 +1,47 @@
1
+ import { Bank, type BankJSON } from "@domain/bank/bank.js";
2
+ import type { BankSwiftCode } from "@domain/bank/bank.types.js";
3
+ import type { ISO2CountryCode } from "@domain/country/country.types.js";
4
+ import { type RawBank } from "@repositories/bank.repository.js";
5
+ /**
6
+ * Constructs Bank model instances from raw bank records.
7
+ *
8
+ * Registries own lookup/caching; this factory is the only layer that should
9
+ * call the Bank constructor.
10
+ */
11
+ export declare class BankFactory {
12
+ private readonly repository;
13
+ private static instance;
14
+ private constructor();
15
+ static getInstance(): BankFactory;
16
+ /**
17
+ * Resolves a Bank by BIC. When `countryCode` is provided the lookup is
18
+ * scoped to that country; otherwise the repository searches across every
19
+ * supported country (and falls back to inferring the country from the BIC).
20
+ */
21
+ create(bic: BankSwiftCode | string, countryCode?: ISO2CountryCode): Bank | undefined;
22
+ /**
23
+ * Builds a Bank directly from a raw bank record. Returns undefined if the
24
+ * record is missing required fields (officialName / shortName / bic).
25
+ */
26
+ createFromRaw(raw: RawBank, countryCode: ISO2CountryCode): Bank | undefined;
27
+ /** Re-resolves a Bank from its compact JSON identity. */
28
+ createFromJSON(json: BankJSON | string): Bank | undefined;
29
+ /** Re-resolves a Bank from a JSON string. */
30
+ createFromJSONString(jsonString: string): Bank | undefined;
31
+ /** Whether the input BIC can be resolved to a known Bank. */
32
+ canCreate(bic?: string | null, countryCode?: ISO2CountryCode): boolean;
33
+ /**
34
+ * Type guard that an unknown value is a known Bank instance whose
35
+ * (bic, countryCode) round-trips through the repository.
36
+ */
37
+ isBank(obj: unknown): obj is Bank;
38
+ /** Type guard for the compact BankJSON shape. */
39
+ isBankJSON(obj: unknown): obj is BankJSON;
40
+ /** Parses a JSON value or string into a validated BankJSON. */
41
+ private parseJSON;
42
+ /**
43
+ * SWIFT codes encode the country in characters 5-6. This is used as a fallback
44
+ * when the caller didn't supply `countryCode` to `create`.
45
+ */
46
+ private getCountryCodeFromBIC;
47
+ }
@@ -0,0 +1,40 @@
1
+ import { Country, type CountryJSON } from "@domain/country/country.js";
2
+ import { CountryCode } from "@domain/country/country.types.js";
3
+ import { type RawCountry } from "@repositories/country.repository.js";
4
+ /**
5
+ * Constructs Country model instances from raw country records.
6
+ *
7
+ * Registries own lookup/caching; this factory is the only layer that should
8
+ * call the Country constructor.
9
+ */
10
+ export declare class CountryFactory {
11
+ private readonly repository;
12
+ private static instance;
13
+ private constructor();
14
+ static getInstance(): CountryFactory;
15
+ /**
16
+ * Resolves a Country by ISO-2 or ISO-3 code (case-insensitive). Returns
17
+ * undefined when the code is not in the dataset.
18
+ */
19
+ create(countryCode: CountryCode | string): Country | undefined;
20
+ /**
21
+ * Builds a Country directly from a raw country record. The continent and
22
+ * sub-region strings are normalised to their enum equivalents.
23
+ */
24
+ createFromRaw(raw: RawCountry): Country;
25
+ /** Re-resolves a Country from its compact JSON identity. */
26
+ createFromJSON(json: CountryJSON | string): Country | undefined;
27
+ /** Re-resolves a Country from a JSON string. */
28
+ createFromJSONString(jsonString: string): Country | undefined;
29
+ /** Whether the input string can be resolved to a known Country. */
30
+ canCreate(input?: string | null): boolean;
31
+ /**
32
+ * Type guard that an unknown value is a known Country instance whose
33
+ * private name/iso2/iso3 fields match the canonical record.
34
+ */
35
+ isCountry(obj: unknown): obj is Country;
36
+ /** Type guard for the compact CountryJSON shape. */
37
+ isCountryJSON(obj: unknown): obj is CountryJSON;
38
+ /** Parses a JSON value or string into a validated CountryJSON. */
39
+ private parseJSON;
40
+ }
@@ -0,0 +1,40 @@
1
+ import { Currency, type CurrencyJSON } from "@domain/currency/currency.js";
2
+ import { CurrencyCode } from "@domain/currency/currency.types.js";
3
+ import { type RawCurrency } from "@repositories/currency.repository.js";
4
+ /**
5
+ * Constructs Currency model instances from validated raw records.
6
+ *
7
+ * Registries own lookup/caching; this factory is the only layer that should
8
+ * call the Currency constructor.
9
+ */
10
+ export declare class CurrencyFactory {
11
+ private readonly repository;
12
+ private static instance;
13
+ private constructor();
14
+ static getInstance(): CurrencyFactory;
15
+ /**
16
+ * Resolves a Currency by ISO 4217 code (case-insensitive). Returns
17
+ * undefined when the code is not in the dataset.
18
+ */
19
+ create(code: CurrencyCode | string): Currency | undefined;
20
+ /**
21
+ * Builds a Currency directly from a raw currency record. Returns undefined
22
+ * if the record's code isn't a valid ISO 4217 code.
23
+ */
24
+ createFromRaw(raw: RawCurrency): Currency | undefined;
25
+ /** Re-resolves a Currency from its compact JSON identity. */
26
+ createFromJSON(json: CurrencyJSON | string): Currency | undefined;
27
+ /** Re-resolves a Currency from a JSON string. */
28
+ createFromJSONString(jsonString: string): Currency | undefined;
29
+ /** Whether the input string can be resolved to a known Currency. */
30
+ canCreate(input?: string | null): boolean;
31
+ /**
32
+ * Type guard that an unknown value is a known Currency instance whose
33
+ * private fields match the dataset.
34
+ */
35
+ isCurrency(obj: unknown): obj is Currency;
36
+ /** Type guard for the compact CurrencyJSON shape. */
37
+ isCurrencyJSON(obj: unknown): obj is CurrencyJSON;
38
+ /** Parses a JSON value or string into a validated CurrencyJSON. */
39
+ private parseJSON;
40
+ }
@@ -0,0 +1,7 @@
1
+ export * from "./amount.factory.js";
2
+ export * from "./bank.factory.js";
3
+ export * from "./country.factory.js";
4
+ export * from "./currency.factory.js";
5
+ export * from "./mobile-money-provider.factory.js";
6
+ export * from "./phone-number.factory.js";
7
+ export * from "./transaction-limit.factory.js";
@@ -0,0 +1,43 @@
1
+ import type { ISO2CountryCode } from "@domain/country/country.types.js";
2
+ import type { CurrencyCode } from "@domain/currency/currency.types.js";
3
+ import { MobileMoneyProvider } from "@domain/mobile-money-provider/mobile-money-provider.js";
4
+ import { type MobileMoneyProviderJSON } from "@domain/mobile-money-provider/mobile-money-provider.schema.js";
5
+ import { type RawMobileMoneyProvider } from "@repositories/mobile-money-provider.repository.js";
6
+ /**
7
+ * Constructs MobileMoneyProvider model instances from raw provider records.
8
+ *
9
+ * Registries own lookup/caching; this factory is the only layer that should
10
+ * call the MobileMoneyProvider constructor.
11
+ */
12
+ export declare class MobileMoneyProviderFactory {
13
+ private readonly repository;
14
+ private static instance;
15
+ private constructor();
16
+ static getInstance(): MobileMoneyProviderFactory;
17
+ /**
18
+ * Resolves a MobileMoneyProvider by ID. When `countryCode` is provided the
19
+ * lookup is scoped to that country; otherwise the repository searches across
20
+ * every supported country.
21
+ */
22
+ create(id: string, countryCode?: ISO2CountryCode): MobileMoneyProvider | undefined;
23
+ /**
24
+ * Builds a MobileMoneyProvider directly from a raw provider record plus the
25
+ * country/currency context (typically supplied by the repository or registry).
26
+ */
27
+ createFromRaw(raw: RawMobileMoneyProvider, countryCode: ISO2CountryCode, currencyCode: CurrencyCode): MobileMoneyProvider;
28
+ /** Re-resolves a MobileMoneyProvider from its compact JSON identity. */
29
+ createFromJSON(json: MobileMoneyProviderJSON | string): MobileMoneyProvider | undefined;
30
+ /** Re-resolves a MobileMoneyProvider from a JSON string. */
31
+ createFromJSONString(jsonString: string): MobileMoneyProvider | undefined;
32
+ /** Whether the input ID can be resolved to a known MobileMoneyProvider. */
33
+ canCreate(input?: string | null, countryCode?: ISO2CountryCode): boolean;
34
+ /**
35
+ * Type guard that an unknown value is a known MobileMoneyProvider instance
36
+ * whose (id, countryCode) round-trips through `create`.
37
+ */
38
+ isMobileMoneyProvider(obj: unknown): obj is MobileMoneyProvider;
39
+ /** Type guard for the compact MobileMoneyProviderJSON shape. */
40
+ isMobileMoneyProviderJSON(obj: unknown): obj is MobileMoneyProviderJSON;
41
+ /** Parses a JSON value or string into a validated MobileMoneyProviderJSON. */
42
+ private parseJSON;
43
+ }
@@ -0,0 +1,31 @@
1
+ import { PhoneNumber } from "@domain/phone-number/phone-number.js";
2
+ import { type PhoneNumberJSON } from "@domain/phone-number/phone-number.schema.js";
3
+ import type { PhoneNumberParseOptions } from "@domain/phone-number/phone-number.types.js";
4
+ /**
5
+ * Owns PhoneNumber construction and validation. The model has no dataset, so
6
+ * there is no PhoneNumberRepository; the factory composes the parser directly.
7
+ */
8
+ export declare class PhoneNumberFactory {
9
+ private static instance;
10
+ private readonly parser;
11
+ private constructor();
12
+ static getInstance(): PhoneNumberFactory;
13
+ /**
14
+ * Parses arbitrary input into a validated PhoneNumber. Returns undefined when
15
+ * the input cannot be parsed or fails country-aware validation.
16
+ */
17
+ create(input: string, options?: PhoneNumberParseOptions): PhoneNumber | undefined;
18
+ /** Re-resolves a PhoneNumber from its compact JSON identity. */
19
+ createFromJSON(json: PhoneNumberJSON | string): PhoneNumber | undefined;
20
+ /** Re-resolves a PhoneNumber from a JSON string. */
21
+ createFromJSONString(jsonString: string): PhoneNumber | undefined;
22
+ /** Whether the input string can be parsed and validated as a phone number. */
23
+ canCreate(input?: string | null, options?: PhoneNumberParseOptions): boolean;
24
+ /**
25
+ * Type guard that an unknown value is a valid PhoneNumber instance whose
26
+ * E.164 representation re-parses successfully.
27
+ */
28
+ isPhoneNumber(obj: unknown): obj is PhoneNumber;
29
+ /** Type guard for the compact PhoneNumberJSON shape. */
30
+ isPhoneNumberJSON(obj: unknown): obj is PhoneNumberJSON;
31
+ }
@@ -0,0 +1,36 @@
1
+ import type { ChannelType, TransactionDirection } from "@domain/channel/channel.enums.js";
2
+ import type { ISO2CountryCode } from "@domain/country/country.types.js";
3
+ import type { CurrencyCode } from "@domain/currency/currency.types.js";
4
+ import type { Amount } from "@domain/amount/amount.js";
5
+ import type { RawTransactionLimit } from "@repositories/transaction-limit.repository.js";
6
+ /**
7
+ * Amount-aware result returned to callers. Wraps the numeric repository values
8
+ * in `Amount` instances so consumers get currency-correct comparisons and
9
+ * formatting out of the box.
10
+ */
11
+ export interface TransactionLimits {
12
+ countryCode: ISO2CountryCode;
13
+ currencyCode: CurrencyCode;
14
+ direction: TransactionDirection;
15
+ channelType: ChannelType;
16
+ providerId?: string;
17
+ min: Amount;
18
+ max: Amount;
19
+ }
20
+ /**
21
+ * Converts raw numeric transaction-limit records into amount-aware domain
22
+ * objects. The repository returns numbers; this factory turns them into
23
+ * `Amount` instances by way of `AmountFactory`.
24
+ */
25
+ export declare class TransactionLimitFactory {
26
+ private static instance;
27
+ private readonly amountFactory;
28
+ private constructor();
29
+ static getInstance(): TransactionLimitFactory;
30
+ /**
31
+ * Wraps a raw transaction-limit record (numeric min/max) in a
32
+ * `TransactionLimits` object whose min/max are `Amount` instances. Returns
33
+ * undefined when either bound cannot be constructed (e.g. unknown currency).
34
+ */
35
+ createFromRaw(raw: RawTransactionLimit): TransactionLimits | undefined;
36
+ }