@temboplus/afloat 0.1.77-beta.9 → 0.1.79

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 (415) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +42 -246
  3. package/esm/mod.d.ts +8 -0
  4. package/esm/mod.d.ts.map +1 -0
  5. package/esm/mod.js +7 -0
  6. package/esm/package.json +3 -0
  7. package/{dist/lib/error/error.api.d.ts → esm/src/errors/api_error.d.ts} +1 -0
  8. package/esm/src/errors/api_error.d.ts.map +1 -0
  9. package/esm/src/errors/api_error.js +90 -0
  10. package/esm/src/errors/index.d.ts +3 -0
  11. package/esm/src/errors/index.d.ts.map +1 -0
  12. package/esm/src/errors/index.js +2 -0
  13. package/{dist/lib/error/error.permission.d.ts → esm/src/errors/permission_error.d.ts} +2 -1
  14. package/esm/src/errors/permission_error.d.ts.map +1 -0
  15. package/esm/src/errors/permission_error.js +70 -0
  16. package/{dist/modules/team-member/team-member.contract.d.ts → esm/src/features/admin/contract.d.ts} +158 -233
  17. package/esm/src/features/admin/contract.d.ts.map +1 -0
  18. package/esm/src/features/admin/contract.js +210 -0
  19. package/esm/src/features/admin/index.d.ts +4 -0
  20. package/esm/src/features/admin/index.d.ts.map +1 -0
  21. package/esm/src/features/admin/index.js +3 -0
  22. package/esm/src/features/admin/repository.d.ts +114 -0
  23. package/esm/src/features/admin/repository.d.ts.map +1 -0
  24. package/esm/src/features/admin/repository.js +248 -0
  25. package/esm/src/features/admin/schemas.d.ts +146 -0
  26. package/esm/src/features/admin/schemas.d.ts.map +1 -0
  27. package/esm/src/features/admin/schemas.js +206 -0
  28. package/esm/src/features/auth/access/contract.d.ts +14 -0
  29. package/esm/src/features/auth/access/contract.d.ts.map +1 -0
  30. package/esm/src/features/auth/access/contract.js +14 -0
  31. package/esm/src/features/auth/access/repository.d.ts +11 -0
  32. package/esm/src/features/auth/access/repository.d.ts.map +1 -0
  33. package/esm/src/features/auth/access/repository.js +25 -0
  34. package/{dist/modules/auth/auth.contract.d.ts → esm/src/features/auth/contract.d.ts} +19 -16
  35. package/esm/src/features/auth/contract.d.ts.map +1 -0
  36. package/esm/src/features/auth/contract.js +43 -0
  37. package/esm/src/features/auth/identity/contract.d.ts +23 -0
  38. package/esm/src/features/auth/identity/contract.d.ts.map +1 -0
  39. package/esm/src/features/auth/identity/contract.js +17 -0
  40. package/esm/src/features/auth/identity/repository.d.ts +22 -0
  41. package/esm/src/features/auth/identity/repository.d.ts.map +1 -0
  42. package/esm/src/features/auth/identity/repository.js +30 -0
  43. package/esm/src/features/auth/index.d.ts +6 -0
  44. package/esm/src/features/auth/index.d.ts.map +1 -0
  45. package/esm/src/features/auth/index.js +5 -0
  46. package/esm/src/features/auth/manager.d.ts +105 -0
  47. package/esm/src/features/auth/manager.d.ts.map +1 -0
  48. package/esm/src/features/auth/manager.js +181 -0
  49. package/{dist/modules/profile/profile.api-contract.d.ts → esm/src/features/auth/profile/contract.d.ts} +6 -8
  50. package/esm/src/features/auth/profile/contract.d.ts.map +1 -0
  51. package/esm/src/features/auth/profile/contract.js +14 -0
  52. package/esm/src/features/auth/profile/repository.d.ts +11 -0
  53. package/esm/src/features/auth/profile/repository.d.ts.map +1 -0
  54. package/esm/src/features/auth/profile/repository.js +25 -0
  55. package/esm/src/features/auth/repository.d.ts +30 -0
  56. package/esm/src/features/auth/repository.d.ts.map +1 -0
  57. package/esm/src/features/auth/repository.js +69 -0
  58. package/{dist/modules/auth/storage/client-store.d.ts → esm/src/features/auth/storage/client_store.d.ts} +2 -1
  59. package/esm/src/features/auth/storage/client_store.d.ts.map +1 -0
  60. package/esm/src/features/auth/storage/client_store.js +46 -0
  61. package/{dist/modules/auth/storage/client-token-handler.d.ts → esm/src/features/auth/storage/client_token_handler.d.ts} +1 -0
  62. package/esm/src/features/auth/storage/client_token_handler.d.ts.map +1 -0
  63. package/esm/src/features/auth/storage/client_token_handler.js +36 -0
  64. package/esm/src/features/auth/storage/server_store.d.ts +24 -0
  65. package/esm/src/features/auth/storage/server_store.d.ts.map +1 -0
  66. package/esm/src/features/auth/storage/server_store.js +34 -0
  67. package/esm/src/features/auth/storage/server_token_handler.d.ts +36 -0
  68. package/esm/src/features/auth/storage/server_token_handler.d.ts.map +1 -0
  69. package/esm/src/features/auth/storage/server_token_handler.js +115 -0
  70. package/{dist/modules → esm/src/features}/auth/storage/types.d.ts +2 -1
  71. package/esm/src/features/auth/storage/types.d.ts.map +1 -0
  72. package/esm/src/features/auth/storage/types.js +1 -0
  73. package/{dist/modules/contact/contact.api-contract.d.ts → esm/src/features/contact/contract.d.ts} +55 -88
  74. package/esm/src/features/contact/contract.d.ts.map +1 -0
  75. package/esm/src/features/contact/contract.js +49 -0
  76. package/esm/src/features/contact/index.d.ts +2 -0
  77. package/esm/src/features/contact/index.d.ts.map +1 -0
  78. package/esm/src/features/contact/index.js +1 -0
  79. package/esm/src/features/contact/repository.d.ts +58 -0
  80. package/esm/src/features/contact/repository.d.ts.map +1 -0
  81. package/esm/src/features/contact/repository.js +108 -0
  82. package/{dist/modules/payout/payout.api-contract.d.ts → esm/src/features/payout/contract.d.ts} +197 -340
  83. package/esm/src/features/payout/contract.d.ts.map +1 -0
  84. package/esm/src/features/payout/contract.js +75 -0
  85. package/esm/src/features/payout/index.d.ts +2 -0
  86. package/esm/src/features/payout/index.d.ts.map +1 -0
  87. package/esm/src/features/payout/index.js +1 -0
  88. package/esm/src/features/payout/repository.d.ts +67 -0
  89. package/esm/src/features/payout/repository.d.ts.map +1 -0
  90. package/esm/src/features/payout/repository.js +163 -0
  91. package/{dist/modules/wallet/wallet.contract.d.ts → esm/src/features/wallet/contract.d.ts} +11 -13
  92. package/esm/src/features/wallet/contract.d.ts.map +1 -0
  93. package/esm/src/features/wallet/contract.js +38 -0
  94. package/esm/src/features/wallet/index.d.ts +2 -0
  95. package/esm/src/features/wallet/index.d.ts.map +1 -0
  96. package/esm/src/features/wallet/index.js +1 -0
  97. package/esm/src/features/wallet/repository.d.ts +57 -0
  98. package/esm/src/features/wallet/repository.d.ts.map +1 -0
  99. package/esm/src/features/wallet/repository.js +93 -0
  100. package/esm/src/models/contact/derivatives/contact.d.ts +172 -0
  101. package/esm/src/models/contact/derivatives/contact.d.ts.map +1 -0
  102. package/esm/src/models/contact/derivatives/contact.js +266 -0
  103. package/esm/src/models/contact/derivatives/contact_info.d.ts +188 -0
  104. package/esm/src/models/contact/derivatives/contact_info.d.ts.map +1 -0
  105. package/esm/src/models/contact/derivatives/contact_info.js +255 -0
  106. package/esm/src/models/contact/index.d.ts +5 -0
  107. package/esm/src/models/contact/index.d.ts.map +1 -0
  108. package/esm/src/models/contact/index.js +4 -0
  109. package/esm/src/models/contact/schemas.d.ts +66 -0
  110. package/esm/src/models/contact/schemas.d.ts.map +1 -0
  111. package/esm/src/models/contact/schemas.js +64 -0
  112. package/esm/src/models/contact/validation.d.ts +37 -0
  113. package/esm/src/models/contact/validation.d.ts.map +1 -0
  114. package/esm/src/models/contact/validation.js +146 -0
  115. package/esm/src/models/index.d.ts +7 -0
  116. package/esm/src/models/index.d.ts.map +1 -0
  117. package/esm/src/models/index.js +6 -0
  118. package/esm/src/models/payout/api.d.ts +29 -0
  119. package/esm/src/models/payout/api.d.ts.map +1 -0
  120. package/esm/src/models/payout/api.js +1 -0
  121. package/esm/src/models/payout/channel.d.ts +58 -0
  122. package/esm/src/models/payout/channel.d.ts.map +1 -0
  123. package/esm/src/models/payout/channel.js +53 -0
  124. package/esm/src/models/payout/derivatives/payout.d.ts +158 -0
  125. package/esm/src/models/payout/derivatives/payout.d.ts.map +1 -0
  126. package/esm/src/models/payout/derivatives/payout.js +271 -0
  127. package/esm/src/models/payout/index.d.ts +7 -0
  128. package/esm/src/models/payout/index.d.ts.map +1 -0
  129. package/esm/src/models/payout/index.js +6 -0
  130. package/esm/src/models/payout/narration.d.ts +164 -0
  131. package/esm/src/models/payout/narration.d.ts.map +1 -0
  132. package/esm/src/models/payout/narration.js +308 -0
  133. package/esm/src/models/payout/schemas.d.ts +156 -0
  134. package/esm/src/models/payout/schemas.d.ts.map +1 -0
  135. package/esm/src/models/payout/schemas.js +105 -0
  136. package/esm/src/models/payout/status.d.ts +33 -0
  137. package/esm/src/models/payout/status.d.ts.map +1 -0
  138. package/esm/src/models/payout/status.js +34 -0
  139. package/{dist/modules/login/permission.type.d.ts → esm/src/models/permission.d.ts} +9 -8
  140. package/esm/src/models/permission.d.ts.map +1 -0
  141. package/esm/src/models/permission.js +50 -0
  142. package/esm/src/models/role.d.ts +21 -0
  143. package/esm/src/models/role.d.ts.map +1 -0
  144. package/esm/src/models/role.js +73 -0
  145. package/esm/src/models/user/authenticated-user.d.ts +77 -0
  146. package/esm/src/models/user/authenticated-user.d.ts.map +1 -0
  147. package/esm/src/models/user/authenticated-user.js +226 -0
  148. package/esm/src/models/user/index.d.ts +4 -0
  149. package/esm/src/models/user/index.d.ts.map +1 -0
  150. package/esm/src/models/user/index.js +3 -0
  151. package/esm/src/models/user/managed-user.d.ts +108 -0
  152. package/esm/src/models/user/managed-user.d.ts.map +1 -0
  153. package/esm/src/models/user/managed-user.js +255 -0
  154. package/{dist/modules/profile/profile.model.d.ts → esm/src/models/user/profile.d.ts} +52 -81
  155. package/esm/src/models/user/profile.d.ts.map +1 -0
  156. package/esm/src/models/user/profile.js +334 -0
  157. package/esm/src/models/wallet/index.d.ts +4 -0
  158. package/esm/src/models/wallet/index.d.ts.map +1 -0
  159. package/esm/src/models/wallet/index.js +3 -0
  160. package/esm/src/models/wallet/schemas.d.ts +95 -0
  161. package/esm/src/models/wallet/schemas.d.ts.map +1 -0
  162. package/esm/src/models/wallet/schemas.js +35 -0
  163. package/esm/src/models/wallet/statement_entry.d.ts +160 -0
  164. package/esm/src/models/wallet/statement_entry.d.ts.map +1 -0
  165. package/esm/src/models/wallet/statement_entry.js +255 -0
  166. package/{dist/modules/wallet/wallet.model.d.ts → esm/src/models/wallet/wallet.d.ts} +37 -31
  167. package/esm/src/models/wallet/wallet.d.ts.map +1 -0
  168. package/esm/src/models/wallet/wallet.js +279 -0
  169. package/esm/src/shared/base_repository.d.ts +80 -0
  170. package/esm/src/shared/base_repository.d.ts.map +1 -0
  171. package/esm/src/shared/base_repository.js +153 -0
  172. package/esm/src/shared/common_responses.d.ts +13 -0
  173. package/esm/src/shared/common_responses.d.ts.map +1 -0
  174. package/esm/src/shared/common_responses.js +10 -0
  175. package/esm/src/shared/index.d.ts +3 -0
  176. package/esm/src/shared/index.d.ts.map +1 -0
  177. package/esm/src/shared/index.js +2 -0
  178. package/esm/src/shared/token_required_repository.d.ts +78 -0
  179. package/esm/src/shared/token_required_repository.d.ts.map +1 -0
  180. package/esm/src/shared/token_required_repository.js +128 -0
  181. package/package.json +23 -49
  182. package/script/mod.d.ts +8 -0
  183. package/script/mod.d.ts.map +1 -0
  184. package/script/mod.js +23 -0
  185. package/script/npm/src/mod.d.ts +8 -0
  186. package/script/npm/src/mod.d.ts.map +1 -0
  187. package/script/npm/src/mod.js +23 -0
  188. package/script/npm/src/src/errors/api_error.d.ts +63 -0
  189. package/script/npm/src/src/errors/api_error.d.ts.map +1 -0
  190. package/script/npm/src/src/errors/api_error.js +94 -0
  191. package/script/npm/src/src/errors/index.d.ts +3 -0
  192. package/script/npm/src/src/errors/index.d.ts.map +1 -0
  193. package/script/npm/src/src/errors/index.js +18 -0
  194. package/script/npm/src/src/errors/permission_error.d.ts +48 -0
  195. package/script/npm/src/src/errors/permission_error.d.ts.map +1 -0
  196. package/script/npm/src/src/errors/permission_error.js +74 -0
  197. package/script/npm/src/src/features/admin/contract.d.ts +842 -0
  198. package/script/npm/src/src/features/admin/contract.d.ts.map +1 -0
  199. package/script/npm/src/src/features/admin/contract.js +213 -0
  200. package/script/npm/src/src/features/admin/index.d.ts +4 -0
  201. package/script/npm/src/src/features/admin/index.d.ts.map +1 -0
  202. package/script/npm/src/src/features/admin/index.js +19 -0
  203. package/script/npm/src/src/features/admin/repository.d.ts +114 -0
  204. package/script/npm/src/src/features/admin/repository.d.ts.map +1 -0
  205. package/script/npm/src/src/features/admin/repository.js +252 -0
  206. package/script/npm/src/src/features/admin/schemas.d.ts +146 -0
  207. package/script/npm/src/src/features/admin/schemas.d.ts.map +1 -0
  208. package/script/npm/src/src/features/admin/schemas.js +209 -0
  209. package/script/npm/src/src/features/auth/access/contract.d.ts +14 -0
  210. package/script/npm/src/src/features/auth/access/contract.d.ts.map +1 -0
  211. package/script/npm/src/src/features/auth/access/contract.js +17 -0
  212. package/script/npm/src/src/features/auth/access/repository.d.ts +11 -0
  213. package/script/npm/src/src/features/auth/access/repository.d.ts.map +1 -0
  214. package/script/npm/src/src/features/auth/access/repository.js +29 -0
  215. package/script/npm/src/src/features/auth/contract.d.ts +112 -0
  216. package/script/npm/src/src/features/auth/contract.d.ts.map +1 -0
  217. package/script/npm/src/src/features/auth/contract.js +46 -0
  218. package/script/npm/src/src/features/auth/identity/contract.d.ts +23 -0
  219. package/script/npm/src/src/features/auth/identity/contract.d.ts.map +1 -0
  220. package/script/npm/src/src/features/auth/identity/contract.js +20 -0
  221. package/script/npm/src/src/features/auth/identity/repository.d.ts +22 -0
  222. package/script/npm/src/src/features/auth/identity/repository.d.ts.map +1 -0
  223. package/script/npm/src/src/features/auth/identity/repository.js +34 -0
  224. package/script/npm/src/src/features/auth/index.d.ts +6 -0
  225. package/script/npm/src/src/features/auth/index.d.ts.map +1 -0
  226. package/script/npm/src/src/features/auth/index.js +21 -0
  227. package/script/npm/src/src/features/auth/manager.d.ts +105 -0
  228. package/script/npm/src/src/features/auth/manager.d.ts.map +1 -0
  229. package/script/npm/src/src/features/auth/manager.js +185 -0
  230. package/script/npm/src/src/features/auth/profile/contract.d.ts +37 -0
  231. package/script/npm/src/src/features/auth/profile/contract.d.ts.map +1 -0
  232. package/script/npm/src/src/features/auth/profile/contract.js +17 -0
  233. package/script/npm/src/src/features/auth/profile/repository.d.ts +11 -0
  234. package/script/npm/src/src/features/auth/profile/repository.d.ts.map +1 -0
  235. package/script/npm/src/src/features/auth/profile/repository.js +29 -0
  236. package/script/npm/src/src/features/auth/repository.d.ts +30 -0
  237. package/script/npm/src/src/features/auth/repository.d.ts.map +1 -0
  238. package/script/npm/src/src/features/auth/repository.js +73 -0
  239. package/script/npm/src/src/features/auth/storage/client_store.d.ts +30 -0
  240. package/script/npm/src/src/features/auth/storage/client_store.d.ts.map +1 -0
  241. package/script/npm/src/src/features/auth/storage/client_store.js +51 -0
  242. package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts +32 -0
  243. package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts.map +1 -0
  244. package/script/npm/src/src/features/auth/storage/client_token_handler.js +40 -0
  245. package/script/npm/src/src/features/auth/storage/server_store.d.ts +24 -0
  246. package/script/npm/src/src/features/auth/storage/server_store.d.ts.map +1 -0
  247. package/script/npm/src/src/features/auth/storage/server_store.js +38 -0
  248. package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts +36 -0
  249. package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts.map +1 -0
  250. package/script/npm/src/src/features/auth/storage/server_token_handler.js +119 -0
  251. package/script/npm/src/src/features/auth/storage/types.d.ts +42 -0
  252. package/script/npm/src/src/features/auth/storage/types.d.ts.map +1 -0
  253. package/script/npm/src/src/features/auth/storage/types.js +2 -0
  254. package/script/npm/src/src/features/contact/contract.d.ts +170 -0
  255. package/script/npm/src/src/features/contact/contract.d.ts.map +1 -0
  256. package/script/npm/src/src/features/contact/contract.js +52 -0
  257. package/script/npm/src/src/features/contact/index.d.ts +2 -0
  258. package/script/npm/src/src/features/contact/index.d.ts.map +1 -0
  259. package/script/npm/src/src/features/contact/index.js +17 -0
  260. package/script/npm/src/src/features/contact/repository.d.ts +58 -0
  261. package/script/npm/src/src/features/contact/repository.d.ts.map +1 -0
  262. package/script/npm/src/src/features/contact/repository.js +112 -0
  263. package/script/npm/src/src/features/payout/contract.d.ts +623 -0
  264. package/script/npm/src/src/features/payout/contract.d.ts.map +1 -0
  265. package/script/npm/src/src/features/payout/contract.js +78 -0
  266. package/script/npm/src/src/features/payout/index.d.ts +2 -0
  267. package/script/npm/src/src/features/payout/index.d.ts.map +1 -0
  268. package/script/npm/src/src/features/payout/index.js +17 -0
  269. package/script/npm/src/src/features/payout/repository.d.ts +67 -0
  270. package/script/npm/src/src/features/payout/repository.d.ts.map +1 -0
  271. package/script/npm/src/src/features/payout/repository.js +167 -0
  272. package/script/npm/src/src/features/wallet/contract.d.ts +137 -0
  273. package/script/npm/src/src/features/wallet/contract.d.ts.map +1 -0
  274. package/script/npm/src/src/features/wallet/contract.js +41 -0
  275. package/script/npm/src/src/features/wallet/index.d.ts +2 -0
  276. package/script/npm/src/src/features/wallet/index.d.ts.map +1 -0
  277. package/script/npm/src/src/features/wallet/index.js +17 -0
  278. package/script/npm/src/src/features/wallet/repository.d.ts +57 -0
  279. package/script/npm/src/src/features/wallet/repository.d.ts.map +1 -0
  280. package/script/npm/src/src/features/wallet/repository.js +97 -0
  281. package/script/npm/src/src/models/contact/derivatives/contact.d.ts +172 -0
  282. package/script/npm/src/src/models/contact/derivatives/contact.d.ts.map +1 -0
  283. package/script/npm/src/src/models/contact/derivatives/contact.js +270 -0
  284. package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts +188 -0
  285. package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts.map +1 -0
  286. package/script/npm/src/src/models/contact/derivatives/contact_info.js +260 -0
  287. package/script/npm/src/src/models/contact/index.d.ts +5 -0
  288. package/script/npm/src/src/models/contact/index.d.ts.map +1 -0
  289. package/script/npm/src/src/models/contact/index.js +20 -0
  290. package/script/npm/src/src/models/contact/schemas.d.ts +66 -0
  291. package/script/npm/src/src/models/contact/schemas.d.ts.map +1 -0
  292. package/script/npm/src/src/models/contact/schemas.js +67 -0
  293. package/script/npm/src/src/models/contact/validation.d.ts +37 -0
  294. package/script/npm/src/src/models/contact/validation.d.ts.map +1 -0
  295. package/script/npm/src/src/models/contact/validation.js +153 -0
  296. package/script/npm/src/src/models/index.d.ts +7 -0
  297. package/script/npm/src/src/models/index.d.ts.map +1 -0
  298. package/script/npm/src/src/models/index.js +22 -0
  299. package/script/npm/src/src/models/payout/api.d.ts +29 -0
  300. package/script/npm/src/src/models/payout/api.d.ts.map +1 -0
  301. package/script/npm/src/src/models/payout/api.js +2 -0
  302. package/script/npm/src/src/models/payout/channel.d.ts +58 -0
  303. package/script/npm/src/src/models/payout/channel.d.ts.map +1 -0
  304. package/script/npm/src/src/models/payout/channel.js +56 -0
  305. package/script/npm/src/src/models/payout/derivatives/payout.d.ts +158 -0
  306. package/script/npm/src/src/models/payout/derivatives/payout.d.ts.map +1 -0
  307. package/script/npm/src/src/models/payout/derivatives/payout.js +275 -0
  308. package/script/npm/src/src/models/payout/index.d.ts +7 -0
  309. package/script/npm/src/src/models/payout/index.d.ts.map +1 -0
  310. package/script/npm/src/src/models/payout/index.js +22 -0
  311. package/script/npm/src/src/models/payout/narration.d.ts +164 -0
  312. package/script/npm/src/src/models/payout/narration.d.ts.map +1 -0
  313. package/script/npm/src/src/models/payout/narration.js +312 -0
  314. package/script/npm/src/src/models/payout/schemas.d.ts +156 -0
  315. package/script/npm/src/src/models/payout/schemas.d.ts.map +1 -0
  316. package/script/npm/src/src/models/payout/schemas.js +108 -0
  317. package/script/npm/src/src/models/payout/status.d.ts +33 -0
  318. package/script/npm/src/src/models/payout/status.d.ts.map +1 -0
  319. package/script/npm/src/src/models/payout/status.js +37 -0
  320. package/script/npm/src/src/models/permission.d.ts +55 -0
  321. package/script/npm/src/src/models/permission.d.ts.map +1 -0
  322. package/script/npm/src/src/models/permission.js +53 -0
  323. package/script/npm/src/src/models/role.d.ts +21 -0
  324. package/script/npm/src/src/models/role.d.ts.map +1 -0
  325. package/script/npm/src/src/models/role.js +77 -0
  326. package/script/npm/src/src/models/user/authenticated-user.d.ts +77 -0
  327. package/script/npm/src/src/models/user/authenticated-user.d.ts.map +1 -0
  328. package/script/npm/src/src/models/user/authenticated-user.js +230 -0
  329. package/script/npm/src/src/models/user/index.d.ts +4 -0
  330. package/script/npm/src/src/models/user/index.d.ts.map +1 -0
  331. package/script/npm/src/src/models/user/index.js +19 -0
  332. package/script/npm/src/src/models/user/managed-user.d.ts +108 -0
  333. package/script/npm/src/src/models/user/managed-user.d.ts.map +1 -0
  334. package/script/npm/src/src/models/user/managed-user.js +260 -0
  335. package/script/npm/src/src/models/user/profile.d.ts +161 -0
  336. package/script/npm/src/src/models/user/profile.d.ts.map +1 -0
  337. package/script/npm/src/src/models/user/profile.js +338 -0
  338. package/script/npm/src/src/models/wallet/index.d.ts +4 -0
  339. package/script/npm/src/src/models/wallet/index.d.ts.map +1 -0
  340. package/script/npm/src/src/models/wallet/index.js +19 -0
  341. package/script/npm/src/src/models/wallet/schemas.d.ts +95 -0
  342. package/script/npm/src/src/models/wallet/schemas.d.ts.map +1 -0
  343. package/script/npm/src/src/models/wallet/schemas.js +38 -0
  344. package/script/npm/src/src/models/wallet/statement_entry.d.ts +160 -0
  345. package/script/npm/src/src/models/wallet/statement_entry.d.ts.map +1 -0
  346. package/script/npm/src/src/models/wallet/statement_entry.js +259 -0
  347. package/script/npm/src/src/models/wallet/wallet.d.ts +147 -0
  348. package/script/npm/src/src/models/wallet/wallet.d.ts.map +1 -0
  349. package/script/npm/src/src/models/wallet/wallet.js +283 -0
  350. package/script/npm/src/src/shared/base_repository.d.ts +80 -0
  351. package/script/npm/src/src/shared/base_repository.d.ts.map +1 -0
  352. package/script/npm/src/src/shared/base_repository.js +157 -0
  353. package/script/npm/src/src/shared/common_responses.d.ts +13 -0
  354. package/script/npm/src/src/shared/common_responses.d.ts.map +1 -0
  355. package/script/npm/src/src/shared/common_responses.js +13 -0
  356. package/script/npm/src/src/shared/index.d.ts +3 -0
  357. package/script/npm/src/src/shared/index.d.ts.map +1 -0
  358. package/script/npm/src/src/shared/index.js +18 -0
  359. package/script/npm/src/src/shared/token_required_repository.d.ts +78 -0
  360. package/script/npm/src/src/shared/token_required_repository.d.ts.map +1 -0
  361. package/script/npm/src/src/shared/token_required_repository.js +132 -0
  362. package/script/package.json +3 -0
  363. package/dist/index.cjs.js +0 -2
  364. package/dist/index.cjs.js.map +0 -1
  365. package/dist/index.d.ts +0 -10
  366. package/dist/index.esm.js +0 -2
  367. package/dist/index.esm.js.map +0 -1
  368. package/dist/lib/api/base-repository.d.ts +0 -175
  369. package/dist/lib/api/index.d.ts +0 -1
  370. package/dist/lib/error/error.utils.d.ts +0 -22
  371. package/dist/lib/error/index.d.ts +0 -3
  372. package/dist/lib/query/index.d.ts +0 -4
  373. package/dist/lib/query/pagination/pagination.d.ts +0 -73
  374. package/dist/lib/query/pagination/pagination.schemas.d.ts +0 -83
  375. package/dist/lib/query/query.builder.d.ts +0 -71
  376. package/dist/lib/query/query.types.d.ts +0 -36
  377. package/dist/modules/auth/auth.manager.d.ts +0 -249
  378. package/dist/modules/auth/auth.repository.d.ts +0 -83
  379. package/dist/modules/auth/auth.store.d.ts +0 -139
  380. package/dist/modules/auth/company-membership.model.d.ts +0 -171
  381. package/dist/modules/auth/index.d.ts +0 -4
  382. package/dist/modules/auth/user.model.d.ts +0 -363
  383. package/dist/modules/contact/contact-info.model.d.ts +0 -485
  384. package/dist/modules/contact/contact-input-handler.d.ts +0 -16
  385. package/dist/modules/contact/contact.dtos.d.ts +0 -84
  386. package/dist/modules/contact/contact.model.d.ts +0 -441
  387. package/dist/modules/contact/contact.repository.d.ts +0 -116
  388. package/dist/modules/contact/index.d.ts +0 -4
  389. package/dist/modules/login/index.d.ts +0 -4
  390. package/dist/modules/login/login.api-contract.d.ts +0 -51
  391. package/dist/modules/login/login.dtos.d.ts +0 -85
  392. package/dist/modules/login/login.model.d.ts +0 -168
  393. package/dist/modules/login/login.repository.d.ts +0 -58
  394. package/dist/modules/payout/index.d.ts +0 -5
  395. package/dist/modules/payout/payout-channel-handler.d.ts +0 -82
  396. package/dist/modules/payout/payout.dtos.d.ts +0 -605
  397. package/dist/modules/payout/payout.model.d.ts +0 -379
  398. package/dist/modules/payout/payout.query.d.ts +0 -133
  399. package/dist/modules/payout/payout.repository.d.ts +0 -181
  400. package/dist/modules/profile/index.d.ts +0 -3
  401. package/dist/modules/profile/profile.dtos.d.ts +0 -80
  402. package/dist/modules/profile/profile.repository.d.ts +0 -56
  403. package/dist/modules/team-member/index.d.ts +0 -4
  404. package/dist/modules/team-member/role.model.d.ts +0 -61
  405. package/dist/modules/team-member/team-member.dtos.d.ts +0 -261
  406. package/dist/modules/team-member/team-member.model.d.ts +0 -237
  407. package/dist/modules/team-member/team-member.repository.d.ts +0 -179
  408. package/dist/modules/wallet/index.d.ts +0 -7
  409. package/dist/modules/wallet/narration.model.d.ts +0 -225
  410. package/dist/modules/wallet/statement-entry.model.d.ts +0 -299
  411. package/dist/modules/wallet/wallet-manager.session.d.ts +0 -143
  412. package/dist/modules/wallet/wallet.dtos.d.ts +0 -204
  413. package/dist/modules/wallet/wallet.query.d.ts +0 -95
  414. package/dist/modules/wallet/wallet.repository.d.ts +0 -205
  415. package/dist/modules/wallet/wallet.utils.d.ts +0 -17
