@temboplus/afloat 0.1.81 → 0.2.0-beta.2

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/{esm/src/models/permission.d.ts → dist/modules/login/permission.type.d.ts} +9 -10
  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.map +0 -1
  198. package/esm/src/models/permission.js +0 -50
  199. package/esm/src/models/role.d.ts +0 -21
  200. package/esm/src/models/role.d.ts.map +0 -1
  201. package/esm/src/models/role.js +0 -73
  202. package/esm/src/models/user/authenticated-user.d.ts +0 -77
  203. package/esm/src/models/user/authenticated-user.d.ts.map +0 -1
  204. package/esm/src/models/user/authenticated-user.js +0 -226
  205. package/esm/src/models/user/index.d.ts +0 -4
  206. package/esm/src/models/user/index.d.ts.map +0 -1
  207. package/esm/src/models/user/index.js +0 -3
  208. package/esm/src/models/user/managed-user.d.ts +0 -108
  209. package/esm/src/models/user/managed-user.d.ts.map +0 -1
  210. package/esm/src/models/user/managed-user.js +0 -255
  211. package/esm/src/models/user/profile.d.ts +0 -161
  212. package/esm/src/models/user/profile.d.ts.map +0 -1
  213. package/esm/src/models/user/profile.js +0 -334
  214. package/esm/src/models/wallet/index.d.ts +0 -4
  215. package/esm/src/models/wallet/index.d.ts.map +0 -1
  216. package/esm/src/models/wallet/index.js +0 -3
  217. package/esm/src/models/wallet/schemas.d.ts +0 -95
  218. package/esm/src/models/wallet/schemas.d.ts.map +0 -1
  219. package/esm/src/models/wallet/schemas.js +0 -35
  220. package/esm/src/models/wallet/statement_entry.d.ts +0 -160
  221. package/esm/src/models/wallet/statement_entry.d.ts.map +0 -1
  222. package/esm/src/models/wallet/statement_entry.js +0 -255
  223. package/esm/src/models/wallet/wallet.d.ts.map +0 -1
  224. package/esm/src/models/wallet/wallet.js +0 -279
  225. package/esm/src/shared/base_repository.d.ts +0 -80
  226. package/esm/src/shared/base_repository.d.ts.map +0 -1
  227. package/esm/src/shared/base_repository.js +0 -153
  228. package/esm/src/shared/common_responses.d.ts +0 -13
  229. package/esm/src/shared/common_responses.d.ts.map +0 -1
  230. package/esm/src/shared/common_responses.js +0 -10
  231. package/esm/src/shared/index.d.ts +0 -3
  232. package/esm/src/shared/index.d.ts.map +0 -1
  233. package/esm/src/shared/index.js +0 -2
  234. package/esm/src/shared/token_required_repository.d.ts +0 -78
  235. package/esm/src/shared/token_required_repository.d.ts.map +0 -1
  236. package/esm/src/shared/token_required_repository.js +0 -128
  237. package/script/mod.d.ts +0 -8
  238. package/script/mod.d.ts.map +0 -1
  239. package/script/mod.js +0 -23
  240. package/script/npm/src/mod.d.ts +0 -8
  241. package/script/npm/src/mod.d.ts.map +0 -1
  242. package/script/npm/src/mod.js +0 -23
  243. package/script/npm/src/src/errors/api_error.d.ts +0 -63
  244. package/script/npm/src/src/errors/api_error.d.ts.map +0 -1
  245. package/script/npm/src/src/errors/api_error.js +0 -94
  246. package/script/npm/src/src/errors/index.d.ts +0 -3
  247. package/script/npm/src/src/errors/index.d.ts.map +0 -1
  248. package/script/npm/src/src/errors/index.js +0 -18
  249. package/script/npm/src/src/errors/permission_error.d.ts.map +0 -1
  250. package/script/npm/src/src/errors/permission_error.js +0 -74
  251. package/script/npm/src/src/features/admin/contract.d.ts +0 -842
  252. package/script/npm/src/src/features/admin/contract.d.ts.map +0 -1
  253. package/script/npm/src/src/features/admin/contract.js +0 -213
  254. package/script/npm/src/src/features/admin/index.d.ts +0 -4
  255. package/script/npm/src/src/features/admin/index.d.ts.map +0 -1
  256. package/script/npm/src/src/features/admin/index.js +0 -19
  257. package/script/npm/src/src/features/admin/repository.d.ts +0 -114
  258. package/script/npm/src/src/features/admin/repository.d.ts.map +0 -1
  259. package/script/npm/src/src/features/admin/repository.js +0 -252
  260. package/script/npm/src/src/features/admin/schemas.d.ts +0 -146
  261. package/script/npm/src/src/features/admin/schemas.d.ts.map +0 -1
  262. package/script/npm/src/src/features/admin/schemas.js +0 -209
  263. package/script/npm/src/src/features/auth/access/contract.d.ts +0 -14
  264. package/script/npm/src/src/features/auth/access/contract.d.ts.map +0 -1
  265. package/script/npm/src/src/features/auth/access/contract.js +0 -17
  266. package/script/npm/src/src/features/auth/access/repository.d.ts +0 -11
  267. package/script/npm/src/src/features/auth/access/repository.d.ts.map +0 -1
  268. package/script/npm/src/src/features/auth/access/repository.js +0 -29
  269. package/script/npm/src/src/features/auth/contract.d.ts +0 -112
  270. package/script/npm/src/src/features/auth/contract.d.ts.map +0 -1
  271. package/script/npm/src/src/features/auth/contract.js +0 -46
  272. package/script/npm/src/src/features/auth/identity/contract.d.ts +0 -23
  273. package/script/npm/src/src/features/auth/identity/contract.d.ts.map +0 -1
  274. package/script/npm/src/src/features/auth/identity/contract.js +0 -20
  275. package/script/npm/src/src/features/auth/identity/repository.d.ts +0 -22
  276. package/script/npm/src/src/features/auth/identity/repository.d.ts.map +0 -1
  277. package/script/npm/src/src/features/auth/identity/repository.js +0 -34
  278. package/script/npm/src/src/features/auth/index.d.ts +0 -6
  279. package/script/npm/src/src/features/auth/index.d.ts.map +0 -1
  280. package/script/npm/src/src/features/auth/index.js +0 -21
  281. package/script/npm/src/src/features/auth/manager.d.ts +0 -105
  282. package/script/npm/src/src/features/auth/manager.d.ts.map +0 -1
  283. package/script/npm/src/src/features/auth/manager.js +0 -185
  284. package/script/npm/src/src/features/auth/profile/contract.d.ts.map +0 -1
  285. package/script/npm/src/src/features/auth/profile/contract.js +0 -17
  286. package/script/npm/src/src/features/auth/profile/repository.d.ts +0 -11
  287. package/script/npm/src/src/features/auth/profile/repository.d.ts.map +0 -1
  288. package/script/npm/src/src/features/auth/profile/repository.js +0 -29
  289. package/script/npm/src/src/features/auth/repository.d.ts +0 -30
  290. package/script/npm/src/src/features/auth/repository.d.ts.map +0 -1
  291. package/script/npm/src/src/features/auth/repository.js +0 -73
  292. package/script/npm/src/src/features/auth/storage/client_store.d.ts +0 -30
  293. package/script/npm/src/src/features/auth/storage/client_store.d.ts.map +0 -1
  294. package/script/npm/src/src/features/auth/storage/client_store.js +0 -51
  295. package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts +0 -32
  296. package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts.map +0 -1
  297. package/script/npm/src/src/features/auth/storage/client_token_handler.js +0 -40
  298. package/script/npm/src/src/features/auth/storage/server_store.d.ts +0 -24
  299. package/script/npm/src/src/features/auth/storage/server_store.d.ts.map +0 -1
  300. package/script/npm/src/src/features/auth/storage/server_store.js +0 -38
  301. package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts +0 -36
  302. package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts.map +0 -1
  303. package/script/npm/src/src/features/auth/storage/server_token_handler.js +0 -119
  304. package/script/npm/src/src/features/auth/storage/types.d.ts +0 -42
  305. package/script/npm/src/src/features/auth/storage/types.d.ts.map +0 -1
  306. package/script/npm/src/src/features/auth/storage/types.js +0 -2
  307. package/script/npm/src/src/features/contact/contract.d.ts +0 -170
  308. package/script/npm/src/src/features/contact/contract.d.ts.map +0 -1
  309. package/script/npm/src/src/features/contact/contract.js +0 -52
  310. package/script/npm/src/src/features/contact/index.d.ts +0 -2
  311. package/script/npm/src/src/features/contact/index.d.ts.map +0 -1
  312. package/script/npm/src/src/features/contact/index.js +0 -17
  313. package/script/npm/src/src/features/contact/repository.d.ts +0 -58
  314. package/script/npm/src/src/features/contact/repository.d.ts.map +0 -1
  315. package/script/npm/src/src/features/contact/repository.js +0 -112
  316. package/script/npm/src/src/features/payout/contract.d.ts +0 -623
  317. package/script/npm/src/src/features/payout/contract.d.ts.map +0 -1
  318. package/script/npm/src/src/features/payout/contract.js +0 -78
  319. package/script/npm/src/src/features/payout/index.d.ts +0 -2
  320. package/script/npm/src/src/features/payout/index.d.ts.map +0 -1
  321. package/script/npm/src/src/features/payout/index.js +0 -17
  322. package/script/npm/src/src/features/payout/repository.d.ts +0 -67
  323. package/script/npm/src/src/features/payout/repository.d.ts.map +0 -1
  324. package/script/npm/src/src/features/payout/repository.js +0 -183
  325. package/script/npm/src/src/features/wallet/contract.d.ts.map +0 -1
  326. package/script/npm/src/src/features/wallet/contract.js +0 -41
  327. package/script/npm/src/src/features/wallet/index.d.ts +0 -2
  328. package/script/npm/src/src/features/wallet/index.d.ts.map +0 -1
  329. package/script/npm/src/src/features/wallet/index.js +0 -17
  330. package/script/npm/src/src/features/wallet/repository.d.ts +0 -57
  331. package/script/npm/src/src/features/wallet/repository.d.ts.map +0 -1
  332. package/script/npm/src/src/features/wallet/repository.js +0 -97
  333. package/script/npm/src/src/models/contact/derivatives/contact.d.ts +0 -172
  334. package/script/npm/src/src/models/contact/derivatives/contact.d.ts.map +0 -1
  335. package/script/npm/src/src/models/contact/derivatives/contact.js +0 -270
  336. package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts +0 -188
  337. package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts.map +0 -1
  338. package/script/npm/src/src/models/contact/derivatives/contact_info.js +0 -260
  339. package/script/npm/src/src/models/contact/index.d.ts +0 -5
  340. package/script/npm/src/src/models/contact/index.d.ts.map +0 -1
  341. package/script/npm/src/src/models/contact/index.js +0 -20
  342. package/script/npm/src/src/models/contact/schemas.d.ts +0 -66
  343. package/script/npm/src/src/models/contact/schemas.d.ts.map +0 -1
  344. package/script/npm/src/src/models/contact/schemas.js +0 -67
  345. package/script/npm/src/src/models/contact/validation.d.ts +0 -37
  346. package/script/npm/src/src/models/contact/validation.d.ts.map +0 -1
  347. package/script/npm/src/src/models/contact/validation.js +0 -153
  348. package/script/npm/src/src/models/index.d.ts +0 -7
  349. package/script/npm/src/src/models/index.d.ts.map +0 -1
  350. package/script/npm/src/src/models/index.js +0 -22
  351. package/script/npm/src/src/models/payout/api.d.ts +0 -29
  352. package/script/npm/src/src/models/payout/api.d.ts.map +0 -1
  353. package/script/npm/src/src/models/payout/api.js +0 -2
  354. package/script/npm/src/src/models/payout/channel.d.ts +0 -58
  355. package/script/npm/src/src/models/payout/channel.d.ts.map +0 -1
  356. package/script/npm/src/src/models/payout/channel.js +0 -56
  357. package/script/npm/src/src/models/payout/derivatives/payout.d.ts +0 -158
  358. package/script/npm/src/src/models/payout/derivatives/payout.d.ts.map +0 -1
  359. package/script/npm/src/src/models/payout/derivatives/payout.js +0 -275
  360. package/script/npm/src/src/models/payout/index.d.ts +0 -7
  361. package/script/npm/src/src/models/payout/index.d.ts.map +0 -1
  362. package/script/npm/src/src/models/payout/index.js +0 -22
  363. package/script/npm/src/src/models/payout/narration.d.ts +0 -164
  364. package/script/npm/src/src/models/payout/narration.d.ts.map +0 -1
  365. package/script/npm/src/src/models/payout/narration.js +0 -312
  366. package/script/npm/src/src/models/payout/schemas.d.ts +0 -156
  367. package/script/npm/src/src/models/payout/schemas.d.ts.map +0 -1
  368. package/script/npm/src/src/models/payout/schemas.js +0 -108
  369. package/script/npm/src/src/models/payout/status.d.ts +0 -33
  370. package/script/npm/src/src/models/payout/status.d.ts.map +0 -1
  371. package/script/npm/src/src/models/payout/status.js +0 -37
  372. package/script/npm/src/src/models/permission.d.ts +0 -55
  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
