@temboplus/afloat 0.1.54 → 0.1.55

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 (465) hide show
  1. package/README.md +246 -42
  2. package/{esm/src/features/admin/contract.d.ts → dist/features/admin/admin.contract.d.ts} +41 -77
  3. package/{script/src/features/admin/schemas.d.ts → dist/features/admin/admin.dtos.d.ts} +8 -9
  4. package/dist/features/admin/admin.repository.d.ts +179 -0
  5. package/dist/features/admin/index.d.ts +2 -0
  6. package/{esm/src/features/auth/access/contract.d.ts → dist/features/auth/access/access.api-contract.d.ts} +0 -1
  7. package/dist/features/auth/access/access.repository.d.ts +55 -0
  8. package/{esm/src/features/auth/contract.d.ts → dist/features/auth/auth.contract.d.ts} +12 -8
  9. package/dist/features/auth/auth.manager.d.ts +249 -0
  10. package/dist/features/auth/auth.repository.d.ts +66 -0
  11. package/dist/features/auth/auth.store.d.ts +139 -0
  12. package/{script/src/features/auth/identity/contract.d.ts → dist/features/auth/identity/identity.api-contract.d.ts} +0 -1
  13. package/dist/features/auth/identity/identity.repository.d.ts +58 -0
  14. package/dist/features/auth/index.d.ts +5 -0
  15. package/{script/src/features/auth/profile/contract.d.ts → dist/features/auth/profile/profile.api-contract.d.ts} +8 -6
  16. package/dist/features/auth/profile/profile.dtos.d.ts +80 -0
  17. package/dist/features/auth/profile/profile.repository.d.ts +56 -0
  18. package/{script/src/features/auth/storage/client_store.d.ts → dist/features/auth/storage/client-store.d.ts} +2 -3
  19. package/{esm/src/features/auth/storage/client_token_handler.d.ts → dist/features/auth/storage/client-token-handler.d.ts} +1 -2
  20. package/{script/src → dist}/features/auth/storage/types.d.ts +1 -2
  21. package/dist/features/contact/contact-input-handler.d.ts +16 -0
  22. package/{esm/src/features/contact/contract.d.ts → dist/features/contact/contact.api-contract.d.ts} +101 -45
  23. package/dist/features/contact/contact.dtos.d.ts +90 -0
  24. package/dist/features/contact/contact.repository.d.ts +116 -0
  25. package/dist/features/contact/index.d.ts +2 -0
  26. package/dist/features/payout/index.d.ts +3 -0
  27. package/dist/features/payout/payout-channel-handler.d.ts +108 -0
  28. package/{esm/src/features/payout/contract.d.ts → dist/features/payout/payout.api-contract.d.ts} +351 -187
  29. package/dist/features/payout/payout.dtos.d.ts +365 -0
  30. package/dist/features/payout/payout.repository.d.ts +193 -0
  31. package/dist/features/wallet/index.d.ts +4 -0
  32. package/dist/features/wallet/wallet-manager.session.d.ts +143 -0
  33. package/{script/src/features/wallet/contract.d.ts → dist/features/wallet/wallet.contract.d.ts} +9 -7
  34. package/dist/features/wallet/wallet.dtos.d.ts +204 -0
  35. package/dist/features/wallet/wallet.repository.d.ts +120 -0
  36. package/dist/features/wallet/wallet.utils.d.ts +17 -0
  37. package/dist/index.cjs.js +2 -0
  38. package/dist/index.cjs.js.map +1 -0
  39. package/dist/index.d.ts +7 -0
  40. package/dist/index.esm.js +2 -0
  41. package/dist/index.esm.js.map +1 -0
  42. package/{esm/src/shared/base_repository.d.ts → dist/lib/api/base-repository.d.ts} +137 -42
  43. package/{script/src/shared/common_responses.d.ts → dist/lib/api/common-responses.d.ts} +0 -1
  44. package/dist/lib/api/index.d.ts +2 -0
  45. package/{esm/src/errors/api_error.d.ts → dist/lib/error/error.api.d.ts} +0 -1
  46. package/{script/src/errors/permission_error.d.ts → dist/lib/error/error.permission.d.ts} +1 -2
  47. package/dist/lib/error/error.utils.d.ts +22 -0
  48. package/dist/lib/error/index.d.ts +3 -0
  49. package/dist/models/contact-info.model.d.ts +817 -0
  50. package/{script/src/models/contact/derivatives/contact.d.ts → dist/models/contact.model.d.ts} +23 -16
  51. package/dist/models/index.d.ts +10 -0
  52. package/{esm/src/models/user/managed-user.d.ts → dist/models/managed-user.model.d.ts} +3 -3
  53. package/{script/src/models/payout/derivatives/payout.d.ts → dist/models/payout.model.d.ts} +13 -15
  54. package/{esm/src → dist}/models/permission.d.ts +1 -2
  55. package/{script/src/models/user/profile.d.ts → dist/models/profile.model.d.ts} +37 -43
  56. package/{script/src/models/role.d.ts → dist/models/role.model.d.ts} +2 -10
  57. package/dist/models/statement-entry.model.d.ts +195 -0
  58. package/{esm/src/models/user/authenticated-user.d.ts → dist/models/user.model.d.ts} +1 -2
  59. package/{script/src/models/wallet/wallet.d.ts → dist/models/wallet.model.d.ts} +3 -46
  60. package/package.json +47 -26
  61. package/LICENSE +0 -7
  62. package/esm/_dnt.test_shims.d.ts.map +0 -1
  63. package/esm/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts.map +0 -1
  64. package/esm/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts.map +0 -1
  65. package/esm/deps/jsr.io/@std/assert/1.0.10/assert.d.ts.map +0 -1
  66. package/esm/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts.map +0 -1
  67. package/esm/deps/jsr.io/@std/assert/1.0.10/equal.d.ts.map +0 -1
  68. package/esm/deps/jsr.io/@std/assert/1.0.10/equals.d.ts.map +0 -1
  69. package/esm/deps/jsr.io/@std/assert/1.0.10/exists.d.ts.map +0 -1
  70. package/esm/deps/jsr.io/@std/assert/1.0.10/fail.d.ts.map +0 -1
  71. package/esm/deps/jsr.io/@std/assert/1.0.10/false.d.ts.map +0 -1
  72. package/esm/deps/jsr.io/@std/assert/1.0.10/greater.d.ts.map +0 -1
  73. package/esm/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts.map +0 -1
  74. package/esm/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts.map +0 -1
  75. package/esm/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts.map +0 -1
  76. package/esm/deps/jsr.io/@std/assert/1.0.10/less.d.ts.map +0 -1
  77. package/esm/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts.map +0 -1
  78. package/esm/deps/jsr.io/@std/assert/1.0.10/match.d.ts.map +0 -1
  79. package/esm/deps/jsr.io/@std/assert/1.0.10/mod.d.ts.map +0 -1
  80. package/esm/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts.map +0 -1
  81. package/esm/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts.map +0 -1
  82. package/esm/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts.map +0 -1
  83. package/esm/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts.map +0 -1
  84. package/esm/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts.map +0 -1
  85. package/esm/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts.map +0 -1
  86. package/esm/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts.map +0 -1
  87. package/esm/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts.map +0 -1
  88. package/esm/deps/jsr.io/@std/assert/1.0.10/throws.d.ts.map +0 -1
  89. package/esm/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts.map +0 -1
  90. package/esm/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts.map +0 -1
  91. package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +0 -1
  92. package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +0 -1
  93. package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +0 -1
  94. package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +0 -1
  95. package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +0 -1
  96. package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +0 -1
  97. package/esm/mod.d.ts +0 -8
  98. package/esm/mod.d.ts.map +0 -1
  99. package/esm/mod.js +0 -7
  100. package/esm/package.json +0 -3
  101. package/esm/src/errors/api_error.d.ts.map +0 -1
  102. package/esm/src/errors/api_error.js +0 -90
  103. package/esm/src/errors/index.d.ts +0 -3
  104. package/esm/src/errors/index.d.ts.map +0 -1
  105. package/esm/src/errors/index.js +0 -2
  106. package/esm/src/errors/permission_error.d.ts +0 -48
  107. package/esm/src/errors/permission_error.d.ts.map +0 -1
  108. package/esm/src/errors/permission_error.js +0 -70
  109. package/esm/src/features/admin/contract.d.ts.map +0 -1
  110. package/esm/src/features/admin/contract.js +0 -210
  111. package/esm/src/features/admin/index.d.ts +0 -4
  112. package/esm/src/features/admin/index.d.ts.map +0 -1
  113. package/esm/src/features/admin/index.js +0 -3
  114. package/esm/src/features/admin/repository.d.ts +0 -114
  115. package/esm/src/features/admin/repository.d.ts.map +0 -1
  116. package/esm/src/features/admin/repository.js +0 -248
  117. package/esm/src/features/admin/schemas.d.ts +0 -146
  118. package/esm/src/features/admin/schemas.d.ts.map +0 -1
  119. package/esm/src/features/admin/schemas.js +0 -206
  120. package/esm/src/features/auth/access/contract.d.ts.map +0 -1
  121. package/esm/src/features/auth/access/contract.js +0 -14
  122. package/esm/src/features/auth/access/repository.d.ts +0 -11
  123. package/esm/src/features/auth/access/repository.d.ts.map +0 -1
  124. package/esm/src/features/auth/access/repository.js +0 -25
  125. package/esm/src/features/auth/contract.d.ts.map +0 -1
  126. package/esm/src/features/auth/contract.js +0 -43
  127. package/esm/src/features/auth/identity/contract.d.ts +0 -23
  128. package/esm/src/features/auth/identity/contract.d.ts.map +0 -1
  129. package/esm/src/features/auth/identity/contract.js +0 -17
  130. package/esm/src/features/auth/identity/repository.d.ts +0 -22
  131. package/esm/src/features/auth/identity/repository.d.ts.map +0 -1
  132. package/esm/src/features/auth/identity/repository.js +0 -30
  133. package/esm/src/features/auth/index.d.ts +0 -6
  134. package/esm/src/features/auth/index.d.ts.map +0 -1
  135. package/esm/src/features/auth/index.js +0 -5
  136. package/esm/src/features/auth/manager.d.ts +0 -105
  137. package/esm/src/features/auth/manager.d.ts.map +0 -1
  138. package/esm/src/features/auth/manager.js +0 -181
  139. package/esm/src/features/auth/profile/contract.d.ts +0 -37
  140. package/esm/src/features/auth/profile/contract.d.ts.map +0 -1
  141. package/esm/src/features/auth/profile/contract.js +0 -14
  142. package/esm/src/features/auth/profile/repository.d.ts +0 -11
  143. package/esm/src/features/auth/profile/repository.d.ts.map +0 -1
  144. package/esm/src/features/auth/profile/repository.js +0 -25
  145. package/esm/src/features/auth/repository.d.ts +0 -30
  146. package/esm/src/features/auth/repository.d.ts.map +0 -1
  147. package/esm/src/features/auth/repository.js +0 -69
  148. package/esm/src/features/auth/storage/client_store.d.ts +0 -30
  149. package/esm/src/features/auth/storage/client_store.d.ts.map +0 -1
  150. package/esm/src/features/auth/storage/client_store.js +0 -46
  151. package/esm/src/features/auth/storage/client_token_handler.d.ts.map +0 -1
  152. package/esm/src/features/auth/storage/client_token_handler.js +0 -36
  153. package/esm/src/features/auth/storage/server_store.d.ts +0 -24
  154. package/esm/src/features/auth/storage/server_store.d.ts.map +0 -1
  155. package/esm/src/features/auth/storage/server_store.js +0 -34
  156. package/esm/src/features/auth/storage/server_token_handler.d.ts +0 -36
  157. package/esm/src/features/auth/storage/server_token_handler.d.ts.map +0 -1
  158. package/esm/src/features/auth/storage/server_token_handler.js +0 -115
  159. package/esm/src/features/auth/storage/types.d.ts +0 -42
  160. package/esm/src/features/auth/storage/types.d.ts.map +0 -1
  161. package/esm/src/features/auth/storage/types.js +0 -1
  162. package/esm/src/features/contact/contract.d.ts.map +0 -1
  163. package/esm/src/features/contact/contract.js +0 -49
  164. package/esm/src/features/contact/index.d.ts +0 -2
  165. package/esm/src/features/contact/index.d.ts.map +0 -1
  166. package/esm/src/features/contact/index.js +0 -1
  167. package/esm/src/features/contact/repository.d.ts +0 -58
  168. package/esm/src/features/contact/repository.d.ts.map +0 -1
  169. package/esm/src/features/contact/repository.js +0 -108
  170. package/esm/src/features/payout/contract.d.ts.map +0 -1
  171. package/esm/src/features/payout/contract.js +0 -75
  172. package/esm/src/features/payout/index.d.ts +0 -2
  173. package/esm/src/features/payout/index.d.ts.map +0 -1
  174. package/esm/src/features/payout/index.js +0 -1
  175. package/esm/src/features/payout/repository.d.ts +0 -67
  176. package/esm/src/features/payout/repository.d.ts.map +0 -1
  177. package/esm/src/features/payout/repository.js +0 -163
  178. package/esm/src/features/wallet/contract.d.ts +0 -137
  179. package/esm/src/features/wallet/contract.d.ts.map +0 -1
  180. package/esm/src/features/wallet/contract.js +0 -38
  181. package/esm/src/features/wallet/index.d.ts +0 -2
  182. package/esm/src/features/wallet/index.d.ts.map +0 -1
  183. package/esm/src/features/wallet/index.js +0 -1
  184. package/esm/src/features/wallet/repository.d.ts +0 -57
  185. package/esm/src/features/wallet/repository.d.ts.map +0 -1
  186. package/esm/src/features/wallet/repository.js +0 -93
  187. package/esm/src/models/contact/derivatives/contact.d.ts +0 -172
  188. package/esm/src/models/contact/derivatives/contact.d.ts.map +0 -1
  189. package/esm/src/models/contact/derivatives/contact.js +0 -266
  190. package/esm/src/models/contact/derivatives/contact.test.d.ts.map +0 -1
  191. package/esm/src/models/contact/derivatives/contact_info.d.ts +0 -188
  192. package/esm/src/models/contact/derivatives/contact_info.d.ts.map +0 -1
  193. package/esm/src/models/contact/derivatives/contact_info.js +0 -255
  194. package/esm/src/models/contact/derivatives/contact_info.test.d.ts.map +0 -1
  195. package/esm/src/models/contact/index.d.ts +0 -5
  196. package/esm/src/models/contact/index.d.ts.map +0 -1
  197. package/esm/src/models/contact/index.js +0 -4
  198. package/esm/src/models/contact/schemas.d.ts +0 -66
  199. package/esm/src/models/contact/schemas.d.ts.map +0 -1
  200. package/esm/src/models/contact/schemas.js +0 -64
  201. package/esm/src/models/contact/validation.d.ts +0 -37
  202. package/esm/src/models/contact/validation.d.ts.map +0 -1
  203. package/esm/src/models/contact/validation.js +0 -139
  204. package/esm/src/models/contact/validation.test.d.ts.map +0 -1
  205. package/esm/src/models/index.d.ts +0 -7
  206. package/esm/src/models/index.d.ts.map +0 -1
  207. package/esm/src/models/index.js +0 -6
  208. package/esm/src/models/payout/api.d.ts +0 -29
  209. package/esm/src/models/payout/api.d.ts.map +0 -1
  210. package/esm/src/models/payout/api.js +0 -1
  211. package/esm/src/models/payout/channel.d.ts +0 -58
  212. package/esm/src/models/payout/channel.d.ts.map +0 -1
  213. package/esm/src/models/payout/channel.js +0 -53
  214. package/esm/src/models/payout/derivatives/payout.d.ts +0 -156
  215. package/esm/src/models/payout/derivatives/payout.d.ts.map +0 -1
  216. package/esm/src/models/payout/derivatives/payout.js +0 -261
  217. package/esm/src/models/payout/derivatives/payout.test.d.ts.map +0 -1
  218. package/esm/src/models/payout/index.d.ts +0 -6
  219. package/esm/src/models/payout/index.d.ts.map +0 -1
  220. package/esm/src/models/payout/index.js +0 -5
  221. package/esm/src/models/payout/schemas.d.ts +0 -156
  222. package/esm/src/models/payout/schemas.d.ts.map +0 -1
  223. package/esm/src/models/payout/schemas.js +0 -105
  224. package/esm/src/models/payout/status.d.ts +0 -33
  225. package/esm/src/models/payout/status.d.ts.map +0 -1
  226. package/esm/src/models/payout/status.js +0 -34
  227. package/esm/src/models/permission.d.ts.map +0 -1
  228. package/esm/src/models/permission.js +0 -50
  229. package/esm/src/models/role.d.ts +0 -21
  230. package/esm/src/models/role.d.ts.map +0 -1
  231. package/esm/src/models/role.js +0 -73
  232. package/esm/src/models/user/authenticated-user.d.ts.map +0 -1
  233. package/esm/src/models/user/authenticated-user.js +0 -226
  234. package/esm/src/models/user/index.d.ts +0 -4
  235. package/esm/src/models/user/index.d.ts.map +0 -1
  236. package/esm/src/models/user/index.js +0 -3
  237. package/esm/src/models/user/managed-user.d.ts.map +0 -1
  238. package/esm/src/models/user/managed-user.js +0 -255
  239. package/esm/src/models/user/profile.d.ts +0 -161
  240. package/esm/src/models/user/profile.d.ts.map +0 -1
  241. package/esm/src/models/user/profile.js +0 -334
  242. package/esm/src/models/wallet/index.d.ts +0 -4
  243. package/esm/src/models/wallet/index.d.ts.map +0 -1
  244. package/esm/src/models/wallet/index.js +0 -3
  245. package/esm/src/models/wallet/schemas.d.ts +0 -95
  246. package/esm/src/models/wallet/schemas.d.ts.map +0 -1
  247. package/esm/src/models/wallet/schemas.js +0 -35
  248. package/esm/src/models/wallet/statement_entry.d.ts +0 -160
  249. package/esm/src/models/wallet/statement_entry.d.ts.map +0 -1
  250. package/esm/src/models/wallet/statement_entry.js +0 -255
  251. package/esm/src/models/wallet/wallet.d.ts +0 -147
  252. package/esm/src/models/wallet/wallet.d.ts.map +0 -1
  253. package/esm/src/models/wallet/wallet.js +0 -279
  254. package/esm/src/shared/base_repository.d.ts.map +0 -1
  255. package/esm/src/shared/base_repository.js +0 -153
  256. package/esm/src/shared/common_responses.d.ts +0 -13
  257. package/esm/src/shared/common_responses.d.ts.map +0 -1
  258. package/esm/src/shared/common_responses.js +0 -10
  259. package/esm/src/shared/index.d.ts +0 -3
  260. package/esm/src/shared/index.d.ts.map +0 -1
  261. package/esm/src/shared/index.js +0 -2
  262. package/esm/src/shared/token_required_repository.d.ts +0 -78
  263. package/esm/src/shared/token_required_repository.d.ts.map +0 -1
  264. package/esm/src/shared/token_required_repository.js +0 -128
  265. package/script/_dnt.test_shims.d.ts.map +0 -1
  266. package/script/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts.map +0 -1
  267. package/script/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts.map +0 -1
  268. package/script/deps/jsr.io/@std/assert/1.0.10/assert.d.ts.map +0 -1
  269. package/script/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts.map +0 -1
  270. package/script/deps/jsr.io/@std/assert/1.0.10/equal.d.ts.map +0 -1
  271. package/script/deps/jsr.io/@std/assert/1.0.10/equals.d.ts.map +0 -1
  272. package/script/deps/jsr.io/@std/assert/1.0.10/exists.d.ts.map +0 -1
  273. package/script/deps/jsr.io/@std/assert/1.0.10/fail.d.ts.map +0 -1
  274. package/script/deps/jsr.io/@std/assert/1.0.10/false.d.ts.map +0 -1
  275. package/script/deps/jsr.io/@std/assert/1.0.10/greater.d.ts.map +0 -1
  276. package/script/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts.map +0 -1
  277. package/script/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts.map +0 -1
  278. package/script/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts.map +0 -1
  279. package/script/deps/jsr.io/@std/assert/1.0.10/less.d.ts.map +0 -1
  280. package/script/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts.map +0 -1
  281. package/script/deps/jsr.io/@std/assert/1.0.10/match.d.ts.map +0 -1
  282. package/script/deps/jsr.io/@std/assert/1.0.10/mod.d.ts.map +0 -1
  283. package/script/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts.map +0 -1
  284. package/script/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts.map +0 -1
  285. package/script/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts.map +0 -1
  286. package/script/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts.map +0 -1
  287. package/script/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts.map +0 -1
  288. package/script/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts.map +0 -1
  289. package/script/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts.map +0 -1
  290. package/script/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts.map +0 -1
  291. package/script/deps/jsr.io/@std/assert/1.0.10/throws.d.ts.map +0 -1
  292. package/script/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts.map +0 -1
  293. package/script/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts.map +0 -1
  294. package/script/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +0 -1
  295. package/script/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +0 -1
  296. package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +0 -1
  297. package/script/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +0 -1
  298. package/script/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +0 -1
  299. package/script/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +0 -1
  300. package/script/mod.d.ts +0 -8
  301. package/script/mod.d.ts.map +0 -1
  302. package/script/mod.js +0 -23
  303. package/script/package.json +0 -3
  304. package/script/src/errors/api_error.d.ts +0 -63
  305. package/script/src/errors/api_error.d.ts.map +0 -1
  306. package/script/src/errors/api_error.js +0 -94
  307. package/script/src/errors/index.d.ts +0 -3
  308. package/script/src/errors/index.d.ts.map +0 -1
  309. package/script/src/errors/index.js +0 -18
  310. package/script/src/errors/permission_error.d.ts.map +0 -1
  311. package/script/src/errors/permission_error.js +0 -74
  312. package/script/src/features/admin/contract.d.ts +0 -842
  313. package/script/src/features/admin/contract.d.ts.map +0 -1
  314. package/script/src/features/admin/contract.js +0 -213
  315. package/script/src/features/admin/index.d.ts +0 -4
  316. package/script/src/features/admin/index.d.ts.map +0 -1
  317. package/script/src/features/admin/index.js +0 -19
  318. package/script/src/features/admin/repository.d.ts +0 -114
  319. package/script/src/features/admin/repository.d.ts.map +0 -1
  320. package/script/src/features/admin/repository.js +0 -252
  321. package/script/src/features/admin/schemas.d.ts.map +0 -1
  322. package/script/src/features/admin/schemas.js +0 -209
  323. package/script/src/features/auth/access/contract.d.ts +0 -14
  324. package/script/src/features/auth/access/contract.d.ts.map +0 -1
  325. package/script/src/features/auth/access/contract.js +0 -17
  326. package/script/src/features/auth/access/repository.d.ts +0 -11
  327. package/script/src/features/auth/access/repository.d.ts.map +0 -1
  328. package/script/src/features/auth/access/repository.js +0 -29
  329. package/script/src/features/auth/contract.d.ts +0 -112
  330. package/script/src/features/auth/contract.d.ts.map +0 -1
  331. package/script/src/features/auth/contract.js +0 -46
  332. package/script/src/features/auth/identity/contract.d.ts.map +0 -1
  333. package/script/src/features/auth/identity/contract.js +0 -20
  334. package/script/src/features/auth/identity/repository.d.ts +0 -22
  335. package/script/src/features/auth/identity/repository.d.ts.map +0 -1
  336. package/script/src/features/auth/identity/repository.js +0 -34
  337. package/script/src/features/auth/index.d.ts +0 -6
  338. package/script/src/features/auth/index.d.ts.map +0 -1
  339. package/script/src/features/auth/index.js +0 -21
  340. package/script/src/features/auth/manager.d.ts +0 -105
  341. package/script/src/features/auth/manager.d.ts.map +0 -1
  342. package/script/src/features/auth/manager.js +0 -185
  343. package/script/src/features/auth/profile/contract.d.ts.map +0 -1
  344. package/script/src/features/auth/profile/contract.js +0 -17
  345. package/script/src/features/auth/profile/repository.d.ts +0 -11
  346. package/script/src/features/auth/profile/repository.d.ts.map +0 -1
  347. package/script/src/features/auth/profile/repository.js +0 -29
  348. package/script/src/features/auth/repository.d.ts +0 -30
  349. package/script/src/features/auth/repository.d.ts.map +0 -1
  350. package/script/src/features/auth/repository.js +0 -73
  351. package/script/src/features/auth/storage/client_store.d.ts.map +0 -1
  352. package/script/src/features/auth/storage/client_store.js +0 -51
  353. package/script/src/features/auth/storage/client_token_handler.d.ts +0 -32
  354. package/script/src/features/auth/storage/client_token_handler.d.ts.map +0 -1
  355. package/script/src/features/auth/storage/client_token_handler.js +0 -40
  356. package/script/src/features/auth/storage/server_store.d.ts +0 -24
  357. package/script/src/features/auth/storage/server_store.d.ts.map +0 -1
  358. package/script/src/features/auth/storage/server_store.js +0 -38
  359. package/script/src/features/auth/storage/server_token_handler.d.ts +0 -36
  360. package/script/src/features/auth/storage/server_token_handler.d.ts.map +0 -1
  361. package/script/src/features/auth/storage/server_token_handler.js +0 -119
  362. package/script/src/features/auth/storage/types.d.ts.map +0 -1
  363. package/script/src/features/auth/storage/types.js +0 -2
  364. package/script/src/features/contact/contract.d.ts +0 -170
  365. package/script/src/features/contact/contract.d.ts.map +0 -1
  366. package/script/src/features/contact/contract.js +0 -52
  367. package/script/src/features/contact/index.d.ts +0 -2
  368. package/script/src/features/contact/index.d.ts.map +0 -1
  369. package/script/src/features/contact/index.js +0 -17
  370. package/script/src/features/contact/repository.d.ts +0 -58
  371. package/script/src/features/contact/repository.d.ts.map +0 -1
  372. package/script/src/features/contact/repository.js +0 -112
  373. package/script/src/features/payout/contract.d.ts +0 -623
  374. package/script/src/features/payout/contract.d.ts.map +0 -1
  375. package/script/src/features/payout/contract.js +0 -78
  376. package/script/src/features/payout/index.d.ts +0 -2
  377. package/script/src/features/payout/index.d.ts.map +0 -1
  378. package/script/src/features/payout/index.js +0 -17
  379. package/script/src/features/payout/repository.d.ts +0 -67
  380. package/script/src/features/payout/repository.d.ts.map +0 -1
  381. package/script/src/features/payout/repository.js +0 -167
  382. package/script/src/features/wallet/contract.d.ts.map +0 -1
  383. package/script/src/features/wallet/contract.js +0 -41
  384. package/script/src/features/wallet/index.d.ts +0 -2
  385. package/script/src/features/wallet/index.d.ts.map +0 -1
  386. package/script/src/features/wallet/index.js +0 -17
  387. package/script/src/features/wallet/repository.d.ts +0 -57
  388. package/script/src/features/wallet/repository.d.ts.map +0 -1
  389. package/script/src/features/wallet/repository.js +0 -97
  390. package/script/src/models/contact/derivatives/contact.d.ts.map +0 -1
  391. package/script/src/models/contact/derivatives/contact.js +0 -270
  392. package/script/src/models/contact/derivatives/contact.test.d.ts.map +0 -1
  393. package/script/src/models/contact/derivatives/contact_info.d.ts +0 -188
  394. package/script/src/models/contact/derivatives/contact_info.d.ts.map +0 -1
  395. package/script/src/models/contact/derivatives/contact_info.js +0 -260
  396. package/script/src/models/contact/derivatives/contact_info.test.d.ts.map +0 -1
  397. package/script/src/models/contact/index.d.ts +0 -5
  398. package/script/src/models/contact/index.d.ts.map +0 -1
  399. package/script/src/models/contact/index.js +0 -20
  400. package/script/src/models/contact/schemas.d.ts +0 -66
  401. package/script/src/models/contact/schemas.d.ts.map +0 -1
  402. package/script/src/models/contact/schemas.js +0 -67
  403. package/script/src/models/contact/validation.d.ts +0 -37
  404. package/script/src/models/contact/validation.d.ts.map +0 -1
  405. package/script/src/models/contact/validation.js +0 -146
  406. package/script/src/models/contact/validation.test.d.ts.map +0 -1
  407. package/script/src/models/index.d.ts +0 -7
  408. package/script/src/models/index.d.ts.map +0 -1
  409. package/script/src/models/index.js +0 -22
  410. package/script/src/models/payout/api.d.ts +0 -29
  411. package/script/src/models/payout/api.d.ts.map +0 -1
  412. package/script/src/models/payout/api.js +0 -2
  413. package/script/src/models/payout/channel.d.ts +0 -58
  414. package/script/src/models/payout/channel.d.ts.map +0 -1
  415. package/script/src/models/payout/channel.js +0 -56
  416. package/script/src/models/payout/derivatives/payout.d.ts.map +0 -1
  417. package/script/src/models/payout/derivatives/payout.js +0 -265
  418. package/script/src/models/payout/derivatives/payout.test.d.ts.map +0 -1
  419. package/script/src/models/payout/index.d.ts +0 -6
  420. package/script/src/models/payout/index.d.ts.map +0 -1
  421. package/script/src/models/payout/index.js +0 -21
  422. package/script/src/models/payout/schemas.d.ts +0 -156
  423. package/script/src/models/payout/schemas.d.ts.map +0 -1
  424. package/script/src/models/payout/schemas.js +0 -108
  425. package/script/src/models/payout/status.d.ts +0 -33
  426. package/script/src/models/payout/status.d.ts.map +0 -1
  427. package/script/src/models/payout/status.js +0 -37
  428. package/script/src/models/permission.d.ts +0 -55
  429. package/script/src/models/permission.d.ts.map +0 -1
  430. package/script/src/models/permission.js +0 -53
  431. package/script/src/models/role.d.ts.map +0 -1
  432. package/script/src/models/role.js +0 -77
  433. package/script/src/models/user/authenticated-user.d.ts +0 -77
  434. package/script/src/models/user/authenticated-user.d.ts.map +0 -1
  435. package/script/src/models/user/authenticated-user.js +0 -230
  436. package/script/src/models/user/index.d.ts +0 -4
  437. package/script/src/models/user/index.d.ts.map +0 -1
  438. package/script/src/models/user/index.js +0 -19
  439. package/script/src/models/user/managed-user.d.ts +0 -108
  440. package/script/src/models/user/managed-user.d.ts.map +0 -1
  441. package/script/src/models/user/managed-user.js +0 -260
  442. package/script/src/models/user/profile.d.ts.map +0 -1
  443. package/script/src/models/user/profile.js +0 -338
  444. package/script/src/models/wallet/index.d.ts +0 -4
  445. package/script/src/models/wallet/index.d.ts.map +0 -1
  446. package/script/src/models/wallet/index.js +0 -19
  447. package/script/src/models/wallet/schemas.d.ts +0 -95
  448. package/script/src/models/wallet/schemas.d.ts.map +0 -1
  449. package/script/src/models/wallet/schemas.js +0 -38
  450. package/script/src/models/wallet/statement_entry.d.ts +0 -160
  451. package/script/src/models/wallet/statement_entry.d.ts.map +0 -1
  452. package/script/src/models/wallet/statement_entry.js +0 -259
  453. package/script/src/models/wallet/wallet.d.ts.map +0 -1
  454. package/script/src/models/wallet/wallet.js +0 -283
  455. package/script/src/shared/base_repository.d.ts +0 -80
  456. package/script/src/shared/base_repository.d.ts.map +0 -1
  457. package/script/src/shared/base_repository.js +0 -157
  458. package/script/src/shared/common_responses.d.ts.map +0 -1
  459. package/script/src/shared/common_responses.js +0 -13
  460. package/script/src/shared/index.d.ts +0 -3
  461. package/script/src/shared/index.d.ts.map +0 -1
  462. package/script/src/shared/index.js +0 -18
  463. package/script/src/shared/token_required_repository.d.ts +0 -78
  464. package/script/src/shared/token_required_repository.d.ts.map +0 -1
  465. package/script/src/shared/token_required_repository.js +0 -132
