@temboplus/afloat 0.1.61 → 0.1.63

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 (398) hide show
  1. package/README.md +246 -42
  2. package/{esm/src/features/admin/contract.d.ts → dist/features/admin/admin.contract.d.ts} +41 -77
  3. package/{script/npm/src/src/features/admin/schemas.d.ts → dist/features/admin/admin.dtos.d.ts} +8 -9
  4. package/dist/features/admin/admin.repository.d.ts +179 -0
  5. package/dist/features/admin/index.d.ts +2 -0
  6. package/{esm/src/features/auth/access/contract.d.ts → dist/features/auth/access/access.api-contract.d.ts} +0 -1
  7. package/dist/features/auth/access/access.repository.d.ts +55 -0
  8. package/{esm/src/features/auth/contract.d.ts → dist/features/auth/auth.contract.d.ts} +12 -8
  9. package/dist/features/auth/auth.manager.d.ts +249 -0
  10. package/dist/features/auth/auth.repository.d.ts +66 -0
  11. package/dist/features/auth/auth.store.d.ts +139 -0
  12. package/{script/npm/src/src/features/auth/identity/contract.d.ts → dist/features/auth/identity/identity.api-contract.d.ts} +0 -1
  13. package/dist/features/auth/identity/identity.repository.d.ts +58 -0
  14. package/dist/features/auth/index.d.ts +5 -0
  15. package/{script/npm/src/src/features/auth/profile/contract.d.ts → dist/features/auth/profile/profile.api-contract.d.ts} +8 -6
  16. package/dist/features/auth/profile/profile.dtos.d.ts +80 -0
  17. package/dist/features/auth/profile/profile.repository.d.ts +56 -0
  18. package/{script/npm/src/src/features/auth/storage/client_store.d.ts → dist/features/auth/storage/client-store.d.ts} +2 -3
  19. package/{esm/src/features/auth/storage/client_token_handler.d.ts → dist/features/auth/storage/client-token-handler.d.ts} +1 -2
  20. package/{script/npm/src/src → dist}/features/auth/storage/types.d.ts +1 -2
  21. package/dist/features/contact/contact-input-handler.d.ts +16 -0
  22. package/{esm/src/features/contact/contract.d.ts → dist/features/contact/contact.api-contract.d.ts} +101 -45
  23. package/dist/features/contact/contact.dtos.d.ts +90 -0
  24. package/dist/features/contact/contact.repository.d.ts +116 -0
  25. package/dist/features/contact/index.d.ts +2 -0
  26. package/dist/features/payout/index.d.ts +3 -0
  27. package/dist/features/payout/payout-channel-handler.d.ts +108 -0
  28. package/{esm/src/features/payout/contract.d.ts → dist/features/payout/payout.api-contract.d.ts} +351 -187
  29. package/dist/features/payout/payout.dtos.d.ts +365 -0
  30. package/dist/features/payout/payout.repository.d.ts +193 -0
  31. package/dist/features/wallet/index.d.ts +4 -0
  32. package/dist/features/wallet/wallet-manager.session.d.ts +143 -0
  33. package/{script/npm/src/src/features/wallet/contract.d.ts → dist/features/wallet/wallet.contract.d.ts} +9 -7
  34. package/dist/features/wallet/wallet.dtos.d.ts +204 -0
  35. package/dist/features/wallet/wallet.repository.d.ts +173 -0
  36. package/dist/features/wallet/wallet.utils.d.ts +17 -0
  37. package/dist/index.cjs.js +2 -0
  38. package/dist/index.cjs.js.map +1 -0
  39. package/dist/index.d.ts +7 -0
  40. package/dist/index.esm.js +2 -0
  41. package/dist/index.esm.js.map +1 -0
  42. package/{esm/src/shared/base_repository.d.ts → dist/lib/api/base-repository.d.ts} +137 -42
  43. package/{script/npm/src/src/shared/common_responses.d.ts → dist/lib/api/common-responses.d.ts} +0 -1
  44. package/dist/lib/api/index.d.ts +2 -0
  45. package/{esm/src/errors/api_error.d.ts → dist/lib/error/error.api.d.ts} +0 -1
  46. package/{script/npm/src/src/errors/permission_error.d.ts → dist/lib/error/error.permission.d.ts} +1 -2
  47. package/dist/lib/error/error.utils.d.ts +22 -0
  48. package/dist/lib/error/index.d.ts +3 -0
  49. package/dist/models/contact-info.model.d.ts +817 -0
  50. package/{script/npm/src/src/models/contact/derivatives/contact.d.ts → dist/models/contact.model.d.ts} +23 -16
  51. package/dist/models/index.d.ts +11 -0
  52. package/{esm/src/models/user/managed-user.d.ts → dist/models/managed-user.model.d.ts} +3 -3
  53. package/dist/models/narration.model.d.ts +184 -0
  54. package/{script/npm/src/src/models/payout/derivatives/payout.d.ts → dist/models/payout.model.d.ts} +14 -16
  55. package/{esm/src → dist}/models/permission.d.ts +1 -2
  56. package/{script/npm/src/src/models/user/profile.d.ts → dist/models/profile.model.d.ts} +37 -43
  57. package/{script/npm/src/src/models/role.d.ts → dist/models/role.model.d.ts} +2 -10
  58. package/dist/models/statement-entry.model.d.ts +248 -0
  59. package/dist/models/user.model.d.ts +65 -0
  60. package/{script/npm/src/src/models/wallet/wallet.d.ts → dist/models/wallet.model.d.ts} +3 -46
  61. package/package.json +47 -24
  62. package/LICENSE +0 -7
  63. package/esm/mod.d.ts +0 -8
  64. package/esm/mod.d.ts.map +0 -1
  65. package/esm/mod.js +0 -7
  66. package/esm/package.json +0 -3
  67. package/esm/src/errors/api_error.d.ts.map +0 -1
  68. package/esm/src/errors/api_error.js +0 -90
  69. package/esm/src/errors/index.d.ts +0 -3
  70. package/esm/src/errors/index.d.ts.map +0 -1
  71. package/esm/src/errors/index.js +0 -2
  72. package/esm/src/errors/permission_error.d.ts +0 -48
  73. package/esm/src/errors/permission_error.d.ts.map +0 -1
  74. package/esm/src/errors/permission_error.js +0 -70
  75. package/esm/src/features/admin/contract.d.ts.map +0 -1
  76. package/esm/src/features/admin/contract.js +0 -210
  77. package/esm/src/features/admin/index.d.ts +0 -4
  78. package/esm/src/features/admin/index.d.ts.map +0 -1
  79. package/esm/src/features/admin/index.js +0 -3
  80. package/esm/src/features/admin/repository.d.ts +0 -114
  81. package/esm/src/features/admin/repository.d.ts.map +0 -1
  82. package/esm/src/features/admin/repository.js +0 -248
  83. package/esm/src/features/admin/schemas.d.ts +0 -146
  84. package/esm/src/features/admin/schemas.d.ts.map +0 -1
  85. package/esm/src/features/admin/schemas.js +0 -206
  86. package/esm/src/features/auth/access/contract.d.ts.map +0 -1
  87. package/esm/src/features/auth/access/contract.js +0 -14
  88. package/esm/src/features/auth/access/repository.d.ts +0 -11
  89. package/esm/src/features/auth/access/repository.d.ts.map +0 -1
  90. package/esm/src/features/auth/access/repository.js +0 -25
  91. package/esm/src/features/auth/contract.d.ts.map +0 -1
  92. package/esm/src/features/auth/contract.js +0 -43
  93. package/esm/src/features/auth/identity/contract.d.ts +0 -23
  94. package/esm/src/features/auth/identity/contract.d.ts.map +0 -1
  95. package/esm/src/features/auth/identity/contract.js +0 -17
  96. package/esm/src/features/auth/identity/repository.d.ts +0 -22
  97. package/esm/src/features/auth/identity/repository.d.ts.map +0 -1
  98. package/esm/src/features/auth/identity/repository.js +0 -30
  99. package/esm/src/features/auth/index.d.ts +0 -6
  100. package/esm/src/features/auth/index.d.ts.map +0 -1
  101. package/esm/src/features/auth/index.js +0 -5
  102. package/esm/src/features/auth/manager.d.ts +0 -105
  103. package/esm/src/features/auth/manager.d.ts.map +0 -1
  104. package/esm/src/features/auth/manager.js +0 -181
  105. package/esm/src/features/auth/profile/contract.d.ts +0 -37
  106. package/esm/src/features/auth/profile/contract.d.ts.map +0 -1
  107. package/esm/src/features/auth/profile/contract.js +0 -14
  108. package/esm/src/features/auth/profile/repository.d.ts +0 -11
  109. package/esm/src/features/auth/profile/repository.d.ts.map +0 -1
  110. package/esm/src/features/auth/profile/repository.js +0 -25
  111. package/esm/src/features/auth/repository.d.ts +0 -30
  112. package/esm/src/features/auth/repository.d.ts.map +0 -1
  113. package/esm/src/features/auth/repository.js +0 -69
  114. package/esm/src/features/auth/storage/client_store.d.ts +0 -30
  115. package/esm/src/features/auth/storage/client_store.d.ts.map +0 -1
  116. package/esm/src/features/auth/storage/client_store.js +0 -46
  117. package/esm/src/features/auth/storage/client_token_handler.d.ts.map +0 -1
  118. package/esm/src/features/auth/storage/client_token_handler.js +0 -36
  119. package/esm/src/features/auth/storage/server_store.d.ts +0 -24
  120. package/esm/src/features/auth/storage/server_store.d.ts.map +0 -1
  121. package/esm/src/features/auth/storage/server_store.js +0 -34
  122. package/esm/src/features/auth/storage/server_token_handler.d.ts +0 -36
  123. package/esm/src/features/auth/storage/server_token_handler.d.ts.map +0 -1
  124. package/esm/src/features/auth/storage/server_token_handler.js +0 -115
  125. package/esm/src/features/auth/storage/types.d.ts +0 -42
  126. package/esm/src/features/auth/storage/types.d.ts.map +0 -1
  127. package/esm/src/features/auth/storage/types.js +0 -1
  128. package/esm/src/features/contact/contract.d.ts.map +0 -1
  129. package/esm/src/features/contact/contract.js +0 -49
  130. package/esm/src/features/contact/index.d.ts +0 -2
  131. package/esm/src/features/contact/index.d.ts.map +0 -1
  132. package/esm/src/features/contact/index.js +0 -1
  133. package/esm/src/features/contact/repository.d.ts +0 -58
  134. package/esm/src/features/contact/repository.d.ts.map +0 -1
  135. package/esm/src/features/contact/repository.js +0 -108
  136. package/esm/src/features/payout/contract.d.ts.map +0 -1
  137. package/esm/src/features/payout/contract.js +0 -75
  138. package/esm/src/features/payout/index.d.ts +0 -2
  139. package/esm/src/features/payout/index.d.ts.map +0 -1
  140. package/esm/src/features/payout/index.js +0 -1
  141. package/esm/src/features/payout/repository.d.ts +0 -67
  142. package/esm/src/features/payout/repository.d.ts.map +0 -1
  143. package/esm/src/features/payout/repository.js +0 -163
  144. package/esm/src/features/wallet/contract.d.ts +0 -137
  145. package/esm/src/features/wallet/contract.d.ts.map +0 -1
  146. package/esm/src/features/wallet/contract.js +0 -38
  147. package/esm/src/features/wallet/index.d.ts +0 -2
  148. package/esm/src/features/wallet/index.d.ts.map +0 -1
  149. package/esm/src/features/wallet/index.js +0 -1
  150. package/esm/src/features/wallet/repository.d.ts +0 -57
  151. package/esm/src/features/wallet/repository.d.ts.map +0 -1
  152. package/esm/src/features/wallet/repository.js +0 -93
  153. package/esm/src/models/contact/derivatives/contact.d.ts +0 -172
  154. package/esm/src/models/contact/derivatives/contact.d.ts.map +0 -1
  155. package/esm/src/models/contact/derivatives/contact.js +0 -266
  156. package/esm/src/models/contact/derivatives/contact_info.d.ts +0 -188
  157. package/esm/src/models/contact/derivatives/contact_info.d.ts.map +0 -1
  158. package/esm/src/models/contact/derivatives/contact_info.js +0 -255
  159. package/esm/src/models/contact/index.d.ts +0 -5
  160. package/esm/src/models/contact/index.d.ts.map +0 -1
  161. package/esm/src/models/contact/index.js +0 -4
  162. package/esm/src/models/contact/schemas.d.ts +0 -66
  163. package/esm/src/models/contact/schemas.d.ts.map +0 -1
  164. package/esm/src/models/contact/schemas.js +0 -64
  165. package/esm/src/models/contact/validation.d.ts +0 -37
  166. package/esm/src/models/contact/validation.d.ts.map +0 -1
  167. package/esm/src/models/contact/validation.js +0 -146
  168. package/esm/src/models/index.d.ts +0 -7
  169. package/esm/src/models/index.d.ts.map +0 -1
  170. package/esm/src/models/index.js +0 -6
  171. package/esm/src/models/payout/api.d.ts +0 -29
  172. package/esm/src/models/payout/api.d.ts.map +0 -1
  173. package/esm/src/models/payout/api.js +0 -1
  174. package/esm/src/models/payout/channel.d.ts +0 -58
  175. package/esm/src/models/payout/channel.d.ts.map +0 -1
  176. package/esm/src/models/payout/channel.js +0 -53
  177. package/esm/src/models/payout/derivatives/payout.d.ts +0 -158
  178. package/esm/src/models/payout/derivatives/payout.d.ts.map +0 -1
  179. package/esm/src/models/payout/derivatives/payout.js +0 -265
  180. package/esm/src/models/payout/index.d.ts +0 -7
  181. package/esm/src/models/payout/index.d.ts.map +0 -1
  182. package/esm/src/models/payout/index.js +0 -6
  183. package/esm/src/models/payout/narration.d.ts +0 -164
  184. package/esm/src/models/payout/narration.d.ts.map +0 -1
  185. package/esm/src/models/payout/narration.js +0 -308
  186. package/esm/src/models/payout/schemas.d.ts +0 -156
  187. package/esm/src/models/payout/schemas.d.ts.map +0 -1
  188. package/esm/src/models/payout/schemas.js +0 -105
  189. package/esm/src/models/payout/status.d.ts +0 -33
  190. package/esm/src/models/payout/status.d.ts.map +0 -1
  191. package/esm/src/models/payout/status.js +0 -34
  192. package/esm/src/models/permission.d.ts.map +0 -1
  193. package/esm/src/models/permission.js +0 -50
  194. package/esm/src/models/role.d.ts +0 -21
  195. package/esm/src/models/role.d.ts.map +0 -1
  196. package/esm/src/models/role.js +0 -73
  197. package/esm/src/models/user/authenticated-user.d.ts +0 -77
  198. package/esm/src/models/user/authenticated-user.d.ts.map +0 -1
  199. package/esm/src/models/user/authenticated-user.js +0 -226
  200. package/esm/src/models/user/index.d.ts +0 -4
  201. package/esm/src/models/user/index.d.ts.map +0 -1
  202. package/esm/src/models/user/index.js +0 -3
  203. package/esm/src/models/user/managed-user.d.ts.map +0 -1
  204. package/esm/src/models/user/managed-user.js +0 -255
  205. package/esm/src/models/user/profile.d.ts +0 -161
  206. package/esm/src/models/user/profile.d.ts.map +0 -1
  207. package/esm/src/models/user/profile.js +0 -334
  208. package/esm/src/models/wallet/index.d.ts +0 -4
  209. package/esm/src/models/wallet/index.d.ts.map +0 -1
  210. package/esm/src/models/wallet/index.js +0 -3
  211. package/esm/src/models/wallet/schemas.d.ts +0 -95
  212. package/esm/src/models/wallet/schemas.d.ts.map +0 -1
  213. package/esm/src/models/wallet/schemas.js +0 -35
  214. package/esm/src/models/wallet/statement_entry.d.ts +0 -160
  215. package/esm/src/models/wallet/statement_entry.d.ts.map +0 -1
  216. package/esm/src/models/wallet/statement_entry.js +0 -255
  217. package/esm/src/models/wallet/wallet.d.ts +0 -147
  218. package/esm/src/models/wallet/wallet.d.ts.map +0 -1
  219. package/esm/src/models/wallet/wallet.js +0 -279
  220. package/esm/src/shared/base_repository.d.ts.map +0 -1
  221. package/esm/src/shared/base_repository.js +0 -153
  222. package/esm/src/shared/common_responses.d.ts +0 -13
  223. package/esm/src/shared/common_responses.d.ts.map +0 -1
  224. package/esm/src/shared/common_responses.js +0 -10
  225. package/esm/src/shared/index.d.ts +0 -3
  226. package/esm/src/shared/index.d.ts.map +0 -1
  227. package/esm/src/shared/index.js +0 -2
  228. package/esm/src/shared/token_required_repository.d.ts +0 -78
  229. package/esm/src/shared/token_required_repository.d.ts.map +0 -1
  230. package/esm/src/shared/token_required_repository.js +0 -128
  231. package/script/mod.d.ts +0 -8
  232. package/script/mod.d.ts.map +0 -1
  233. package/script/mod.js +0 -23
  234. package/script/npm/src/mod.d.ts +0 -8
  235. package/script/npm/src/mod.d.ts.map +0 -1
  236. package/script/npm/src/mod.js +0 -23
  237. package/script/npm/src/src/errors/api_error.d.ts +0 -63
  238. package/script/npm/src/src/errors/api_error.d.ts.map +0 -1
  239. package/script/npm/src/src/errors/api_error.js +0 -94
  240. package/script/npm/src/src/errors/index.d.ts +0 -3
  241. package/script/npm/src/src/errors/index.d.ts.map +0 -1
  242. package/script/npm/src/src/errors/index.js +0 -18
  243. package/script/npm/src/src/errors/permission_error.d.ts.map +0 -1
  244. package/script/npm/src/src/errors/permission_error.js +0 -74
  245. package/script/npm/src/src/features/admin/contract.d.ts +0 -842
  246. package/script/npm/src/src/features/admin/contract.d.ts.map +0 -1
  247. package/script/npm/src/src/features/admin/contract.js +0 -213
  248. package/script/npm/src/src/features/admin/index.d.ts +0 -4
  249. package/script/npm/src/src/features/admin/index.d.ts.map +0 -1
  250. package/script/npm/src/src/features/admin/index.js +0 -19
  251. package/script/npm/src/src/features/admin/repository.d.ts +0 -114
  252. package/script/npm/src/src/features/admin/repository.d.ts.map +0 -1
  253. package/script/npm/src/src/features/admin/repository.js +0 -252
  254. package/script/npm/src/src/features/admin/schemas.d.ts.map +0 -1
  255. package/script/npm/src/src/features/admin/schemas.js +0 -209
  256. package/script/npm/src/src/features/auth/access/contract.d.ts +0 -14
  257. package/script/npm/src/src/features/auth/access/contract.d.ts.map +0 -1
  258. package/script/npm/src/src/features/auth/access/contract.js +0 -17
  259. package/script/npm/src/src/features/auth/access/repository.d.ts +0 -11
  260. package/script/npm/src/src/features/auth/access/repository.d.ts.map +0 -1
  261. package/script/npm/src/src/features/auth/access/repository.js +0 -29
  262. package/script/npm/src/src/features/auth/contract.d.ts +0 -112
  263. package/script/npm/src/src/features/auth/contract.d.ts.map +0 -1
  264. package/script/npm/src/src/features/auth/contract.js +0 -46
  265. package/script/npm/src/src/features/auth/identity/contract.d.ts.map +0 -1
  266. package/script/npm/src/src/features/auth/identity/contract.js +0 -20
  267. package/script/npm/src/src/features/auth/identity/repository.d.ts +0 -22
  268. package/script/npm/src/src/features/auth/identity/repository.d.ts.map +0 -1
  269. package/script/npm/src/src/features/auth/identity/repository.js +0 -34
  270. package/script/npm/src/src/features/auth/index.d.ts +0 -6
  271. package/script/npm/src/src/features/auth/index.d.ts.map +0 -1
  272. package/script/npm/src/src/features/auth/index.js +0 -21
  273. package/script/npm/src/src/features/auth/manager.d.ts +0 -105
  274. package/script/npm/src/src/features/auth/manager.d.ts.map +0 -1
  275. package/script/npm/src/src/features/auth/manager.js +0 -185
  276. package/script/npm/src/src/features/auth/profile/contract.d.ts.map +0 -1
  277. package/script/npm/src/src/features/auth/profile/contract.js +0 -17
  278. package/script/npm/src/src/features/auth/profile/repository.d.ts +0 -11
  279. package/script/npm/src/src/features/auth/profile/repository.d.ts.map +0 -1
  280. package/script/npm/src/src/features/auth/profile/repository.js +0 -29
  281. package/script/npm/src/src/features/auth/repository.d.ts +0 -30
  282. package/script/npm/src/src/features/auth/repository.d.ts.map +0 -1
  283. package/script/npm/src/src/features/auth/repository.js +0 -73
  284. package/script/npm/src/src/features/auth/storage/client_store.d.ts.map +0 -1
  285. package/script/npm/src/src/features/auth/storage/client_store.js +0 -51
  286. package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts +0 -32
  287. package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts.map +0 -1
  288. package/script/npm/src/src/features/auth/storage/client_token_handler.js +0 -40
  289. package/script/npm/src/src/features/auth/storage/server_store.d.ts +0 -24
  290. package/script/npm/src/src/features/auth/storage/server_store.d.ts.map +0 -1
  291. package/script/npm/src/src/features/auth/storage/server_store.js +0 -38
  292. package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts +0 -36
  293. package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts.map +0 -1
  294. package/script/npm/src/src/features/auth/storage/server_token_handler.js +0 -119
  295. package/script/npm/src/src/features/auth/storage/types.d.ts.map +0 -1
  296. package/script/npm/src/src/features/auth/storage/types.js +0 -2
  297. package/script/npm/src/src/features/contact/contract.d.ts +0 -170
  298. package/script/npm/src/src/features/contact/contract.d.ts.map +0 -1
  299. package/script/npm/src/src/features/contact/contract.js +0 -52
  300. package/script/npm/src/src/features/contact/index.d.ts +0 -2
  301. package/script/npm/src/src/features/contact/index.d.ts.map +0 -1
  302. package/script/npm/src/src/features/contact/index.js +0 -17
  303. package/script/npm/src/src/features/contact/repository.d.ts +0 -58
  304. package/script/npm/src/src/features/contact/repository.d.ts.map +0 -1
  305. package/script/npm/src/src/features/contact/repository.js +0 -112
  306. package/script/npm/src/src/features/payout/contract.d.ts +0 -623
  307. package/script/npm/src/src/features/payout/contract.d.ts.map +0 -1
  308. package/script/npm/src/src/features/payout/contract.js +0 -78
  309. package/script/npm/src/src/features/payout/index.d.ts +0 -2
  310. package/script/npm/src/src/features/payout/index.d.ts.map +0 -1
  311. package/script/npm/src/src/features/payout/index.js +0 -17
  312. package/script/npm/src/src/features/payout/repository.d.ts +0 -67
  313. package/script/npm/src/src/features/payout/repository.d.ts.map +0 -1
  314. package/script/npm/src/src/features/payout/repository.js +0 -167
  315. package/script/npm/src/src/features/wallet/contract.d.ts.map +0 -1
  316. package/script/npm/src/src/features/wallet/contract.js +0 -41
  317. package/script/npm/src/src/features/wallet/index.d.ts +0 -2
  318. package/script/npm/src/src/features/wallet/index.d.ts.map +0 -1
  319. package/script/npm/src/src/features/wallet/index.js +0 -17
  320. package/script/npm/src/src/features/wallet/repository.d.ts +0 -57
  321. package/script/npm/src/src/features/wallet/repository.d.ts.map +0 -1
  322. package/script/npm/src/src/features/wallet/repository.js +0 -97
  323. package/script/npm/src/src/models/contact/derivatives/contact.d.ts.map +0 -1
  324. package/script/npm/src/src/models/contact/derivatives/contact.js +0 -270
  325. package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts +0 -188
  326. package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts.map +0 -1
  327. package/script/npm/src/src/models/contact/derivatives/contact_info.js +0 -260
  328. package/script/npm/src/src/models/contact/index.d.ts +0 -5
  329. package/script/npm/src/src/models/contact/index.d.ts.map +0 -1
  330. package/script/npm/src/src/models/contact/index.js +0 -20
  331. package/script/npm/src/src/models/contact/schemas.d.ts +0 -66
  332. package/script/npm/src/src/models/contact/schemas.d.ts.map +0 -1
  333. package/script/npm/src/src/models/contact/schemas.js +0 -67
  334. package/script/npm/src/src/models/contact/validation.d.ts +0 -37
  335. package/script/npm/src/src/models/contact/validation.d.ts.map +0 -1
  336. package/script/npm/src/src/models/contact/validation.js +0 -153
  337. package/script/npm/src/src/models/index.d.ts +0 -7
  338. package/script/npm/src/src/models/index.d.ts.map +0 -1
  339. package/script/npm/src/src/models/index.js +0 -22
  340. package/script/npm/src/src/models/payout/api.d.ts +0 -29
  341. package/script/npm/src/src/models/payout/api.d.ts.map +0 -1
  342. package/script/npm/src/src/models/payout/api.js +0 -2
  343. package/script/npm/src/src/models/payout/channel.d.ts +0 -58
  344. package/script/npm/src/src/models/payout/channel.d.ts.map +0 -1
  345. package/script/npm/src/src/models/payout/channel.js +0 -56
  346. package/script/npm/src/src/models/payout/derivatives/payout.d.ts.map +0 -1
  347. package/script/npm/src/src/models/payout/derivatives/payout.js +0 -269
  348. package/script/npm/src/src/models/payout/index.d.ts +0 -7
  349. package/script/npm/src/src/models/payout/index.d.ts.map +0 -1
  350. package/script/npm/src/src/models/payout/index.js +0 -22
  351. package/script/npm/src/src/models/payout/narration.d.ts +0 -164
  352. package/script/npm/src/src/models/payout/narration.d.ts.map +0 -1
  353. package/script/npm/src/src/models/payout/narration.js +0 -312
  354. package/script/npm/src/src/models/payout/schemas.d.ts +0 -156
  355. package/script/npm/src/src/models/payout/schemas.d.ts.map +0 -1
  356. package/script/npm/src/src/models/payout/schemas.js +0 -108
  357. package/script/npm/src/src/models/payout/status.d.ts +0 -33
  358. package/script/npm/src/src/models/payout/status.d.ts.map +0 -1
  359. package/script/npm/src/src/models/payout/status.js +0 -37
  360. package/script/npm/src/src/models/permission.d.ts +0 -55
  361. package/script/npm/src/src/models/permission.d.ts.map +0 -1
  362. package/script/npm/src/src/models/permission.js +0 -53
  363. package/script/npm/src/src/models/role.d.ts.map +0 -1
  364. package/script/npm/src/src/models/role.js +0 -77
  365. package/script/npm/src/src/models/user/authenticated-user.d.ts +0 -77
  366. package/script/npm/src/src/models/user/authenticated-user.d.ts.map +0 -1
  367. package/script/npm/src/src/models/user/authenticated-user.js +0 -230
  368. package/script/npm/src/src/models/user/index.d.ts +0 -4
  369. package/script/npm/src/src/models/user/index.d.ts.map +0 -1
  370. package/script/npm/src/src/models/user/index.js +0 -19
  371. package/script/npm/src/src/models/user/managed-user.d.ts +0 -108
  372. package/script/npm/src/src/models/user/managed-user.d.ts.map +0 -1
  373. package/script/npm/src/src/models/user/managed-user.js +0 -260
  374. package/script/npm/src/src/models/user/profile.d.ts.map +0 -1
  375. package/script/npm/src/src/models/user/profile.js +0 -338
  376. package/script/npm/src/src/models/wallet/index.d.ts +0 -4
  377. package/script/npm/src/src/models/wallet/index.d.ts.map +0 -1
  378. package/script/npm/src/src/models/wallet/index.js +0 -19
  379. package/script/npm/src/src/models/wallet/schemas.d.ts +0 -95
  380. package/script/npm/src/src/models/wallet/schemas.d.ts.map +0 -1
  381. package/script/npm/src/src/models/wallet/schemas.js +0 -38
  382. package/script/npm/src/src/models/wallet/statement_entry.d.ts +0 -160
  383. package/script/npm/src/src/models/wallet/statement_entry.d.ts.map +0 -1
  384. package/script/npm/src/src/models/wallet/statement_entry.js +0 -259
  385. package/script/npm/src/src/models/wallet/wallet.d.ts.map +0 -1
  386. package/script/npm/src/src/models/wallet/wallet.js +0 -283
  387. package/script/npm/src/src/shared/base_repository.d.ts +0 -80
  388. package/script/npm/src/src/shared/base_repository.d.ts.map +0 -1
  389. package/script/npm/src/src/shared/base_repository.js +0 -157
  390. package/script/npm/src/src/shared/common_responses.d.ts.map +0 -1
  391. package/script/npm/src/src/shared/common_responses.js +0 -13
  392. package/script/npm/src/src/shared/index.d.ts +0 -3
  393. package/script/npm/src/src/shared/index.d.ts.map +0 -1
  394. package/script/npm/src/src/shared/index.js +0 -18
  395. package/script/npm/src/src/shared/token_required_repository.d.ts +0 -78
  396. package/script/npm/src/src/shared/token_required_repository.d.ts.map +0 -1
  397. package/script/npm/src/src/shared/token_required_repository.js +0 -132
  398. package/script/package.json +0 -3