@@ -0,0 +1,204 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Zod schema definition for validating Wallet data structures.
4
+ * Ensures data integrity for wallet objects, including runtime validation
5
+ * of country codes against the imported ISO2CountryCodesSet.
6
+ */
7
+ declare const walletSchema: z.ZodObject<{
8
+ id: z.ZodString;
9
+ profileId: z.ZodString;
10
+ accountNo: z.ZodString;
11
+ accountName: z.ZodString;
12
+ channel: z.ZodString;
13
+ countryCode: z.ZodEffects<z.ZodDefault<z.ZodString>, import("@temboplus/frontend-core").ISO2CountryCode, string | undefined>;
14
+ currencyCode: z.ZodEffects<z.ZodDefault<z.ZodString>, import("@temboplus/frontend-core").CurrencyCode, string | undefined>;
15
+ createdAt: z.ZodString;
16
+ updatedAt: z.ZodString;
17
+ }, "strip", z.ZodTypeAny, {
18
+ createdAt: string;
19
+ id: string;
20
+ accountNo: string;
21
+ profileId: string;
22
+ updatedAt: string;
23
+ channel: string;
24
+ countryCode: import("@temboplus/frontend-core").ISO2CountryCode;
25
+ currencyCode: import("@temboplus/frontend-core").CurrencyCode;
26
+ accountName: string;
27
+ }, {
28
+ createdAt: string;
29
+ id: string;
30
+ accountNo: string;
31
+ profileId: string;
32
+ updatedAt: string;
33
+ channel: string;
34
+ accountName: string;
35
+ countryCode?: string | undefined;
36
+ currencyCode?: string | undefined;
37
+ }>;
38
+ /**
39
+ * Zod schema definition for validating Wallet data structures.
40
+ * Ensures data integrity for wallet objects, including runtime validation
41
+ * of country codes against the imported ISO2CountryCodesSet.
42
+ */
43
+ declare const walletQuerySchema: z.ZodObject<{
44
+ id: z.ZodOptional<z.ZodString>;
45
+ profileId: z.ZodOptional<z.ZodString>;
46
+ accountNo: z.ZodOptional<z.ZodString>;
47
+ accountName: z.ZodOptional<z.ZodString>;
48
+ channel: z.ZodOptional<z.ZodString>;
49
+ countryCode: z.ZodOptional<z.ZodEffects<z.ZodDefault<z.ZodString>, string, string | undefined>>;
50
+ currencyCode: z.ZodOptional<z.ZodEffects<z.ZodDefault<z.ZodString>, string, string | undefined>>;
51
+ }, "strip", z.ZodTypeAny, {
52
+ id?: string | undefined;
53
+ accountNo?: string | undefined;
54
+ profileId?: string | undefined;
55
+ channel?: string | undefined;
56
+ countryCode?: string | undefined;
57
+ currencyCode?: string | undefined;
58
+ accountName?: string | undefined;
59
+ }, {
60
+ id?: string | undefined;
61
+ accountNo?: string | undefined;
62
+ profileId?: string | undefined;
63
+ channel?: string | undefined;
64
+ countryCode?: string | undefined;
65
+ currencyCode?: string | undefined;
66
+ accountName?: string | undefined;
67
+ }>;
68
+ /**
69
+ * Schema definition for a statement entry.
70
+ */
71
+ declare const statementEntrySchema: z.ZodObject<{
72
+ accountNo: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
73
+ debitOrCredit: z.ZodString;
74
+ tranRefNo: z.ZodString;
75
+ narration: z.ZodString;
76
+ txnDate: z.ZodDate;
77
+ valueDate: z.ZodDate;
78
+ amountCredited: z.ZodNumber;
79
+ amountDebited: z.ZodNumber;
80
+ balance: z.ZodNumber;
81
+ currencyCode: z.ZodDefault<z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>>;
82
+ }, "strip", z.ZodTypeAny, {
83
+ currencyCode: string;
84
+ debitOrCredit: string;
85
+ tranRefNo: string;
86
+ narration: string;
87
+ txnDate: Date;
88
+ valueDate: Date;
89
+ amountCredited: number;
90
+ amountDebited: number;
91
+ balance: number;
92
+ accountNo?: string | undefined;
93
+ }, {
94
+ debitOrCredit: string;
95
+ tranRefNo: string;
96
+ narration: string;
97
+ txnDate: Date;
98
+ valueDate: Date;
99
+ amountCredited: number;
100
+ amountDebited: number;
101
+ balance: number;
102
+ accountNo?: string | undefined;
103
+ currencyCode?: string | undefined;
104
+ }>;
105
+ /**
106
+ * Collection of wallet-related schemas for export.
107
+ * Provides access to both wallet and statement entry validation schemas.
108
+ */
109
+ export declare const WalletDTOSchemas: {
110
+ walletDTO: z.ZodObject<{
111
+ id: z.ZodString;
112
+ profileId: z.ZodString;
113
+ accountNo: z.ZodString;
114
+ accountName: z.ZodString;
115
+ channel: z.ZodString;
116
+ countryCode: z.ZodEffects<z.ZodDefault<z.ZodString>, import("@temboplus/frontend-core").ISO2CountryCode, string | undefined>;
117
+ currencyCode: z.ZodEffects<z.ZodDefault<z.ZodString>, import("@temboplus/frontend-core").CurrencyCode, string | undefined>;
118
+ createdAt: z.ZodString;
119
+ updatedAt: z.ZodString;
120
+ }, "strip", z.ZodTypeAny, {
121
+ createdAt: string;
122
+ id: string;
123
+ accountNo: string;
124
+ profileId: string;
125
+ updatedAt: string;
126
+ channel: string;
127
+ countryCode: import("@temboplus/frontend-core").ISO2CountryCode;
128
+ currencyCode: import("@temboplus/frontend-core").CurrencyCode;
129
+ accountName: string;
130
+ }, {
131
+ createdAt: string;
132
+ id: string;
133
+ accountNo: string;
134
+ profileId: string;
135
+ updatedAt: string;
136
+ channel: string;
137
+ accountName: string;
138
+ countryCode?: string | undefined;
139
+ currencyCode?: string | undefined;
140
+ }>;
141
+ walletQuery: z.ZodObject<{
142
+ id: z.ZodOptional<z.ZodString>;
143
+ profileId: z.ZodOptional<z.ZodString>;
144
+ accountNo: z.ZodOptional<z.ZodString>;
145
+ accountName: z.ZodOptional<z.ZodString>;
146
+ channel: z.ZodOptional<z.ZodString>;
147
+ countryCode: z.ZodOptional<z.ZodEffects<z.ZodDefault<z.ZodString>, string, string | undefined>>;
148
+ currencyCode: z.ZodOptional<z.ZodEffects<z.ZodDefault<z.ZodString>, string, string | undefined>>;
149
+ }, "strip", z.ZodTypeAny, {
150
+ id?: string | undefined;
151
+ accountNo?: string | undefined;
152
+ profileId?: string | undefined;
153
+ channel?: string | undefined;
154
+ countryCode?: string | undefined;
155
+ currencyCode?: string | undefined;
156
+ accountName?: string | undefined;
157
+ }, {
158
+ id?: string | undefined;
159
+ accountNo?: string | undefined;
160
+ profileId?: string | undefined;
161
+ channel?: string | undefined;
162
+ countryCode?: string | undefined;
163
+ currencyCode?: string | undefined;
164
+ accountName?: string | undefined;
165
+ }>;
166
+ statementEntry: z.ZodObject<{
167
+ accountNo: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
168
+ debitOrCredit: z.ZodString;
169
+ tranRefNo: z.ZodString;
170
+ narration: z.ZodString;
171
+ txnDate: z.ZodDate;
172
+ valueDate: z.ZodDate;
173
+ amountCredited: z.ZodNumber;
174
+ amountDebited: z.ZodNumber;
175
+ balance: z.ZodNumber;
176
+ currencyCode: z.ZodDefault<z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>>;
177
+ }, "strip", z.ZodTypeAny, {
178
+ currencyCode: string;
179
+ debitOrCredit: string;
180
+ tranRefNo: string;
181
+ narration: string;
182
+ txnDate: Date;
183
+ valueDate: Date;
184
+ amountCredited: number;
185
+ amountDebited: number;
186
+ balance: number;
187
+ accountNo?: string | undefined;
188
+ }, {
189
+ debitOrCredit: string;
190
+ tranRefNo: string;
191
+ narration: string;
192
+ txnDate: Date;
193
+ valueDate: Date;
194
+ amountCredited: number;
195
+ amountDebited: number;
196
+ balance: number;
197
+ accountNo?: string | undefined;
198
+ currencyCode?: string | undefined;
199
+ }>;
200
+ };
201
+ export type WalletDTO = z.infer<typeof walletSchema>;
202
+ export type WalletQueryDTO = z.infer<typeof walletQuerySchema>;
203
+ export type WalletStatementEntryDTO = z.infer<typeof statementEntrySchema>;
204
+ export {};
@@ -1,46 +1,44 @@
1
- import { z } from "zod";
2
1
  import { type CurrencyCode, type ISO2CountryCode } from "@temboplus/frontend-core";
