@temboplus/afloat 0.1.77-beta.9 → 0.1.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (415) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +42 -246
  3. package/esm/mod.d.ts +8 -0
  4. package/esm/mod.d.ts.map +1 -0
  5. package/esm/mod.js +7 -0
  6. package/esm/package.json +3 -0
  7. package/{dist/lib/error/error.api.d.ts → esm/src/errors/api_error.d.ts} +1 -0
  8. package/esm/src/errors/api_error.d.ts.map +1 -0
  9. package/esm/src/errors/api_error.js +90 -0
  10. package/esm/src/errors/index.d.ts +3 -0
  11. package/esm/src/errors/index.d.ts.map +1 -0
  12. package/esm/src/errors/index.js +2 -0
  13. package/{dist/lib/error/error.permission.d.ts → esm/src/errors/permission_error.d.ts} +2 -1
  14. package/esm/src/errors/permission_error.d.ts.map +1 -0
  15. package/esm/src/errors/permission_error.js +70 -0
  16. package/{dist/modules/team-member/team-member.contract.d.ts → esm/src/features/admin/contract.d.ts} +158 -233
  17. package/esm/src/features/admin/contract.d.ts.map +1 -0
  18. package/esm/src/features/admin/contract.js +210 -0
  19. package/esm/src/features/admin/index.d.ts +4 -0
  20. package/esm/src/features/admin/index.d.ts.map +1 -0
  21. package/esm/src/features/admin/index.js +3 -0
  22. package/esm/src/features/admin/repository.d.ts +114 -0
  23. package/esm/src/features/admin/repository.d.ts.map +1 -0
  24. package/esm/src/features/admin/repository.js +248 -0
  25. package/esm/src/features/admin/schemas.d.ts +146 -0
  26. package/esm/src/features/admin/schemas.d.ts.map +1 -0
  27. package/esm/src/features/admin/schemas.js +206 -0
  28. package/esm/src/features/auth/access/contract.d.ts +14 -0
  29. package/esm/src/features/auth/access/contract.d.ts.map +1 -0
  30. package/esm/src/features/auth/access/contract.js +14 -0
  31. package/esm/src/features/auth/access/repository.d.ts +11 -0
  32. package/esm/src/features/auth/access/repository.d.ts.map +1 -0
  33. package/esm/src/features/auth/access/repository.js +25 -0
  34. package/{dist/modules/auth/auth.contract.d.ts → esm/src/features/auth/contract.d.ts} +19 -16
  35. package/esm/src/features/auth/contract.d.ts.map +1 -0
  36. package/esm/src/features/auth/contract.js +43 -0
  37. package/esm/src/features/auth/identity/contract.d.ts +23 -0
  38. package/esm/src/features/auth/identity/contract.d.ts.map +1 -0
  39. package/esm/src/features/auth/identity/contract.js +17 -0
  40. package/esm/src/features/auth/identity/repository.d.ts +22 -0
  41. package/esm/src/features/auth/identity/repository.d.ts.map +1 -0
  42. package/esm/src/features/auth/identity/repository.js +30 -0
  43. package/esm/src/features/auth/index.d.ts +6 -0
  44. package/esm/src/features/auth/index.d.ts.map +1 -0
  45. package/esm/src/features/auth/index.js +5 -0
  46. package/esm/src/features/auth/manager.d.ts +105 -0
  47. package/esm/src/features/auth/manager.d.ts.map +1 -0
  48. package/esm/src/features/auth/manager.js +181 -0
  49. package/{dist/modules/profile/profile.api-contract.d.ts → esm/src/features/auth/profile/contract.d.ts} +6 -8
  50. package/esm/src/features/auth/profile/contract.d.ts.map +1 -0
  51. package/esm/src/features/auth/profile/contract.js +14 -0
  52. package/esm/src/features/auth/profile/repository.d.ts +11 -0
  53. package/esm/src/features/auth/profile/repository.d.ts.map +1 -0
  54. package/esm/src/features/auth/profile/repository.js +25 -0
  55. package/esm/src/features/auth/repository.d.ts +30 -0
  56. package/esm/src/features/auth/repository.d.ts.map +1 -0
  57. package/esm/src/features/auth/repository.js +69 -0
  58. package/{dist/modules/auth/storage/client-store.d.ts → esm/src/features/auth/storage/client_store.d.ts} +2 -1
  59. package/esm/src/features/auth/storage/client_store.d.ts.map +1 -0
  60. package/esm/src/features/auth/storage/client_store.js +46 -0
  61. package/{dist/modules/auth/storage/client-token-handler.d.ts → esm/src/features/auth/storage/client_token_handler.d.ts} +1 -0
  62. package/esm/src/features/auth/storage/client_token_handler.d.ts.map +1 -0
  63. package/esm/src/features/auth/storage/client_token_handler.js +36 -0
  64. package/esm/src/features/auth/storage/server_store.d.ts +24 -0
  65. package/esm/src/features/auth/storage/server_store.d.ts.map +1 -0
  66. package/esm/src/features/auth/storage/server_store.js +34 -0
  67. package/esm/src/features/auth/storage/server_token_handler.d.ts +36 -0
  68. package/esm/src/features/auth/storage/server_token_handler.d.ts.map +1 -0
  69. package/esm/src/features/auth/storage/server_token_handler.js +115 -0
  70. package/{dist/modules → esm/src/features}/auth/storage/types.d.ts +2 -1
  71. package/esm/src/features/auth/storage/types.d.ts.map +1 -0
  72. package/esm/src/features/auth/storage/types.js +1 -0
  73. package/{dist/modules/contact/contact.api-contract.d.ts → esm/src/features/contact/contract.d.ts} +55 -88
  74. package/esm/src/features/contact/contract.d.ts.map +1 -0
  75. package/esm/src/features/contact/contract.js +49 -0
  76. package/esm/src/features/contact/index.d.ts +2 -0
  77. package/esm/src/features/contact/index.d.ts.map +1 -0
  78. package/esm/src/features/contact/index.js +1 -0
  79. package/esm/src/features/contact/repository.d.ts +58 -0
  80. package/esm/src/features/contact/repository.d.ts.map +1 -0
  81. package/esm/src/features/contact/repository.js +108 -0
  82. package/{dist/modules/payout/payout.api-contract.d.ts → esm/src/features/payout/contract.d.ts} +197 -340
  83. package/esm/src/features/payout/contract.d.ts.map +1 -0
  84. package/esm/src/features/payout/contract.js +75 -0
  85. package/esm/src/features/payout/index.d.ts +2 -0
  86. package/esm/src/features/payout/index.d.ts.map +1 -0
  87. package/esm/src/features/payout/index.js +1 -0
  88. package/esm/src/features/payout/repository.d.ts +67 -0
  89. package/esm/src/features/payout/repository.d.ts.map +1 -0
  90. package/esm/src/features/payout/repository.js +163 -0
  91. package/{dist/modules/wallet/wallet.contract.d.ts → esm/src/features/wallet/contract.d.ts} +11 -13
  92. package/esm/src/features/wallet/contract.d.ts.map +1 -0
  93. package/esm/src/features/wallet/contract.js +38 -0
  94. package/esm/src/features/wallet/index.d.ts +2 -0
  95. package/esm/src/features/wallet/index.d.ts.map +1 -0
  96. package/esm/src/features/wallet/index.js +1 -0
  97. package/esm/src/features/wallet/repository.d.ts +57 -0
  98. package/esm/src/features/wallet/repository.d.ts.map +1 -0
  99. package/esm/src/features/wallet/repository.js +93 -0
  100. package/esm/src/models/contact/derivatives/contact.d.ts +172 -0
  101. package/esm/src/models/contact/derivatives/contact.d.ts.map +1 -0
  102. package/esm/src/models/contact/derivatives/contact.js +266 -0
  103. package/esm/src/models/contact/derivatives/contact_info.d.ts +188 -0
  104. package/esm/src/models/contact/derivatives/contact_info.d.ts.map +1 -0
  105. package/esm/src/models/contact/derivatives/contact_info.js +255 -0
  106. package/esm/src/models/contact/index.d.ts +5 -0
  107. package/esm/src/models/contact/index.d.ts.map +1 -0
  108. package/esm/src/models/contact/index.js +4 -0
  109. package/esm/src/models/contact/schemas.d.ts +66 -0
  110. package/esm/src/models/contact/schemas.d.ts.map +1 -0
  111. package/esm/src/models/contact/schemas.js +64 -0
  112. package/esm/src/models/contact/validation.d.ts +37 -0
  113. package/esm/src/models/contact/validation.d.ts.map +1 -0
  114. package/esm/src/models/contact/validation.js +146 -0
  115. package/esm/src/models/index.d.ts +7 -0
  116. package/esm/src/models/index.d.ts.map +1 -0
  117. package/esm/src/models/index.js +6 -0
  118. package/esm/src/models/payout/api.d.ts +29 -0
  119. package/esm/src/models/payout/api.d.ts.map +1 -0
  120. package/esm/src/models/payout/api.js +1 -0
  121. package/esm/src/models/payout/channel.d.ts +58 -0
  122. package/esm/src/models/payout/channel.d.ts.map +1 -0
  123. package/esm/src/models/payout/channel.js +53 -0
  124. package/esm/src/models/payout/derivatives/payout.d.ts +158 -0
  125. package/esm/src/models/payout/derivatives/payout.d.ts.map +1 -0
  126. package/esm/src/models/payout/derivatives/payout.js +271 -0
  127. package/esm/src/models/payout/index.d.ts +7 -0
  128. package/esm/src/models/payout/index.d.ts.map +1 -0
  129. package/esm/src/models/payout/index.js +6 -0
  130. package/esm/src/models/payout/narration.d.ts +164 -0
  131. package/esm/src/models/payout/narration.d.ts.map +1 -0
  132. package/esm/src/models/payout/narration.js +308 -0
  133. package/esm/src/models/payout/schemas.d.ts +156 -0
  134. package/esm/src/models/payout/schemas.d.ts.map +1 -0
  135. package/esm/src/models/payout/schemas.js +105 -0
  136. package/esm/src/models/payout/status.d.ts +33 -0
  137. package/esm/src/models/payout/status.d.ts.map +1 -0
  138. package/esm/src/models/payout/status.js +34 -0
  139. package/{dist/modules/login/permission.type.d.ts → esm/src/models/permission.d.ts} +9 -8
  140. package/esm/src/models/permission.d.ts.map +1 -0
  141. package/esm/src/models/permission.js +50 -0
  142. package/esm/src/models/role.d.ts +21 -0
  143. package/esm/src/models/role.d.ts.map +1 -0
  144. package/esm/src/models/role.js +73 -0
  145. package/esm/src/models/user/authenticated-user.d.ts +77 -0
  146. package/esm/src/models/user/authenticated-user.d.ts.map +1 -0
  147. package/esm/src/models/user/authenticated-user.js +226 -0
  148. package/esm/src/models/user/index.d.ts +4 -0
  149. package/esm/src/models/user/index.d.ts.map +1 -0
  150. package/esm/src/models/user/index.js +3 -0
  151. package/esm/src/models/user/managed-user.d.ts +108 -0
  152. package/esm/src/models/user/managed-user.d.ts.map +1 -0
  153. package/esm/src/models/user/managed-user.js +255 -0
  154. package/{dist/modules/profile/profile.model.d.ts → esm/src/models/user/profile.d.ts} +52 -81
  155. package/esm/src/models/user/profile.d.ts.map +1 -0
  156. package/esm/src/models/user/profile.js +334 -0
  157. package/esm/src/models/wallet/index.d.ts +4 -0
  158. package/esm/src/models/wallet/index.d.ts.map +1 -0
  159. package/esm/src/models/wallet/index.js +3 -0
  160. package/esm/src/models/wallet/schemas.d.ts +95 -0
  161. package/esm/src/models/wallet/schemas.d.ts.map +1 -0
  162. package/esm/src/models/wallet/schemas.js +35 -0
  163. package/esm/src/models/wallet/statement_entry.d.ts +160 -0
  164. package/esm/src/models/wallet/statement_entry.d.ts.map +1 -0
  165. package/esm/src/models/wallet/statement_entry.js +255 -0
  166. package/{dist/modules/wallet/wallet.model.d.ts → esm/src/models/wallet/wallet.d.ts} +37 -31
  167. package/esm/src/models/wallet/wallet.d.ts.map +1 -0
  168. package/esm/src/models/wallet/wallet.js +279 -0
  169. package/esm/src/shared/base_repository.d.ts +80 -0
  170. package/esm/src/shared/base_repository.d.ts.map +1 -0
  171. package/esm/src/shared/base_repository.js +153 -0
  172. package/esm/src/shared/common_responses.d.ts +13 -0
  173. package/esm/src/shared/common_responses.d.ts.map +1 -0
  174. package/esm/src/shared/common_responses.js +10 -0
  175. package/esm/src/shared/index.d.ts +3 -0
  176. package/esm/src/shared/index.d.ts.map +1 -0
  177. package/esm/src/shared/index.js +2 -0
  178. package/esm/src/shared/token_required_repository.d.ts +78 -0
  179. package/esm/src/shared/token_required_repository.d.ts.map +1 -0
  180. package/esm/src/shared/token_required_repository.js +128 -0
  181. package/package.json +23 -49
  182. package/script/mod.d.ts +8 -0
  183. package/script/mod.d.ts.map +1 -0
  184. package/script/mod.js +23 -0
  185. package/script/npm/src/mod.d.ts +8 -0
  186. package/script/npm/src/mod.d.ts.map +1 -0
  187. package/script/npm/src/mod.js +23 -0
  188. package/script/npm/src/src/errors/api_error.d.ts +63 -0
  189. package/script/npm/src/src/errors/api_error.d.ts.map +1 -0
  190. package/script/npm/src/src/errors/api_error.js +94 -0
  191. package/script/npm/src/src/errors/index.d.ts +3 -0
  192. package/script/npm/src/src/errors/index.d.ts.map +1 -0
  193. package/script/npm/src/src/errors/index.js +18 -0
  194. package/script/npm/src/src/errors/permission_error.d.ts +48 -0
  195. package/script/npm/src/src/errors/permission_error.d.ts.map +1 -0
  196. package/script/npm/src/src/errors/permission_error.js +74 -0
  197. package/script/npm/src/src/features/admin/contract.d.ts +842 -0
  198. package/script/npm/src/src/features/admin/contract.d.ts.map +1 -0
  199. package/script/npm/src/src/features/admin/contract.js +213 -0
  200. package/script/npm/src/src/features/admin/index.d.ts +4 -0
  201. package/script/npm/src/src/features/admin/index.d.ts.map +1 -0
  202. package/script/npm/src/src/features/admin/index.js +19 -0
  203. package/script/npm/src/src/features/admin/repository.d.ts +114 -0
  204. package/script/npm/src/src/features/admin/repository.d.ts.map +1 -0
  205. package/script/npm/src/src/features/admin/repository.js +252 -0
  206. package/script/npm/src/src/features/admin/schemas.d.ts +146 -0
  207. package/script/npm/src/src/features/admin/schemas.d.ts.map +1 -0
  208. package/script/npm/src/src/features/admin/schemas.js +209 -0
  209. package/script/npm/src/src/features/auth/access/contract.d.ts +14 -0
  210. package/script/npm/src/src/features/auth/access/contract.d.ts.map +1 -0
  211. package/script/npm/src/src/features/auth/access/contract.js +17 -0
  212. package/script/npm/src/src/features/auth/access/repository.d.ts +11 -0
  213. package/script/npm/src/src/features/auth/access/repository.d.ts.map +1 -0
  214. package/script/npm/src/src/features/auth/access/repository.js +29 -0
  215. package/script/npm/src/src/features/auth/contract.d.ts +112 -0
  216. package/script/npm/src/src/features/auth/contract.d.ts.map +1 -0
  217. package/script/npm/src/src/features/auth/contract.js +46 -0
  218. package/script/npm/src/src/features/auth/identity/contract.d.ts +23 -0
  219. package/script/npm/src/src/features/auth/identity/contract.d.ts.map +1 -0
  220. package/script/npm/src/src/features/auth/identity/contract.js +20 -0
  221. package/script/npm/src/src/features/auth/identity/repository.d.ts +22 -0
  222. package/script/npm/src/src/features/auth/identity/repository.d.ts.map +1 -0
  223. package/script/npm/src/src/features/auth/identity/repository.js +34 -0
  224. package/script/npm/src/src/features/auth/index.d.ts +6 -0
  225. package/script/npm/src/src/features/auth/index.d.ts.map +1 -0
  226. package/script/npm/src/src/features/auth/index.js +21 -0
  227. package/script/npm/src/src/features/auth/manager.d.ts +105 -0
  228. package/script/npm/src/src/features/auth/manager.d.ts.map +1 -0
  229. package/script/npm/src/src/features/auth/manager.js +185 -0
  230. package/script/npm/src/src/features/auth/profile/contract.d.ts +37 -0
  231. package/script/npm/src/src/features/auth/profile/contract.d.ts.map +1 -0
  232. package/script/npm/src/src/features/auth/profile/contract.js +17 -0
  233. package/script/npm/src/src/features/auth/profile/repository.d.ts +11 -0
  234. package/script/npm/src/src/features/auth/profile/repository.d.ts.map +1 -0
  235. package/script/npm/src/src/features/auth/profile/repository.js +29 -0
  236. package/script/npm/src/src/features/auth/repository.d.ts +30 -0
  237. package/script/npm/src/src/features/auth/repository.d.ts.map +1 -0
  238. package/script/npm/src/src/features/auth/repository.js +73 -0
  239. package/script/npm/src/src/features/auth/storage/client_store.d.ts +30 -0
  240. package/script/npm/src/src/features/auth/storage/client_store.d.ts.map +1 -0
  241. package/script/npm/src/src/features/auth/storage/client_store.js +51 -0
  242. package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts +32 -0
  243. package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts.map +1 -0
  244. package/script/npm/src/src/features/auth/storage/client_token_handler.js +40 -0
  245. package/script/npm/src/src/features/auth/storage/server_store.d.ts +24 -0
  246. package/script/npm/src/src/features/auth/storage/server_store.d.ts.map +1 -0
  247. package/script/npm/src/src/features/auth/storage/server_store.js +38 -0
  248. package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts +36 -0
  249. package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts.map +1 -0
  250. package/script/npm/src/src/features/auth/storage/server_token_handler.js +119 -0
  251. package/script/npm/src/src/features/auth/storage/types.d.ts +42 -0
  252. package/script/npm/src/src/features/auth/storage/types.d.ts.map +1 -0
  253. package/script/npm/src/src/features/auth/storage/types.js +2 -0
  254. package/script/npm/src/src/features/contact/contract.d.ts +170 -0
  255. package/script/npm/src/src/features/contact/contract.d.ts.map +1 -0
  256. package/script/npm/src/src/features/contact/contract.js +52 -0
  257. package/script/npm/src/src/features/contact/index.d.ts +2 -0
  258. package/script/npm/src/src/features/contact/index.d.ts.map +1 -0
  259. package/script/npm/src/src/features/contact/index.js +17 -0
  260. package/script/npm/src/src/features/contact/repository.d.ts +58 -0
  261. package/script/npm/src/src/features/contact/repository.d.ts.map +1 -0
  262. package/script/npm/src/src/features/contact/repository.js +112 -0
  263. package/script/npm/src/src/features/payout/contract.d.ts +623 -0
  264. package/script/npm/src/src/features/payout/contract.d.ts.map +1 -0
  265. package/script/npm/src/src/features/payout/contract.js +78 -0
  266. package/script/npm/src/src/features/payout/index.d.ts +2 -0
  267. package/script/npm/src/src/features/payout/index.d.ts.map +1 -0
  268. package/script/npm/src/src/features/payout/index.js +17 -0
  269. package/script/npm/src/src/features/payout/repository.d.ts +67 -0
  270. package/script/npm/src/src/features/payout/repository.d.ts.map +1 -0
  271. package/script/npm/src/src/features/payout/repository.js +167 -0
  272. package/script/npm/src/src/features/wallet/contract.d.ts +137 -0
  273. package/script/npm/src/src/features/wallet/contract.d.ts.map +1 -0
  274. package/script/npm/src/src/features/wallet/contract.js +41 -0
  275. package/script/npm/src/src/features/wallet/index.d.ts +2 -0
  276. package/script/npm/src/src/features/wallet/index.d.ts.map +1 -0
  277. package/script/npm/src/src/features/wallet/index.js +17 -0
  278. package/script/npm/src/src/features/wallet/repository.d.ts +57 -0
  279. package/script/npm/src/src/features/wallet/repository.d.ts.map +1 -0
  280. package/script/npm/src/src/features/wallet/repository.js +97 -0
  281. package/script/npm/src/src/models/contact/derivatives/contact.d.ts +172 -0
  282. package/script/npm/src/src/models/contact/derivatives/contact.d.ts.map +1 -0
  283. package/script/npm/src/src/models/contact/derivatives/contact.js +270 -0
  284. package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts +188 -0
  285. package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts.map +1 -0
  286. package/script/npm/src/src/models/contact/derivatives/contact_info.js +260 -0
  287. package/script/npm/src/src/models/contact/index.d.ts +5 -0
  288. package/script/npm/src/src/models/contact/index.d.ts.map +1 -0
  289. package/script/npm/src/src/models/contact/index.js +20 -0
  290. package/script/npm/src/src/models/contact/schemas.d.ts +66 -0
  291. package/script/npm/src/src/models/contact/schemas.d.ts.map +1 -0
  292. package/script/npm/src/src/models/contact/schemas.js +67 -0
  293. package/script/npm/src/src/models/contact/validation.d.ts +37 -0
  294. package/script/npm/src/src/models/contact/validation.d.ts.map +1 -0
  295. package/script/npm/src/src/models/contact/validation.js +153 -0
  296. package/script/npm/src/src/models/index.d.ts +7 -0
  297. package/script/npm/src/src/models/index.d.ts.map +1 -0
  298. package/script/npm/src/src/models/index.js +22 -0
  299. package/script/npm/src/src/models/payout/api.d.ts +29 -0
  300. package/script/npm/src/src/models/payout/api.d.ts.map +1 -0
  301. package/script/npm/src/src/models/payout/api.js +2 -0
  302. package/script/npm/src/src/models/payout/channel.d.ts +58 -0
  303. package/script/npm/src/src/models/payout/channel.d.ts.map +1 -0
  304. package/script/npm/src/src/models/payout/channel.js +56 -0
  305. package/script/npm/src/src/models/payout/derivatives/payout.d.ts +158 -0
  306. package/script/npm/src/src/models/payout/derivatives/payout.d.ts.map +1 -0
  307. package/script/npm/src/src/models/payout/derivatives/payout.js +275 -0
  308. package/script/npm/src/src/models/payout/index.d.ts +7 -0
  309. package/script/npm/src/src/models/payout/index.d.ts.map +1 -0
  310. package/script/npm/src/src/models/payout/index.js +22 -0
  311. package/script/npm/src/src/models/payout/narration.d.ts +164 -0
  312. package/script/npm/src/src/models/payout/narration.d.ts.map +1 -0
  313. package/script/npm/src/src/models/payout/narration.js +312 -0
  314. package/script/npm/src/src/models/payout/schemas.d.ts +156 -0
  315. package/script/npm/src/src/models/payout/schemas.d.ts.map +1 -0
  316. package/script/npm/src/src/models/payout/schemas.js +108 -0
  317. package/script/npm/src/src/models/payout/status.d.ts +33 -0
  318. package/script/npm/src/src/models/payout/status.d.ts.map +1 -0
  319. package/script/npm/src/src/models/payout/status.js +37 -0
  320. package/script/npm/src/src/models/permission.d.ts +55 -0
  321. package/script/npm/src/src/models/permission.d.ts.map +1 -0
  322. package/script/npm/src/src/models/permission.js +53 -0
  323. package/script/npm/src/src/models/role.d.ts +21 -0
  324. package/script/npm/src/src/models/role.d.ts.map +1 -0
  325. package/script/npm/src/src/models/role.js +77 -0
  326. package/script/npm/src/src/models/user/authenticated-user.d.ts +77 -0
  327. package/script/npm/src/src/models/user/authenticated-user.d.ts.map +1 -0
  328. package/script/npm/src/src/models/user/authenticated-user.js +230 -0
  329. package/script/npm/src/src/models/user/index.d.ts +4 -0
  330. package/script/npm/src/src/models/user/index.d.ts.map +1 -0
  331. package/script/npm/src/src/models/user/index.js +19 -0
  332. package/script/npm/src/src/models/user/managed-user.d.ts +108 -0
  333. package/script/npm/src/src/models/user/managed-user.d.ts.map +1 -0
  334. package/script/npm/src/src/models/user/managed-user.js +260 -0
  335. package/script/npm/src/src/models/user/profile.d.ts +161 -0
  336. package/script/npm/src/src/models/user/profile.d.ts.map +1 -0
  337. package/script/npm/src/src/models/user/profile.js +338 -0
  338. package/script/npm/src/src/models/wallet/index.d.ts +4 -0
  339. package/script/npm/src/src/models/wallet/index.d.ts.map +1 -0
  340. package/script/npm/src/src/models/wallet/index.js +19 -0
  341. package/script/npm/src/src/models/wallet/schemas.d.ts +95 -0
  342. package/script/npm/src/src/models/wallet/schemas.d.ts.map +1 -0
  343. package/script/npm/src/src/models/wallet/schemas.js +38 -0
  344. package/script/npm/src/src/models/wallet/statement_entry.d.ts +160 -0
  345. package/script/npm/src/src/models/wallet/statement_entry.d.ts.map +1 -0
  346. package/script/npm/src/src/models/wallet/statement_entry.js +259 -0
  347. package/script/npm/src/src/models/wallet/wallet.d.ts +147 -0
  348. package/script/npm/src/src/models/wallet/wallet.d.ts.map +1 -0
  349. package/script/npm/src/src/models/wallet/wallet.js +283 -0
  350. package/script/npm/src/src/shared/base_repository.d.ts +80 -0
  351. package/script/npm/src/src/shared/base_repository.d.ts.map +1 -0
  352. package/script/npm/src/src/shared/base_repository.js +157 -0
  353. package/script/npm/src/src/shared/common_responses.d.ts +13 -0
  354. package/script/npm/src/src/shared/common_responses.d.ts.map +1 -0
  355. package/script/npm/src/src/shared/common_responses.js +13 -0
  356. package/script/npm/src/src/shared/index.d.ts +3 -0
  357. package/script/npm/src/src/shared/index.d.ts.map +1 -0
  358. package/script/npm/src/src/shared/index.js +18 -0
  359. package/script/npm/src/src/shared/token_required_repository.d.ts +78 -0
  360. package/script/npm/src/src/shared/token_required_repository.d.ts.map +1 -0
  361. package/script/npm/src/src/shared/token_required_repository.js +132 -0
  362. package/script/package.json +3 -0
  363. package/dist/index.cjs.js +0 -2
  364. package/dist/index.cjs.js.map +0 -1
  365. package/dist/index.d.ts +0 -10
  366. package/dist/index.esm.js +0 -2
  367. package/dist/index.esm.js.map +0 -1
  368. package/dist/lib/api/base-repository.d.ts +0 -175
  369. package/dist/lib/api/index.d.ts +0 -1
  370. package/dist/lib/error/error.utils.d.ts +0 -22
  371. package/dist/lib/error/index.d.ts +0 -3
  372. package/dist/lib/query/index.d.ts +0 -4
  373. package/dist/lib/query/pagination/pagination.d.ts +0 -73
  374. package/dist/lib/query/pagination/pagination.schemas.d.ts +0 -83
  375. package/dist/lib/query/query.builder.d.ts +0 -71
  376. package/dist/lib/query/query.types.d.ts +0 -36
  377. package/dist/modules/auth/auth.manager.d.ts +0 -249
  378. package/dist/modules/auth/auth.repository.d.ts +0 -83
  379. package/dist/modules/auth/auth.store.d.ts +0 -139
  380. package/dist/modules/auth/company-membership.model.d.ts +0 -171
  381. package/dist/modules/auth/index.d.ts +0 -4
  382. package/dist/modules/auth/user.model.d.ts +0 -363
  383. package/dist/modules/contact/contact-info.model.d.ts +0 -485
  384. package/dist/modules/contact/contact-input-handler.d.ts +0 -16
  385. package/dist/modules/contact/contact.dtos.d.ts +0 -84
  386. package/dist/modules/contact/contact.model.d.ts +0 -441
  387. package/dist/modules/contact/contact.repository.d.ts +0 -116
  388. package/dist/modules/contact/index.d.ts +0 -4
  389. package/dist/modules/login/index.d.ts +0 -4
  390. package/dist/modules/login/login.api-contract.d.ts +0 -51
  391. package/dist/modules/login/login.dtos.d.ts +0 -85
  392. package/dist/modules/login/login.model.d.ts +0 -168
  393. package/dist/modules/login/login.repository.d.ts +0 -58
  394. package/dist/modules/payout/index.d.ts +0 -5
  395. package/dist/modules/payout/payout-channel-handler.d.ts +0 -82
  396. package/dist/modules/payout/payout.dtos.d.ts +0 -605
  397. package/dist/modules/payout/payout.model.d.ts +0 -379
  398. package/dist/modules/payout/payout.query.d.ts +0 -133
  399. package/dist/modules/payout/payout.repository.d.ts +0 -181
  400. package/dist/modules/profile/index.d.ts +0 -3
  401. package/dist/modules/profile/profile.dtos.d.ts +0 -80
  402. package/dist/modules/profile/profile.repository.d.ts +0 -56
  403. package/dist/modules/team-member/index.d.ts +0 -4
  404. package/dist/modules/team-member/role.model.d.ts +0 -61
  405. package/dist/modules/team-member/team-member.dtos.d.ts +0 -261
  406. package/dist/modules/team-member/team-member.model.d.ts +0 -237
  407. package/dist/modules/team-member/team-member.repository.d.ts +0 -179
  408. package/dist/modules/wallet/index.d.ts +0 -7
  409. package/dist/modules/wallet/narration.model.d.ts +0 -225
  410. package/dist/modules/wallet/statement-entry.model.d.ts +0 -299
  411. package/dist/modules/wallet/wallet-manager.session.d.ts +0 -143
  412. package/dist/modules/wallet/wallet.dtos.d.ts +0 -204
  413. package/dist/modules/wallet/wallet.query.d.ts +0 -95
  414. package/dist/modules/wallet/wallet.repository.d.ts +0 -205
  415. package/dist/modules/wallet/wallet.utils.d.ts +0 -17