@@ -0,0 +1,188 @@
1
+ import type { ContactType } from "../index.js";
2
+ import { Bank, TZPhoneNumber } from "@temboplus/frontend-core";
3
+ /**
4
+ * Abstract base class that provides a common interface for different types of contact information.
5
+ * This class defines the structure and validation requirements for both mobile and bank contacts.
6
+ *
7
+ * @abstract
8
+ * @class BaseContactInfo
9
+ * @property {ContactType} type - The type of contact (either "Mobile" or "Bank")
10
+ */
11
+ declare abstract class BaseContactInfo {
12
+ readonly type: ContactType;
13
+ /**
14
+ * Creates a new instance of BaseContactInfo
15
+ * @param {ContactType} type - The type of contact to create
16
+ */
17
+ constructor(type: ContactType);
18
+ /**
19
+ * Validates the contact information according to type-specific rules
20
+ * @abstract
21
+ * @returns {boolean} True if the contact information is valid, false otherwise
22
+ */
23
+ abstract validate(): boolean;
24
+ /**
25
+ * Gets the primary display name for the contact
26
+ * @abstract
27
+ * @returns {string} The contact's display name (personal name for mobile, account name for bank)
28
+ */
29
+ abstract get displayName(): string;
30
+ /**
31
+ * Gets the primary account/identification number for the contact
32
+ * @abstract
33
+ * @returns {string} The contact's number (phone number for mobile, account number for bank)
34
+ */
35
+ abstract get accNumber(): string;
36
+ /**
37
+ * Gets the service provider or institution name for the contact
38
+ * @abstract
39
+ * @returns {string} The contact's channel (telecom company for mobile, bank name for bank)
40
+ */
41
+ abstract get channel(): string;
42
+ /**
43
+ * Gets the localized label for the display name field
44
+ * @abstract
45
+ * @returns {string} The appropriate label for the display name based on contact type
46
+ */
47
+ abstract get displayNameLabel(): string;
48
+ /**
49
+ * Gets the localized label for the account number field
50
+ * @abstract
51
+ * @returns {string} The appropriate label for the account number based on contact type
52
+ */
53
+ abstract get accNumberLabel(): string;
54
+ /**
55
+ * Gets the localized label for the channel field
56
+ * @abstract
57
+ * @returns {string} The appropriate label for the channel based on contact type
58
+ */
59
+ abstract get channelLabel(): string;
60
+ }
61
+ /**
62
+ * Implementation of BaseContactInfo for mobile phone contacts.
63
+ * Handles storage and validation of contact details specific to mobile numbers.
64
+ *
65
+ * @extends BaseContactInfo
66
+ * @class MobileContactInfo
67
+ * @property {string} name - The contact's personal name
68
+ * @property {TZPhoneNumber} phoneNumber - The contact's phone number object
69
+ */
70
+ export declare class MobileContactInfo extends BaseContactInfo {
71
+ readonly name: string;
72
+ readonly phoneNumber: TZPhoneNumber;
73
+ /**
74
+ * Creates a new mobile contact
75
+ * @param {string} name - The contact's personal name
76
+ * @param {TZPhoneNumber} phoneNumber - The contact's phone number
77
+ */
78
+ constructor(name: string, phoneNumber: TZPhoneNumber);
79
+ /**
80
+ * Validates the mobile contact information
81
+ * Checks that:
82
+ * - Phone number is defined and valid
83
+ * - Contact name is not empty
84
+ * @returns {boolean} True if all validation checks pass
85
+ */
86
+ validate(): boolean;
87
+ /**
88
+ * Validates if an unknown value is a valid MobileContactInfo object.
89
+ * Checks both the structural integrity and data validity of name and phone number properties.
90
+ *
91
+ * @param {unknown} obj - The value to validate
92
+ * @returns {obj is MobileContactInfo} Type predicate indicating if the value is a valid MobileContactInfo
93
+ *
94
+ * @example
95
+ * const maybeContact = JSON.parse(someData);
96
+ * if (MobileContactInfo.is(maybeContact)) {
97
+ * // maybeContact is typed as MobileContactInfo
98
+ * console.log(maybeContact.name);
99
+ * console.log(maybeContact.TZPhoneNumber.label);
100
+ * }
101
+ *
102
+ * @remarks
103
+ * - Name must be a non-empty string
104
+ * - Phone number can be either:
105
+ * - A string that can be parsed into a valid TZPhoneNumber
106
+ * - A TZPhoneNumber object with valid properties
107
+ * - Returns false if either property is invalid or missing
108
+ */
109
+ static is(obj: unknown): obj is MobileContactInfo;
110
+ get displayName(): string;
111
+ /**
112
+ * Gets the phone number formatted according to the 255 standard
113
+ * @returns {string} Formatted phone number
114
+ */
115
+ get accNumber(): string;
116
+ get channel(): string;
117
+ get displayNameLabel(): string;
118
+ get accNumberLabel(): string;
119
+ get channelLabel(): string;
120
+ }
121
+ /**
122
+ * Implementation of BaseContactInfo for bank account contacts.
123
+ * Handles storage and validation of contact details specific to bank accounts.
124
+ *
125
+ * @extends BaseContactInfo
126
+ * @class BankContactInfo
127
+ * @property {string} accName - The bank account holder's name
128
+ * @property {Bank} bank - The bank object containing institution details
129
+ * @property {string} accNo - The bank account number
130
+ */
131
+ export declare class BankContactInfo extends BaseContactInfo {
132
+ readonly accName: string;
133
+ readonly bank: Bank;
134
+ readonly accNo: string;
135
+ /**
136
+ * Creates a new bank contact
137
+ * @param {string} accName - The account holder's name
138
+ * @param {Bank} bank - The bank object
139
+ * @param {string} accNo - The account number
140
+ */
141
+ constructor(accName: string, bank: Bank, accNo: string);
142
+ /**
143
+ * Validates the bank contact information
144
+ * Checks that:
145
+ * - Bank object is valid
146
+ * - Account name meets requirements
147
+ * - Account number meets bank-specific format requirements
148
+ * @returns {boolean} True if all validation checks pass
149
+ */
150
+ validate(): boolean;
151
+ /**
152
+ * Validates if an unknown value is a valid BankContactInfo object.
153
+ * Checks both the structural integrity and data validity of account name, account number, and bank details.
154
+ *
155
+ * @param {unknown} obj - The value to validate
156
+ * @returns {obj is BankContactInfo} Type predicate indicating if the value is a valid BankContactInfo
157
+ *
158
+ * @example
159
+ * const maybeBank = JSON.parse(someData);
160
+ * if (BankContactInfo.is(maybeBank)) {
161
+ * // maybeBank is typed as BankContactInfo
162
+ * console.log(maybeBank.accName);
163
+ * console.log(maybeBank.accNumber);
164
+ * console.log(maybeBank.bank.name);
165
+ * }
166
+ *
167
+ * @remarks
168
+ * - Account name must be a valid string (validated by {@link validateAccName})
169
+ * - Account number must be a valid string (validated by {@link validateBankAccNo})
170
+ * - Bank must be a valid Bank object (validated by {@link Bank.is})
171
+ * - Returns false if any property is invalid or missing
172
+ * - All properties are required and must pass their respective validations
173
+ */
174
+ static is(obj: unknown): obj is BankContactInfo;
175
+ get displayName(): string;
176
+ get accNumber(): string;
177
+ get channel(): string;
178
+ get displayNameLabel(): string;
179
+ get accNumberLabel(): string;
180
+ get channelLabel(): string;
181
+ }
182
+ /**
183
+ * Union type representing either a mobile or bank contact
184
+ * Used for type-safe handling of contact information throughout the application
185
+ */
186
+ export type ContactInfo = MobileContactInfo | BankContactInfo;
187
+ export {};
188
+ //# sourceMappingURL=contact_info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact_info.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/models/contact/derivatives/contact_info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACL,IAAI,EAEJ,aAAa,EACd,MAAM,0BAA0B,CAAC;AAMlC;;;;;;;GAOG;AACH,uBAAe,eAAe;IAC5B,SAAgB,IAAI,EAAE,WAAW,CAAC;IAElC;;;OAGG;gBACS,IAAI,EAAE,WAAW;IAI7B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,IAAI,OAAO;IAE5B;;;;OAIG;IACH,QAAQ,KAAK,WAAW,IAAI,MAAM,CAAC;IAEnC;;;;OAIG;IACH,QAAQ,KAAK,SAAS,IAAI,MAAM,CAAC;IAEjC;;;;OAIG;IACH,QAAQ,KAAK,OAAO,IAAI,MAAM,CAAC;IAE/B;;;;OAIG;IACH,QAAQ,KAAK,gBAAgB,IAAI,MAAM,CAAC;IAExC;;;;OAIG;IACH,QAAQ,KAAK,cAAc,IAAI,MAAM,CAAC;IAEtC;;;;OAIG;IACH,QAAQ,KAAK,YAAY,IAAI,MAAM,CAAC;CACrC;AAED;;;;;;;;GAQG;AACH,qBAAa,iBAAkB,SAAQ,eAAe;aAOlC,IAAI,EAAE,MAAM;aACZ,WAAW,EAAE,aAAa;IAP5C;;;;OAIG;gBAEe,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,aAAa;IAK5C;;;;;;OAMG;IACH,QAAQ,IAAI,OAAO;IAMnB;;;;;;;;;;;;;;;;;;;;;OAqBG;WACW,EAAE,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,iBAAiB;IA6BxD,IAAa,WAAW,IAAI,MAAM,CAEjC;IAED;;;OAGG;IACH,IAAa,SAAS,IAAI,MAAM,CAE/B;IAED,IAAa,OAAO,IAAI,MAAM,CAE7B;IAED,IAAa,gBAAgB,IAAI,MAAM,CAEtC;IAED,IAAa,cAAc,IAAI,MAAM,CAEpC;IAED,IAAa,YAAY,IAAI,MAAM,CAElC;CACF;AAED;;;;;;;;;GASG;AACH,qBAAa,eAAgB,SAAQ,eAAe;aAQhC,OAAO,EAAE,MAAM;aACf,IAAI,EAAE,IAAI;aACV,KAAK,EAAE,MAAM;IAT/B;;;;;OAKG;gBAEe,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,MAAM;IAK/B;;;;;;;OAOG;IACH,QAAQ,IAAI,OAAO;IAMnB;;;;;;;;;;;;;;;;;;;;;;OAsBG;WACW,EAAE,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,eAAe;IA8BtD,IAAa,WAAW,IAAI,MAAM,CAEjC;IAED,IAAa,SAAS,IAAI,MAAM,CAE/B;IAED,IAAa,OAAO,IAAI,MAAM,CAE7B;IAED,IAAa,gBAAgB,IAAI,MAAM,CAEtC;IAED,IAAa,cAAc,IAAI,MAAM,CAEpC;IAED,IAAa,YAAY,IAAI,MAAM,CAElC;CACF;AAED;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,iBAAiB,GAAG,eAAe,CAAC"}
@@ -0,0 +1,260 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BankContactInfo = exports.MobileContactInfo = void 0;
4
+ const frontend_core_1 = require("@temboplus/frontend-core");
5
+ const validation_js_1 = require("../validation.js");
6
+ /**
7
+ * Abstract base class that provides a common interface for different types of contact information.
8
+ * This class defines the structure and validation requirements for both mobile and bank contacts.
9
+ *
10
+ * @abstract
11
+ * @class BaseContactInfo
12
+ * @property {ContactType} type - The type of contact (either "Mobile" or "Bank")
13
+ */
14
+ class BaseContactInfo {
15
+ /**
16
+ * Creates a new instance of BaseContactInfo
17
+ * @param {ContactType} type - The type of contact to create
18
+ */
19
+ constructor(type) {
20
+ Object.defineProperty(this, "type", {
21
+ enumerable: true,
22
+ configurable: true,
23
+ writable: true,
24
+ value: void 0
25
+ });
26
+ this.type = type;
27
+ }
28
+ }
29
+ /**
30
+ * Implementation of BaseContactInfo for mobile phone contacts.
31
+ * Handles storage and validation of contact details specific to mobile numbers.
32
+ *
33
+ * @extends BaseContactInfo
34
+ * @class MobileContactInfo
35
+ * @property {string} name - The contact's personal name
36
+ * @property {TZPhoneNumber} phoneNumber - The contact's phone number object
37
+ */
38
+ class MobileContactInfo extends BaseContactInfo {
39
+ /**
40
+ * Creates a new mobile contact
41
+ * @param {string} name - The contact's personal name
42
+ * @param {TZPhoneNumber} phoneNumber - The contact's phone number
43
+ */
44
+ constructor(name, phoneNumber) {
45
+ super("Mobile");
46
+ Object.defineProperty(this, "name", {
47
+ enumerable: true,
48
+ configurable: true,
49
+ writable: true,
50
+ value: name
51
+ });
52
+ Object.defineProperty(this, "phoneNumber", {
53
+ enumerable: true,
54
+ configurable: true,
55
+ writable: true,
56
+ value: phoneNumber
57
+ });
58
+ }
59
+ /**
60
+ * Validates the mobile contact information
61
+ * Checks that:
62
+ * - Phone number is defined and valid
63
+ * - Contact name is not empty
64
+ * @returns {boolean} True if all validation checks pass
65
+ */
66
+ validate() {
67
+ return this.phoneNumber !== undefined &&
68
+ frontend_core_1.TZPhoneNumber.canConstruct(this.phoneNumber.compactNumber) &&
69
+ this.name.length > 0;
70
+ }
71
+ /**
72
+ * Validates if an unknown value is a valid MobileContactInfo object.
73
+ * Checks both the structural integrity and data validity of name and phone number properties.
74
+ *
75
+ * @param {unknown} obj - The value to validate
76
+ * @returns {obj is MobileContactInfo} Type predicate indicating if the value is a valid MobileContactInfo
77
+ *
78
+ * @example
79
+ * const maybeContact = JSON.parse(someData);
80
+ * if (MobileContactInfo.is(maybeContact)) {
81
+ * // maybeContact is typed as MobileContactInfo
82
+ * console.log(maybeContact.name);
83
+ * console.log(maybeContact.TZPhoneNumber.label);
84
+ * }
85
+ *
86
+ * @remarks
87
+ * - Name must be a non-empty string
88
+ * - Phone number can be either:
89
+ * - A string that can be parsed into a valid TZPhoneNumber
90
+ * - A TZPhoneNumber object with valid properties
91
+ * - Returns false if either property is invalid or missing
92
+ */
93
+ static is(obj) {
94
+ if (!obj || typeof obj !== "object")
95
+ return false;
96
+ const mobileContactInfo = obj;
97
+ // checks if name exists and is a string
98
+ if (typeof mobileContactInfo.name !== "string")
99
+ return false;
100
+ const name = mobileContactInfo.name;
101
+ // checks if TZPhoneNumber exists and is valid
102
+ let phone_number = undefined;
103
+ if (typeof mobileContactInfo.phoneNumber === "string") {
104
+ phone_number = frontend_core_1.TZPhoneNumber.from(mobileContactInfo.phoneNumber);
105
+ }
106
+ if (typeof mobileContactInfo.phoneNumber === "object") {
107
+ const obj = mobileContactInfo.phoneNumber;
108
+ const isValidPhone = frontend_core_1.TZPhoneNumber.is(obj);
109
+ if (isValidPhone) {
110
+ phone_number = obj;
111
+ }
112
+ }
113
+ const validName = name.trim().length > 0;
114
+ const validPhone = phone_number !== undefined;
115
+ return validName && validPhone;
116
+ }
117
+ get displayName() {
118
+ return this.name;
119
+ }
120
+ /**
121
+ * Gets the phone number formatted according to the 255 standard
122
+ * @returns {string} Formatted phone number
123
+ */
124
+ get accNumber() {
125
+ return this.phoneNumber.getWithFormat(frontend_core_1.PhoneNumberFormat.INTERNATIONAL);
126
+ }
127
+ get channel() {
128
+ return this.phoneNumber.networkOperator.mobileMoneyService;
129
+ }
130
+ get displayNameLabel() {
131
+ return "Name";
132
+ }
133
+ get accNumberLabel() {
134
+ return "Phone Number";
135
+ }
136
+ get channelLabel() {
137
+ return "Channel";
138
+ }
139
+ }
140
+ exports.MobileContactInfo = MobileContactInfo;
141
+ /**
142
+ * Implementation of BaseContactInfo for bank account contacts.
143
+ * Handles storage and validation of contact details specific to bank accounts.
144
+ *
145
+ * @extends BaseContactInfo
146
+ * @class BankContactInfo
147
+ * @property {string} accName - The bank account holder's name
148
+ * @property {Bank} bank - The bank object containing institution details
149
+ * @property {string} accNo - The bank account number
150
+ */
151
+ class BankContactInfo extends BaseContactInfo {
152
+ /**
153
+ * Creates a new bank contact
154
+ * @param {string} accName - The account holder's name
155
+ * @param {Bank} bank - The bank object
156
+ * @param {string} accNo - The account number
157
+ */
158
+ constructor(accName, bank, accNo) {
159
+ super("Bank");
160
+ Object.defineProperty(this, "accName", {
161
+ enumerable: true,
162
+ configurable: true,
163
+ writable: true,
164
+ value: accName
165
+ });
166
+ Object.defineProperty(this, "bank", {
167
+ enumerable: true,
168
+ configurable: true,
169
+ writable: true,
170
+ value: bank
171
+ });
172
+ Object.defineProperty(this, "accNo", {
173
+ enumerable: true,
174
+ configurable: true,
175
+ writable: true,
176
+ value: accNo
177
+ });
178
+ }
179
+ /**
180
+ * Validates the bank contact information
181
+ * Checks that:
182
+ * - Bank object is valid
183
+ * - Account name meets requirements
184
+ * - Account number meets bank-specific format requirements
185
+ * @returns {boolean} True if all validation checks pass
186
+ */
187
+ validate() {
188
+ return this.bank.validate() &&
189
+ (0, validation_js_1.validateAccName)(this.accName) &&
190
+ (0, validation_js_1.validateBankAccNo)(this.accNumber);
191
+ }
192
+ /**
193
+ * Validates if an unknown value is a valid BankContactInfo object.
194
+ * Checks both the structural integrity and data validity of account name, account number, and bank details.
195
+ *
196
+ * @param {unknown} obj - The value to validate
197
+ * @returns {obj is BankContactInfo} Type predicate indicating if the value is a valid BankContactInfo
198
+ *
199
+ * @example
200
+ * const maybeBank = JSON.parse(someData);
201
+ * if (BankContactInfo.is(maybeBank)) {
202
+ * // maybeBank is typed as BankContactInfo
203
+ * console.log(maybeBank.accName);
204
+ * console.log(maybeBank.accNumber);
205
+ * console.log(maybeBank.bank.name);
206
+ * }
207
+ *
208
+ * @remarks
209
+ * - Account name must be a valid string (validated by {@link validateAccName})
210
+ * - Account number must be a valid string (validated by {@link validateBankAccNo})
211
+ * - Bank must be a valid Bank object (validated by {@link Bank.is})
212
+ * - Returns false if any property is invalid or missing
213
+ * - All properties are required and must pass their respective validations
214
+ */
215
+ static is(obj) {
216
+ if (!obj || typeof obj !== "object")
217
+ return false;
218
+ const bankContactInfo = obj;
219
+ // checks if acc. name exists and is a string
220
+ if (typeof bankContactInfo.accName !== "string")
221
+ return false;
222
+ const accName = bankContactInfo.accName;
223
+ // checks if acc. no. exists and is a string
224
+ if (typeof bankContactInfo.accNumber !== "string")
225
+ return false;
226
+ const accNumber = bankContactInfo.accNumber;
227
+ // checks if TZPhoneNumber exists and is valid
228
+ let bank = undefined;
229
+ if (typeof bankContactInfo.bank === "object") {
230
+ const obj = bankContactInfo.bank;
231
+ const isValidBank = frontend_core_1.Bank.is(obj);
232
+ if (isValidBank) {
233
+ bank = obj;
234
+ }
235
+ }
236
+ const validAccName = (0, validation_js_1.validateAccName)(accName);
237
+ const validAccNumber = (0, validation_js_1.validateBankAccNo)(accNumber);
238
+ const validBank = bank !== undefined;
239
+ return validAccName && validAccNumber && validBank;
240
+ }
241
+ get displayName() {
242
+ return this.accName;
243
+ }
244
+ get accNumber() {
245
+ return this.accNo;
246
+ }
247
+ get channel() {
248
+ return this.bank.shortName;
249
+ }
250
+ get displayNameLabel() {
251
+ return "Acc. Name";
252
+ }
253
+ get accNumberLabel() {
254
+ return "Bank Acc. No.";
255
+ }
256
+ get channelLabel() {
257
+ return "Bank";
258
+ }
259
+ }
260
+ exports.BankContactInfo = BankContactInfo;
@@ -0,0 +1,5 @@
1
+ export * from "./schemas.js";
2
+ export * from "./validation.js";
3
+ export * from "./derivatives/contact_info.js";
4
+ export * from "./derivatives/contact.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/src/models/contact/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./schemas.js"), exports);
18
+ __exportStar(require("./validation.js"), exports);
19
+ __exportStar(require("./derivatives/contact_info.js"), exports);
20
+ __exportStar(require("./derivatives/contact.js"), exports);
@@ -0,0 +1,66 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Valid contact channel types.
4
+ * Inferred from the contactTypeSchema.
5
+ *
6
+ * @see {@link contactTypeSchema} for validation rules
7
+ */
8
+ export type ContactType = z.infer<typeof ContactSchemas.contactType>;
9
+ /**
10
+ * Schema type definition for contact input validation.
11
+ *
12
+ * @internal
13
+ * This is an internal type used to enforce type consistency
14
+ * in the contactInputSchema.
15
+ */
16
+ type _ContactInput = z.ZodObject<{
17
+ displayName: z.ZodString;
18
+ accountNo: z.ZodString;
19
+ channel: z.ZodString;
20
+ type: z.ZodEnum<["Bank", "Mobile"]>;
21
+ }>;
22
+ /**
23
+ * Type representing user-provided contact information.
24
+ * Used for creating or updating contacts.
25
+ *
26
+ * @see {@link contactInputSchema} for validation rules
27
+ * @see {@link ContactSchemas} for all available schemas
28
+ */
29
+ export type ContactInput = z.infer<typeof ContactSchemas.contactInput>;
30
+ /**
31
+ * Schema type definition for complete contact records.
32
+ *
33
+ * @internal
34
+ * Extends ContactInput with system-generated fields like
35
+ * IDs and timestamps.
36
+ */
37
+ type _Contact = z.ZodObject<{
38
+ displayName: z.ZodString;
39
+ accountNo: z.ZodString;
40
+ channel: z.ZodString;
41
+ type: z.ZodEnum<["Bank", "Mobile"]>;
42
+ id: z.ZodString;
43
+ profileId: z.ZodString;
44
+ createdAt: z.ZodDate;
45
+ updatedAt: z.ZodDate;
46
+ }>;
47
+ /**
48
+ * Type representing a complete contact record.
49
+ * Includes both user-provided and system-generated fields.
50
+ *
51
+ * @see {@link contactSchema} for validation rules
52
+ */
53
+ export type ContactData = z.infer<typeof ContactSchemas.contactData>;
54
+ /**
55
+ * Collection of all contact-related schemas.
56
+ */
57
+ export declare const ContactSchemas: {
58
+ /** Schema for complete contact records */
59
+ contactData: _Contact;
60
+ /** Schema for contact input validation */
61
+ contactInput: _ContactInput;
62
+ /** Schema for contact channel types */
63
+ contactType: z.ZodEnum<["Bank", "Mobile"]>;
64
+ };
65
+ export {};
66
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../../../src/src/models/contact/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,WAAW,CAAC,CAAC;AAErE;;;;;;GAMG;AACH,KAAK,aAAa,GAAG,CAAC,CAAC,SAAS,CAAC;IAC/B,WAAW,EAAE,CAAC,CAAC,SAAS,CAAC;IACzB,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC;IACvB,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC;IACrB,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;CACrC,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,YAAY,CAAC,CAAC;AAyBvE;;;;;;GAMG;AACH,KAAK,QAAQ,GAAG,CAAC,CAAC,SAAS,CAAC;IAC1B,WAAW,EAAE,CAAC,CAAC,SAAS,CAAC;IACzB,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC;IACvB,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC;IACrB,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;IACpC,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC;IAChB,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC;IACvB,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC;IACrB,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC;CACtB,CAAC,CAAC;AAmBH;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,WAAW,CAAC,CAAC;AAErE;;GAEG;AACH,eAAO,MAAM,cAAc;IACzB,0CAA0C;;IAE1C,0CAA0C;;IAE1C,uCAAuC;;CAExC,CAAC"}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ContactSchemas = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * Schema for contact channel types.
7
+ *
8
+ * @remarks
9
+ * Currently supports two channel types:
10
+ * - "Bank": For traditional banking channels
11
+ * - "Mobile": For mobile money channels
12
+ *
13
+ * @see {@link ContactType} for the inferred type
14
+ */
15
+ const contactTypeSchema = zod_1.z.enum([
16
+ "Bank",
17
+ "Mobile",
18
+ ]);
19
+ /**
20
+ * Schema for validating contact input data.
21
+ *
22
+ * @remarks
23
+ * Validates the following fields:
24
+ * - displayName: Non-empty string
25
+ * - accountNo: Non-empty string
26
+ * - channel: Non-empty string
27
+ * - type: Must be either "Bank" or "Mobile"
28
+ */
29
+ const contactInputSchema = zod_1.z.object({
30
+ displayName: zod_1.z
31
+ .string()
32
+ .min(1, "Display name is required"),
33
+ accountNo: zod_1.z
34
+ .string()
35
+ .min(1, "Account number is required"),
36
+ channel: zod_1.z
37
+ .string()
38
+ .min(1, "Channel is required"),
39
+ type: contactTypeSchema,
40
+ });
41
+ /**
42
+ * Schema for complete contact records.
43
+ *
44
+ * @remarks
45
+ * Extends contactInputSchema with additional system fields:
46
+ * - id: Unique identifier
47
+ * - profileId: Associated profile ID
48
+ * - createdAt: Creation timestamp
49
+ * - updatedAt: Last update timestamp
50
+ */
51
+ const contactSchema = zod_1.z.object({
52
+ id: zod_1.z.string().min(1, "Contact id is required"),
53
+ profileId: zod_1.z.string(),
54
+ createdAt: zod_1.z.coerce.date(),
55
+ updatedAt: zod_1.z.coerce.date(),
56
+ }).merge(contactInputSchema);
57
+ /**
58
+ * Collection of all contact-related schemas.
59
+ */
60
+ exports.ContactSchemas = {
61
+ /** Schema for complete contact records */
62
+ contactData: contactSchema,
63
+ /** Schema for contact input validation */
64
+ contactInput: contactInputSchema,
65
+ /** Schema for contact channel types */
66
+ contactType: contactTypeSchema,
67
+ };
@@ -0,0 +1,37 @@
1
+ import type { RuleObject } from "antd/es/form";
2
+ /**
3
+ * Regex pattern to validate account numbers.
4
+ * The account number must only contain letters and digits, between 6 and 20 characters long.
5
+ * @constant {RegExp}
6
+ */
7
+ export declare const ACCOUNT_NUMBER_REGEX: RegExp;
8
+ /**
9
+ * Validator for account number field.
10
+ * Ensures the account number is between 8-12 digits and numeric.
11
+ * @param {RuleObject} _ The rule object for validation (used by validation framework).
12
+ * @param {string} value The value to validate.
13
+ * @throws Will throw an error if validation fails.
14
+ */
15
+ export declare const ACC_NUMBER_VALIDATOR: (rule: RuleObject, value: string | null | undefined) => Promise<string | undefined>;
16
+ /**
17
+ * Validator for account name field.
18
+ * Ensures the account name is at least 3 characters long and contains only letters and spaces.
19
+ * @param {RuleObject} _ The rule object for validation (used by validation framework).
20
+ * @param {string} value The value to validate.
21
+ * @throws Will throw an error if validation fails.
22
+ */
23
+ export declare const ACC_NAME_VALIDATOR: (rule: RuleObject, value: string) => Promise<string | undefined>;
24
+ /**
25
+ * Validates if the provided account name is valid.
26
+ * @param {string} [name] The account name to validate.
27
+ * @returns {boolean} `true` if valid, otherwise `false`.
28
+ */
29
+ export declare const validateAccName: (name?: string) => boolean;
30
+ /**
31
+ * Validates if the provided account number is valid.
32
+ * The account number must be numeric and between 8-12 digits.
33
+ * @param {string} [accountNumber] The account number to validate.
34
+ * @returns {boolean} `true` if valid, otherwise `false`.
35
+ */
36
+ export declare const validateBankAccNo: (accountNumber?: string) => boolean;
37
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../../../src/src/models/contact/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAqC/C;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,QAAwB,CAAC;AAE1D;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,SACzB,UAAU,SACT,MAAM,GAAG,IAAI,GAAG,SAAS,KAC/B,OAAO,CAAC,MAAM,GAAG,SAAS,CAkB5B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,SACvB,UAAU,SACT,MAAM,KACZ,OAAO,CAAC,MAAM,GAAG,SAAS,CAoB5B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,UAAW,MAAM,KAAG,OAI/C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,mBAAoB,MAAM,KAAG,OAU1D,CAAC"}