2
+ import { WalletDTOSchemas } from "@/modules/wallet/wallet.dtos.js";
3
+ import z from "zod";
3
4
  /**
4
- * Zod schema definition for validating Wallet data structures.
5
- * Ensures data integrity for wallet objects, including runtime validation
6
- * of country codes against the imported ISO2CountryCodesSet.
5
+ * Zod schema for Wallet JSON serialization
7
6
  */
8
- declare const walletSchema: z.ZodObject<{
7
+ export declare const WalletJSONSchema: z.ZodObject<{
9
8
  id: z.ZodString;
10
9
  profileId: z.ZodString;
11
10
  accountNo: z.ZodString;
12
11
  accountName: z.ZodString;
13
12
  channel: z.ZodString;
14
- countryCode: z.ZodEffects<z.ZodDefault<z.ZodString>, string, string | undefined>;
15
- currencyCode: z.ZodEffects<z.ZodDefault<z.ZodString>, string, string | undefined>;
13
+ countryCode: z.ZodString;
14
+ currencyCode: z.ZodString;
16
15
  createdAt: z.ZodString;
17
16
  updatedAt: z.ZodString;
17
+ version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
18
18
  }, "strip", z.ZodTypeAny, {
19
+ createdAt: string;
19
20
  id: string;
20
21
  accountNo: string;
21
- channel: string;
22
+ version: string;
22
23
  profileId: string;
23
- createdAt: string;
24
24
  updatedAt: string;
25
- accountName: string;
25
+ channel: string;
26
26
  countryCode: string;
27
27
  currencyCode: string;
28
+ accountName: string;
28
29
  }, {
30
+ createdAt: string;
29
31
  id: string;
30
32
  accountNo: string;
31
- channel: string;
32
33
  profileId: string;
33
- createdAt: string;
34
34
  updatedAt: string;
35
+ channel: string;
36
+ countryCode: string;
37
+ currencyCode: string;
35
38
  accountName: string;
36
- countryCode?: string | undefined;
37
- currencyCode?: string | undefined;
39
+ version?: string | undefined;
38
40
  }>;
39
- /**
40
- * TypeScript type representing the validated data structure for a Wallet.
41
- * Derived from the walletSchema. Note: countryCode is inferred as string.
42
- */
43
- type WalletDataType = z.infer<typeof walletSchema>;
41
+ export type WalletJSON = z.infer<typeof WalletJSONSchema>;
44
42
  /**
45
43
  * Represents a digital Wallet entity.
46
44
  *
@@ -61,7 +59,7 @@ export declare class Wallet {
61
59
  * Retrieves the Zod schema used for Wallet validation.
62
60
  * @returns The Zod schema object for Wallet.
63
61
  */
64
- static get schema(): typeof walletSchema;
62
+ static get schema(): typeof WalletDTOSchemas.walletDTO;
65
63
  /**
66
64
  * Private constructor enforces instantiation via static factory methods.
67
65
  * @param data - The validated wallet data object (countryCode is string).
@@ -104,30 +102,12 @@ export declare class Wallet {
104
102
  * @returns The last update Date object.
105
103
  */
106
104
  get updatedAtDate(): Date;
107
- /**
108
- * Creates a plain data object representation of the Wallet instance.
109
- * Suitable for serialization or validation.
110
- * @returns A plain object conforming to the WalletDataType structure.
111
- */
112
- toObject(): WalletDataType;
113
- /**
114
- * Serializes the Wallet instance into a JSON string.
115
- * @returns A JSON string representation of the wallet data.
116
- */
117
- toJSON(): string;
118
105
  /**
119
106
  * Validates the Wallet instance's current data against the defined schema.
120
107
  * This includes checking the countryCode against ISO2CountryCodesSet.
121
108
  * @returns True if the current instance data is valid, otherwise false.
122
109
  */
123
110
  validate(): boolean;
124
- /**
125
- * Creates a Wallet instance from a JSON string.
126
- * Performs parsing and validation, including the countryCode runtime check.
127
- * @param jsonString - A JSON string containing wallet data.
128
- * @returns A new Wallet instance if parsing and validation succeed, otherwise undefined.
129
- */
130
- static fromJSON(jsonString: string): Wallet | undefined;
131
111
  /**
132
112
  * Creates a Wallet instance from a plain JavaScript object.
133
113
  * Validates the input object using the Wallet schema, including the countryCode runtime check.
@@ -142,6 +122,20 @@ export declare class Wallet {
142
122
  * @returns True if the object resembles a Wallet instance, false otherwise.
143
123
  */
144
124
  static is(obj: unknown): obj is Wallet;
125
+ /**
126
+ * Serializes the Wallet instance to a JSON-compatible object
127
+ */
128
+ toJSON(): WalletJSON;
129
+ /**
130
+ * Serializes the Wallet instance to a JSON string
131
+ */
132
+ toJSONString(): string;
133
+ /**
134
+ * Creates a Wallet instance from a JSON-compatible object or string
135
+ */
136
+ static fromJSON(json: WalletJSON | string): Wallet | undefined;
137
+ /**
138
+ * Type guard using Zod schema validation
139
+ */
140
+ static isWalletJSON(obj: unknown): obj is WalletJSON;
145
141
  }