@@ -1,379 +0,0 @@
1
- import { PayoutDTO, PayoutStatus, PayoutApprovalStatus, PayoutAuthorizer } from "@/modules/payout/payout.dtos.js";
2
- import { Amount } from "@temboplus/frontend-core";
3
- import { ContactInfo } from "../contact/contact-info.model.js";
4
- import z from "zod";
5
- /**
6
- * Zod schema for Payout JSON serialization
7
- * This mirrors the PayoutDTO structure but is specifically for JSON serialization
8
- */
9
- export declare const PayoutJSONSchema: z.ZodObject<{
10
- id: z.ZodString;
11
- profileId: z.ZodString;
12
- payeeName: z.ZodString;
13
- channel: z.ZodString;
14
- msisdn: z.ZodString;
15
- amount: z.ZodNumber;
16
- currencyCode: z.ZodString;
17
- countryCode: z.ZodString;
18
- description: z.ZodString;
19
- notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20
- status: z.ZodNativeEnum<typeof PayoutStatus>;
21
- statusMessage: z.ZodString;
22
- partnerReference: z.ZodOptional<z.ZodNullable<z.ZodString>>;
23
- createdAt: z.ZodString;
24
- updatedAt: z.ZodString;
25
- actionedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
26
- approvalStatus: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof PayoutApprovalStatus>>>;
27
- createdBy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
28
- id: z.ZodString;
29
- name: z.ZodString;
30
- identity: z.ZodString;
31
- }, "strip", z.ZodTypeAny, {
32
- name: string;
33
- id: string;
34
- identity: string;
35
- }, {
36
- name: string;
37
- id: string;
38
- identity: string;
39
- }>>>;
40
- actionedBy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
41
- id: z.ZodString;
42
- name: z.ZodString;
43
- identity: z.ZodString;
44
- }, "strip", z.ZodTypeAny, {
45
- name: string;
46
- id: string;
47
- identity: string;
48
- }, {
49
- name: string;
50
- id: string;
51
- identity: string;
52
- }>>>;
53
- version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
54
- }, "strip", z.ZodTypeAny, {
55
- status: PayoutStatus;
56
- id: string;
57
- version: string;
58
- profileId: string;
59
- createdAt: string;
60
- updatedAt: string;
61
- description: string;
62
- channel: string;
63
- countryCode: string;
64
- currencyCode: string;
65
- msisdn: string;
66
- amount: number;
67
- payeeName: string;
68
- statusMessage: string;
69
- notes?: string | null | undefined;
70
- partnerReference?: string | null | undefined;
71
- actionedAt?: string | null | undefined;
72
- approvalStatus?: PayoutApprovalStatus | null | undefined;
73
- createdBy?: {
74
- name: string;
75
- id: string;
76
- identity: string;
77
- } | null | undefined;
78
- actionedBy?: {
79
- name: string;
80
- id: string;
81
- identity: string;
82
- } | null | undefined;
83
- }, {
84
- status: PayoutStatus;
85
- id: string;
86
- profileId: string;
87
- createdAt: string;
88
- updatedAt: string;
89
- description: string;
90
- channel: string;
91
- countryCode: string;
92
- currencyCode: string;
93
- msisdn: string;
94
- amount: number;
95
- payeeName: string;
96
- statusMessage: string;
97
- version?: string | undefined;
98
- notes?: string | null | undefined;
99
- partnerReference?: string | null | undefined;
100
- actionedAt?: string | null | undefined;
101
- approvalStatus?: PayoutApprovalStatus | null | undefined;
102
- createdBy?: {
103
- name: string;
104
- id: string;
105
- identity: string;
106
- } | null | undefined;
107
- actionedBy?: {
108
- name: string;
109
- id: string;
110
- identity: string;
111
- } | null | undefined;
112
- }>;
113
- /**
114
- * Infer the PayoutJSON type from the schema
115
- */
116
- export type PayoutJSON = z.infer<typeof PayoutJSONSchema>;
117
- /**
118
- * Payout class that wraps the Zod schema and provides additional functionality
119
- */
120
- export declare class Payout {
121
- private readonly data;
122
- /**
123
- * Private constructor - use static methods to create instances
124
- */
125
- private constructor();
126
- /** Unique identifier for the payout */
127
- get id(): string;
128
- /** Profile identifier associated with this payout */
129
- get profileId(): string;
130
- /** Name of the payee/recipient */
131
- get payeeName(): string;
132
- /** Payment channel used for this payout */
133
- get channel(): string;
134
- /** Mobile number or bank account identifier */
135
- get msisdn(): string;
136
- /**
137
- * Amount to be paid out
138
- * @returns {Amount} Amount object representing the payout value
139
- */
140
- get amount(): Amount;
141
- /** Description of the payout purpose */
142
- get description(): string;
143
- /** Optional additional notes about the payout */
144
- get notes(): string | undefined | null;
145
- /**
146
- * Current status of the payout
147
- * Derived from both approval status and transaction status:
148
- * - Returns REJECTED if approval status is "Rejected"
149
- * - Returns FAILED if approved but transaction failed
150
- * - Returns PAID if approved and transaction succeeded
151
- * - Returns PENDING if awaiting approval
152
- * - Falls back to transaction status in other cases
153
- *
154
- * @returns {PAYOUT_STATUS} Current status of the payout
155
- * @see {@link PAYOUT_STATUS} for all possible status values
156
- */
157
- get status(): PayoutStatus;
158
- /** Status message providing details about current state */
159
- get statusMessage(): string;
160
- /** Optional reference ID from payment partner */
161
- get partnerReference(): string | undefined | null;
162
- /** Timestamp when payout was created */
163
- get createdAt(): Date;
164
- /** Timestamp when payout was last updated */
165
- get updatedAt(): Date;
166
- /** Timestamp when payout was last updated */
167
- get actionedAt(): Date | undefined | null;
168
- /** Current approval status of the payout */
169
- get approvalStatus(): PayoutApprovalStatus | undefined | null;
170
- /** Information about who created the payout */
171
- get createdBy(): PayoutAuthorizer | undefined | null;
172
- /** Information about who last actioned the payout */
173
- get actionedBy(): PayoutAuthorizer | undefined | null;
174
- /**
175
- * Tries to construct contact information from the payout data.
176
- */
177
- get contactInfo(): ContactInfo | undefined;
178
- /**
179
- * Creates a Payout instance from raw data
180
- * @throws {ZodError} if validation fails
181
- */
182
- static create(data: PayoutDTO): Payout;
183
- /**
184
- * Creates multiple Payout instances from an array of raw data
185
- * @throws {ZodError} if validation fails for any item
186
- */
187
- static createMany(dataArray: PayoutDTO[]): Payout[];
188
- /**
189
- * Creates a Payout instance from raw data without throwing
190
- * @returns {Payout | null} Payout instance or null if validation fails
191
- */
192
- static createSafe(data: PayoutDTO): Payout | null;
193
- /**
194
- * Checks if an unknown value contains valid data to construct a Payout instance.
195
- * This is useful when validating raw data structures before instantiation.
196
- *
197
- * @param {unknown} obj - The value containing potential payout data
198
- * @returns {obj is Payout} Type predicate indicating if a Payout can be constructed
199
- *
200
- * @example
201
- * ```typescript
202
- * const rawData = await fetchPayoutData();
203
- * if (Payout.canConstruct(rawData)) {
204
- * const payout = Payout.create(rawData);
205
- * // TypeScript knows payout is valid here
206
- * console.log(payout.amount.toString());
207
- * }
208
- * ```
209
- *
210
- * @throws {never} This method never throws errors
211
- *
212
- * @remarks
213
- * This method performs strict validation against the {@link PayoutData} schema
214
- */
215
- static canConstruct(obj: unknown): obj is Payout;
216
- /**
217
- * Validates if an unknown value is a Payout instance.
218
- * This is a runtime type guard that ensures proper object structure and data validity.
219
- *
220
- * @param {unknown} obj - The value to validate
221
- * @returns {obj is Payout} Type predicate indicating if the value is a valid Payout
222
- *
223
- * @example
224
- * ```typescript
225
- * const maybePayout = getPayoutFromCache();
226
- * if (Payout.is(maybePayout)) {
227
- * // TypeScript knows maybePayout is a Payout here
228
- * console.log(maybePayout.status);
229
- * }
230
- * ```
231
- *
232
- * @throws {never} This method never throws errors
233
- *
234
- * @remarks
235
- * This method performs a complete structural validation:
236
- * 1. Checks if the value is an object
237
- * 2. Verifies presence of internal data property
238
- * 3. Validates the data against PayoutData schema
239
- * 4. Ensures the object is a proper Payout instance
240
- *
241
- * Use this method when:
242
- * - Validating cached Payout instances
243
- * - Checking serialized Payout objects
244
- * - Verifying API responses
245
- * - Type narrowing in conditional blocks
246
- */
247
- static is(obj: unknown): obj is Payout;
248
- /**
249
- * Serializes the Payout instance to a JSON-compatible object
250
- *
251
- * Converts all Date objects to ISO strings for proper JSON serialization.
252
- * The resulting object can be safely stringified and stored or transmitted.
253
- *
254
- * @returns {PayoutJSON} A plain object containing all payout data
255
- *
256
- * @example
257
- * ```typescript
258
- * const payout = Payout.create(payoutData);
259
- * const json = payout.toJSON();
260
- * // {
261
- * // id: "payout-123",
262
- * // amount: 50000,
263
- * // currencyCode: "TZS",
264
- * // createdAt: "2024-01-15T10:30:00.000Z",
265
- * // ...
266
- * // }
267
- * ```
268
- */
269
- toJSON(): PayoutJSON;
270
- /**
271
- * Serializes the Payout instance to a JSON string
272
- *
273
- * @returns {string} JSON string representation of the payout
274
- *
275
- * @example
276
- * ```typescript
277
- * const payout = Payout.create(payoutData);
278
- * const jsonString = payout.toJSONString();
279
- *
280
- * // Store in localStorage
281
- * localStorage.setItem('pendingPayout', jsonString);
282
- *
283
- * // Or send to server
284
- * await fetch('/api/cache-payout', {
285
- * method: 'POST',
286
- * body: jsonString
287
- * });
288
- * ```
289
- */
290
- toJSONString(): string;
291
- /**
292
- * Creates a Payout instance from a JSON-compatible object or string
293
- *
294
- * This method reconstructs a Payout instance from data that was previously
295
- * serialized using toJSON(). It validates the input data using Zod schema
296
- * and converts ISO date strings back to Date objects.
297
- *
298
- * @param {PayoutJSON | string} json - Either a PayoutJSON object or a JSON string
299
- * @returns {Payout | undefined} A Payout instance if valid, undefined otherwise
300
- *
301
- * @example
302
- * ```typescript
303
- * // From localStorage
304
- * const stored = localStorage.getItem('pendingPayout');
305
- * const payout = Payout.fromJSON(stored!);
306
- *
307
- * if (payout) {
308
- * console.log(payout.amount.label); // "TSh 50,000.00"
309
- * console.log(payout.status); // "PENDING"
310
- * }
311
- *
312
- * // From object
313
- * const payoutJson = {
314
- * id: "payout-123",
315
- * amount: 50000,
316
- * currencyCode: "TZS",
317
- * createdAt: "2024-01-15T10:30:00.000Z",
318
- * ...
319
- * };
320
- * const payout = Payout.fromJSON(payoutJson);
321
- * ```
322
- */
323
- static fromJSON(json: PayoutJSON | string): Payout | undefined;
324
- /**
325
- * Type guard using Zod schema validation
326
- *
327
- * Checks if an unknown value conforms to the PayoutJSON structure
328
- * without attempting to create a Payout instance.
329
- *
330
- * @param {unknown} obj - The object to validate
331
- * @returns {boolean} True if the object is a valid PayoutJSON
332
- *
333
- * @example
334
- * ```typescript
335
- * const data = JSON.parse(localStorage.getItem('payout'));
336
- *
337
- * if (Payout.isPayoutJSON(data)) {
338
- * const payout = Payout.fromJSON(data);
339
- * // TypeScript knows data is PayoutJSON here
340
- * }
341
- * ```
342
- */
343
- static isPayoutJSON(obj: unknown): obj is PayoutJSON;
344
- /**
345
- * Creates multiple Payout instances from a JSON array
346
- *
347
- * @param {PayoutJSON[] | string} jsonArray - Array of PayoutJSON objects or JSON string
348
- * @returns {Payout[]} Array of Payout instances (invalid items are filtered out)
349
- *
350
- * @example
351
- * ```typescript
352
- * // From API response
353
- * const response = await fetch('/api/payouts');
354
- * const jsonArray = await response.json();
355
- * const payouts = Payout.fromJSONArray(jsonArray);
356
- *
357
- * // From stored array
358
- * const stored = localStorage.getItem('recentPayouts');
359
- * const payouts = Payout.fromJSONArray(stored!);
360
- * ```
361
- */
362
- static fromJSONArray(jsonArray: PayoutJSON[] | string): Payout[];
363
- /**
364
- * Serializes an array of Payout instances to JSON
365
- *
366
- * @param {Payout[]} payouts - Array of Payout instances to serialize
367
- * @returns {PayoutJSON[]} Array of PayoutJSON objects
368
- *
369
- * @example
370
- * ```typescript
371
- * const payouts = [payout1, payout2, payout3];
372
- * const jsonArray = Payout.toJSONArray(payouts);
373
- *
374
- * // Store or transmit
375
- * localStorage.setItem('recentPayouts', JSON.stringify(jsonArray));
376
- * ```
377
- */
378
- static toJSONArray(payouts: Payout[]): PayoutJSON[];
379
- }
@@ -1,133 +0,0 @@
1
- import { QueryBuilder } from "@/lib/query/index.js";
2
- import { PayoutStatus, PayoutApprovalStatus, PayoutFilters } from "./payout.dtos.js";
3
- /**
4
- * Payout-specific query builder that extends the base QueryBuilder
5
- * and handles all possible input conversions (DTOs, URL params, etc.)
6
- */
7
- export declare class PayoutQuery extends QueryBuilder {
8
- /**
9
- * Create empty payout query with defaults
10
- */
11
- static create(): PayoutQuery;
12
- /**
13
- * Create from typed DTO/filters object
14
- */
15
- static fromFilters(filters: PayoutFilters): PayoutQuery;
16
- /**
17
- * Create from URL search parameters (strings)
18
- */
19
- static fromUrlParams(params: Record<string, string>): PayoutQuery;
20
- /**
21
- * Create from URLSearchParams object
22
- */
23
- static fromSearchParams(searchParams: URLSearchParams): PayoutQuery;
24
- /**
25
- * Create from Next.js Request object
26
- */
27
- static fromRequest(request: Request): PayoutQuery;
28
- /**
29
- * Create from any supported input type
30
- */
31
- static from(input: QueryBuilder | PayoutFilters | Record<string, string> | URLSearchParams | null | undefined): PayoutQuery;
32
- /**
33
- * Type guard for string records
34
- */
35
- private static isStringRecord;
36
- whereStatus(status: PayoutStatus): this;
37
- whereApprovalStatus(approvalStatus: PayoutApprovalStatus): this;
38
- whereChannel(channel: string): this;
39
- wherePending(): this;
40
- whereApproved(): this;
41
- whereRejected(): this;
42
- wherePaid(): this;
43
- whereFailed(): this;
44
- whereAmountBetween(min: number, max: number): this;
45
- wherePayee(payeeName: string): this;
46
- whereMsisdn(msisdn: string): this;
47
- whereProfileId(profileId: string): this;
48
- wherePartnerReference(partnerReference: string): this;
49
- whereSearch(searchTerm: string): this;
50
- whereCurrencyCode(currencyCode: string): this;
51
- /**
52
- * Apply all filters from PayoutFilters object
53
- */
54
- private applyFilters;
55
- /**
56
- * Convert to PayoutFilters DTO
57
- */
58
- toFilters(): PayoutFilters;
59
- /**
60
- * Convert to URL-safe string parameters
61
- */
62
- toUrlParams(): Record<string, string>;
63
- /**
64
- * Convert to URLSearchParams
65
- */
66
- toSearchParams(): URLSearchParams;
67
- /**
68
- * Convert to query string
69
- */
70
- toQueryString(): string;
71
- /**
72
- * Create new instance with updated pagination
73
- */
74
- withPagination(page: number, limit?: number): PayoutQuery;
75
- /**
76
- * Create new instance with updated sorting
77
- */
78
- withSorting(sortBy: string, sortOrder?: "asc" | "desc"): PayoutQuery;
79
- /**
80
- * Create new instance with date range
81
- */
82
- withDateRange(startDate?: string, endDate?: string): PayoutQuery;
83
- /**
84
- * Create new instance with status filter
85
- */
86
- withStatus(status?: PayoutStatus): PayoutQuery;
87
- /**
88
- * Create new instance with approval status filter
89
- */
90
- withApprovalStatus(approvalStatus?: PayoutApprovalStatus): PayoutQuery;
91
- /**
92
- * Create new instance with channel filter
93
- */
94
- withChannel(channel?: string): PayoutQuery;
95
- /**
96
- * Includes default relations for eager loading.
97
- * This ensures that related data (createdBy, actionedBy) is fetched automatically.
98
- * @returns The current query builder instance.
99
- */
100
- includeDefaultRelations(): this;
101
- /**
102
- * Reset to first page
103
- */
104
- resetPage(): PayoutQuery;
105
- /**
106
- * Check if any filters are applied
107
- */
108
- hasFilters(): boolean;
109
- /**
110
- * Get human-readable filter descriptions
111
- */
112
- getActiveFilters(): string[];
113
- /**
114
- * Extract filter values from QueryBuilder options
115
- */
116
- private extractFilterValues;
117
- /**
118
- * Extract primary sort field
119
- */
120
- private extractSortField;
121
- /**
122
- * Extract primary sort order
123
- */
124
- private extractSortOrder;
125
- /**
126
- * Type guard for valid statuses
127
- */
128
- private isValidStatus;
129
- /**
130
- * Type guard for valid approval statuses
131
- */
132
- private isValidApprovalStatus;
133
- }
@@ -1,181 +0,0 @@
1
- import { BaseRepository } from "@/lib/api/index.js";
2
- import { ContactInfo } from "@/modules/contact/contact-info.model.js";
3
- import { Payout } from "@/modules/payout/payout.model.js";
4
- import { Amount } from "@temboplus/frontend-core";
5
- import { PayoutAPI } from "./payout.api-contract.js";
6
- import { PayoutChannel } from "./payout.dtos.js";
7
- import { PayoutQuery } from "./payout.query.js";
8
- import { PayoutFilters } from "./payout.dtos.js";
9
- import { Paged } from "@/lib/query/index.js";
10
- /**
11
- * Flexible query input type - supports the class, filters interface, URL params, etc.
12
- */
13
- export type PayoutQueryInput = PayoutQuery | PayoutFilters | Record<string, string> | URLSearchParams | null | undefined;
14
- /**
15
- * Repository class for managing payout operations including creation, approval,
16
- * rejection, and retrieval of payouts.
17
- *
18
- * This repository handles pure API communication without permission checking.
19
- * Permission validation should be handled at the service layer or route handlers.
20
- *
21
- * @extends {BaseRepository<PayoutAPI>}
22
- *
23
- * @example
24
- * ```typescript
25
- * const repo = new PayoutRepository({ token: userToken });
26
- * const payouts = await repo.getPayouts();
27
- * ```
28
- */
29
- export declare class PayoutRepository extends BaseRepository<PayoutAPI> {
30
- /**
31
- * Creates an instance of PayoutRepository initialized with the payout contract.
32
- *
33
- * @param options - Optional configuration
34
- * @param options.token - Authentication token for API calls
35
- * @param options.root - Custom API root URL
36
- *
37
- * @example
38
- * ```typescript
39
- * const repo = new PayoutRepository({
40
- * token: "user-auth-token"
41
- * });
42
- * ```
43
- */
44
- constructor(options?: {
45
- token?: string;
46
- root?: string;
47
- });
48
- /**
49
- * Get paginated payouts with filtering.
50
- * Always returns paginated results with metadata.
51
- *
52
- * @param query - Query parameters in any supported format
53
- * @returns Promise resolving to paginated payouts
54
- *
55
- * @example
56
- * ```typescript
57
- * // From API route with URL search params
58
- * const { searchParams } = new URL(req.url);
59
- * const result = await repo.getPayouts(searchParams);
60
- *
61
- * // From client with typed params
62
- * const filters: PayoutFilters = { page: 1, limit: 20, approvalStatus: 'Pending' };
63
- * const result2 = await repo.getPayouts(filters);
64
- *
65
- * // With PayoutQuery instance
66
- * const query = PayoutQuery.create().wherePending().withPagination(1, 50);
67
- * const result3 = await repo.getPayouts(query);
68
- * ```
69
- */
70
- getPayouts(query?: PayoutQueryInput): Promise<Paged<Payout>>;
71
- /**
72
- * Get all payouts without pagination.
73
- * Returns a plain array of all matching results.
74
- *
75
- * @param query - Query parameters (pagination params will be ignored)
76
- * @returns Promise resolving to array of all payouts
77
- *
78
- * @example
79
- * ```typescript
80
- * // Get all pending payouts for a dropdown
81
- * const allPending = await repo.getAllPayouts({ approvalStatus: 'Pending' });
82
- *
83
- * // Get all payouts without any filters
84
- * const allPayouts = await repo.getAllPayouts();
85
- * ```
86
- */
87
- getAllPayouts(query?: PayoutQueryInput): Promise<Payout[]>;
88
- /**
89
- * Convenience method for Next.js API routes.
90
- * Extracts search params directly from Request object and returns paginated results.
91
- */
92
- getPayoutsFromRequest(req: Request): Promise<Paged<Payout>>;
93
- /**
94
- * Creates a new payout with the provided input data.
95
- *
96
- * @param args - The payout creation data
97
- * @param args.channel - The payout channel to use
98
- * @param args.receiver - Contact information for the payout receiver
99
- * @param args.amount - The amount to pay out
100
- * @param args.notes - Optional notes for the payout
101
- * @returns Promise that resolves to the created payout
102
- * @throws {APIError} If the input is invalid or if the creation operation fails
103
- *
104
- * @example
105
- * ```typescript
106
- * const payout = await repo.pay({
107
- * channel: PayoutChannel.MOBILE,
108
- * receiver: { name: "John Doe", phone: "+255123456789" },
109
- * amount: Amount.from(10000, "TZS"),
110
- * notes: "Payment for services"
111
- * });
112
- * ```
113
- */
114
- pay(args: {
115
- channel: PayoutChannel;
116
- receiver: ContactInfo;
117
- amount: Amount;
118
- notes?: string;
119
- }): Promise<Payout>;
120
- /**
121
- * Approves a payout with optional notes.
122
- *
123
- * @param id - The ID of the payout to approve
124
- * @param args - Optional arguments
125
- * @param args.notes - Optional notes for the approval
126
- * @returns Promise that resolves to the approved payout
127
- * @throws {APIError} If payout is not found, already approved, or if the operation fails
128
- *
129
- * @example
130
- * ```typescript
131
- * const approvedPayout = await repo.approve("payout-id", {
132
- * notes: "Approved after verification"
133
- * });
134
- * ```
135
- */
136
- approve(id: string, args?: {
137
- notes?: string;
138
- }): Promise<Payout>;
139
- /**
140
- * Rejects a payout with optional notes.
141
- *
142
- * @param id - The ID of the payout to reject
143
- * @param args - Optional arguments
144
- * @param args.notes - Optional notes for the rejection
145
- * @returns Promise that resolves to the rejected payout
146
- * @throws {APIError} If payout is not found, already rejected, or if the operation fails
147
- *
148
- * @example
149
- * ```typescript
150
- * const rejectedPayout = await repo.reject("payout-id", {
151
- * notes: "Insufficient documentation"
152
- * });
153
- * ```
154
- */
155
- reject(id: string, args?: {
156
- notes?: string;
157
- }): Promise<Payout>;
158
- /**
159
- * Retrieves a payout by its ID.
160
- *
161
- * @param id - The ID of the payout to retrieve
162
- * @returns Promise that resolves to the payout instance if found
163
- * @throws {APIError} If the payout is not found or another error occurs
164
- *
165
- * @example
166
- * ```typescript
167
- * const payout = await repo.getByID("payout-id");
168
- * console.log(`Payout status: ${payout.status}`);
169
- * ```
170
- */
171
- getByID(id: string): Promise<Payout>;
172
- /**
173
- * Get count of payouts matching a query
174
- * Uses the same query syntax as getPayouts but only returns the count
175
- */
176
- count(query?: PayoutQueryInput): Promise<number>;
177
- /**
178
- * Check if any payouts exist matching a query
179
- */
180
- exists(query?: PayoutQueryInput): Promise<boolean>;
181
- }
@@ -1,3 +0,0 @@
1
- export * from "./profile.dtos.js";
2
- export * from "./profile.model.js";
3
- export * from "./profile.repository.js";