@temboplus/afloat 0.1.80 → 0.2.0-beta.1

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 (413) hide show
  1. package/README.md +246 -42
  2. package/dist/index.cjs.js +2 -0
  3. package/dist/index.cjs.js.map +1 -0
  4. package/dist/index.d.ts +10 -0
  5. package/dist/index.esm.js +2 -0
  6. package/dist/index.esm.js.map +1 -0
  7. package/dist/lib/api/base-repository.d.ts +177 -0
  8. package/dist/lib/api/index.d.ts +1 -0
  9. package/{esm/src/errors/api_error.d.ts → dist/lib/error/error.api.d.ts} +0 -1
  10. package/{script/npm/src/src/errors/permission_error.d.ts → dist/lib/error/error.permission.d.ts} +1 -2
  11. package/dist/lib/error/error.utils.d.ts +22 -0
  12. package/dist/lib/error/index.d.ts +3 -0
  13. package/dist/lib/query/index.d.ts +4 -0
  14. package/dist/lib/query/pagination/pagination.d.ts +73 -0
  15. package/dist/lib/query/pagination/pagination.schemas.d.ts +83 -0
  16. package/dist/lib/query/query.builder.d.ts +75 -0
  17. package/dist/lib/query/query.types.d.ts +36 -0
  18. package/{esm/src/features/auth/contract.d.ts → dist/modules/auth/auth.contract.d.ts} +16 -19
  19. package/dist/modules/auth/auth.repository.d.ts +83 -0
  20. package/dist/modules/auth/company-membership.model.d.ts +171 -0
  21. package/dist/modules/auth/index.d.ts +3 -0
  22. package/dist/modules/auth/user.model.d.ts +363 -0
  23. package/dist/modules/beneficiary/beneficiary-info.model.d.ts +178 -0
  24. package/dist/modules/beneficiary/beneficiary-input-handler.d.ts +16 -0
  25. package/dist/modules/beneficiary/beneficiary.api-contract.d.ts +203 -0
  26. package/dist/modules/beneficiary/beneficiary.dtos.d.ts +84 -0
  27. package/dist/modules/beneficiary/beneficiary.model.d.ts +441 -0
  28. package/dist/modules/beneficiary/beneficiary.repository.d.ts +116 -0
  29. package/dist/modules/beneficiary/index.d.ts +6 -0
  30. package/dist/modules/login/index.d.ts +4 -0
  31. package/dist/modules/login/login.api-contract.d.ts +51 -0
  32. package/dist/modules/login/login.dtos.d.ts +85 -0
  33. package/dist/modules/login/login.model.d.ts +168 -0
  34. package/dist/modules/login/login.repository.d.ts +58 -0
  35. package/{script/npm/src/src/models/permission.d.ts → dist/modules/login/permission.type.d.ts} +8 -9
  36. package/dist/modules/payout/index.d.ts +5 -0
  37. package/dist/modules/payout/payout-channel-handler.d.ts +82 -0
  38. package/{esm/src/features/payout/contract.d.ts → dist/modules/payout/payout.api-contract.d.ts} +350 -207
  39. package/dist/modules/payout/payout.dtos.d.ts +607 -0
  40. package/dist/modules/payout/payout.model.d.ts +383 -0
  41. package/dist/modules/payout/payout.query.d.ts +134 -0
  42. package/dist/modules/payout/payout.repository.d.ts +204 -0
  43. package/dist/modules/profile/index.d.ts +3 -0
  44. package/{script/npm/src/src/features/auth/profile/contract.d.ts → dist/modules/profile/profile.api-contract.d.ts} +8 -6
  45. package/dist/modules/profile/profile.dtos.d.ts +80 -0
  46. package/{script/npm/src/src/models/user/profile.d.ts → dist/modules/profile/profile.model.d.ts} +81 -52
  47. package/dist/modules/profile/profile.repository.d.ts +56 -0
  48. package/dist/modules/team-member/index.d.ts +4 -0
  49. package/dist/modules/team-member/role.model.d.ts +61 -0
  50. package/{esm/src/features/admin/contract.d.ts → dist/modules/team-member/team-member.contract.d.ts} +229 -154
  51. package/dist/modules/team-member/team-member.dtos.d.ts +261 -0
  52. package/dist/modules/team-member/team-member.model.d.ts +237 -0
  53. package/dist/modules/team-member/team-member.repository.d.ts +179 -0
  54. package/dist/modules/wallet/index.d.ts +6 -0
  55. package/dist/modules/wallet/narration.model.d.ts +225 -0
  56. package/dist/modules/wallet/statement-entry.model.d.ts +299 -0
  57. package/{script/npm/src/src/features/wallet/contract.d.ts → dist/modules/wallet/wallet.contract.d.ts} +17 -15
  58. package/dist/modules/wallet/wallet.dtos.d.ts +204 -0
  59. package/{esm/src/models/wallet/wallet.d.ts → dist/modules/wallet/wallet.model.d.ts} +34 -40
  60. package/dist/modules/wallet/wallet.query.d.ts +95 -0
  61. package/dist/modules/wallet/wallet.repository.d.ts +205 -0
  62. package/dist/modules/wallet/wallet.utils.d.ts +17 -0
  63. package/package.json +49 -23
  64. package/LICENSE +0 -7
  65. package/esm/mod.d.ts +0 -8
  66. package/esm/mod.d.ts.map +0 -1
  67. package/esm/mod.js +0 -7
  68. package/esm/package.json +0 -3
  69. package/esm/src/errors/api_error.d.ts.map +0 -1
  70. package/esm/src/errors/api_error.js +0 -90
  71. package/esm/src/errors/index.d.ts +0 -3
  72. package/esm/src/errors/index.d.ts.map +0 -1
  73. package/esm/src/errors/index.js +0 -2
  74. package/esm/src/errors/permission_error.d.ts +0 -48
  75. package/esm/src/errors/permission_error.d.ts.map +0 -1
  76. package/esm/src/errors/permission_error.js +0 -70
  77. package/esm/src/features/admin/contract.d.ts.map +0 -1
  78. package/esm/src/features/admin/contract.js +0 -210
  79. package/esm/src/features/admin/index.d.ts +0 -4
  80. package/esm/src/features/admin/index.d.ts.map +0 -1
  81. package/esm/src/features/admin/index.js +0 -3
  82. package/esm/src/features/admin/repository.d.ts +0 -114
  83. package/esm/src/features/admin/repository.d.ts.map +0 -1
  84. package/esm/src/features/admin/repository.js +0 -248
  85. package/esm/src/features/admin/schemas.d.ts +0 -146
  86. package/esm/src/features/admin/schemas.d.ts.map +0 -1
  87. package/esm/src/features/admin/schemas.js +0 -206
  88. package/esm/src/features/auth/access/contract.d.ts +0 -14
  89. package/esm/src/features/auth/access/contract.d.ts.map +0 -1
  90. package/esm/src/features/auth/access/contract.js +0 -14
  91. package/esm/src/features/auth/access/repository.d.ts +0 -11
  92. package/esm/src/features/auth/access/repository.d.ts.map +0 -1
  93. package/esm/src/features/auth/access/repository.js +0 -25
  94. package/esm/src/features/auth/contract.d.ts.map +0 -1
  95. package/esm/src/features/auth/contract.js +0 -43
  96. package/esm/src/features/auth/identity/contract.d.ts +0 -23
  97. package/esm/src/features/auth/identity/contract.d.ts.map +0 -1
  98. package/esm/src/features/auth/identity/contract.js +0 -17
  99. package/esm/src/features/auth/identity/repository.d.ts +0 -22
  100. package/esm/src/features/auth/identity/repository.d.ts.map +0 -1
  101. package/esm/src/features/auth/identity/repository.js +0 -30
  102. package/esm/src/features/auth/index.d.ts +0 -6
  103. package/esm/src/features/auth/index.d.ts.map +0 -1
  104. package/esm/src/features/auth/index.js +0 -5
  105. package/esm/src/features/auth/manager.d.ts +0 -105
  106. package/esm/src/features/auth/manager.d.ts.map +0 -1
  107. package/esm/src/features/auth/manager.js +0 -181
  108. package/esm/src/features/auth/profile/contract.d.ts +0 -37
  109. package/esm/src/features/auth/profile/contract.d.ts.map +0 -1
  110. package/esm/src/features/auth/profile/contract.js +0 -14
  111. package/esm/src/features/auth/profile/repository.d.ts +0 -11
  112. package/esm/src/features/auth/profile/repository.d.ts.map +0 -1
  113. package/esm/src/features/auth/profile/repository.js +0 -25
  114. package/esm/src/features/auth/repository.d.ts +0 -30
  115. package/esm/src/features/auth/repository.d.ts.map +0 -1
  116. package/esm/src/features/auth/repository.js +0 -69
  117. package/esm/src/features/auth/storage/client_store.d.ts +0 -30
  118. package/esm/src/features/auth/storage/client_store.d.ts.map +0 -1
  119. package/esm/src/features/auth/storage/client_store.js +0 -46
  120. package/esm/src/features/auth/storage/client_token_handler.d.ts +0 -32
  121. package/esm/src/features/auth/storage/client_token_handler.d.ts.map +0 -1
  122. package/esm/src/features/auth/storage/client_token_handler.js +0 -36
  123. package/esm/src/features/auth/storage/server_store.d.ts +0 -24
  124. package/esm/src/features/auth/storage/server_store.d.ts.map +0 -1
  125. package/esm/src/features/auth/storage/server_store.js +0 -34
  126. package/esm/src/features/auth/storage/server_token_handler.d.ts +0 -36
  127. package/esm/src/features/auth/storage/server_token_handler.d.ts.map +0 -1
  128. package/esm/src/features/auth/storage/server_token_handler.js +0 -115
  129. package/esm/src/features/auth/storage/types.d.ts +0 -42
  130. package/esm/src/features/auth/storage/types.d.ts.map +0 -1
  131. package/esm/src/features/auth/storage/types.js +0 -1
  132. package/esm/src/features/contact/contract.d.ts +0 -170
  133. package/esm/src/features/contact/contract.d.ts.map +0 -1
  134. package/esm/src/features/contact/contract.js +0 -49
  135. package/esm/src/features/contact/index.d.ts +0 -2
  136. package/esm/src/features/contact/index.d.ts.map +0 -1
  137. package/esm/src/features/contact/index.js +0 -1
  138. package/esm/src/features/contact/repository.d.ts +0 -58
  139. package/esm/src/features/contact/repository.d.ts.map +0 -1
  140. package/esm/src/features/contact/repository.js +0 -108
  141. package/esm/src/features/payout/contract.d.ts.map +0 -1
  142. package/esm/src/features/payout/contract.js +0 -75
  143. package/esm/src/features/payout/index.d.ts +0 -2
  144. package/esm/src/features/payout/index.d.ts.map +0 -1
  145. package/esm/src/features/payout/index.js +0 -1
  146. package/esm/src/features/payout/repository.d.ts +0 -67
  147. package/esm/src/features/payout/repository.d.ts.map +0 -1
  148. package/esm/src/features/payout/repository.js +0 -179
  149. package/esm/src/features/wallet/contract.d.ts +0 -137
  150. package/esm/src/features/wallet/contract.d.ts.map +0 -1
  151. package/esm/src/features/wallet/contract.js +0 -38
  152. package/esm/src/features/wallet/index.d.ts +0 -2
  153. package/esm/src/features/wallet/index.d.ts.map +0 -1
  154. package/esm/src/features/wallet/index.js +0 -1
  155. package/esm/src/features/wallet/repository.d.ts +0 -57
  156. package/esm/src/features/wallet/repository.d.ts.map +0 -1
  157. package/esm/src/features/wallet/repository.js +0 -93
  158. package/esm/src/models/contact/derivatives/contact.d.ts +0 -172
  159. package/esm/src/models/contact/derivatives/contact.d.ts.map +0 -1
  160. package/esm/src/models/contact/derivatives/contact.js +0 -266
  161. package/esm/src/models/contact/derivatives/contact_info.d.ts +0 -188
  162. package/esm/src/models/contact/derivatives/contact_info.d.ts.map +0 -1
  163. package/esm/src/models/contact/derivatives/contact_info.js +0 -255
  164. package/esm/src/models/contact/index.d.ts +0 -5
  165. package/esm/src/models/contact/index.d.ts.map +0 -1
  166. package/esm/src/models/contact/index.js +0 -4
  167. package/esm/src/models/contact/schemas.d.ts +0 -66
  168. package/esm/src/models/contact/schemas.d.ts.map +0 -1
  169. package/esm/src/models/contact/schemas.js +0 -64
  170. package/esm/src/models/contact/validation.d.ts +0 -37
  171. package/esm/src/models/contact/validation.d.ts.map +0 -1
  172. package/esm/src/models/contact/validation.js +0 -146
  173. package/esm/src/models/index.d.ts +0 -7
  174. package/esm/src/models/index.d.ts.map +0 -1
  175. package/esm/src/models/index.js +0 -6
  176. package/esm/src/models/payout/api.d.ts +0 -29
  177. package/esm/src/models/payout/api.d.ts.map +0 -1
  178. package/esm/src/models/payout/api.js +0 -1
  179. package/esm/src/models/payout/channel.d.ts +0 -58
  180. package/esm/src/models/payout/channel.d.ts.map +0 -1
  181. package/esm/src/models/payout/channel.js +0 -53
  182. package/esm/src/models/payout/derivatives/payout.d.ts +0 -158
  183. package/esm/src/models/payout/derivatives/payout.d.ts.map +0 -1
  184. package/esm/src/models/payout/derivatives/payout.js +0 -271
  185. package/esm/src/models/payout/index.d.ts +0 -7
  186. package/esm/src/models/payout/index.d.ts.map +0 -1
  187. package/esm/src/models/payout/index.js +0 -6
  188. package/esm/src/models/payout/narration.d.ts +0 -164
  189. package/esm/src/models/payout/narration.d.ts.map +0 -1
  190. package/esm/src/models/payout/narration.js +0 -308
  191. package/esm/src/models/payout/schemas.d.ts +0 -156
  192. package/esm/src/models/payout/schemas.d.ts.map +0 -1
  193. package/esm/src/models/payout/schemas.js +0 -105
  194. package/esm/src/models/payout/status.d.ts +0 -33
  195. package/esm/src/models/payout/status.d.ts.map +0 -1
  196. package/esm/src/models/payout/status.js +0 -34
  197. package/esm/src/models/permission.d.ts +0 -55
  198. package/esm/src/models/permission.d.ts.map +0 -1
  199. package/esm/src/models/permission.js +0 -50
  200. package/esm/src/models/role.d.ts +0 -21
  201. package/esm/src/models/role.d.ts.map +0 -1
  202. package/esm/src/models/role.js +0 -73
  203. package/esm/src/models/user/authenticated-user.d.ts +0 -77
  204. package/esm/src/models/user/authenticated-user.d.ts.map +0 -1
  205. package/esm/src/models/user/authenticated-user.js +0 -226
  206. package/esm/src/models/user/index.d.ts +0 -4
  207. package/esm/src/models/user/index.d.ts.map +0 -1
  208. package/esm/src/models/user/index.js +0 -3
  209. package/esm/src/models/user/managed-user.d.ts +0 -108
  210. package/esm/src/models/user/managed-user.d.ts.map +0 -1
  211. package/esm/src/models/user/managed-user.js +0 -255
  212. package/esm/src/models/user/profile.d.ts +0 -161
  213. package/esm/src/models/user/profile.d.ts.map +0 -1
  214. package/esm/src/models/user/profile.js +0 -334
  215. package/esm/src/models/wallet/index.d.ts +0 -4
  216. package/esm/src/models/wallet/index.d.ts.map +0 -1
  217. package/esm/src/models/wallet/index.js +0 -3
  218. package/esm/src/models/wallet/schemas.d.ts +0 -95
  219. package/esm/src/models/wallet/schemas.d.ts.map +0 -1
  220. package/esm/src/models/wallet/schemas.js +0 -35
  221. package/esm/src/models/wallet/statement_entry.d.ts +0 -160
  222. package/esm/src/models/wallet/statement_entry.d.ts.map +0 -1
  223. package/esm/src/models/wallet/statement_entry.js +0 -255
  224. package/esm/src/models/wallet/wallet.d.ts.map +0 -1
  225. package/esm/src/models/wallet/wallet.js +0 -279
  226. package/esm/src/shared/base_repository.d.ts +0 -80
  227. package/esm/src/shared/base_repository.d.ts.map +0 -1
  228. package/esm/src/shared/base_repository.js +0 -153
  229. package/esm/src/shared/common_responses.d.ts +0 -13
  230. package/esm/src/shared/common_responses.d.ts.map +0 -1
  231. package/esm/src/shared/common_responses.js +0 -10
  232. package/esm/src/shared/index.d.ts +0 -3
  233. package/esm/src/shared/index.d.ts.map +0 -1
  234. package/esm/src/shared/index.js +0 -2
  235. package/esm/src/shared/token_required_repository.d.ts +0 -78
  236. package/esm/src/shared/token_required_repository.d.ts.map +0 -1
  237. package/esm/src/shared/token_required_repository.js +0 -128
  238. package/script/mod.d.ts +0 -8
  239. package/script/mod.d.ts.map +0 -1
  240. package/script/mod.js +0 -23
  241. package/script/npm/src/mod.d.ts +0 -8
  242. package/script/npm/src/mod.d.ts.map +0 -1
  243. package/script/npm/src/mod.js +0 -23
  244. package/script/npm/src/src/errors/api_error.d.ts +0 -63
  245. package/script/npm/src/src/errors/api_error.d.ts.map +0 -1
  246. package/script/npm/src/src/errors/api_error.js +0 -94
  247. package/script/npm/src/src/errors/index.d.ts +0 -3
  248. package/script/npm/src/src/errors/index.d.ts.map +0 -1
  249. package/script/npm/src/src/errors/index.js +0 -18
  250. package/script/npm/src/src/errors/permission_error.d.ts.map +0 -1
  251. package/script/npm/src/src/errors/permission_error.js +0 -74
  252. package/script/npm/src/src/features/admin/contract.d.ts +0 -842
  253. package/script/npm/src/src/features/admin/contract.d.ts.map +0 -1
  254. package/script/npm/src/src/features/admin/contract.js +0 -213
  255. package/script/npm/src/src/features/admin/index.d.ts +0 -4
  256. package/script/npm/src/src/features/admin/index.d.ts.map +0 -1
  257. package/script/npm/src/src/features/admin/index.js +0 -19
  258. package/script/npm/src/src/features/admin/repository.d.ts +0 -114
  259. package/script/npm/src/src/features/admin/repository.d.ts.map +0 -1
  260. package/script/npm/src/src/features/admin/repository.js +0 -252
  261. package/script/npm/src/src/features/admin/schemas.d.ts +0 -146
  262. package/script/npm/src/src/features/admin/schemas.d.ts.map +0 -1
  263. package/script/npm/src/src/features/admin/schemas.js +0 -209
  264. package/script/npm/src/src/features/auth/access/contract.d.ts +0 -14
  265. package/script/npm/src/src/features/auth/access/contract.d.ts.map +0 -1
  266. package/script/npm/src/src/features/auth/access/contract.js +0 -17
  267. package/script/npm/src/src/features/auth/access/repository.d.ts +0 -11
  268. package/script/npm/src/src/features/auth/access/repository.d.ts.map +0 -1
  269. package/script/npm/src/src/features/auth/access/repository.js +0 -29
  270. package/script/npm/src/src/features/auth/contract.d.ts +0 -112
  271. package/script/npm/src/src/features/auth/contract.d.ts.map +0 -1
  272. package/script/npm/src/src/features/auth/contract.js +0 -46
  273. package/script/npm/src/src/features/auth/identity/contract.d.ts +0 -23
  274. package/script/npm/src/src/features/auth/identity/contract.d.ts.map +0 -1
  275. package/script/npm/src/src/features/auth/identity/contract.js +0 -20
  276. package/script/npm/src/src/features/auth/identity/repository.d.ts +0 -22
  277. package/script/npm/src/src/features/auth/identity/repository.d.ts.map +0 -1
  278. package/script/npm/src/src/features/auth/identity/repository.js +0 -34
  279. package/script/npm/src/src/features/auth/index.d.ts +0 -6
  280. package/script/npm/src/src/features/auth/index.d.ts.map +0 -1
  281. package/script/npm/src/src/features/auth/index.js +0 -21
  282. package/script/npm/src/src/features/auth/manager.d.ts +0 -105
  283. package/script/npm/src/src/features/auth/manager.d.ts.map +0 -1
  284. package/script/npm/src/src/features/auth/manager.js +0 -185
  285. package/script/npm/src/src/features/auth/profile/contract.d.ts.map +0 -1
  286. package/script/npm/src/src/features/auth/profile/contract.js +0 -17
  287. package/script/npm/src/src/features/auth/profile/repository.d.ts +0 -11
  288. package/script/npm/src/src/features/auth/profile/repository.d.ts.map +0 -1
  289. package/script/npm/src/src/features/auth/profile/repository.js +0 -29
  290. package/script/npm/src/src/features/auth/repository.d.ts +0 -30
  291. package/script/npm/src/src/features/auth/repository.d.ts.map +0 -1
  292. package/script/npm/src/src/features/auth/repository.js +0 -73
  293. package/script/npm/src/src/features/auth/storage/client_store.d.ts +0 -30
  294. package/script/npm/src/src/features/auth/storage/client_store.d.ts.map +0 -1
  295. package/script/npm/src/src/features/auth/storage/client_store.js +0 -51
  296. package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts +0 -32
  297. package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts.map +0 -1
  298. package/script/npm/src/src/features/auth/storage/client_token_handler.js +0 -40
  299. package/script/npm/src/src/features/auth/storage/server_store.d.ts +0 -24
  300. package/script/npm/src/src/features/auth/storage/server_store.d.ts.map +0 -1
  301. package/script/npm/src/src/features/auth/storage/server_store.js +0 -38
  302. package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts +0 -36
  303. package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts.map +0 -1
  304. package/script/npm/src/src/features/auth/storage/server_token_handler.js +0 -119
  305. package/script/npm/src/src/features/auth/storage/types.d.ts +0 -42
  306. package/script/npm/src/src/features/auth/storage/types.d.ts.map +0 -1
  307. package/script/npm/src/src/features/auth/storage/types.js +0 -2
  308. package/script/npm/src/src/features/contact/contract.d.ts +0 -170
  309. package/script/npm/src/src/features/contact/contract.d.ts.map +0 -1
  310. package/script/npm/src/src/features/contact/contract.js +0 -52
  311. package/script/npm/src/src/features/contact/index.d.ts +0 -2
  312. package/script/npm/src/src/features/contact/index.d.ts.map +0 -1
  313. package/script/npm/src/src/features/contact/index.js +0 -17
  314. package/script/npm/src/src/features/contact/repository.d.ts +0 -58
  315. package/script/npm/src/src/features/contact/repository.d.ts.map +0 -1
  316. package/script/npm/src/src/features/contact/repository.js +0 -112
  317. package/script/npm/src/src/features/payout/contract.d.ts +0 -623
  318. package/script/npm/src/src/features/payout/contract.d.ts.map +0 -1
  319. package/script/npm/src/src/features/payout/contract.js +0 -78
  320. package/script/npm/src/src/features/payout/index.d.ts +0 -2
  321. package/script/npm/src/src/features/payout/index.d.ts.map +0 -1
  322. package/script/npm/src/src/features/payout/index.js +0 -17
  323. package/script/npm/src/src/features/payout/repository.d.ts +0 -67
  324. package/script/npm/src/src/features/payout/repository.d.ts.map +0 -1
  325. package/script/npm/src/src/features/payout/repository.js +0 -183
  326. package/script/npm/src/src/features/wallet/contract.d.ts.map +0 -1
  327. package/script/npm/src/src/features/wallet/contract.js +0 -41
  328. package/script/npm/src/src/features/wallet/index.d.ts +0 -2
  329. package/script/npm/src/src/features/wallet/index.d.ts.map +0 -1
  330. package/script/npm/src/src/features/wallet/index.js +0 -17
  331. package/script/npm/src/src/features/wallet/repository.d.ts +0 -57
  332. package/script/npm/src/src/features/wallet/repository.d.ts.map +0 -1
  333. package/script/npm/src/src/features/wallet/repository.js +0 -97
  334. package/script/npm/src/src/models/contact/derivatives/contact.d.ts +0 -172
  335. package/script/npm/src/src/models/contact/derivatives/contact.d.ts.map +0 -1
  336. package/script/npm/src/src/models/contact/derivatives/contact.js +0 -270
  337. package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts +0 -188
  338. package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts.map +0 -1
  339. package/script/npm/src/src/models/contact/derivatives/contact_info.js +0 -260
  340. package/script/npm/src/src/models/contact/index.d.ts +0 -5
  341. package/script/npm/src/src/models/contact/index.d.ts.map +0 -1
  342. package/script/npm/src/src/models/contact/index.js +0 -20
  343. package/script/npm/src/src/models/contact/schemas.d.ts +0 -66
  344. package/script/npm/src/src/models/contact/schemas.d.ts.map +0 -1
  345. package/script/npm/src/src/models/contact/schemas.js +0 -67
  346. package/script/npm/src/src/models/contact/validation.d.ts +0 -37
  347. package/script/npm/src/src/models/contact/validation.d.ts.map +0 -1
  348. package/script/npm/src/src/models/contact/validation.js +0 -153
  349. package/script/npm/src/src/models/index.d.ts +0 -7
  350. package/script/npm/src/src/models/index.d.ts.map +0 -1
  351. package/script/npm/src/src/models/index.js +0 -22
  352. package/script/npm/src/src/models/payout/api.d.ts +0 -29
  353. package/script/npm/src/src/models/payout/api.d.ts.map +0 -1
  354. package/script/npm/src/src/models/payout/api.js +0 -2
  355. package/script/npm/src/src/models/payout/channel.d.ts +0 -58
  356. package/script/npm/src/src/models/payout/channel.d.ts.map +0 -1
  357. package/script/npm/src/src/models/payout/channel.js +0 -56
  358. package/script/npm/src/src/models/payout/derivatives/payout.d.ts +0 -158
  359. package/script/npm/src/src/models/payout/derivatives/payout.d.ts.map +0 -1
  360. package/script/npm/src/src/models/payout/derivatives/payout.js +0 -275
  361. package/script/npm/src/src/models/payout/index.d.ts +0 -7
  362. package/script/npm/src/src/models/payout/index.d.ts.map +0 -1
  363. package/script/npm/src/src/models/payout/index.js +0 -22
  364. package/script/npm/src/src/models/payout/narration.d.ts +0 -164
  365. package/script/npm/src/src/models/payout/narration.d.ts.map +0 -1
  366. package/script/npm/src/src/models/payout/narration.js +0 -312
  367. package/script/npm/src/src/models/payout/schemas.d.ts +0 -156
  368. package/script/npm/src/src/models/payout/schemas.d.ts.map +0 -1
  369. package/script/npm/src/src/models/payout/schemas.js +0 -108
  370. package/script/npm/src/src/models/payout/status.d.ts +0 -33
  371. package/script/npm/src/src/models/payout/status.d.ts.map +0 -1
  372. package/script/npm/src/src/models/payout/status.js +0 -37
  373. package/script/npm/src/src/models/permission.d.ts.map +0 -1
  374. package/script/npm/src/src/models/permission.js +0 -53
  375. package/script/npm/src/src/models/role.d.ts +0 -21
  376. package/script/npm/src/src/models/role.d.ts.map +0 -1
  377. package/script/npm/src/src/models/role.js +0 -77
  378. package/script/npm/src/src/models/user/authenticated-user.d.ts +0 -77
  379. package/script/npm/src/src/models/user/authenticated-user.d.ts.map +0 -1
  380. package/script/npm/src/src/models/user/authenticated-user.js +0 -230
  381. package/script/npm/src/src/models/user/index.d.ts +0 -4
  382. package/script/npm/src/src/models/user/index.d.ts.map +0 -1
  383. package/script/npm/src/src/models/user/index.js +0 -19
  384. package/script/npm/src/src/models/user/managed-user.d.ts +0 -108
  385. package/script/npm/src/src/models/user/managed-user.d.ts.map +0 -1
  386. package/script/npm/src/src/models/user/managed-user.js +0 -260
  387. package/script/npm/src/src/models/user/profile.d.ts.map +0 -1
  388. package/script/npm/src/src/models/user/profile.js +0 -338
  389. package/script/npm/src/src/models/wallet/index.d.ts +0 -4
  390. package/script/npm/src/src/models/wallet/index.d.ts.map +0 -1
  391. package/script/npm/src/src/models/wallet/index.js +0 -19
  392. package/script/npm/src/src/models/wallet/schemas.d.ts +0 -95
  393. package/script/npm/src/src/models/wallet/schemas.d.ts.map +0 -1
  394. package/script/npm/src/src/models/wallet/schemas.js +0 -38
  395. package/script/npm/src/src/models/wallet/statement_entry.d.ts +0 -160
  396. package/script/npm/src/src/models/wallet/statement_entry.d.ts.map +0 -1
  397. package/script/npm/src/src/models/wallet/statement_entry.js +0 -259
  398. package/script/npm/src/src/models/wallet/wallet.d.ts +0 -147
  399. package/script/npm/src/src/models/wallet/wallet.d.ts.map +0 -1
  400. package/script/npm/src/src/models/wallet/wallet.js +0 -283
  401. package/script/npm/src/src/shared/base_repository.d.ts +0 -80
  402. package/script/npm/src/src/shared/base_repository.d.ts.map +0 -1
  403. package/script/npm/src/src/shared/base_repository.js +0 -157
  404. package/script/npm/src/src/shared/common_responses.d.ts +0 -13
  405. package/script/npm/src/src/shared/common_responses.d.ts.map +0 -1
  406. package/script/npm/src/src/shared/common_responses.js +0 -13
  407. package/script/npm/src/src/shared/index.d.ts +0 -3
  408. package/script/npm/src/src/shared/index.d.ts.map +0 -1
  409. package/script/npm/src/src/shared/index.js +0 -18
  410. package/script/npm/src/src/shared/token_required_repository.d.ts +0 -78
  411. package/script/npm/src/src/shared/token_required_repository.d.ts.map +0 -1
  412. package/script/npm/src/src/shared/token_required_repository.js +0 -132
  413. package/script/package.json +0 -3