@@ -1,29 +0,0 @@
1
- /**
2
- * Arguments for retrieving payouts from the API.
3
- *
4
- * @interface GetPayoutsAPIArgs
5
- *
6
- * @property {number} [rangeStart] - The starting index for pagination. If not provided, defaults to beginning.
7
- * @property {number} [rangeEnd] - The ending index for pagination. If not provided, defaults to 10.
8
- * @property {boolean} [pending] - Filter for pending payouts only. If true, returns only pending payouts.
9
- *
10
- * @example
11
- * ```ts
12
- * // Get first 10 payouts
13
- * const args: GetPayoutsAPIArgs = {
14
- * rangeStart: 0,
15
- * rangeEnd: 10
16
- * };
17
- *
18
- * // Get only pending payouts
19
- * const pendingArgs: GetPayoutsAPIArgs = {
20
- * pending: true
21
- * };
22
- * ```
23
- */
24
- export interface GetPayoutsAPIArgs {
25
- rangeStart?: number;
26
- rangeEnd?: number;
27
- pending?: boolean;
28
- }
29
- //# sourceMappingURL=api.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../../src/src/models/payout/api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,58 +0,0 @@
1
- import { type TZPhoneNumber } from "@temboplus/frontend-core";
2
- /**
3
- * Represents the available channels through which payouts can be processed.
4
- * @enum {string}
5
- * @readonly
6
- */
7
- export declare enum PAYOUT_CHANNEL {
8
- /** Payment processed through mobile money services */
9
- MOBILE = "Mobile",
10
- /** Payment processed through traditional banking channels */
11
- BANK = "Bank",
12
- /** Payment processed through CRDB named account */
13
- CRDB_NAMED_ACC = "CRDB_NAMED_ACC"
14
- }
15
- /**
16
- * Valid payout channel codes that can be used in the system
17
- *
18
- * @remarks
19
- * - `TZ-BANK-B2C`: Code for bank transfers
20
- * - `TZ-VERTO-B2C`: Code for Verto transfers
21
- * - `TZ-${telecom}-B2C`: Pattern for mobile money transfers where the telecom company is the provider code
22
- *
23
- * @see {@link createPayoutChannelCode} for functions to generate valid codes
24
- */
25
- export type PayoutChannelCode = "TZ-BANK-B2C" | "TZ-VERTO-B2C" | `TZ-${string}-B2C`;
26
- /**
27
- * Utility functions to create standardized payout channel codes
28
- *
29
- * @example
30
- * ```ts
31
- * // Create bank channel code
32
- * const bankCode = createPayoutChannelCode.bank(); // Returns "TZ-BANK-B2C"
33
- *
34
- * // Create mobile channel code
35
- * const mobileCode = createPayoutChannelCode.mobile(phoneNumber); // Returns "TZ-VODACOM-B2C" for Vodacom number
36
- * ```
37
- */
38
- export declare const createPayoutChannelCode: {
39
- /**
40
- * Creates a bank transfer channel code
41
- * @returns {"TZ-BANK-B2C"} Standard bank transfer code
42
- */
43
- bank: () => "TZ-BANK-B2C";
44
- /**
45
- * Creates a Verto transfer channel code
46
- * @returns {"TZ-VERTO-B2C"} Standard Verto transfer code
47
- */
48
- verto: () => "TZ-VERTO-B2C";
49
- /**
50
- * Creates a mobile money channel code based on the telecom provider
51
- * @param {TZPhoneNumber} phoneNumber - Phone number object containing telecom information
52
- * @returns {PayoutChannelCode} Channel code in format "TZ-{TELECOM}-B2C"
53
- *
54
- * @see {@link TZPhoneNumber} from "@jsr/temboplus__tembo-core" for phone number structure
55
- */
56
- mobile: (phoneNumber: TZPhoneNumber) => PayoutChannelCode;
57
- };
58
- //# sourceMappingURL=channel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../../../../../src/src/models/payout/channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE/E;;;;GAIG;AACH,oBAAY,cAAc;IACxB,sDAAsD;IACtD,MAAM,WAAW;IACjB,6DAA6D;IAC7D,IAAI,SAAS;IACb,mDAAmD;IACnD,cAAc,mBAAmB;CAClC;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,iBAAiB,GACzB,aAAa,GACb,cAAc,GACd,MAAM,MAAM,MAAM,CAAC;AAEvB;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB;IAClC;;;OAGG;gBACO,aAAa;IAEvB;;;OAGG;iBACQ,cAAc;IAEzB;;;;;;OAMG;0BAC4B,aAAa,KAAG,iBAAiB;CAOjE,CAAC"}
@@ -1,56 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createPayoutChannelCode = exports.PAYOUT_CHANNEL = void 0;
4
- const frontend_core_1 = require("@temboplus/frontend-core");
5
- /**
6
- * Represents the available channels through which payouts can be processed.
7
- * @enum {string}
8
- * @readonly
9
- */
10
- var PAYOUT_CHANNEL;
11
- (function (PAYOUT_CHANNEL) {
12
- /** Payment processed through mobile money services */
13
- PAYOUT_CHANNEL["MOBILE"] = "Mobile";
14
- /** Payment processed through traditional banking channels */
15
- PAYOUT_CHANNEL["BANK"] = "Bank";
16
- /** Payment processed through CRDB named account */
17
- PAYOUT_CHANNEL["CRDB_NAMED_ACC"] = "CRDB_NAMED_ACC";
18
- })(PAYOUT_CHANNEL || (exports.PAYOUT_CHANNEL = PAYOUT_CHANNEL = {}));
19
- /**
20
- * Utility functions to create standardized payout channel codes
21
- *
22
- * @example
23
- * ```ts
24
- * // Create bank channel code
25
- * const bankCode = createPayoutChannelCode.bank(); // Returns "TZ-BANK-B2C"
26
- *
27
- * // Create mobile channel code
28
- * const mobileCode = createPayoutChannelCode.mobile(phoneNumber); // Returns "TZ-VODACOM-B2C" for Vodacom number
29
- * ```
30
- */
31
- exports.createPayoutChannelCode = {
32
- /**
33
- * Creates a bank transfer channel code
34
- * @returns {"TZ-BANK-B2C"} Standard bank transfer code
35
- */
36
- bank: () => "TZ-BANK-B2C",
37
- /**
38
- * Creates a Verto transfer channel code
39
- * @returns {"TZ-VERTO-B2C"} Standard Verto transfer code
40
- */
41
- verto: () => "TZ-VERTO-B2C",
42
- /**
43
- * Creates a mobile money channel code based on the telecom provider
44
- * @param {TZPhoneNumber} phoneNumber - Phone number object containing telecom information
45
- * @returns {PayoutChannelCode} Channel code in format "TZ-{TELECOM}-B2C"
46
- *
47
- * @see {@link TZPhoneNumber} from "@jsr/temboplus__tembo-core" for phone number structure
48
- */
49
- mobile: function (phoneNumber) {
50
- //! fix: Channeling all Vodacom numbers to Tigo. Request from Mr. Tesha to solve some specific problem
51
- if (phoneNumber.networkOperator.id === frontend_core_1.NetworkOperator.VODACOM) {
52
- return `TZ-${frontend_core_1.NetworkOperator.TIGO.toString().toUpperCase()}-B2C`;
53
- }
54
- return `TZ-${phoneNumber.networkOperator.id.toString().toUpperCase()}-B2C`;
55
- },
56
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"payout.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/models/payout/derivatives/payout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAuB,MAAM,0BAA0B,CAAC;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9D,OAAO,EAEL,KAAK,WAAW,EAEjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,KAAK,sBAAsB,EAC3B,aAAa,EACd,MAAM,cAAc,CAAC;AAGtB;;GAEG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;IAElC;;OAEG;IACH,OAAO;IAKP,uCAAuC;IACvC,IAAI,EAAE,IAAI,MAAM,CAEf;IAED,qDAAqD;IACrD,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,kCAAkC;IAClC,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,2CAA2C;IAC3C,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,+CAA+C;IAC/C,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED;;;OAGG;IACH,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,wCAAwC;IACxC,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,iDAAiD;IACjD,IAAI,KAAK,IAAI,MAAM,GAAG,SAAS,CAE9B;IAED;;;;;;;;;;;OAWG;IACH,IAAI,MAAM,IAAI,aAAa,CAe1B;IAED,2DAA2D;IAC3D,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED,iDAAiD;IACjD,IAAI,gBAAgB,IAAI,MAAM,GAAG,SAAS,CAEzC;IAED,wCAAwC;IACxC,IAAI,SAAS,IAAI,IAAI,CAEpB;IAED,6CAA6C;IAC7C,IAAI,SAAS,IAAI,IAAI,CAEpB;IAED,6CAA6C;IAC7C,IAAI,UAAU,IAAI,IAAI,GAAG,SAAS,CAEjC;IAED,4CAA4C;IAC5C,IAAI,cAAc,IAAI,sBAAsB,CAE3C;IAED,+CAA+C;IAC/C,IAAI,SAAS,IAAI,cAAc,GAAG,SAAS,CAE1C;IAED,qDAAqD;IACrD,IAAI,UAAU,IAAI,cAAc,GAAG,SAAS,CAE3C;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,IAAI,WAAW,IAAI,WAAW,GAAG,SAAS,CA+BzC;IAED;;;OAGG;IACH,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM;IAIvC;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,EAAE,GAAG,MAAM,EAAE;IAIpD;;;OAGG;WACW,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI;IAQzD;;;;;;;;;;;;;;;;;;;;;OAqBG;WACW,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,MAAM;IAUvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;WACW,EAAE,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,MAAM;IAO7C;;OAEG;IACI,MAAM,IAAI,UAAU;CAG5B"}
@@ -1,269 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Payout = void 0;
4
- const frontend_core_1 = require("@temboplus/frontend-core");
5
- const schemas_js_1 = require("../schemas.js");
6
- const index_js_1 = require("../../contact/index.js");
7
- const status_js_1 = require("../status.js");
8
- const channel_js_1 = require("../channel.js");
9
- /**
10
- * Payout class that wraps the Zod schema and provides additional functionality
11
- */
12
- class Payout {
13
- /**
14
- * Private constructor - use static methods to create instances
15
- */
16
- constructor(data) {
17
- Object.defineProperty(this, "data", {
18
- enumerable: true,
19
- configurable: true,
20
- writable: true,
21
- value: void 0
22
- });
23
- this.data = schemas_js_1.PayoutSchemas.payoutData.parse(data);
24
- }
25
- // Getters for all properties
26
- /** Unique identifier for the payout */
27
- get id() {
28
- return this.data.id;
29
- }
30
- /** Profile identifier associated with this payout */
31
- get profileId() {
32
- return this.data.profileId;
33
- }
34
- /** Name of the payee/recipient */
35
- get payeeName() {
36
- return this.data.payeeName;
37
- }
38
- /** Payment channel used for this payout */
39
- get channel() {
40
- return this.data.channel;
41
- }
42
- /** Mobile number or bank account identifier */
43
- get msisdn() {
44
- return this.data.msisdn;
45
- }
46
- /**
47
- * Amount to be paid out
48
- * @returns {Amount} Amount object representing the payout value
49
- */
50
- get amount() {
51
- return frontend_core_1.Amount.from(this.data.amount);
52
- }
53
- /** Description of the payout purpose */
54
- get description() {
55
- return this.data.description;
56
- }
57
- /** Optional additional notes about the payout */
58
- get notes() {
59
- return this.data.notes;
60
- }
61
- /**
62
- * Current status of the payout
63
- * Derived from both approval status and transaction status:
64
- * - Returns REJECTED if approval status is "Rejected"
65
- * - Returns FAILED if approved but transaction failed
66
- * - Returns PAID if approved and transaction succeeded
67
- * - Returns PENDING if awaiting approval
68
- * - Falls back to transaction status in other cases
69
- *
70
- * @returns {PAYOUT_STATUS} Current status of the payout
71
- * @see {@link PAYOUT_STATUS} for all possible status values
72
- */
73
- get status() {
74
- if (this.data.approvalStatus === "Rejected") {
75
- return status_js_1.PAYOUT_STATUS.REJECTED;
76
- }
77
- if (this.data.approvalStatus === "Approved") {
78
- if (this.data.status === "FAILED") {
79
- return status_js_1.PAYOUT_STATUS.FAILED;
80
- }
81
- return status_js_1.PAYOUT_STATUS.PAID;
82
- }
83
- if (this.data.approvalStatus === "Pending") {
84
- return status_js_1.PAYOUT_STATUS.PENDING;
85
- }
86
- return this.data.status;
87
- }
88
- /** Status message providing details about current state */
89
- get statusMessage() {
90
- return this.data.statusMessage;
91
- }
92
- /** Optional reference ID from payment partner */
93
- get partnerReference() {
94
- return this.data.partnerReference;
95
- }
96
- /** Timestamp when payout was created */
97
- get createdAt() {
98
- return this.data.createdAt;
99
- }
100
- /** Timestamp when payout was last updated */
101
- get updatedAt() {
102
- return this.data.updatedAt;
103
- }
104
- /** Timestamp when payout was last updated */
105
- get actionedAt() {
106
- return this.data.actionedAt ?? undefined;
107
- }
108
- /** Current approval status of the payout */
109
- get approvalStatus() {
110
- return this.data.approvalStatus;
111
- }
112
- /** Information about who created the payout */
113
- get createdBy() {
114
- return this.data.createdBy;
115
- }
116
- /** Information about who last actioned the payout */
117
- get actionedBy() {
118
- return this.data.actionedBy;
119
- }
120
- /**
121
- * Constructs contact information based on payout channel
122
- *
123
- * @returns {ContactInfo | undefined} Contact information object:
124
- * - MobileContactInfo for mobile money payouts
125
- * - BankContactInfo for bank transfers
126
- * - undefined if contact info cannot be constructed
127
- *
128
- * @remarks
129
- * For bank payouts, expects msisdn in format "SWIFTCODE:ACCOUNTNUMBER"
130
- *
131
- * @example
132
- * ```ts
133
- * // Mobile payout
134
- * payout.contactInfo // Returns MobileContactInfo with phone details
135
- *
136
- * // Bank payout
137
- * payout.contactInfo // Returns BankContactInfo with bank and account details
138
- * ```
139
- */
140
- get contactInfo() {
141
- let contactInfo;
142
- // extracting mobile contact information
143
- const phone = frontend_core_1.TZPhoneNumber.from(this.data.msisdn);
144
- if (phone) {
145
- contactInfo = new index_js_1.MobileContactInfo(this.data.payeeName, phone);
146
- }
147
- // extracting bank contact information
148
- const isBankPayout = this.data.channel === channel_js_1.createPayoutChannelCode.bank() ||
149
- this.data.channel === channel_js_1.createPayoutChannelCode.verto();
150
- if (isBankPayout) {
151
- // getting bank information from payout msisdn
152
- const text = this.data.msisdn.trim().split(":");
153
- try {
154
- const swiftcode = text[0];
155
- const accNo = text[1];
156
- const bank = frontend_core_1.Bank.fromSWIFTCode(swiftcode);
157
- if (bank) {
158
- contactInfo = new index_js_1.BankContactInfo(this.data.payeeName, bank, accNo);
159
- }
160
- }
161
- catch (_) {
162
- //
163
- }
164
- }
165
- return contactInfo;
166
- }
167
- /**
168
- * Creates a Payout instance from raw data
169
- * @throws {ZodError} if validation fails
170
- */
171
- static create(data) {
172
- return new Payout(data);
173
- }
174
- /**
175
- * Creates multiple Payout instances from an array of raw data
176
- * @throws {ZodError} if validation fails for any item
177
- */
178
- static createMany(dataArray) {
179
- return dataArray.map((data) => new Payout(data));
180
- }
181
- /**
182
- * Creates a Payout instance from raw data without throwing
183
- * @returns {Payout | null} Payout instance or null if validation fails
184
- */
185
- static createSafe(data) {
186
- try {
187
- return new Payout(data);
188
- }
189
- catch {
190
- return null;
191
- }
192
- }
193
- /**
194
- * Checks if an unknown value contains valid data to construct a Payout instance.
195
- * This is useful when validating raw data structures before instantiation.
196
- *
197
- * @param {unknown} obj - The value containing potential payout data
198
- * @returns {obj is Payout} Type predicate indicating if a Payout can be constructed
199
- *
200
- * @example
201
- * ```typescript
202
- * const rawData = await fetchPayoutData();
203
- * if (Payout.canConstruct(rawData)) {
204
- * const payout = Payout.create(rawData);
205
- * // TypeScript knows payout is valid here
206
- * console.log(payout.amount.toString());
207
- * }
208
- * ```
209
- *
210
- * @throws {never} This method never throws errors
211
- *
212
- * @remarks
213
- * This method performs strict validation against the {@link PayoutData} schema
214
- */
215
- static canConstruct(obj) {
216
- if (!obj || typeof obj !== "object")
217
- return false;
218
- const result = schemas_js_1.PayoutSchemas.payoutData.safeParse(obj);
219
- if (!result.success)
220
- return false;
221
- const payout = Payout.createSafe(result.data);
222
- return payout !== null;
223
- }
224
- /**
225
- * Validates if an unknown value is a Payout instance.
226
- * This is a runtime type guard that ensures proper object structure and data validity.
227
- *
228
- * @param {unknown} obj - The value to validate
229
- * @returns {obj is Payout} Type predicate indicating if the value is a valid Payout
230
- *
231
- * @example
232
- * ```typescript
233
- * const maybePayout = getPayoutFromCache();
234
- * if (Payout.is(maybePayout)) {
235
- * // TypeScript knows maybePayout is a Payout here
236
- * console.log(maybePayout.status);
237
- * }
238
- * ```
239
- *
240
- * @throws {never} This method never throws errors
241
- *
242
- * @remarks
243
- * This method performs a complete structural validation:
244
- * 1. Checks if the value is an object
245
- * 2. Verifies presence of internal data property
246
- * 3. Validates the data against PayoutData schema
247
- * 4. Ensures the object is a proper Payout instance
248
- *
249
- * Use this method when:
250
- * - Validating cached Payout instances
251
- * - Checking serialized Payout objects
252
- * - Verifying API responses
253
- * - Type narrowing in conditional blocks
254
- */
255
- static is(obj) {
256
- if (!obj || typeof obj !== "object")
257
- return false;
258
- if (!("data" in obj))
259
- return false;
260
- return Payout.canConstruct(obj.data);
261
- }
262
- /**
263
- * Converts Payout instance to a plain object
264
- */
265
- toJSON() {
266
- return { ...this.data };
267
- }
268
- }
269
- exports.Payout = Payout;
@@ -1,7 +0,0 @@
1
- export * from "./status.js";
2
- export * from "./schemas.js";
3
- export * from "./channel.js";
4
- export * from "./api.js";
5
- export * from "./narration.js";
6
- export * from "./derivatives/payout.js";
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/src/models/payout/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC"}
@@ -1,22 +0,0 @@
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("./status.js"), exports);
18
- __exportStar(require("./schemas.js"), exports);
19
- __exportStar(require("./channel.js"), exports);
20
- __exportStar(require("./api.js"), exports);
21
- __exportStar(require("./narration.js"), exports);
22
- __exportStar(require("./derivatives/payout.js"), exports);
@@ -1,164 +0,0 @@
1
- import { BankContactInfo, type ContactInfo, MobileContactInfo } from "@temboplus/afloat";
2
- /** Prefix for Ecobank mobile transfer narrations */
3
- export declare const ECOBANK_PREFIX = "MOBILE TRANSFER ";
4
- /** Current format prefix for bank payout narrations */
5
- export declare const BANK_NARR_PREFIX: string;
6
- /** Legacy format prefix for bank payout narrations */
7
- export declare const LEGACY_BANK_NARR_PREFIX: string;
8
- /** Current format prefix for mobile money payout narrations */
9
- export declare const MOBILE_NARR_PREFIX: string;
10
- /** Legacy format prefix for mobile money payout narrations */
11
- export declare const LEGACY_MOBILE_NARR_PREFIX: string;
12
- /**
13
- * Handles payout narration generation and parsing for the Afloat platform.
14
- *
15
- * This class provides functionality to:
16
- * - Generate standardized default narrations for mobile money and bank payouts
17
- * - Parse existing narrations to extract contact information
18
- * - Format narration text for different display contexts
19
- * - Handle both current and legacy narration formats for backward compatibility
20
- *
21
- * @example
22
- * ```typescript
23
- * // Generate default narration for a mobile contact
24
- * const mobileContact = new MobileContactInfo("John Doe", phoneNumber);
25
- * const narration = Narration.generateDefaultPayoutNarration(mobileContact);
26
- * // Result: "PAYOUT TO MOBILE +255123456789 JOHN DOE"
27
- *
28
- * // Parse narration to extract contact details
29
- * const existingNarration = new Narration("PAYOUT TO BANK CRDB 1234567890 Jane Smith");
30
- * const contact = existingNarration.getContactDetails();
31
- * ```
32
- */
33
- export declare class Narration {
34
- /** The raw narration text */
35
- text: string;
36
- /**
37
- * Creates a new Narration instance.
38
- *
39
- * @param text - The narration text to wrap
40
- */
41
- constructor(text: string);
42
- /**
43
- * Returns a medium-length version of the narration text suitable for table columns.
44
- * Truncates to 47 characters + "..." if longer than 50 characters.
45
- *
46
- * @returns Truncated narration text for medium-width displays
47
- */
48
- get mediumText(): string;
49
- /**
50
- * Returns a short version of the narration text suitable for compact displays.
51
- * Truncates to 32 characters + "..." if longer than 35 characters.
52
- *
53
- * @returns Truncated narration text for narrow displays
54
- */
55
- get shortText(): string;
56
- /**
57
- * Generates a default payout narration based on contact information.
58
- * Automatically determines whether to generate mobile or bank narration based on contact type.
59
- *
60
- * @param data - Contact information (either MobileContactInfo or BankContactInfo)
61
- * @returns Formatted default narration string in uppercase, or empty string if contact type is unrecognized
62
- *
63
- * @example
64
- * ```typescript
65
- * const mobileContact = new MobileContactInfo("John Doe", phoneNumber);
66
- * const narration = Narration.generateDefaultPayoutNarration(mobileContact);
67
- * // Returns: "PAYOUT TO MOBILE +255123456789 JOHN DOE"
68
- *
69
- * const bankContact = new BankContactInfo("Jane Smith", bank, "1234567890");
70
- * const narration = Narration.generateDefaultPayoutNarration(bankContact);
71
- * // Returns: "PAYOUT TO BANK CRDB 1234567890 JANE SMITH"
72
- * ```
73
- */
74
- static generateDefaultPayoutNarration(data: ContactInfo): string;
75
- /**
76
- * Generates a standardized mobile money payout narration.
77
- * Format: "PAYOUT TO MOBILE {phone_number} {name}"
78
- *
79
- * @param data - Mobile contact information containing phone number and name
80
- * @returns Formatted mobile payout narration in uppercase
81
- *
82
- * @example
83
- * ```typescript
84
- * const contact = new MobileContactInfo("John Doe", phoneNumber);
85
- * const narration = Narration.generateMobilePayoutNarration(contact);
86
- * // Returns: "PAYOUT TO MOBILE +255123456789 JOHN DOE"
87
- * ```
88
- */
89
- static generateMobilePayoutNarration(data: MobileContactInfo): string;
90
- /**
91
- * Generates a standardized bank payout narration.
92
- * Format: "PAYOUT TO BANK {bank_short_name} {account_number} {account_name}"
93
- *
94
- * @param data - Bank contact information containing bank details, account number, and account name
95
- * @returns Formatted bank payout narration in uppercase
96
- *
97
- * @example
98
- * ```typescript
99
- * const contact = new BankContactInfo("Jane Smith", bank, "1234567890");
100
- * const narration = Narration.generateBankPayoutNarration(contact);
101
- * // Returns: "PAYOUT TO BANK CRDB 1234567890 JANE SMITH"
102
- * ```
103
- */
104
- static generateBankPayoutNarration(data: BankContactInfo): string;
105
- /**
106
- * Extracts contact information from the narration text.
107
- * Attempts to parse both bank and mobile contact details from the narration.
108
- *
109
- * @returns Parsed ContactInfo (BankContactInfo or MobileContactInfo) if successful, undefined otherwise
110
- *
111
- * @example
112
- * ```typescript
113
- * const narration = new Narration("PAYOUT TO BANK CRDB 1234567890 Jane Smith");
114
- * const contact = narration.getContactDetails();
115
- * // Returns: BankContactInfo instance with parsed details
116
- * ```
117
- */
118
- getContactDetails: () => ContactInfo | undefined;
119
- /**
120
- * Extracts bank contact information from the narration text.
121
- * Handles both current format ("PAYOUT TO BANK") and legacy format ("TO_BANK").
122
- * Also handles Ecobank-prefixed narrations by stripping the prefix.
123
- *
124
- * Current format: "PAYOUT TO BANK {bank_name} {account_number} {account_name}"
125
- * Legacy format: "TO_BANK => {json_object}"
126
- *
127
- * @returns BankContactInfo if parsing is successful, undefined otherwise
128
- *
129
- * @example
130
- * ```typescript
131
- * // Current format
132
- * const narration = new Narration("PAYOUT TO BANK CRDB 1234567890 Jane Smith");
133
- * const contact = narration.getBankContactDetails();
134
- *
135
- * // Legacy format
136
- * const legacyNarration = new Narration('TO_BANK => {"account_number":"1234567890","account_name":"Jane Smith","swift_code":"CORUTZTZ"}');
137
- * const legacyContact = narration.getBankContactDetails();
138
- * ```
139
- */
140
- getBankContactDetails: () => BankContactInfo | undefined;
141
- /**
142
- * Extracts mobile contact information from the narration text.
143
- * Handles both current format ("PAYOUT TO MOBILE") and legacy format ("TO_MOMO").
144
- * Also handles Ecobank-prefixed narrations by stripping the prefix.
145
- *
146
- * Current format: "PAYOUT TO MOBILE {phone_number} {name}"
147
- * Legacy format: "TO_MOMO => {json_object}"
148
- *
149
- * @returns MobileContactInfo if parsing is successful, undefined otherwise
150
- *
151
- * @example
152
- * ```typescript
153
- * // Current format
154
- * const narration = new Narration("PAYOUT TO MOBILE +255123456789 John Doe");
155
- * const contact = narration.getMobileContactDetails();
156
- *
157
- * // Legacy format
158
- * const legacyNarration = new Narration('TO_MOMO => {"phone_number":"+255123456789","username":"John Doe"}');
159
- * const legacyContact = narration.getMobileContactDetails();
160
- * ```
161
- */
162
- getMobileContactDetails: () => MobileContactInfo | undefined;
163
- }
164
- //# sourceMappingURL=narration.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"narration.d.ts","sourceRoot":"","sources":["../../../../../../src/src/models/payout/narration.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,KAAK,WAAW,EAChB,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAG3B,oDAAoD;AACpD,eAAO,MAAM,cAAc,qBAAqB,CAAC;AAEjD,uDAAuD;AACvD,eAAO,MAAM,gBAAgB,EAAE,MAAyB,CAAC;AACzD,sDAAsD;AACtD,eAAO,MAAM,uBAAuB,EAAE,MAAkB,CAAC;AAEzD,+DAA+D;AAC/D,eAAO,MAAM,kBAAkB,EAAE,MAA2B,CAAC;AAC7D,8DAA8D;AAC9D,eAAO,MAAM,yBAAyB,EAAE,MAAkB,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,SAAS;IACpB,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;gBACS,IAAI,EAAE,MAAM;IAIxB;;;;;OAKG;IACH,IAAI,UAAU,WAMb;IAED;;;;;OAKG;IACH,IAAI,SAAS,WAMZ;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,8BAA8B,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM;IAUhE;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,6BAA6B,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM;IAKrE;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,2BAA2B,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM;IAKjE;;;;;;;;;;;;OAYG;IACH,iBAAiB,QAAO,WAAW,GAAG,SAAS,CAM7C;IAEF;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,qBAAqB,QAAO,eAAe,GAAG,SAAS,CAqCrD;IAEF;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,uBAAuB,QAAO,iBAAiB,GAAG,SAAS,CAuCzD;CACH"}