@temboplus/afloat 0.1.0

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 (335) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +21 -0
  3. package/esm/_dnt.test_shims.d.ts.map +1 -0
  4. package/esm/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts.map +1 -0
  5. package/esm/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts.map +1 -0
  6. package/esm/deps/jsr.io/@std/assert/1.0.10/assert.d.ts.map +1 -0
  7. package/esm/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts.map +1 -0
  8. package/esm/deps/jsr.io/@std/assert/1.0.10/equal.d.ts.map +1 -0
  9. package/esm/deps/jsr.io/@std/assert/1.0.10/equals.d.ts.map +1 -0
  10. package/esm/deps/jsr.io/@std/assert/1.0.10/exists.d.ts.map +1 -0
  11. package/esm/deps/jsr.io/@std/assert/1.0.10/fail.d.ts.map +1 -0
  12. package/esm/deps/jsr.io/@std/assert/1.0.10/false.d.ts.map +1 -0
  13. package/esm/deps/jsr.io/@std/assert/1.0.10/greater.d.ts.map +1 -0
  14. package/esm/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts.map +1 -0
  15. package/esm/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts.map +1 -0
  16. package/esm/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts.map +1 -0
  17. package/esm/deps/jsr.io/@std/assert/1.0.10/less.d.ts.map +1 -0
  18. package/esm/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts.map +1 -0
  19. package/esm/deps/jsr.io/@std/assert/1.0.10/match.d.ts.map +1 -0
  20. package/esm/deps/jsr.io/@std/assert/1.0.10/mod.d.ts.map +1 -0
  21. package/esm/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts.map +1 -0
  22. package/esm/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts.map +1 -0
  23. package/esm/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts.map +1 -0
  24. package/esm/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts.map +1 -0
  25. package/esm/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts.map +1 -0
  26. package/esm/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts.map +1 -0
  27. package/esm/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts.map +1 -0
  28. package/esm/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts.map +1 -0
  29. package/esm/deps/jsr.io/@std/assert/1.0.10/throws.d.ts.map +1 -0
  30. package/esm/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts.map +1 -0
  31. package/esm/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts.map +1 -0
  32. package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +1 -0
  33. package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +1 -0
  34. package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +1 -0
  35. package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +1 -0
  36. package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +1 -0
  37. package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +1 -0
  38. package/esm/mod.d.ts +7 -0
  39. package/esm/mod.d.ts.map +1 -0
  40. package/esm/mod.js +6 -0
  41. package/esm/package.json +3 -0
  42. package/esm/src/errors/api_error.d.ts +63 -0
  43. package/esm/src/errors/api_error.d.ts.map +1 -0
  44. package/esm/src/errors/api_error.js +90 -0
  45. package/esm/src/errors/index.d.ts +3 -0
  46. package/esm/src/errors/index.d.ts.map +1 -0
  47. package/esm/src/errors/index.js +2 -0
  48. package/esm/src/errors/permission_error.d.ts +48 -0
  49. package/esm/src/errors/permission_error.d.ts.map +1 -0
  50. package/esm/src/errors/permission_error.js +70 -0
  51. package/esm/src/features/auth/contract.d.ts +123 -0
  52. package/esm/src/features/auth/contract.d.ts.map +1 -0
  53. package/esm/src/features/auth/contract.js +50 -0
  54. package/esm/src/features/auth/index.d.ts +2 -0
  55. package/esm/src/features/auth/index.d.ts.map +1 -0
  56. package/esm/src/features/auth/index.js +1 -0
  57. package/esm/src/features/auth/manager.d.ts +71 -0
  58. package/esm/src/features/auth/manager.d.ts.map +1 -0
  59. package/esm/src/features/auth/manager.js +118 -0
  60. package/esm/src/features/auth/repository.d.ts +30 -0
  61. package/esm/src/features/auth/repository.d.ts.map +1 -0
  62. package/esm/src/features/auth/repository.js +94 -0
  63. package/esm/src/features/contact/contract.d.ts +170 -0
  64. package/esm/src/features/contact/contract.d.ts.map +1 -0
  65. package/esm/src/features/contact/contract.js +49 -0
  66. package/esm/src/features/contact/index.d.ts +2 -0
  67. package/esm/src/features/contact/index.d.ts.map +1 -0
  68. package/esm/src/features/contact/index.js +1 -0
  69. package/esm/src/features/contact/repository.d.ts +47 -0
  70. package/esm/src/features/contact/repository.d.ts.map +1 -0
  71. package/esm/src/features/contact/repository.js +94 -0
  72. package/esm/src/features/files-gen/contract.d.ts +67 -0
  73. package/esm/src/features/files-gen/contract.d.ts.map +1 -0
  74. package/esm/src/features/files-gen/contract.js +40 -0
  75. package/esm/src/features/files-gen/repository.d.ts +47 -0
  76. package/esm/src/features/files-gen/repository.d.ts.map +1 -0
  77. package/esm/src/features/files-gen/repository.js +48 -0
  78. package/esm/src/features/payout/contract.d.ts +623 -0
  79. package/esm/src/features/payout/contract.d.ts.map +1 -0
  80. package/esm/src/features/payout/contract.js +75 -0
  81. package/esm/src/features/payout/index.d.ts +2 -0
  82. package/esm/src/features/payout/index.d.ts.map +1 -0
  83. package/esm/src/features/payout/index.js +1 -0
  84. package/esm/src/features/payout/repository.d.ts +62 -0
  85. package/esm/src/features/payout/repository.d.ts.map +1 -0
  86. package/esm/src/features/payout/repository.js +158 -0
  87. package/esm/src/features/wallet/contract.d.ts +103 -0
  88. package/esm/src/features/wallet/contract.d.ts.map +1 -0
  89. package/esm/src/features/wallet/contract.js +35 -0
  90. package/esm/src/features/wallet/index.d.ts +2 -0
  91. package/esm/src/features/wallet/index.d.ts.map +1 -0
  92. package/esm/src/features/wallet/index.js +1 -0
  93. package/esm/src/features/wallet/repository.d.ts +74 -0
  94. package/esm/src/features/wallet/repository.d.ts.map +1 -0
  95. package/esm/src/features/wallet/repository.js +132 -0
  96. package/esm/src/models/contact/derivatives/contact.d.ts +168 -0
  97. package/esm/src/models/contact/derivatives/contact.d.ts.map +1 -0
  98. package/esm/src/models/contact/derivatives/contact.js +260 -0
  99. package/esm/src/models/contact/derivatives/contact.test.d.ts.map +1 -0
  100. package/esm/src/models/contact/derivatives/contact_info.d.ts +188 -0
  101. package/esm/src/models/contact/derivatives/contact_info.d.ts.map +1 -0
  102. package/esm/src/models/contact/derivatives/contact_info.js +255 -0
  103. package/esm/src/models/contact/derivatives/contact_info.test.d.ts.map +1 -0
  104. package/esm/src/models/contact/index.d.ts +5 -0
  105. package/esm/src/models/contact/index.d.ts.map +1 -0
  106. package/esm/src/models/contact/index.js +4 -0
  107. package/esm/src/models/contact/schemas.d.ts +66 -0
  108. package/esm/src/models/contact/schemas.d.ts.map +1 -0
  109. package/esm/src/models/contact/schemas.js +64 -0
  110. package/esm/src/models/contact/validation.d.ts +37 -0
  111. package/esm/src/models/contact/validation.d.ts.map +1 -0
  112. package/esm/src/models/contact/validation.js +139 -0
  113. package/esm/src/models/contact/validation.test.d.ts.map +1 -0
  114. package/esm/src/models/index.d.ts +6 -0
  115. package/esm/src/models/index.d.ts.map +1 -0
  116. package/esm/src/models/index.js +5 -0
  117. package/esm/src/models/payout/api.d.ts +29 -0
  118. package/esm/src/models/payout/api.d.ts.map +1 -0
  119. package/esm/src/models/payout/api.js +1 -0
  120. package/esm/src/models/payout/channel.d.ts +58 -0
  121. package/esm/src/models/payout/channel.d.ts.map +1 -0
  122. package/esm/src/models/payout/channel.js +46 -0
  123. package/esm/src/models/payout/derivatives/payout.d.ts +156 -0
  124. package/esm/src/models/payout/derivatives/payout.d.ts.map +1 -0
  125. package/esm/src/models/payout/derivatives/payout.js +261 -0
  126. package/esm/src/models/payout/derivatives/payout.test.d.ts.map +1 -0
  127. package/esm/src/models/payout/index.d.ts +6 -0
  128. package/esm/src/models/payout/index.d.ts.map +1 -0
  129. package/esm/src/models/payout/index.js +5 -0
  130. package/esm/src/models/payout/schemas.d.ts +154 -0
  131. package/esm/src/models/payout/schemas.d.ts.map +1 -0
  132. package/esm/src/models/payout/schemas.js +103 -0
  133. package/esm/src/models/payout/status.d.ts +31 -0
  134. package/esm/src/models/payout/status.d.ts.map +1 -0
  135. package/esm/src/models/payout/status.js +32 -0
  136. package/esm/src/models/permission.d.ts +42 -0
  137. package/esm/src/models/permission.d.ts.map +1 -0
  138. package/esm/src/models/permission.js +37 -0
  139. package/esm/src/models/user/index.d.ts +3 -0
  140. package/esm/src/models/user/index.d.ts.map +1 -0
  141. package/esm/src/models/user/index.js +2 -0
  142. package/esm/src/models/user/profile.d.ts +38 -0
  143. package/esm/src/models/user/profile.d.ts.map +1 -0
  144. package/esm/src/models/user/profile.js +25 -0
  145. package/esm/src/models/user/user.d.ts +80 -0
  146. package/esm/src/models/user/user.d.ts.map +1 -0
  147. package/esm/src/models/user/user.js +149 -0
  148. package/esm/src/models/wallet/guards.d.ts +11 -0
  149. package/esm/src/models/wallet/guards.d.ts.map +1 -0
  150. package/esm/src/models/wallet/guards.js +14 -0
  151. package/esm/src/models/wallet/index.d.ts +4 -0
  152. package/esm/src/models/wallet/index.d.ts.map +1 -0
  153. package/esm/src/models/wallet/index.js +3 -0
  154. package/esm/src/models/wallet/schemas.d.ts +50 -0
  155. package/esm/src/models/wallet/schemas.d.ts.map +1 -0
  156. package/esm/src/models/wallet/schemas.js +64 -0
  157. package/esm/src/models/wallet/statement.d.ts +27 -0
  158. package/esm/src/models/wallet/statement.d.ts.map +1 -0
  159. package/esm/src/models/wallet/statement.js +13 -0
  160. package/esm/src/shared/base_repository.d.ts +56 -0
  161. package/esm/src/shared/base_repository.d.ts.map +1 -0
  162. package/esm/src/shared/base_repository.js +95 -0
  163. package/esm/src/shared/common_responses.d.ts +13 -0
  164. package/esm/src/shared/common_responses.d.ts.map +1 -0
  165. package/esm/src/shared/common_responses.js +10 -0
  166. package/esm/src/shared/index.d.ts +3 -0
  167. package/esm/src/shared/index.d.ts.map +1 -0
  168. package/esm/src/shared/index.js +2 -0
  169. package/package.json +40 -0
  170. package/script/_dnt.test_shims.d.ts.map +1 -0
  171. package/script/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts.map +1 -0
  172. package/script/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts.map +1 -0
  173. package/script/deps/jsr.io/@std/assert/1.0.10/assert.d.ts.map +1 -0
  174. package/script/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts.map +1 -0
  175. package/script/deps/jsr.io/@std/assert/1.0.10/equal.d.ts.map +1 -0
  176. package/script/deps/jsr.io/@std/assert/1.0.10/equals.d.ts.map +1 -0
  177. package/script/deps/jsr.io/@std/assert/1.0.10/exists.d.ts.map +1 -0
  178. package/script/deps/jsr.io/@std/assert/1.0.10/fail.d.ts.map +1 -0
  179. package/script/deps/jsr.io/@std/assert/1.0.10/false.d.ts.map +1 -0
  180. package/script/deps/jsr.io/@std/assert/1.0.10/greater.d.ts.map +1 -0
  181. package/script/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts.map +1 -0
  182. package/script/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts.map +1 -0
  183. package/script/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts.map +1 -0
  184. package/script/deps/jsr.io/@std/assert/1.0.10/less.d.ts.map +1 -0
  185. package/script/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts.map +1 -0
  186. package/script/deps/jsr.io/@std/assert/1.0.10/match.d.ts.map +1 -0
  187. package/script/deps/jsr.io/@std/assert/1.0.10/mod.d.ts.map +1 -0
  188. package/script/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts.map +1 -0
  189. package/script/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts.map +1 -0
  190. package/script/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts.map +1 -0
  191. package/script/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts.map +1 -0
  192. package/script/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts.map +1 -0
  193. package/script/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts.map +1 -0
  194. package/script/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts.map +1 -0
  195. package/script/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts.map +1 -0
  196. package/script/deps/jsr.io/@std/assert/1.0.10/throws.d.ts.map +1 -0
  197. package/script/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts.map +1 -0
  198. package/script/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts.map +1 -0
  199. package/script/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +1 -0
  200. package/script/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +1 -0
  201. package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +1 -0
  202. package/script/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +1 -0
  203. package/script/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +1 -0
  204. package/script/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +1 -0
  205. package/script/mod.d.ts +7 -0
  206. package/script/mod.d.ts.map +1 -0
  207. package/script/mod.js +22 -0
  208. package/script/package.json +3 -0
  209. package/script/src/errors/api_error.d.ts +63 -0
  210. package/script/src/errors/api_error.d.ts.map +1 -0
  211. package/script/src/errors/api_error.js +94 -0
  212. package/script/src/errors/index.d.ts +3 -0
  213. package/script/src/errors/index.d.ts.map +1 -0
  214. package/script/src/errors/index.js +18 -0
  215. package/script/src/errors/permission_error.d.ts +48 -0
  216. package/script/src/errors/permission_error.d.ts.map +1 -0
  217. package/script/src/errors/permission_error.js +74 -0
  218. package/script/src/features/auth/contract.d.ts +123 -0
  219. package/script/src/features/auth/contract.d.ts.map +1 -0
  220. package/script/src/features/auth/contract.js +53 -0
  221. package/script/src/features/auth/index.d.ts +2 -0
  222. package/script/src/features/auth/index.d.ts.map +1 -0
  223. package/script/src/features/auth/index.js +17 -0
  224. package/script/src/features/auth/manager.d.ts +71 -0
  225. package/script/src/features/auth/manager.d.ts.map +1 -0
  226. package/script/src/features/auth/manager.js +122 -0
  227. package/script/src/features/auth/repository.d.ts +30 -0
  228. package/script/src/features/auth/repository.d.ts.map +1 -0
  229. package/script/src/features/auth/repository.js +98 -0
  230. package/script/src/features/contact/contract.d.ts +170 -0
  231. package/script/src/features/contact/contract.d.ts.map +1 -0
  232. package/script/src/features/contact/contract.js +52 -0
  233. package/script/src/features/contact/index.d.ts +2 -0
  234. package/script/src/features/contact/index.d.ts.map +1 -0
  235. package/script/src/features/contact/index.js +17 -0
  236. package/script/src/features/contact/repository.d.ts +47 -0
  237. package/script/src/features/contact/repository.d.ts.map +1 -0
  238. package/script/src/features/contact/repository.js +98 -0
  239. package/script/src/features/files-gen/contract.d.ts +67 -0
  240. package/script/src/features/files-gen/contract.d.ts.map +1 -0
  241. package/script/src/features/files-gen/contract.js +43 -0
  242. package/script/src/features/files-gen/repository.d.ts +47 -0
  243. package/script/src/features/files-gen/repository.d.ts.map +1 -0
  244. package/script/src/features/files-gen/repository.js +52 -0
  245. package/script/src/features/payout/contract.d.ts +623 -0
  246. package/script/src/features/payout/contract.d.ts.map +1 -0
  247. package/script/src/features/payout/contract.js +78 -0
  248. package/script/src/features/payout/index.d.ts +2 -0
  249. package/script/src/features/payout/index.d.ts.map +1 -0
  250. package/script/src/features/payout/index.js +17 -0
  251. package/script/src/features/payout/repository.d.ts +62 -0
  252. package/script/src/features/payout/repository.d.ts.map +1 -0
  253. package/script/src/features/payout/repository.js +162 -0
  254. package/script/src/features/wallet/contract.d.ts +103 -0
  255. package/script/src/features/wallet/contract.d.ts.map +1 -0
  256. package/script/src/features/wallet/contract.js +38 -0
  257. package/script/src/features/wallet/index.d.ts +2 -0
  258. package/script/src/features/wallet/index.d.ts.map +1 -0
  259. package/script/src/features/wallet/index.js +17 -0
  260. package/script/src/features/wallet/repository.d.ts +74 -0
  261. package/script/src/features/wallet/repository.d.ts.map +1 -0
  262. package/script/src/features/wallet/repository.js +136 -0
  263. package/script/src/models/contact/derivatives/contact.d.ts +168 -0
  264. package/script/src/models/contact/derivatives/contact.d.ts.map +1 -0
  265. package/script/src/models/contact/derivatives/contact.js +264 -0
  266. package/script/src/models/contact/derivatives/contact.test.d.ts.map +1 -0
  267. package/script/src/models/contact/derivatives/contact_info.d.ts +188 -0
  268. package/script/src/models/contact/derivatives/contact_info.d.ts.map +1 -0
  269. package/script/src/models/contact/derivatives/contact_info.js +260 -0
  270. package/script/src/models/contact/derivatives/contact_info.test.d.ts.map +1 -0
  271. package/script/src/models/contact/index.d.ts +5 -0
  272. package/script/src/models/contact/index.d.ts.map +1 -0
  273. package/script/src/models/contact/index.js +20 -0
  274. package/script/src/models/contact/schemas.d.ts +66 -0
  275. package/script/src/models/contact/schemas.d.ts.map +1 -0
  276. package/script/src/models/contact/schemas.js +67 -0
  277. package/script/src/models/contact/validation.d.ts +37 -0
  278. package/script/src/models/contact/validation.d.ts.map +1 -0
  279. package/script/src/models/contact/validation.js +146 -0
  280. package/script/src/models/contact/validation.test.d.ts.map +1 -0
  281. package/script/src/models/index.d.ts +6 -0
  282. package/script/src/models/index.d.ts.map +1 -0
  283. package/script/src/models/index.js +21 -0
  284. package/script/src/models/payout/api.d.ts +29 -0
  285. package/script/src/models/payout/api.d.ts.map +1 -0
  286. package/script/src/models/payout/api.js +2 -0
  287. package/script/src/models/payout/channel.d.ts +58 -0
  288. package/script/src/models/payout/channel.d.ts.map +1 -0
  289. package/script/src/models/payout/channel.js +49 -0
  290. package/script/src/models/payout/derivatives/payout.d.ts +156 -0
  291. package/script/src/models/payout/derivatives/payout.d.ts.map +1 -0
  292. package/script/src/models/payout/derivatives/payout.js +265 -0
  293. package/script/src/models/payout/derivatives/payout.test.d.ts.map +1 -0
  294. package/script/src/models/payout/index.d.ts +6 -0
  295. package/script/src/models/payout/index.d.ts.map +1 -0
  296. package/script/src/models/payout/index.js +21 -0
  297. package/script/src/models/payout/schemas.d.ts +154 -0
  298. package/script/src/models/payout/schemas.d.ts.map +1 -0
  299. package/script/src/models/payout/schemas.js +106 -0
  300. package/script/src/models/payout/status.d.ts +31 -0
  301. package/script/src/models/payout/status.d.ts.map +1 -0
  302. package/script/src/models/payout/status.js +35 -0
  303. package/script/src/models/permission.d.ts +42 -0
  304. package/script/src/models/permission.d.ts.map +1 -0
  305. package/script/src/models/permission.js +40 -0
  306. package/script/src/models/user/index.d.ts +3 -0
  307. package/script/src/models/user/index.d.ts.map +1 -0
  308. package/script/src/models/user/index.js +18 -0
  309. package/script/src/models/user/profile.d.ts +38 -0
  310. package/script/src/models/user/profile.d.ts.map +1 -0
  311. package/script/src/models/user/profile.js +28 -0
  312. package/script/src/models/user/user.d.ts +80 -0
  313. package/script/src/models/user/user.d.ts.map +1 -0
  314. package/script/src/models/user/user.js +153 -0
  315. package/script/src/models/wallet/guards.d.ts +11 -0
  316. package/script/src/models/wallet/guards.d.ts.map +1 -0
  317. package/script/src/models/wallet/guards.js +17 -0
  318. package/script/src/models/wallet/index.d.ts +4 -0
  319. package/script/src/models/wallet/index.d.ts.map +1 -0
  320. package/script/src/models/wallet/index.js +19 -0
  321. package/script/src/models/wallet/schemas.d.ts +50 -0
  322. package/script/src/models/wallet/schemas.d.ts.map +1 -0
  323. package/script/src/models/wallet/schemas.js +67 -0
  324. package/script/src/models/wallet/statement.d.ts +27 -0
  325. package/script/src/models/wallet/statement.d.ts.map +1 -0
  326. package/script/src/models/wallet/statement.js +16 -0
  327. package/script/src/shared/base_repository.d.ts +56 -0
  328. package/script/src/shared/base_repository.d.ts.map +1 -0
  329. package/script/src/shared/base_repository.js +99 -0
  330. package/script/src/shared/common_responses.d.ts +13 -0
  331. package/script/src/shared/common_responses.d.ts.map +1 -0
  332. package/script/src/shared/common_responses.js +13 -0
  333. package/script/src/shared/index.d.ts +3 -0
  334. package/script/src/shared/index.d.ts.map +1 -0
  335. package/script/src/shared/index.js +18 -0
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.contract = exports.DEFAULT_ORDER_BY_DESC = exports.DEFAULT_PAYOUT_API_EAGER = void 0;
4
+ const index_js_1 = require("../../models/payout/index.js");
5
+ const api_error_js_1 = require("../../errors/api_error.js");
6
+ const core_1 = require("@ts-rest/core");
7
+ const zod_1 = require("zod");
8
+ /** Default eager loading settings for payout API */
9
+ exports.DEFAULT_PAYOUT_API_EAGER = "[createdBy,actionedBy]";
10
+ /** Default sort order for payout listings */
11
+ exports.DEFAULT_ORDER_BY_DESC = "createdAt";
12
+ /**
13
+ * Payout management API contract
14
+ * Defines endpoints for creating and managing payouts
15
+ *
16
+ * @property {Object} getPayouts - List payouts with filtering (GET /)
17
+ * @property {Object} getPayoutsByApprovalStatus - List payouts by approval status (GET /)
18
+ * @property {Object} postPayout - Create new payout (POST /)
19
+ * @property {Object} approve - Approve/reject payout (POST /:id/approve)
20
+ */
21
+ exports.contract = (0, core_1.initContract)().router({
22
+ getPayouts: {
23
+ method: "GET",
24
+ path: "",
25
+ query: zod_1.z.object({
26
+ rangeStart: zod_1.z.number(),
27
+ rangeEnd: zod_1.z.number(),
28
+ eager: zod_1.z.string(),
29
+ approvalStatus: index_js_1.PayoutSchemas.payoutApprovalStatus.nullable().optional(),
30
+ orderByDesc: zod_1.z.string(),
31
+ }),
32
+ responses: {
33
+ 200: zod_1.z.object({
34
+ results: zod_1.z.array(index_js_1.PayoutSchemas.payoutData),
35
+ total: zod_1.z.number(),
36
+ }),
37
+ },
38
+ },
39
+ getPayoutsByApprovalStatus: {
40
+ method: "GET",
41
+ path: "",
42
+ query: zod_1.z.object({
43
+ rangeStart: zod_1.z.number(),
44
+ rangeEnd: zod_1.z.number(),
45
+ eager: zod_1.z.string(),
46
+ approvalStatus: index_js_1.PayoutSchemas.payoutApprovalStatus,
47
+ orderByDesc: zod_1.z.string(),
48
+ }),
49
+ responses: {
50
+ 200: zod_1.z.object({
51
+ results: zod_1.z.array(index_js_1.PayoutSchemas.payoutData),
52
+ total: zod_1.z.number(),
53
+ }),
54
+ },
55
+ },
56
+ postPayout: {
57
+ method: "POST",
58
+ path: "",
59
+ body: index_js_1.PayoutSchemas.payoutInput,
60
+ responses: {
61
+ 201: index_js_1.PayoutSchemas.payoutData,
62
+ 400: api_error_js_1.APIError.schema,
63
+ },
64
+ },
65
+ approve: {
66
+ method: "POST",
67
+ path: "/:id/approve",
68
+ body: zod_1.z.object({
69
+ action: zod_1.z.enum(["Approve", "Reject"]),
70
+ notes: zod_1.z.string().optional(),
71
+ }),
72
+ responses: {
73
+ 201: index_js_1.PayoutSchemas.payoutData,
74
+ 404: zod_1.z.object({}),
75
+ 409: zod_1.z.object({}),
76
+ },
77
+ },
78
+ });
@@ -0,0 +1,2 @@
1
+ export * from "./repository.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/features/payout/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./repository.js"), exports);
@@ -0,0 +1,62 @@
1
+ import { BaseRepository } from "../../shared/index.js";
2
+ import { type PayoutAPI } from "./contract.js";
3
+ import { type GetPayoutsAPIArgs, type PayoutInput } from "../../models/payout/index.js";
4
+ import { Payout } from "../../models/payout/derivatives/payout.js";
5
+ /**
6
+ * Repository class for managing payout operations including creation, approval,
7
+ * rejection, and retrieval of payouts.
8
+ * @extends {BaseRepository<PayoutAPI>}
9
+ */
10
+ export declare class PayoutRepository extends BaseRepository<PayoutAPI> {
11
+ /**
12
+ * Creates an instance of PayoutRepository initialized with the payout contract.
13
+ */
14
+ constructor();
15
+ /**
16
+ * Retrieves a paginated list of payouts with optional filtering for pending status.
17
+ * @param {GetPayoutsAPIArgs} [args] - Optional arguments for filtering and pagination
18
+ * @param {number} [args.rangeStart=0] - Starting index for pagination
19
+ * @param {number} [args.rangeEnd=10] - Ending index for pagination
20
+ * @param {boolean} [args.pending] - Filter for pending payouts only
21
+ * @throws {PermissionError} If user lacks the Payout.List permission
22
+ * @throws {APIError} If range is invalid or if the fetch operation fails
23
+ * @returns {Promise<{results: Payout[]; total: number}>} Paginated payout results and total count
24
+ */
25
+ getAll(args?: GetPayoutsAPIArgs): Promise<{
26
+ results: Payout[];
27
+ total: number;
28
+ }>;
29
+ /**
30
+ * Creates a new payout with the provided input data.
31
+ * @param {PayoutInput} input - The payout creation data
32
+ * @throws {PermissionError} If user lacks the Payout.Create permission
33
+ * @throws {APIError} If the input is invalid or if the creation operation fails
34
+ * @returns {Promise<Payout>} The created payout
35
+ */
36
+ pay(input: PayoutInput): Promise<Payout>;
37
+ /**
38
+ * Approves a payout with optional notes.
39
+ * @param {string} id - The ID of the payout to approve
40
+ * @param {Object} [args] - Optional arguments
41
+ * @param {string} [args.notes] - Optional notes for the approval
42
+ * @throws {PermissionError} If user lacks the Payout.Approve permission
43
+ * @throws {APIError} If payout is not found, already approved, or if the operation fails
44
+ * @returns {Promise<Payout>} The approved payout
45
+ */
46
+ approve(id: string, args?: {
47
+ notes?: string;
48
+ }): Promise<Payout>;
49
+ /**
50
+ * Rejects a payout with optional notes.
51
+ * @param {string} id - The ID of the payout to reject
52
+ * @param {Object} [args] - Optional arguments
53
+ * @param {string} [args.notes] - Optional notes for the rejection
54
+ * @throws {PermissionError} If user lacks the Payout.Approve permission
55
+ * @throws {APIError} If payout is not found, already rejected, or if the operation fails
56
+ * @returns {Promise<Payout>} The rejected payout
57
+ */
58
+ reject(id: string, args?: {
59
+ notes?: string;
60
+ }): Promise<Payout>;
61
+ }
62
+ //# sourceMappingURL=repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../../../src/src/features/payout/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EACL,KAAK,iBAAiB,EAEtB,KAAK,WAAW,EACjB,MAAM,8BAA8B,CAAC;AAItC,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAEnE;;;;GAIG;AACH,qBAAa,gBAAiB,SAAQ,cAAc,CAAC,SAAS,CAAC;IAC7D;;OAEG;;IAKH;;;;;;;;;OASG;IACG,MAAM,CAAC,IAAI,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC;QAC9C,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IA2CF;;;;;;OAMG;IACG,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC;IAkB9C;;;;;;;;OAQG;IACG,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IA8BrE;;;;;;;;OAQG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC;CA6BrE"}
@@ -0,0 +1,162 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PayoutRepository = void 0;
4
+ const index_js_1 = require("../../shared/index.js");
5
+ const contract_js_1 = require("./contract.js");
6
+ const index_js_2 = require("../../models/payout/index.js");
7
+ const manager_js_1 = require("../auth/manager.js");
8
+ const permission_js_1 = require("../../models/permission.js");
9
+ const index_js_3 = require("../../errors/index.js");
10
+ const payout_js_1 = require("../../models/payout/derivatives/payout.js");
11
+ /**
12
+ * Repository class for managing payout operations including creation, approval,
13
+ * rejection, and retrieval of payouts.
14
+ * @extends {BaseRepository<PayoutAPI>}
15
+ */
16
+ class PayoutRepository extends index_js_1.BaseRepository {
17
+ /**
18
+ * Creates an instance of PayoutRepository initialized with the payout contract.
19
+ */
20
+ constructor() {
21
+ super("payout", contract_js_1.contract);
22
+ }
23
+ /**
24
+ * Retrieves a paginated list of payouts with optional filtering for pending status.
25
+ * @param {GetPayoutsAPIArgs} [args] - Optional arguments for filtering and pagination
26
+ * @param {number} [args.rangeStart=0] - Starting index for pagination
27
+ * @param {number} [args.rangeEnd=10] - Ending index for pagination
28
+ * @param {boolean} [args.pending] - Filter for pending payouts only
29
+ * @throws {PermissionError} If user lacks the Payout.List permission
30
+ * @throws {APIError} If range is invalid or if the fetch operation fails
31
+ * @returns {Promise<{results: Payout[]; total: number}>} Paginated payout results and total count
32
+ */
33
+ async getAll(args) {
34
+ const requiredPerm = permission_js_1.Permissions.Payout.List;
35
+ if (!manager_js_1.AfloatAuth.instance.checkPermission(requiredPerm)) {
36
+ throw new index_js_3.PermissionError({
37
+ message: "You are not authorized to view payouts.",
38
+ requiredPermissions: [requiredPerm],
39
+ });
40
+ }
41
+ const rangeStart = args?.rangeStart ?? 0;
42
+ const rangeEnd = args?.rangeEnd ?? 10;
43
+ const pendingStatus = index_js_2.PAYOUT_APPROVAL_STATUS.PENDING;
44
+ const query = {
45
+ rangeStart,
46
+ rangeEnd,
47
+ eager: "[createdBy,actionedBy]",
48
+ orderByDesc: "createdAt",
49
+ };
50
+ if (args?.pending) {
51
+ Object.assign(query, { approvalStatus: pendingStatus });
52
+ }
53
+ if (rangeEnd <= rangeStart) {
54
+ throw new index_js_3.APIError({
55
+ message: "Invalid range: end-date must be greater than start-date",
56
+ statusCode: 400,
57
+ });
58
+ }
59
+ const result = await this.client.getPayouts({ query: query });
60
+ if (result.status === 200) {
61
+ return {
62
+ results: payout_js_1.Payout.createMany(result.body.results),
63
+ total: result.body.total,
64
+ };
65
+ }
66
+ throw index_js_3.APIError.unknown("An error occured while fetching payouts");
67
+ }
68
+ /**
69
+ * Creates a new payout with the provided input data.
70
+ * @param {PayoutInput} input - The payout creation data
71
+ * @throws {PermissionError} If user lacks the Payout.Create permission
72
+ * @throws {APIError} If the input is invalid or if the creation operation fails
73
+ * @returns {Promise<Payout>} The created payout
74
+ */
75
+ async pay(input) {
76
+ const requiredPerm = permission_js_1.Permissions.Payout.Create;
77
+ if (!manager_js_1.AfloatAuth.instance.checkPermission(permission_js_1.Permissions.Payout.Create)) {
78
+ throw new index_js_3.PermissionError({
79
+ message: "You are not authorized to create payouts.",
80
+ requiredPermissions: [requiredPerm],
81
+ });
82
+ }
83
+ const result = await this.client.postPayout({ body: input });
84
+ if (result.status === 201)
85
+ return payout_js_1.Payout.create(result.body);
86
+ if (result.status === 400) {
87
+ throw new index_js_3.APIError(result.body);
88
+ }
89
+ throw index_js_3.APIError.unknown();
90
+ }
91
+ /**
92
+ * Approves a payout with optional notes.
93
+ * @param {string} id - The ID of the payout to approve
94
+ * @param {Object} [args] - Optional arguments
95
+ * @param {string} [args.notes] - Optional notes for the approval
96
+ * @throws {PermissionError} If user lacks the Payout.Approve permission
97
+ * @throws {APIError} If payout is not found, already approved, or if the operation fails
98
+ * @returns {Promise<Payout>} The approved payout
99
+ */
100
+ async approve(id, args) {
101
+ const requiredPerm = permission_js_1.Permissions.Payout.Approve;
102
+ if (!manager_js_1.AfloatAuth.instance.checkPermission(requiredPerm)) {
103
+ throw new index_js_3.PermissionError({
104
+ message: "You are not authorized to approve or reject payouts.",
105
+ requiredPermissions: [requiredPerm],
106
+ });
107
+ }
108
+ const result = await this.client.approve({
109
+ params: { id },
110
+ body: { action: "Approve", notes: args?.notes },
111
+ });
112
+ if (result.status === 201) {
113
+ return payout_js_1.Payout.create(result.body);
114
+ }
115
+ if (result.status === 404) {
116
+ throw new index_js_3.APIError({ message: "Payout not found", statusCode: 404 });
117
+ }
118
+ if (result.status === 409) {
119
+ throw new index_js_3.APIError({
120
+ message: "Payout already approved",
121
+ statusCode: 409,
122
+ });
123
+ }
124
+ throw index_js_3.APIError.unknown();
125
+ }
126
+ /**
127
+ * Rejects a payout with optional notes.
128
+ * @param {string} id - The ID of the payout to reject
129
+ * @param {Object} [args] - Optional arguments
130
+ * @param {string} [args.notes] - Optional notes for the rejection
131
+ * @throws {PermissionError} If user lacks the Payout.Approve permission
132
+ * @throws {APIError} If payout is not found, already rejected, or if the operation fails
133
+ * @returns {Promise<Payout>} The rejected payout
134
+ */
135
+ async reject(id, args) {
136
+ const requiredPerm = permission_js_1.Permissions.Payout.Approve;
137
+ if (!manager_js_1.AfloatAuth.instance.checkPermission(requiredPerm)) {
138
+ throw new index_js_3.PermissionError({
139
+ message: "You are not authorized to approve or reject payouts.",
140
+ requiredPermissions: [requiredPerm],
141
+ });
142
+ }
143
+ const result = await this.client.approve({
144
+ params: { id },
145
+ body: { action: "Reject", notes: args?.notes },
146
+ });
147
+ if (result.status === 201) {
148
+ return payout_js_1.Payout.create(result.body);
149
+ }
150
+ if (result.status === 404) {
151
+ throw new index_js_3.APIError({ message: "Payout not found", statusCode: 404 });
152
+ }
153
+ if (result.status === 409) {
154
+ throw new index_js_3.APIError({
155
+ message: "Payout already rejected",
156
+ statusCode: 409,
157
+ });
158
+ }
159
+ throw index_js_3.APIError.unknown();
160
+ }
161
+ }
162
+ exports.PayoutRepository = PayoutRepository;
@@ -0,0 +1,103 @@
1
+ import { z } from "zod";
2
+ export declare const contract: {
3
+ getWallets: {
4
+ method: "GET";
5
+ path: "/";
6
+ responses: {
7
+ 200: z.ZodArray<z.ZodObject<{
8
+ id: z.ZodString;
9
+ profileId: z.ZodString;
10
+ accountNo: z.ZodString;
11
+ accountName: z.ZodString;
12
+ channel: z.ZodString;
13
+ createdAt: z.ZodString;
14
+ updatedAt: z.ZodString;
15
+ }, z.UnknownKeysParam, z.ZodTypeAny, {
16
+ id: string;
17
+ accountNo: string;
18
+ channel: string;
19
+ profileId: string;
20
+ createdAt: string;
21
+ updatedAt: string;
22
+ accountName: string;
23
+ }, {
24
+ id: string;
25
+ accountNo: string;
26
+ channel: string;
27
+ profileId: string;
28
+ createdAt: string;
29
+ updatedAt: string;
30
+ accountName: string;
31
+ }>, "many">;
32
+ };
33
+ };
34
+ getBalance: {
35
+ method: "POST";
36
+ body: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
37
+ path: "/balance";
38
+ responses: {
39
+ 201: z.ZodObject<{
40
+ availableBalance: z.ZodNumber;
41
+ }, "strip", z.ZodTypeAny, {
42
+ availableBalance: number;
43
+ }, {
44
+ availableBalance: number;
45
+ }>;
46
+ };
47
+ };
48
+ getStatement: {
49
+ summary: "Get Wallet Statement";
50
+ method: "POST";
51
+ body: z.ZodObject<{
52
+ endDate: z.ZodDate;
53
+ startDate: z.ZodDate;
54
+ accountNo: z.ZodOptional<z.ZodString>;
55
+ }, "strip", z.ZodTypeAny, {
56
+ endDate: Date;
57
+ startDate: Date;
58
+ accountNo?: string | undefined;
59
+ }, {
60
+ endDate: Date;
61
+ startDate: Date;
62
+ accountNo?: string | undefined;
63
+ }>;
64
+ path: "/statement";
65
+ responses: {
66
+ 201: z.ZodArray<z.ZodObject<{
67
+ accountNo: z.ZodEffects<z.ZodOptional<z.ZodString>>;
68
+ cbaRefNo: z.ZodEffects<z.ZodOptional<z.ZodString>>;
69
+ debitOrCredit: z.ZodString;
70
+ tranRefNo: z.ZodString;
71
+ narration: z.ZodString;
72
+ txnDate: z.ZodDate;
73
+ valueDate: z.ZodDate;
74
+ amountCredited: z.ZodNumber;
75
+ amountDebited: z.ZodNumber;
76
+ balance: z.ZodNumber;
77
+ }, z.UnknownKeysParam, z.ZodTypeAny, {
78
+ debitOrCredit: string;
79
+ tranRefNo: string;
80
+ narration: string;
81
+ txnDate: Date;
82
+ valueDate: Date;
83
+ amountCredited: number;
84
+ amountDebited: number;
85
+ balance: number;
86
+ accountNo?: string | undefined;
87
+ cbaRefNo?: string | undefined;
88
+ }, {
89
+ debitOrCredit: string;
90
+ tranRefNo: string;
91
+ narration: string;
92
+ txnDate: Date;
93
+ valueDate: Date;
94
+ amountCredited: number;
95
+ amountDebited: number;
96
+ balance: number;
97
+ accountNo?: string | undefined;
98
+ cbaRefNo?: string | undefined;
99
+ }>, "many">;
100
+ };
101
+ };
102
+ };
103
+ //# sourceMappingURL=contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../../src/src/features/wallet/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BnB,CAAC"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.contract = void 0;
4
+ const zod_1 = require("zod");
5
+ const core_1 = require("@ts-rest/core");
6
+ const index_js_1 = require("../../models/wallet/index.js");
7
+ exports.contract = (0, core_1.initContract)().router({
8
+ getWallets: {
9
+ method: "GET",
10
+ path: "/",
11
+ responses: {
12
+ 200: zod_1.z.array(index_js_1.WalletSchemas.wallet),
13
+ },
14
+ },
15
+ getBalance: {
16
+ method: "POST",
17
+ path: "/balance",
18
+ body: zod_1.z.object({}),
19
+ responses: {
20
+ 201: zod_1.z.object({
21
+ availableBalance: zod_1.z.number(),
22
+ }),
23
+ },
24
+ },
25
+ getStatement: {
26
+ method: "POST",
27
+ path: "/statement",
28
+ summary: "Get Wallet Statement",
29
+ body: zod_1.z.object({
30
+ endDate: zod_1.z.date(),
31
+ startDate: zod_1.z.date(),
32
+ accountNo: zod_1.z.string().optional(),
33
+ }),
34
+ responses: {
35
+ 201: zod_1.z.array(index_js_1.WalletSchemas.statementEntry),
36
+ },
37
+ },
38
+ });
@@ -0,0 +1,2 @@
1
+ export * from "./repository.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/features/wallet/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./repository.js"), exports);
@@ -0,0 +1,74 @@
1
+ import { BaseRepository } from "../../shared/base_repository.js";
2
+ import { contract } from "./contract.js";
3
+ import type { STATEMENT_OUTPUT_TYPE, StatementFile, Wallet, WalletStatementItem } from "../../models/wallet/index.js";
4
+ /**
5
+ * Repository class for managing wallet operations including balance checking,
6
+ * statement generation, and wallet information retrieval.
7
+ * @extends {BaseRepository<typeof contract>}
8
+ */
9
+ export declare class WalletRepo extends BaseRepository<typeof contract> {
10
+ /**
11
+ * Creates an instance of WalletRepo initialized with the wallet contract.
12
+ */
13
+ constructor();
14
+ /**
15
+ * Gets an instance of the file generation repository.
16
+ * @private
17
+ * @returns {AfloatFilesRepo} A new instance of AfloatFilesRepo
18
+ */
19
+ private get fileGenRepo();
20
+ /**
21
+ * Retrieves the current available balance for the wallet.
22
+ * @throws {PermissionError} If user lacks the ViewBalance permission
23
+ * @throws {Error} If the balance fetch operation fails
24
+ * @returns {Promise<number>} The available balance amount
25
+ */
26
+ getBalance(): Promise<number>;
27
+ /**
28
+ * Retrieves all wallets associated with the current context.
29
+ * @throws {Error} If the wallet fetch operation fails
30
+ * @returns {Promise<Wallet[]>} Array of wallet objects
31
+ */
32
+ getWallets(): Promise<Wallet[]>;
33
+ /**
34
+ * Retrieves wallet statement items for a specified date range and account.
35
+ * If no range is provided, defaults to the current month (1st to 30th).
36
+ * @param {Object} props - The statement request properties
37
+ * @param {Object} [props.range] - Optional date range for the statement
38
+ * @param {Date} props.range.startDate - Start date for the statement period
39
+ * @param {Date} props.range.endDate - End date for the statement period
40
+ * @param {string} [props.accountNo] - Optional account number to fetch statement for
41
+ * @throws {PermissionError} If user lacks the ViewStatement permission
42
+ * @throws {Error} If the statement fetch operation fails
43
+ * @returns {Promise<WalletStatementItem[]>} Array of statement items for the specified period
44
+ */
45
+ getStatement(props: {
46
+ range?: {
47
+ startDate: Date;
48
+ endDate: Date;
49
+ };
50
+ accountNo?: string;
51
+ }): Promise<WalletStatementItem[]>;
52
+ /**
53
+ * Generates a statement file for the specified period and account.
54
+ * @param {STATEMENT_OUTPUT_TYPE} fileType - The desired output format type for the statement
55
+ * @param {Object} props - The statement generation properties
56
+ * @param {Date} props.startDate - Start date for the statement period
57
+ * @param {Date} props.endDate - End date for the statement period
58
+ * @param {string} [props.accountNo] - Optional account number to generate statement for
59
+ * @throws {PermissionError} If user lacks the ViewStatement permission
60
+ * @returns {Promise<StatementFile>} The generated statement file
61
+ */
62
+ genStatement(fileType: STATEMENT_OUTPUT_TYPE, props: {
63
+ startDate: Date;
64
+ endDate: Date;
65
+ accountNo?: string;
66
+ }): Promise<StatementFile>;
67
+ /**
68
+ * Generates a PDF containing detailed wallet account information.
69
+ * @throws {PermissionError} If user lacks the ViewBalance permission
70
+ * @returns {Promise<StatementFile>} The generated PDF file containing wallet details
71
+ */
72
+ genWalletDetailsPDF(): Promise<StatementFile>;
73
+ }
74
+ //# sourceMappingURL=repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../../../src/src/features/wallet/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,EACV,qBAAqB,EACrB,aAAa,EACb,MAAM,EACN,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAMtC;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,cAAc,CAAC,OAAO,QAAQ,CAAC;IAC7D;;OAEG;;IAKH;;;;OAIG;IACH,OAAO,KAAK,WAAW,GAEtB;IAED;;;;;OAKG;IACG,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IAkBnC;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAUrC;;;;;;;;;;;OAWG;IACG,YAAY,CAChB,KAAK,EAAE;QACL,KAAK,CAAC,EAAE;YAAE,SAAS,EAAE,IAAI,CAAC;YAAC,OAAO,EAAE,IAAI,CAAA;SAAE,CAAC;QAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GACA,OAAO,CAAC,mBAAmB,EAAE,CAAC;IA0BjC;;;;;;;;;OASG;IACG,YAAY,CAChB,QAAQ,EAAE,qBAAqB,EAC/B,KAAK,EAAE;QACL,SAAS,EAAE,IAAI,CAAC;QAChB,OAAO,EAAE,IAAI,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GACA,OAAO,CAAC,aAAa,CAAC;IAiBzB;;;;OAIG;IACG,mBAAmB,IAAI,OAAO,CAAC,aAAa,CAAC;CAWpD"}