@@ -0,0 +1,365 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Represents the available channels through which payouts can be processed.
4
+ * @enum {string}
5
+ * @readonly
6
+ */
7
+ export declare enum PayoutChannel {
8
+ /** Payment processed through mobile money services */
9
+ MOBILE = "Mobile",
10
+ /** Payment processed through traditional banking channels */
11
+ BANK = "Bank"
12
+ }
13
+ /**
14
+ * Represents the current status of a payout transaction.
15
+ * @enum {string}
16
+ * @readonly
17
+ */
18
+ export declare enum PayoutStatus {
19
+ /** Payout has been initially created but not yet processed */
20
+ CREATED = "CREATED",
21
+ /** Payout is awaiting processing */
22
+ PENDING = "PENDING",
23
+ /** Payout has been successfully processed */
24
+ PAID = "PAID",
25
+ /** Payout processing has failed */
26
+ FAILED = "FAILED",
27
+ /** Payout has been rejected */
28
+ REJECTED = "REJECTED",
29
+ /** Payout has been reversed */
30
+ REVERSED = "REVERSED"
31
+ }
32
+ /**
33
+ * Represents the approval status for payouts that require authorization.
34
+ * @enum {string}
35
+ * @readonly
36
+ */
37
+ export declare enum PayoutApprovalStatus {
38
+ /** Payout is awaiting approval decision */
39
+ PENDING = "Pending",
40
+ /** Payout has been approved */
41
+ APPROVED = "Approved",
42
+ /** Payout has been rejected during approval process */
43
+ REJECTED = "Rejected"
44
+ }
45
+ /**
46
+ * Schema for identifying users in the payout process
47
+ * Used to track who created or actioned a payout
48
+ */
49
+ declare const AuthorizerSchema: z.ZodObject<{
50
+ id: z.ZodString;
51
+ name: z.ZodString;
52
+ identity: z.ZodString;
53
+ }, "strip", z.ZodTypeAny, {
54
+ name: string;
55
+ id: string;
56
+ identity: string;
57
+ }, {
58
+ name: string;
59
+ id: string;
60
+ identity: string;
61
+ }>;
62
+ /**
63
+ * Schema for creating a new payout
64
+ * Extends base payout schema with payee information
65
+ */
66
+ declare const PayoutInputDTOSchema: z.ZodObject<{
67
+ channel: z.ZodString;
68
+ msisdn: z.ZodString;
69
+ amount: z.ZodNumber;
70
+ description: z.ZodString;
71
+ notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
72
+ } & {
73
+ payeeName: z.ZodString;
74
+ }, "strip", z.ZodTypeAny, {
75
+ channel: string;
76
+ msisdn: string;
77
+ amount: number;
78
+ description: string;
79
+ payeeName: string;
80
+ notes?: string | null | undefined;
81
+ }, {
82
+ channel: string;
83
+ msisdn: string;
84
+ amount: number;
85
+ description: string;
86
+ payeeName: string;
87
+ notes?: string | null | undefined;
88
+ }>;
89
+ /**
90
+ * Schema for complete payout record
91
+ * Extends base payout schema with additional fields for:
92
+ * - Identification (id, profileId)
93
+ * - Status tracking
94
+ * - Timestamps
95
+ * - Approval information
96
+ * - User tracking (created by, actioned by)
97
+ */
98
+ declare const PayoutDTOSchema: z.ZodObject<{
99
+ msisdn: z.ZodString;
100
+ amount: z.ZodNumber;
101
+ description: z.ZodString;
102
+ notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
103
+ } & {
104
+ id: z.ZodString;
105
+ profileId: z.ZodString;
106
+ payeeName: z.ZodString;
107
+ countryCode: z.ZodEffects<z.ZodDefault<z.ZodString>, import("@temboplus/frontend-core").ISO2CountryCode, string | undefined>;
108
+ currencyCode: z.ZodEffects<z.ZodDefault<z.ZodString>, import("@temboplus/frontend-core").CurrencyCode, string | undefined>;
109
+ channel: z.ZodString;
110
+ status: z.ZodNativeEnum<typeof PayoutStatus>;
111
+ statusMessage: z.ZodString;
112
+ partnerReference: z.ZodOptional<z.ZodNullable<z.ZodString>>;
113
+ createdAt: z.ZodDate;
114
+ updatedAt: z.ZodDate;
115
+ actionedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
116
+ approvalStatus: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof PayoutApprovalStatus>>>;
117
+ createdBy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
118
+ id: z.ZodString;
119
+ name: z.ZodString;
120
+ identity: z.ZodString;
121
+ }, "strip", z.ZodTypeAny, {
122
+ name: string;
123
+ id: string;
124
+ identity: string;
125
+ }, {
126
+ name: string;
127
+ id: string;
128
+ identity: string;
129
+ }>>>;
130
+ actionedBy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
131
+ id: z.ZodString;
132
+ name: z.ZodString;
133
+ identity: z.ZodString;
134
+ }, "strip", z.ZodTypeAny, {
135
+ name: string;
136
+ id: string;
137
+ identity: string;
138
+ }, {
139
+ name: string;
140
+ id: string;
141
+ identity: string;
142
+ }>>>;
143
+ }, "strip", z.ZodTypeAny, {
144
+ status: PayoutStatus;
145
+ id: string;
146
+ channel: string;
147
+ msisdn: string;
148
+ amount: number;
149
+ description: string;
150
+ payeeName: string;
151
+ profileId: string;
152
+ countryCode: import("@temboplus/frontend-core").ISO2CountryCode;
153
+ currencyCode: import("@temboplus/frontend-core").CurrencyCode;
154
+ statusMessage: string;
155
+ createdAt: Date;
156
+ updatedAt: Date;
157
+ notes?: string | null | undefined;
158
+ partnerReference?: string | null | undefined;
159
+ actionedAt?: Date | null | undefined;
160
+ approvalStatus?: PayoutApprovalStatus | null | undefined;
161
+ createdBy?: {
162
+ name: string;
163
+ id: string;
164
+ identity: string;
165
+ } | null | undefined;
166
+ actionedBy?: {
167
+ name: string;
168
+ id: string;
169
+ identity: string;
170
+ } | null | undefined;
171
+ }, {
172
+ status: PayoutStatus;
173
+ id: string;
174
+ channel: string;
175
+ msisdn: string;
176
+ amount: number;
177
+ description: string;
178
+ payeeName: string;
179
+ profileId: string;
180
+ statusMessage: string;
181
+ createdAt: Date;
182
+ updatedAt: Date;
183
+ notes?: string | null | undefined;
184
+ countryCode?: string | undefined;
185
+ currencyCode?: string | undefined;
186
+ partnerReference?: string | null | undefined;
187
+ actionedAt?: Date | null | undefined;
188
+ approvalStatus?: PayoutApprovalStatus | null | undefined;
189
+ createdBy?: {
190
+ name: string;
191
+ id: string;
192
+ identity: string;
193
+ } | null | undefined;
194
+ actionedBy?: {
195
+ name: string;
196
+ id: string;
197
+ identity: string;
198
+ } | null | undefined;
199
+ }>;
200
+ /**
201
+ * Type definition inferred from AuthorizerSchema
202
+ * Represents the structure of a user who actions the payout
203
+ */
204
+ type PayoutAuthorizerDTO = z.infer<typeof AuthorizerSchema>;
205
+ /**
206
+ * Type definition inferred from PayoutInputDTOSchema
207
+ * Represents the structure of data required to create a new payout
208
+ */
209
+ type PayoutInputDTO = z.infer<typeof PayoutInputDTOSchema>;
210
+ /**
211
+ * Type definition inferred from PayoutDTOSchema
212
+ * Represents the complete payout record structure
213
+ */
214
+ type PayoutDTO = z.infer<typeof PayoutDTOSchema>;
215
+ /**
216
+ * Export object containing all payout-related schemas
217
+ * Used for validation and type checking throughout the application
218
+ */
219
+ export declare const PayoutDTOSchemas: {
220
+ readonly PayoutDTO: z.ZodObject<{
221
+ msisdn: z.ZodString;
222
+ amount: z.ZodNumber;
223
+ description: z.ZodString;
224
+ notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
225
+ } & {
226
+ id: z.ZodString;
227
+ profileId: z.ZodString;
228
+ payeeName: z.ZodString;
229
+ countryCode: z.ZodEffects<z.ZodDefault<z.ZodString>, import("@temboplus/frontend-core").ISO2CountryCode, string | undefined>;
230
+ currencyCode: z.ZodEffects<z.ZodDefault<z.ZodString>, import("@temboplus/frontend-core").CurrencyCode, string | undefined>;
231
+ channel: z.ZodString;
232
+ status: z.ZodNativeEnum<typeof PayoutStatus>;
233
+ statusMessage: z.ZodString;
234
+ partnerReference: z.ZodOptional<z.ZodNullable<z.ZodString>>;
235
+ createdAt: z.ZodDate;
236
+ updatedAt: z.ZodDate;
237
+ actionedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
238
+ approvalStatus: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof PayoutApprovalStatus>>>;
239
+ createdBy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
240
+ id: z.ZodString;
241
+ name: z.ZodString;
242
+ identity: z.ZodString;
243
+ }, "strip", z.ZodTypeAny, {
244
+ name: string;
245
+ id: string;
246
+ identity: string;
247
+ }, {
248
+ name: string;
249
+ id: string;
250
+ identity: string;
251
+ }>>>;
252
+ actionedBy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
253
+ id: z.ZodString;
254
+ name: z.ZodString;
255
+ identity: z.ZodString;
256
+ }, "strip", z.ZodTypeAny, {
257
+ name: string;
258
+ id: string;
259
+ identity: string;
260
+ }, {
261
+ name: string;
262
+ id: string;
263
+ identity: string;
264
+ }>>>;
265
+ }, "strip", z.ZodTypeAny, {
266
+ status: PayoutStatus;
267
+ id: string;
268
+ channel: string;
269
+ msisdn: string;
270
+ amount: number;
271
+ description: string;
272
+ payeeName: string;
273
+ profileId: string;
274
+ countryCode: import("@temboplus/frontend-core").ISO2CountryCode;
275
+ currencyCode: import("@temboplus/frontend-core").CurrencyCode;
276
+ statusMessage: string;
277
+ createdAt: Date;
278
+ updatedAt: Date;
279
+ notes?: string | null | undefined;
280
+ partnerReference?: string | null | undefined;
281
+ actionedAt?: Date | null | undefined;
282
+ approvalStatus?: PayoutApprovalStatus | null | undefined;
283
+ createdBy?: {
284
+ name: string;
285
+ id: string;
286
+ identity: string;
287
+ } | null | undefined;
288
+ actionedBy?: {
289
+ name: string;
290
+ id: string;
291
+ identity: string;
292
+ } | null | undefined;
293
+ }, {
294
+ status: PayoutStatus;
295
+ id: string;
296
+ channel: string;
297
+ msisdn: string;
298
+ amount: number;
299
+ description: string;
300
+ payeeName: string;
301
+ profileId: string;
302
+ statusMessage: string;
303
+ createdAt: Date;
304
+ updatedAt: Date;
305
+ notes?: string | null | undefined;
306
+ countryCode?: string | undefined;
307
+ currencyCode?: string | undefined;
308
+ partnerReference?: string | null | undefined;
309
+ actionedAt?: Date | null | undefined;
310
+ approvalStatus?: PayoutApprovalStatus | null | undefined;
311
+ createdBy?: {
312
+ name: string;
313
+ id: string;
314
+ identity: string;
315
+ } | null | undefined;
316
+ actionedBy?: {
317
+ name: string;
318
+ id: string;
319
+ identity: string;
320
+ } | null | undefined;
321
+ }>;
322
+ readonly PayoutInputDTO: z.ZodObject<{
323
+ channel: z.ZodString;
324
+ msisdn: z.ZodString;
325
+ amount: z.ZodNumber;
326
+ description: z.ZodString;
327
+ notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
328
+ } & {
329
+ payeeName: z.ZodString;
330
+ }, "strip", z.ZodTypeAny, {
331
+ channel: string;
332
+ msisdn: string;
333
+ amount: number;
334
+ description: string;
335
+ payeeName: string;
336
+ notes?: string | null | undefined;
337
+ }, {
338
+ channel: string;
339
+ msisdn: string;
340
+ amount: number;
341
+ description: string;
342
+ payeeName: string;
343
+ notes?: string | null | undefined;
344
+ }>;
345
+ readonly PayoutStatus: z.ZodNativeEnum<typeof PayoutStatus>;
346
+ readonly PayoutApprovalStatus: z.ZodNativeEnum<typeof PayoutApprovalStatus>;
347
+ readonly PayoutAuthorizer: z.ZodObject<{
348
+ id: z.ZodString;
349
+ name: z.ZodString;
350
+ identity: z.ZodString;
351
+ }, "strip", z.ZodTypeAny, {
352
+ name: string;
353
+ id: string;
354
+ identity: string;
355
+ }, {
356
+ name: string;
357
+ id: string;
358
+ identity: string;
359
+ }>;
360
+ };
361
+ /**
362
+ * Export types for use in other parts of the application
363
+ * These types can be used for type checking and documentation
364
+ */
365
+ export type { PayoutAuthorizerDTO as PayoutAuthorizer, PayoutDTO, PayoutInputDTO };
@@ -0,0 +1,193 @@
1
+ import { BaseRepository } from "@/lib/api";
2
+ import { type PayoutAPI } from "./payout.api-contract";
3
+ import { Payout } from "../../models/payout.model";
4
+ import { Amount, CurrencyCode } from "@temboplus/frontend-core";
5
+ import { PayoutChannel } from "./payout.dtos";
6
+ import { ContactInfo } from "../../models/contact-info.model";
7
+ /**
8
+ * Arguments for retrieving payouts from the API.
9
+ *
10
+ * @interface GetPayoutsAPIArgs
11
+ *
12
+ * @property {number} [rangeStart] - The starting index for pagination. Defaults to 0.
13
+ * @property {number} [rangeEnd] - The ending index for pagination. Defaults to 10.
14
+ * @property {boolean} [pending] - Filter for pending payouts only. If true, returns only pending payouts.
15
+ * @property {string} [msisdn] - Filter for msisdn. Should be properly formatted. {country_code}{compact_number} for phone numbers and {SWIFT_CODE}:{account_no}
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * // Get first 10 payouts
20
+ * const args: GetPayoutsAPIArgs = {
21
+ * rangeStart: 0,
22
+ * rangeEnd: 10
23
+ * };
24
+ *
25
+ * // Get only pending payouts
26
+ * const pendingArgs: GetPayoutsAPIArgs = {
27
+ * pending: true
28
+ * };
29
+ * ```
30
+ */
31
+ export interface GetPayoutsAPIArgs {
32
+ rangeStart?: number;
33
+ rangeEnd?: number;
34
+ pending?: boolean;
35
+ msisdn?: string;
36
+ }
37
+ /**
38
+ * Repository class for managing payout operations including creation, approval,
39
+ * rejection, and retrieval of payouts.
40
+ *
41
+ * This repository handles pure API communication without permission checking.
42
+ * Permission validation should be handled at the service layer or route handlers.
43
+ *
44
+ * @extends {BaseRepository<PayoutAPI>}
45
+ *
46
+ * @example
47
+ * ```typescript
48
+ * const repo = new PayoutRepository({ token: userToken });
49
+ * const payouts = await repo.getAll();
50
+ * ```
51
+ */
52
+ export declare class PayoutRepository extends BaseRepository<PayoutAPI> {
53
+ /**
54
+ * Creates an instance of PayoutRepository initialized with the payout contract.
55
+ *
56
+ * @param options - Optional configuration
57
+ * @param options.token - Authentication token for API calls
58
+ * @param options.root - Custom API root URL
59
+ *
60
+ * @example
61
+ * ```typescript
62
+ * const repo = new PayoutRepository({
63
+ * token: "user-auth-token"
64
+ * });
65
+ * ```
66
+ */
67
+ constructor(options?: {
68
+ token?: string;
69
+ root?: string;
70
+ });
71
+ /**
72
+ * Retrieves a paginated list of payouts with optional filtering for pending status.
73
+ *
74
+ * @param args - Optional arguments for filtering and pagination
75
+ * @param args.rangeStart - Starting index for pagination (default: 0)
76
+ * @param args.rangeEnd - Ending index for pagination (default: 10)
77
+ * @param args.pending - Filter for pending payouts only
78
+ * @param args.msisdn - Filter by MSISDN
79
+ * @returns Promise that resolves to paginated payout results and total count
80
+ * @throws {APIError} If range is invalid or if the fetch operation fails
81
+ *
82
+ * @example
83
+ * ```typescript
84
+ * // Get first 20 payouts
85
+ * const result = await repo.getAll({
86
+ * rangeStart: 0,
87
+ * rangeEnd: 20
88
+ * });
89
+ *
90
+ * // Get only pending payouts
91
+ * const pendingResult = await repo.getAll({ pending: true });
92
+ * ```
93
+ */
94
+ getAll(args?: GetPayoutsAPIArgs): Promise<{
95
+ results: Payout[];
96
+ total: number;
97
+ }>;
98
+ /**
99
+ * Creates a new payout with the provided input data.
100
+ *
101
+ * @param args - The payout creation data
102
+ * @param args.channel - The payout channel to use
103
+ * @param args.receiver - Contact information for the payout receiver
104
+ * @param args.amount - The amount to pay out
105
+ * @param args.notes - Optional notes for the payout
106
+ * @returns Promise that resolves to the created payout
107
+ * @throws {APIError} If the input is invalid or if the creation operation fails
108
+ *
109
+ * @example
110
+ * ```typescript
111
+ * const payout = await repo.pay({
112
+ * channel: PayoutChannel.MOBILE_MONEY,
113
+ * receiver: { name: "John Doe", phone: "+255123456789" },
114
+ * amount: Amount.from(10000, "TZS"),
115
+ * notes: "Payment for services"
116
+ * });
117
+ * ```
118
+ */
119
+ pay(args: {
120
+ channel: PayoutChannel;
121
+ receiver: ContactInfo;
122
+ amount: Amount;
123
+ notes?: string;
124
+ }): Promise<Payout>;
125
+ /**
126
+ * Approves a payout with optional notes.
127
+ *
128
+ * @param id - The ID of the payout to approve
129
+ * @param args - Optional arguments
130
+ * @param args.notes - Optional notes for the approval
131
+ * @returns Promise that resolves to the approved payout
132
+ * @throws {APIError} If payout is not found, already approved, or if the operation fails
133
+ *
134
+ * @example
135
+ * ```typescript
136
+ * const approvedPayout = await repo.approve("payout-id", {
137
+ * notes: "Approved after verification"
138
+ * });
139
+ * ```
140
+ */
141
+ approve(id: string, args?: {
142
+ notes?: string;
143
+ }): Promise<Payout>;
144
+ /**
145
+ * Rejects a payout with optional notes.
146
+ *
147
+ * @param id - The ID of the payout to reject
148
+ * @param args - Optional arguments
149
+ * @param args.notes - Optional notes for the rejection
150
+ * @returns Promise that resolves to the rejected payout
151
+ * @throws {APIError} If payout is not found, already rejected, or if the operation fails
152
+ *
153
+ * @example
154
+ * ```typescript
155
+ * const rejectedPayout = await repo.reject("payout-id", {
156
+ * notes: "Insufficient documentation"
157
+ * });
158
+ * ```
159
+ */
160
+ reject(id: string, args?: {
161
+ notes?: string;
162
+ }): Promise<Payout>;
163
+ /**
164
+ * Retrieves a payout by its ID.
165
+ *
166
+ * @param id - The ID of the payout to retrieve
167
+ * @returns Promise that resolves to the payout instance if found
168
+ * @throws {APIError} If the payout is not found or another error occurs
169
+ *
170
+ * @example
171
+ * ```typescript
172
+ * const payout = await repo.getByID("payout-id");
173
+ * console.log(`Payout status: ${payout.status}`);
174
+ * ```
175
+ */
176
+ getByID(id: string): Promise<Payout>;
177
+ }
178
+ /**
179
+ * Helper function to get default amount constraints based on currency.
180
+ *
181
+ * @param currency - The currency code
182
+ * @returns Object containing default minimum and maximum amounts
183
+ *
184
+ * @example
185
+ * ```typescript
186
+ * const { defaultMin, defaultMax } = getDefaultConstraints("TZS");
187
+ * console.log(`TZS limits: ${defaultMin} - ${defaultMax}`);
188
+ * ```
189
+ */
190
+ export declare const getDefaultConstraints: (currency: CurrencyCode) => {
191
+ defaultMin: number;
192
+ defaultMax: number;
193
+ };
@@ -0,0 +1,4 @@
1
+ export * from "./wallet.repository";
2
+ export * from "./wallet-manager.session";
3
+ export * from "./wallet.dtos";
4
+ export * from "./wallet.utils";
@@ -0,0 +1,143 @@
1
+ import { Country, type CountryCode } from "@temboplus/frontend-core";
2
+ import { Wallet } from "../../models/wallet.model";
3
+ import { User } from "../../models/user.model";
4
+ /**
5
+ * Defines the shape of the persisted wallet session state.
6
+ * IMPORTANT: Properties like selectedWalletId/selectedCountryCode are guaranteed
7
+ * non-nullable and valid ONLY when isInitialized is true.
8
+ */
9
+ interface WalletSession {
10
+ userId: string;
11
+ wallets: Wallet[];
12
+ selectedWalletId: string;
13
+ selectedCountryCode: CountryCode;
14
+ lastSynced: Date | string;
15
+ isInitialized: boolean;
16
+ }
17
+ /**
18
+ * Defines the complete state shape including actions and internal getters.
19
+ */
20
+ interface WalletState extends WalletSession {
21
+ setWallets: (wallets: Wallet[]) => void;
22
+ setSelectedWallet: (wallet: Wallet) => void;
23
+ setSelectedCountry: (countryCode: CountryCode) => void;
24
+ reset: () => void;
25
+ _getWalletsByCountry: (countryCode: CountryCode) => Wallet[];
26
+ _getSelectedWallet: () => Wallet;
27
+ }
28
+ export declare const walletsStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<WalletState>, "persist"> & {
29
+ persist: {
30
+ setOptions: (options: Partial<import("zustand/middleware").PersistOptions<WalletState, unknown>>) => void;
31
+ clearStorage: () => void;
32
+ rehydrate: () => Promise<void> | void;
33
+ hasHydrated: () => boolean;
34
+ onHydrate: (fn: (state: WalletState) => void) => () => void;
35
+ onFinishHydration: (fn: (state: WalletState) => void) => () => void;
36
+ getOptions: () => Partial<import("zustand/middleware").PersistOptions<WalletState, unknown>>;
37
+ };
38
+ }>;
39
+ /**
40
+ * WalletSessionManager handles wallet-related operations and state management coordination.
41
+ * It uses a Zustand store (`useWalletStore`) for state and interacts with WalletRepo.
42
+ *
43
+ * IMPORTANT: This manager enforces the invariant that an initialized user session
44
+ * always has at least one wallet and a valid selection. Methods that return selected
45
+ * data (`getSelectedWallet`, `getSelectedCountry`, etc.) will THROW AN ERROR if called
46
+ * before the session is initialized via the `initialize()` method.
47
+ */
48
+ export declare class WalletSessionManager {
49
+ private repo;
50
+ private static _instance;
51
+ /**
52
+ * @private
53
+ */
54
+ private constructor();
55
+ /**
56
+ * Gets the singleton instance of WalletSessionManager.
57
+ * @returns {WalletSessionManager} The singleton instance.
58
+ */
59
+ static get instance(): WalletSessionManager;
60
+ /**
61
+ * Checks if the wallet session is initialized.
62
+ * @returns {boolean} True if initialized, false otherwise.
63
+ */
64
+ isInitialized(): boolean;
65
+ /**
66
+ * Initializes the wallet manager for the current user.
67
+ * Fetches wallets if the store isn't already initialized.
68
+ * Throws an error if the user is not authenticated or if the user is found to have no wallets.
69
+ * @async
70
+ * @returns {Promise<void>} Resolves when initialization is complete.
71
+ * @throws {Error} If user not authenticated or user has no wallets.
72
+ */
73
+ initialize(user: User): Promise<void>;
74
+ /**
75
+ * Fetches the latest wallet data from the server and updates the store.
76
+ * Throws an error if the user has no wallets or if the fetch fails.
77
+ * Ensures the store is updated and marked as initialized.
78
+ * @async
79
+ * @returns {Promise<void>} Resolves when refresh is complete.
80
+ * @throws {Error} If fetch fails or user has no wallets.
81
+ */
82
+ refreshWallets(): Promise<void>;
83
+ /**
84
+ * Gets all available wallets. Guaranteed non-empty after successful initialization.
85
+ * @returns {Wallet[]} Non-empty array of Wallet instances.
86
+ * @throws {Error} If called before initialization is complete.
87
+ */
88
+ getWallets(): Wallet[];
89
+ /**
90
+ * Gets unique available country codes based on current wallets.
91
+ * @returns {CountryCode[]} Array of CountryCodes. Guaranteed non-empty after initialization.
92
+ * @throws {Error} If called before initialization is complete.
93
+ */
94
+ getCountries(): CountryCode[];
95
+ /**
96
+ * Gets wallets for a specific country.
97
+ * @param {CountryCode} countryCode The country code to filter by.
98
+ * @returns {Wallet[]} Array of Wallet instances for the country. May be empty if no wallets match the code, but the overall list isn't empty.
99
+ * @throws {Error} If called before initialization is complete.
100
+ */
101
+ getWalletsByCountry(countryCode: CountryCode): Wallet[];
102
+ /**
103
+ * Gets the currently selected wallet instance.
104
+ * @returns {Wallet} The selected Wallet instance (guaranteed non-nullable).
105
+ * @throws {Error} If called before initialization is complete or if state is inconsistent.
106
+ */
107
+ getSelectedWallet(): Wallet;
108
+ /**
109
+ * Gets the currently selected country code.
110
+ * @returns {CountryCode} The selected CountryCode (guaranteed non-nullable).
111
+ * @throws {Error} If called before initialization is complete.
112
+ */
113
+ getSelectedCountryCode(): CountryCode;
114
+ /**
115
+ * Gets the currently selected Country object.
116
+ * @returns {Country} The selected Country object (guaranteed non-nullable).
117
+ * @throws {Error} If called before initialization or if Country.fromCode fails for the selected code.
118
+ */
119
+ getSelectedCountry(): Country;
120
+ /**
121
+ * Changes the selected wallet in the store.
122
+ * Throws error if the provided walletId is not found in the current list.
123
+ * @param {string} walletId - The ID of the wallet to select.
124
+ * @returns {void}
125
+ * @throws {Error} If wallet with given ID is not found or if called before initialization.
126
+ */
127
+ changeWallet(walletId: string): void;
128
+ /**
129
+ * Changes the selected country in the store.
130
+ * Automatically selects the first available wallet for that country.
131
+ * Throws error if no wallets exist for the given countryCode or if called before initialization.
132
+ * @param {CountryCode} countryCode - The country code to select.
133
+ * @returns {void}
134
+ * @throws {Error} If no wallets found for the country code or if called before initialization.
135
+ */
136
+ changeCountry(countryCode: CountryCode): void;
137
+ /**
138
+ * Resets the wallet store to initial (uninitialized) state.
139
+ * Typically used during user logout.
140
+ */
141
+ reset(): void;
142
+ }
143
+ export {};