@@ -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"}
@@ -1,308 +0,0 @@
1
- import { BankContactInfo, MobileContactInfo, } from "@temboplus/afloat";
2
- import { Bank, TZPhoneNumber } from "@temboplus/frontend-core";
3
- /** Prefix for Ecobank mobile transfer narrations */
4
- export const ECOBANK_PREFIX = "MOBILE TRANSFER ";
5
- /** Current format prefix for bank payout narrations */
6
- export const BANK_NARR_PREFIX = "PAYOUT TO BANK";
7
- /** Legacy format prefix for bank payout narrations */
8
- export const LEGACY_BANK_NARR_PREFIX = "TO_BANK";
9
- /** Current format prefix for mobile money payout narrations */
10
- export const MOBILE_NARR_PREFIX = "PAYOUT TO MOBILE";
11
- /** Legacy format prefix for mobile money payout narrations */
12
- export const LEGACY_MOBILE_NARR_PREFIX = "TO_MOMO";
13
- /**
14
- * Handles payout narration generation and parsing for the Afloat platform.
15
- *
16
- * This class provides functionality to:
17
- * - Generate standardized default narrations for mobile money and bank payouts
18
- * - Parse existing narrations to extract contact information
19
- * - Format narration text for different display contexts
20
- * - Handle both current and legacy narration formats for backward compatibility
21
- *
22
- * @example
23
- * ```typescript
24
- * // Generate default narration for a mobile contact
25
- * const mobileContact = new MobileContactInfo("John Doe", phoneNumber);
26
- * const narration = Narration.generateDefaultPayoutNarration(mobileContact);
27
- * // Result: "PAYOUT TO MOBILE +255123456789 JOHN DOE"
28
- *
29
- * // Parse narration to extract contact details
30
- * const existingNarration = new Narration("PAYOUT TO BANK CRDB 1234567890 Jane Smith");
31
- * const contact = existingNarration.getContactDetails();
32
- * ```
33
- */
34
- export class Narration {
35
- /**
36
- * Creates a new Narration instance.
37
- *
38
- * @param text - The narration text to wrap
39
- */
40
- constructor(text) {
41
- /** The raw narration text */
42
- Object.defineProperty(this, "text", {
43
- enumerable: true,
44
- configurable: true,
45
- writable: true,
46
- value: void 0
47
- });
48
- /**
49
- * Extracts contact information from the narration text.
50
- * Attempts to parse both bank and mobile contact details from the narration.
51
- *
52
- * @returns Parsed ContactInfo (BankContactInfo or MobileContactInfo) if successful, undefined otherwise
53
- *
54
- * @example
55
- * ```typescript
56
- * const narration = new Narration("PAYOUT TO BANK CRDB 1234567890 Jane Smith");
57
- * const contact = narration.getContactDetails();
58
- * // Returns: BankContactInfo instance with parsed details
59
- * ```
60
- */
61
- Object.defineProperty(this, "getContactDetails", {
62
- enumerable: true,
63
- configurable: true,
64
- writable: true,
65
- value: () => {
66
- const result1 = this.getBankContactDetails();
67
- const result2 = this.getMobileContactDetails();
68
- if (result1)
69
- return result1;
70
- if (result2)
71
- return result2;
72
- }
73
- });
74
- /**
75
- * Extracts bank contact information from the narration text.
76
- * Handles both current format ("PAYOUT TO BANK") and legacy format ("TO_BANK").
77
- * Also handles Ecobank-prefixed narrations by stripping the prefix.
78
- *
79
- * Current format: "PAYOUT TO BANK {bank_name} {account_number} {account_name}"
80
- * Legacy format: "TO_BANK => {json_object}"
81
- *
82
- * @returns BankContactInfo if parsing is successful, undefined otherwise
83
- *
84
- * @example
85
- * ```typescript
86
- * // Current format
87
- * const narration = new Narration("PAYOUT TO BANK CRDB 1234567890 Jane Smith");
88
- * const contact = narration.getBankContactDetails();
89
- *
90
- * // Legacy format
91
- * const legacyNarration = new Narration('TO_BANK => {"account_number":"1234567890","account_name":"Jane Smith","swift_code":"CORUTZTZ"}');
92
- * const legacyContact = narration.getBankContactDetails();
93
- * ```
94
- */
95
- Object.defineProperty(this, "getBankContactDetails", {
96
- enumerable: true,
97
- configurable: true,
98
- writable: true,
99
- value: () => {
100
- let narr = this.text.trim();
101
- if (narr.startsWith(ECOBANK_PREFIX)) {
102
- narr = narr.substring(ECOBANK_PREFIX.length);
103
- }
104
- try {
105
- // Handle legacy format: "TO_BANK => {json}"
106
- if (narr.startsWith(LEGACY_BANK_NARR_PREFIX)) {
107
- const json = narr.split("=>")[1].trim();
108
- const map = JSON.parse(json);
109
- const accNo = map["account_number"];
110
- const accName = map["account_name"];
111
- const code = map["swift_code"];
112
- const bank = Bank.fromSWIFTCode(code);
113
- if (accNo && accName && bank) {
114
- return new BankContactInfo(accName, bank, accNo);
115
- }
116
- }
117
- // Handle current format: "PAYOUT TO BANK {bank} {accNo} {accName}"
118
- if (narr.startsWith(BANK_NARR_PREFIX)) {
119
- const data = narr.replace(BANK_NARR_PREFIX, "").trim().split(" ");
120
- const bank = Bank.fromBankName(data[0]);
121
- const accNo = data[1];
122
- const accName = data.slice(2).map(capitalizeFirstLetter).join(" ");
123
- if (accName && accNo && bank) {
124
- return new BankContactInfo(accName, bank, accNo);
125
- }
126
- }
127
- }
128
- catch (_) {
129
- return undefined;
130
- }
131
- }
132
- });
133
- /**
134
- * Extracts mobile contact information from the narration text.
135
- * Handles both current format ("PAYOUT TO MOBILE") and legacy format ("TO_MOMO").
136
- * Also handles Ecobank-prefixed narrations by stripping the prefix.
137
- *
138
- * Current format: "PAYOUT TO MOBILE {phone_number} {name}"
139
- * Legacy format: "TO_MOMO => {json_object}"
140
- *
141
- * @returns MobileContactInfo if parsing is successful, undefined otherwise
142
- *
143
- * @example
144
- * ```typescript
145
- * // Current format
146
- * const narration = new Narration("PAYOUT TO MOBILE +255123456789 John Doe");
147
- * const contact = narration.getMobileContactDetails();
148
- *
149
- * // Legacy format
150
- * const legacyNarration = new Narration('TO_MOMO => {"phone_number":"+255123456789","username":"John Doe"}');
151
- * const legacyContact = narration.getMobileContactDetails();
152
- * ```
153
- */
154
- Object.defineProperty(this, "getMobileContactDetails", {
155
- enumerable: true,
156
- configurable: true,
157
- writable: true,
158
- value: () => {
159
- let narr = this.text.trim();
160
- if (narr.startsWith(ECOBANK_PREFIX)) {
161
- narr = narr.substring(ECOBANK_PREFIX.length);
162
- }
163
- try {
164
- // Handle legacy format: "TO_MOMO => {json}"
165
- if (narr.startsWith(LEGACY_MOBILE_NARR_PREFIX)) {
166
- const json = narr.split("=>")[1].trim();
167
- const map = JSON.parse(json);
168
- const phoneNumber = TZPhoneNumber.from(map["phone_number"]);
169
- let username = map["username"];
170
- if (username === undefined)
171
- username = "";
172
- // Clean up username: remove extra spaces and capitalize each word
173
- let names = username.split(" ");
174
- names = names.filter((n) => n.trim().length > 0);
175
- username = names.map(capitalizeFirstLetter).join(" ");
176
- if (phoneNumber && username) {
177
- return new MobileContactInfo(username, phoneNumber);
178
- }
179
- }
180
- // Handle current format: "PAYOUT TO MOBILE {phone} {username}"
181
- if (narr.startsWith(MOBILE_NARR_PREFIX)) {
182
- const data = narr.replace(MOBILE_NARR_PREFIX, "").trim().split(" ");
183
- const phone = TZPhoneNumber.from(data[0]);
184
- const username = data.slice(1).map(capitalizeFirstLetter).join(" ");
185
- if (phone && username) {
186
- return new MobileContactInfo(username, phone);
187
- }
188
- }
189
- }
190
- catch (_) {
191
- return undefined;
192
- }
193
- }
194
- });
195
- this.text = text;
196
- }
197
- /**
198
- * Returns a medium-length version of the narration text suitable for table columns.
199
- * Truncates to 47 characters + "..." if longer than 50 characters.
200
- *
201
- * @returns Truncated narration text for medium-width displays
202
- */
203
- get mediumText() {
204
- if (this.text.length > 50) {
205
- return this.text.substring(0, 47) + "...";
206
- }
207
- return this.text;
208
- }
209
- /**
210
- * Returns a short version of the narration text suitable for compact displays.
211
- * Truncates to 32 characters + "..." if longer than 35 characters.
212
- *
213
- * @returns Truncated narration text for narrow displays
214
- */
215
- get shortText() {
216
- if (this.text.length > 35) {
217
- return this.text.substring(0, 32) + "...";
218
- }
219
- return this.text;
220
- }
221
- /**
222
- * Generates a default payout narration based on contact information.
223
- * Automatically determines whether to generate mobile or bank narration based on contact type.
224
- *
225
- * @param data - Contact information (either MobileContactInfo or BankContactInfo)
226
- * @returns Formatted default narration string in uppercase, or empty string if contact type is unrecognized
227
- *
228
- * @example
229
- * ```typescript
230
- * const mobileContact = new MobileContactInfo("John Doe", phoneNumber);
231
- * const narration = Narration.generateDefaultPayoutNarration(mobileContact);
232
- * // Returns: "PAYOUT TO MOBILE +255123456789 JOHN DOE"
233
- *
234
- * const bankContact = new BankContactInfo("Jane Smith", bank, "1234567890");
235
- * const narration = Narration.generateDefaultPayoutNarration(bankContact);
236
- * // Returns: "PAYOUT TO BANK CRDB 1234567890 JANE SMITH"
237
- * ```
238
- */
239
- static generateDefaultPayoutNarration(data) {
240
- if (MobileContactInfo.is(data)) {
241
- return Narration.generateMobilePayoutNarration(data);
242
- }
243
- else if (BankContactInfo.is(data)) {
244
- return Narration.generateBankPayoutNarration(data);
245
- }
246
- else {
247
- return "";
248
- }
249
- }
250
- /**
251
- * Generates a standardized mobile money payout narration.
252
- * Format: "PAYOUT TO MOBILE {phone_number} {name}"
253
- *
254
- * @param data - Mobile contact information containing phone number and name
255
- * @returns Formatted mobile payout narration in uppercase
256
- *
257
- * @example
258
- * ```typescript
259
- * const contact = new MobileContactInfo("John Doe", phoneNumber);
260
- * const narration = Narration.generateMobilePayoutNarration(contact);
261
- * // Returns: "PAYOUT TO MOBILE +255123456789 JOHN DOE"
262
- * ```
263
- */
264
- static generateMobilePayoutNarration(data) {
265
- const { phoneNumber, name } = data;
266
- return `${MOBILE_NARR_PREFIX.trim()} ${phoneNumber.label.trim()} ${name.trim()}`.toUpperCase();
267
- }
268
- /**
269
- * Generates a standardized bank payout narration.
270
- * Format: "PAYOUT TO BANK {bank_short_name} {account_number} {account_name}"
271
- *
272
- * @param data - Bank contact information containing bank details, account number, and account name
273
- * @returns Formatted bank payout narration in uppercase
274
- *
275
- * @example
276
- * ```typescript
277
- * const contact = new BankContactInfo("Jane Smith", bank, "1234567890");
278
- * const narration = Narration.generateBankPayoutNarration(contact);
279
- * // Returns: "PAYOUT TO BANK CRDB 1234567890 JANE SMITH"
280
- * ```
281
- */
282
- static generateBankPayoutNarration(data) {
283
- const { bank, accName, accNo } = data;
284
- return `${BANK_NARR_PREFIX.trim()} ${bank.shortName.trim()} ${accNo.trim()} ${accName.trim()}`.toUpperCase();
285
- }
286
- }
287
- /**
288
- * Capitalizes the first letter of a string and converts the rest to lowercase.
289
- * Used for standardizing name formatting in narrations.
290
- *
291
- * @param str - The string to capitalize
292
- * @returns String with first letter capitalized and rest in lowercase
293
- *
294
- * @example
295
- * ```typescript
296
- * capitalizeFirstLetter("john") // Returns: "John"
297
- * capitalizeFirstLetter("SMITH") // Returns: "Smith"
298
- * capitalizeFirstLetter("") // Returns: ""
299
- * ```
300
- */
301
- function capitalizeFirstLetter(str) {
302
- if (str.length === 0) {
303
- return str; // Return an empty string if input is empty
304
- }
305
- const firstLetter = str.charAt(0).toUpperCase();
306
- const restOfString = str.slice(1).toLowerCase();
307
- return firstLetter + restOfString;
308
- }
@@ -1,156 +0,0 @@
1
- import { z } from "zod";
2
- import { PAYOUT_APPROVAL_STATUS, PAYOUT_STATUS } from "./status.js";
3
- /**
4
- * Type definition for identifier schema
5
- * Used for tracking who created or actioned a payout
6
- * Contains a name and unique identity string
7
- */
8
- type IdentifierType = z.ZodObject<{
9
- name: z.ZodString;
10
- identity: z.ZodString;
11
- }>;
12
- /**
13
- * Type definition for payout status enum
14
- * Represents all possible states of a payout:
15
- *
16
- * @see {@link PAYOUT_STATUS} for the enum definition in "@models/payout/status.ts"
17
- */
18
- type PayoutStatusType = z.ZodEnum<[
19
- typeof PAYOUT_STATUS.CREATED,
20
- typeof PAYOUT_STATUS.PAID,
21
- typeof PAYOUT_STATUS.FAILED,
22
- typeof PAYOUT_STATUS.REJECTED,
23
- typeof PAYOUT_STATUS.PENDING,
24
- typeof PAYOUT_STATUS.QUEUED,
25
- typeof PAYOUT_STATUS.REVERSED
26
- ]>;
27
- /**
28
- * Type definition for payout approval status enum
29
- * Represents the approval state of a payout:
30
- *
31
- * @see {@link PAYOUT_APPROVAL_STATUS} for the enum definition in "@models/payout/status.ts"
32
- */
33
- type ApprovalPayoutStatusType = z.ZodEnum<[
34
- typeof PAYOUT_APPROVAL_STATUS.APPROVED,
35
- typeof PAYOUT_APPROVAL_STATUS.PENDING,
36
- typeof PAYOUT_APPROVAL_STATUS.REJECTED
37
- ]>;
38
- /**
39
- * Type definition for payout input schema
40
- * Extends the base payout type with payee information required for creating new payouts
41
- *
42
- * @extends {BasePayoutType}
43
- * @property {z.ZodString} payeeName - Name of the payment recipient
44
- */
45
- type PayoutInputType = z.ZodObject<{
46
- channel: z.ZodString;
47
- msisdn: z.ZodString;
48
- amount: z.ZodNumber;
49
- description: z.ZodString;
50
- notes: Optional<z.ZodString>;
51
- payeeName: z.ZodString;
52
- }>;
53
- /**
54
- * Type definition for complete payout schema
55
- * Extends the base payout type with additional fields for tracking
56
- * the full lifecycle of a payout transaction
57
- *
58
- * @extends {BasePayoutType}
59
- * @property {z.ZodString} id - Unique identifier for the payout
60
- * @property {z.ZodString} profileId - ID of the profile initiating the payout
61
- * @property {z.ZodString} payeeName - Name of the payment recipient
62
- * @property {PayoutStatusType} status - Current status of the payout
63
- * @property {z.ZodString} statusMessage - Detailed message about the current status
64
- * @property {z.ZodString} partnerReference - Optional reference from payment partner
65
- * @property {z.ZodDate} createdAt - Timestamp of payout creation
66
- * @property {z.ZodDate} updatedAt - Timestamp of last payout update
67
- * @property {ApprovalPayoutStatusType} approvalStatus - Current approval state
68
- * @property {IdentifierType} createdBy - User who created the payout
69
- * @property {IdentifierType} actionedBy - User who last actioned the payout
70
- */
71
- type PayoutType = z.ZodObject<{
72
- channel: z.ZodString;
73
- msisdn: z.ZodString;
74
- amount: z.ZodNumber;
75
- description: z.ZodString;
76
- notes: Optional<z.ZodString>;
77
- id: z.ZodString;
78
- profileId: z.ZodString;
79
- payeeName: z.ZodString;
80
- status: PayoutStatusType;
81
- statusMessage: z.ZodString;
82
- partnerReference: Optional<z.ZodString>;
83
- createdAt: z.ZodDate;
84
- updatedAt: z.ZodDate;
85
- approvalStatus: ApprovalPayoutStatusType;
86
- createdBy: Optional<IdentifierType>;
87
- actionedBy: Optional<IdentifierType>;
88
- }>;
89
- /**
90
- * Type representing a Zod schema that transforms nullable values to undefined
91
- * @template T - The original Zod schema type
92
- * @property {z.ZodNullable<T>} - The nullable version of the input schema
93
- * @property {T["_output"] | undefined} - The output type, allowing the original type or undefined
94
- * @property {T["_input"] | null} - The input type, allowing the original type or null
95
- */
96
- type MakeOptionalResult<T extends z.ZodType> = z.ZodEffects<z.ZodNullable<T>, T["_output"] | undefined, T["_input"] | null>;
97
- /**
98
- * Type representing a fully optional field that transforms nulls to undefined
99
- * @template T - The original Zod schema type
100
- * Combines MakeOptionalResult with ZodOptional to allow both:
101
- * 1. The field to be optional (can be omitted from object)
102
- * 2. When present, the value can be null (transformed to undefined) or the original type
103
- */
104
- type Optional<T extends z.ZodType> = z.ZodOptional<MakeOptionalResult<T>>;
105
- /**
106
- * Schema for identifying users in the payout process
107
- * Used to track who created or actioned a payout
108
- */
109
- declare const identifierSchema: IdentifierType;
110
- /**
111
- * Type definition inferred from identifierSchema
112
- * Represents the structure of a user who actions the payout
113
- */
114
- type PayoutApprover = z.infer<typeof identifierSchema>;
115
- /**
116
- * Type definition inferred from payoutInputSchema
117
- * Represents the structure of data required to create a new payout
118
- */
119
- type PayoutInput = z.infer<typeof payoutInputSchema>;
120
- /**
121
- * Schema for creating a new payout
122
- * Extends base payout schema with payee information
123
- */
124
- declare const payoutInputSchema: PayoutInputType;
125
- /**
126
- * Type definition inferred from payoutSchema
127
- * Represents the complete payout record structure
128
- */
129
- type PayoutData = z.infer<typeof payoutSchema>;
130
- /**
131
- * Schema for complete payout record
132
- * Extends base payout schema with additional fields for:
133
- * - Identification (id, profileId)
134
- * - Status tracking
135
- * - Timestamps
136
- * - Approval information
137
- * - User tracking (created by, actioned by)
138
- */
139
- declare const payoutSchema: PayoutType;
140
- /**
141
- * Export object containing all payout-related schemas
142
- * Used for validation and type checking throughout the application
143
- */
144
- export declare const PayoutSchemas: {
145
- readonly payoutData: PayoutType;
146
- readonly payoutInput: PayoutInputType;
147
- readonly payoutTransactionStatus: PayoutStatusType;
148
- readonly payoutApprovalStatus: ApprovalPayoutStatusType;
149
- readonly payoutApprover: IdentifierType;
150
- };
151
- /**
152
- * Export types for use in other parts of the application
153
- * These types can be used for type checking and documentation
154
- */
155
- export type { PayoutApprover, PayoutData, PayoutInput };
156
- //# sourceMappingURL=schemas.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/src/models/payout/schemas.ts"],"names":[],"mappings":"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"}