146
- export {};
147
- //# sourceMappingURL=wallet.d.ts.map
@@ -0,0 +1,95 @@
1
+ import { QueryBuilder } from "@/lib/query/index.js";
2
+ import { WalletQueryDTO } from "./wallet.dtos.js";
3
+ /**
4
+ * Wallet-specific query builder that extends the base QueryBuilder
5
+ * and handles all possible input conversions (DTOs, URL params, etc.)
6
+ */
7
+ export declare class WalletQuery extends QueryBuilder {
8
+ /**
9
+ * Create empty wallet query with defaults
10
+ */
11
+ static create(): WalletQuery;
12
+ /**
13
+ * Create from typed DTO/filters object
14
+ */
15
+ static fromFilters(filters: WalletQueryDTO): WalletQuery;
16
+ /**
17
+ * Create from URL search parameters (strings)
18
+ */
19
+ static fromUrlParams(params: Record<string, string>): WalletQuery;
20
+ /**
21
+ * Create from URLSearchParams object
22
+ */
23
+ static fromSearchParams(searchParams: URLSearchParams): WalletQuery;
24
+ /**
25
+ * Create from Next.js Request object
26
+ */
27
+ static fromRequest(request: Request): WalletQuery;
28
+ /**
29
+ * Create from any supported input type
30
+ */
31
+ static from(input: QueryBuilder | WalletQueryDTO | Record<string, string> | URLSearchParams | null | undefined): WalletQuery;
32
+ /**
33
+ * Type guard for string records
34
+ */
35
+ private static isStringRecord;
36
+ whereId(id: string): this;
37
+ whereProfileId(profileId: string): this;
38
+ whereAccountNo(accountNo: string): this;
39
+ whereAccountName(accountName: string): this;
40
+ whereChannel(channel: string): this;
41
+ whereCountryCode(countryCode: string): this;
42
+ whereCurrencyCode(currencyCode: string): this;
43
+ /**
44
+ * Apply all filters from WalletQueryDTO object
45
+ */
46
+ private applyFilters;
47
+ /**
48
+ * Convert to WalletQueryDTO
49
+ */
50
+ toFilters(): WalletQueryDTO;
51
+ /**
52
+ * Convert to URL-safe string parameters
53
+ */
54
+ toUrlParams(): Record<string, string>;
55
+ /**
56
+ * Convert to URLSearchParams
57
+ */
58
+ toSearchParams(): URLSearchParams;
59
+ /**
60
+ * Convert to query string
61
+ */
62
+ toQueryString(): string;
63
+ /**
64
+ * Create new instance with wallet ID filter
65
+ */
66
+ withId(id: string): WalletQuery;
67
+ /**
68
+ * Create new instance with profile ID filter
69
+ */
70
+ withProfileId(profileId: string): WalletQuery;
71
+ /**
72
+ * Create new instance with account number filter
73
+ */
74
+ withAccountNo(accountNo: string): WalletQuery;
75
+ /**
76
+ * Create new instance with country code filter
77
+ */
78
+ withCountryCode(countryCode: string): WalletQuery;
79
+ /**
80
+ * Create new instance with currency code filter
81
+ */
82
+ withCurrencyCode(currencyCode: string): WalletQuery;
83
+ /**
84
+ * Check if any filters are applied
85
+ */
86
+ hasFilters(): boolean;
87
+ /**
88
+ * Get human-readable filter descriptions
89
+ */
90
+ getActiveFilters(): string[];
91
+ /**
92
+ * Extract filter values from QueryBuilder options
93
+ */
94
+ private extractFilterValues;
95
+ }
@@ -0,0 +1,205 @@
1
+ import { Amount } from "@temboplus/frontend-core";
2
+ import { WalletStatementEntry } from "./statement-entry.model.js";
3
+ import { Wallet } from "./wallet.model.js";
4
+ import { contract } from "./wallet.contract.js";
5
+ import { BaseRepository } from "@/lib/api/base-repository.js";
6
+ import { WalletQuery } from "./wallet.query.js";
7
+ import { WalletQueryDTO } from "./wallet.dtos.js";
8
+ /**
9
+ * Flexible query input type - supports the class, filters interface, URL params, etc.
10
+ */
11
+ export type WalletQueryInput = WalletQuery | WalletQueryDTO | Record<string, string> | URLSearchParams | null | undefined;
12
+ /**
13
+ * Repository class for managing wallet operations including balance checking,
14
+ * statement generation, and wallet information retrieval.
15
+ *
16
+ * This repository handles pure API communication without permission checking.
17
+ * Permission validation should be handled at the service layer or route handlers.
18
+ *
19
+ * @extends {BaseRepository<typeof contract>}
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * // Direct token usage
24
+ * const repo = new WalletRepository({ token: userToken });
25
+ * const balance = await repo.getBalance({ wallet });
26
+ *
27
+ * // Service locator usage
28
+ * const repo = new WalletRepository();
29
+ * const wallets = await repo.getWallets();
30
+ * ```
31
+ */
32
+ export declare class WalletRepository extends BaseRepository<typeof contract> {
33
+ /**
34
+ * Creates an instance of WalletRepository initialized with the wallet contract.
35
+ *
36
+ * @param options - Optional configuration
37
+ * @param options.root - Custom API root URL
38
+ * @param options.token - Authentication token for API calls
39
+ *
40
+ * @example
41
+ * ```typescript
42
+ * const repo = new WalletRepository({
43
+ * token: "user-auth-token",
44
+ * root: "base-api-url"
45
+ * });
46
+ * ```
47
+ */
48
+ constructor(options?: {
49
+ root?: string;
50
+ token?: string;
51
+ });
52
+ /**
53
+ * Retrieves the current available balance for a specific wallet.
54
+ *
55
+ * Supports two input methods:
56
+ * 1. Direct wallet object (preferred for performance)
57
+ * 2. Account number lookup (requires additional API call to fetch wallet details)
58
+ *
59
+ * @param props - The request properties (must provide either wallet or accountNo)
60
+ * @param props.wallet - The wallet object for which to retrieve the balance (preferred method)
61
+ * @param props.accountNo - Alternative: account number to lookup wallet and fetch balance
62
+ * @returns Promise that resolves to the available balance as an Amount object
63
+ * @throws {Error} If neither wallet nor accountNo is provided
64
+ * @throws {Error} If accountNo is provided but no matching wallet is found
65
+ * @throws {Error} If the balance fetch operation fails due to network or server errors
66
+ *
67
+ * @example
68
+ * ```typescript
69
+ * // Method 1: Using wallet object (recommended - faster)
70
+ * try {
71
+ * const wallet = await repo.getWallets().then(w => w[0]);
72
+ * const balance = await repo.getBalance({ wallet });
73
+ * console.log(`Available balance: ${balance.label}`);
74
+ * } catch (error) {
75
+ * console.error('Failed to fetch balance:', error.message);
76
+ * }
77
+ *
78
+ * // Method 2: Using account number (requires wallet lookup)
79
+ * try {
80
+ * const balance = await repo.getBalance({ accountNo: '123456789' });
81
+ * console.log(`Available balance: ${balance.label}`);
82
+ * } catch (error) {
83
+ * console.error('Failed to fetch balance:', error.message);
84
+ * }
85
+ * ```
86
+ */
87
+ getBalance(props: {
88
+ wallet?: Wallet;
89
+ accountNo?: string;
90
+ }): Promise<Amount>;
91
+ /**
92
+ * Retrieves all wallets associated with the authenticated user.
93
+ *
94
+ * Supports flexible filtering through WalletQuery or plain filter objects.
95
+ *
96
+ * @param query - Optional query parameters for filtering wallets
97
+ * @returns Promise that resolves to an array of validated Wallet instances
98
+ * @throws {Error} If the wallet fetch operation fails or data is invalid
99
+ *
100
+ * @example
101
+ * ```typescript
102
+ * // Get all wallets
103
+ * const allWallets = await repo.getWallets();
104
+ *
105
+ * // Get specific wallet by account number
106
+ * const specificWallet = await repo.getWallets({ accountNo: '123456789' });
107
+ *
108
+ * // Get wallets with multiple filters using WalletQuery
109
+ * const query = WalletQuery.create()
110
+ * .whereCountryCode('TZ')
111
+ * .whereCurrencyCode('TZS');
112
+ * const tzWallets = await repo.getWallets(query);
113
+ *
114
+ * // Get wallets with filters object
115
+ * const usdWallets = await repo.getWallets({ currencyCode: 'USD' });
116
+ * ```
117
+ */
118
+ getWallets(query?: WalletQueryInput): Promise<Wallet[]>;
119
+ /**
120
+ * Retrieves a single wallet by its ID.
121
+ *
122
+ * Since the API doesn't have a dedicated /id endpoint, this method queries
123
+ * the list endpoint with the ID filter and returns the first result.
124
+ *
125
+ * @param id - The unique identifier of the wallet to retrieve
126
+ * @returns Promise that resolves to the wallet if found, undefined otherwise
127
+ * @throws {Error} If the fetch operation fails
128
+ *
129
+ * @example
130
+ * ```typescript
131
+ * const wallet = await repo.getByID("wallet-id");
132
+ * if (wallet) {
133
+ * console.log(`Wallet: ${wallet.accountName}`);
134
+ * } else {
135
+ * console.log('Wallet not found');
136
+ * }
137
+ * ```
138
+ */
139
+ getByID(id: string): Promise<Wallet | undefined>;
140
+ /**
141
+ * Retrieves wallet statement entries for a specified date range.
142
+ *
143
+ * Supports two input methods:
144
+ * 1. Direct wallet object (preferred for performance and currency context)
145
+ * 2. Account number lookup (requires additional API call to determine currency)
146
+ *
147
+ * If no date range is provided, defaults to the current month.
148
+ * Returns statement entries with enhanced narration objects containing payout detection
149
+ * and parsing capabilities.
150
+ *
151
+ * @param props - The statement request properties
152
+ * @param props.wallet - The wallet to get statement for (preferred method)
153
+ * @param props.accountNo - Alternative: account number to lookup wallet and fetch statement
154
+ * @param props.range - Optional date range (defaults to current month)
155
+ * @param props.range.startDate - Start date for statement period
156
+ * @param props.range.endDate - End date for statement period
157
+ * @returns Promise that resolves to an array of validated WalletStatementEntry instances with Narration objects
158
+ * @throws {Error} If neither wallet nor accountNo is provided
159
+ * @throws {Error} If accountNo is provided but no matching wallet is found
160
+ * @throws {Error} If the statement fetch operation fails or data is invalid
161
+ *
162
+ * @example
163
+ * ```typescript
164
+ * // Method 1: Using wallet object (recommended)
165
+ * const wallet = await repo.getWallets().then(w => w[0]);
166
+ * const currentMonthEntries = await repo.getStatement({ wallet });
167
+ *
168
+ * // Method 2: Using account number
169
+ * const entriesForAccount = await repo.getStatement({
170
+ * accountNo: '123456789'
171
+ * });
172
+ *
173
+ * // Custom date range with wallet
174
+ * const customRangeEntries = await repo.getStatement({
175
+ * wallet,
176
+ * range: {
177
+ * startDate: new Date('2024-01-01'),
178
+ * endDate: new Date('2024-01-31')
179
+ * }
180
+ * });
181
+ *
182
+ * // Process payout transactions
183
+ * const payoutEntries = currentMonthEntries.filter(entry => entry.isPayout);
184
+ * payoutEntries.forEach(entry => {
185
+ * console.log(`Payout ID: ${entry.payoutId}, Amount: ${entry.amountDebited.label}`);
186
+ * });
187
+ * ```
188
+ */
189
+ getStatement(props: {
190
+ range?: {
191
+ startDate: Date;
192
+ endDate: Date;
193
+ };
194
+ wallet?: Wallet;
195
+ accountNo?: string;
196
+ }): Promise<WalletStatementEntry[]>;
197
+ /**
198
+ * Check if a wallet exists with the given query
199
+ */
200
+ exists(query?: WalletQueryInput): Promise<boolean>;
201
+ /**
202
+ * Get count of wallets matching a query
203
+ */
204
+ count(query?: WalletQueryInput): Promise<number>;
205
+ }
@@ -0,0 +1,17 @@
1
+ import { CountryCode } from "@temboplus/frontend-core";
2
+ import { Wallet } from "./wallet.model.js";
3
+ export declare const WalletUtils: {
4
+ /**
5
+ * Gets unique countries from a list of wallets
6
+ * @param wallets Array of wallets
7
+ * @returns Array of unique country codes
8
+ */
9
+ getUniqueCountries(wallets: Wallet[]): CountryCode[];
10
+ /**
11
+ * Gets wallets for a specific country
12
+ * @param wallets Array of wallets
13
+ * @param countryCode Country code to filter by
14
+ * @returns Array of wallets for the specified country
15
+ */
16
+ getWalletsByCountry(wallets: Wallet[], countryCode: CountryCode): Wallet[];
17
+ };