@temboplus/afloat 0.1.81 → 0.2.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (413) hide show
  1. package/README.md +246 -42
  2. package/dist/index.cjs.js +2 -0
  3. package/dist/index.cjs.js.map +1 -0
  4. package/dist/index.d.ts +10 -0
  5. package/dist/index.esm.js +2 -0
  6. package/dist/index.esm.js.map +1 -0
  7. package/dist/lib/api/base-repository.d.ts +177 -0
  8. package/dist/lib/api/index.d.ts +1 -0
  9. package/{esm/src/errors/api_error.d.ts → dist/lib/error/error.api.d.ts} +0 -1
  10. package/{script/npm/src/src/errors/permission_error.d.ts → dist/lib/error/error.permission.d.ts} +1 -2
  11. package/dist/lib/error/error.utils.d.ts +22 -0
  12. package/dist/lib/error/index.d.ts +3 -0
  13. package/dist/lib/query/index.d.ts +4 -0
  14. package/dist/lib/query/pagination/pagination.d.ts +73 -0
  15. package/dist/lib/query/pagination/pagination.schemas.d.ts +83 -0
  16. package/dist/lib/query/query.builder.d.ts +75 -0
  17. package/dist/lib/query/query.types.d.ts +36 -0
  18. package/{esm/src/features/auth/contract.d.ts → dist/modules/auth/auth.contract.d.ts} +16 -19
  19. package/dist/modules/auth/auth.repository.d.ts +83 -0
  20. package/dist/modules/auth/company-membership.model.d.ts +171 -0
  21. package/dist/modules/auth/index.d.ts +3 -0
  22. package/dist/modules/auth/user.model.d.ts +363 -0
  23. package/dist/modules/beneficiary/beneficiary-info.model.d.ts +178 -0
  24. package/dist/modules/beneficiary/beneficiary-input-handler.d.ts +16 -0
  25. package/dist/modules/beneficiary/beneficiary.api-contract.d.ts +203 -0
  26. package/dist/modules/beneficiary/beneficiary.dtos.d.ts +84 -0
  27. package/dist/modules/beneficiary/beneficiary.model.d.ts +441 -0
  28. package/dist/modules/beneficiary/beneficiary.repository.d.ts +116 -0
  29. package/dist/modules/beneficiary/index.d.ts +6 -0
  30. package/dist/modules/login/index.d.ts +4 -0
  31. package/dist/modules/login/login.api-contract.d.ts +51 -0
  32. package/dist/modules/login/login.dtos.d.ts +85 -0
  33. package/dist/modules/login/login.model.d.ts +168 -0
  34. package/dist/modules/login/login.repository.d.ts +58 -0
  35. package/{esm/src/models/permission.d.ts → dist/modules/login/permission.type.d.ts} +9 -10
  36. package/dist/modules/payout/index.d.ts +5 -0
  37. package/dist/modules/payout/payout-channel-handler.d.ts +82 -0
  38. package/{esm/src/features/payout/contract.d.ts → dist/modules/payout/payout.api-contract.d.ts} +350 -207
  39. package/dist/modules/payout/payout.dtos.d.ts +607 -0
  40. package/dist/modules/payout/payout.model.d.ts +383 -0
  41. package/dist/modules/payout/payout.query.d.ts +134 -0
  42. package/dist/modules/payout/payout.repository.d.ts +204 -0
  43. package/dist/modules/profile/index.d.ts +3 -0
  44. package/{script/npm/src/src/features/auth/profile/contract.d.ts → dist/modules/profile/profile.api-contract.d.ts} +8 -6
  45. package/dist/modules/profile/profile.dtos.d.ts +80 -0
  46. package/{script/npm/src/src/models/user/profile.d.ts → dist/modules/profile/profile.model.d.ts} +81 -52
  47. package/dist/modules/profile/profile.repository.d.ts +56 -0
  48. package/dist/modules/team-member/index.d.ts +4 -0
  49. package/dist/modules/team-member/role.model.d.ts +61 -0
  50. package/{esm/src/features/admin/contract.d.ts → dist/modules/team-member/team-member.contract.d.ts} +229 -154
  51. package/dist/modules/team-member/team-member.dtos.d.ts +261 -0
  52. package/dist/modules/team-member/team-member.model.d.ts +237 -0
  53. package/dist/modules/team-member/team-member.repository.d.ts +179 -0
  54. package/dist/modules/wallet/index.d.ts +6 -0
  55. package/dist/modules/wallet/narration.model.d.ts +225 -0
  56. package/dist/modules/wallet/statement-entry.model.d.ts +299 -0
  57. package/{script/npm/src/src/features/wallet/contract.d.ts → dist/modules/wallet/wallet.contract.d.ts} +17 -15
  58. package/dist/modules/wallet/wallet.dtos.d.ts +204 -0
  59. package/{esm/src/models/wallet/wallet.d.ts → dist/modules/wallet/wallet.model.d.ts} +34 -40
  60. package/dist/modules/wallet/wallet.query.d.ts +95 -0
  61. package/dist/modules/wallet/wallet.repository.d.ts +205 -0
  62. package/dist/modules/wallet/wallet.utils.d.ts +17 -0
  63. package/package.json +49 -23
  64. package/LICENSE +0 -7
  65. package/esm/mod.d.ts +0 -8
  66. package/esm/mod.d.ts.map +0 -1
  67. package/esm/mod.js +0 -7
  68. package/esm/package.json +0 -3
  69. package/esm/src/errors/api_error.d.ts.map +0 -1
  70. package/esm/src/errors/api_error.js +0 -90
  71. package/esm/src/errors/index.d.ts +0 -3
  72. package/esm/src/errors/index.d.ts.map +0 -1
  73. package/esm/src/errors/index.js +0 -2
  74. package/esm/src/errors/permission_error.d.ts +0 -48
  75. package/esm/src/errors/permission_error.d.ts.map +0 -1
  76. package/esm/src/errors/permission_error.js +0 -70
  77. package/esm/src/features/admin/contract.d.ts.map +0 -1
  78. package/esm/src/features/admin/contract.js +0 -210
  79. package/esm/src/features/admin/index.d.ts +0 -4
  80. package/esm/src/features/admin/index.d.ts.map +0 -1
  81. package/esm/src/features/admin/index.js +0 -3
  82. package/esm/src/features/admin/repository.d.ts +0 -114
  83. package/esm/src/features/admin/repository.d.ts.map +0 -1
  84. package/esm/src/features/admin/repository.js +0 -248
  85. package/esm/src/features/admin/schemas.d.ts +0 -146
  86. package/esm/src/features/admin/schemas.d.ts.map +0 -1
  87. package/esm/src/features/admin/schemas.js +0 -206
  88. package/esm/src/features/auth/access/contract.d.ts +0 -14
  89. package/esm/src/features/auth/access/contract.d.ts.map +0 -1
  90. package/esm/src/features/auth/access/contract.js +0 -14
  91. package/esm/src/features/auth/access/repository.d.ts +0 -11
  92. package/esm/src/features/auth/access/repository.d.ts.map +0 -1
  93. package/esm/src/features/auth/access/repository.js +0 -25
  94. package/esm/src/features/auth/contract.d.ts.map +0 -1
  95. package/esm/src/features/auth/contract.js +0 -43
  96. package/esm/src/features/auth/identity/contract.d.ts +0 -23
  97. package/esm/src/features/auth/identity/contract.d.ts.map +0 -1
  98. package/esm/src/features/auth/identity/contract.js +0 -17
  99. package/esm/src/features/auth/identity/repository.d.ts +0 -22
  100. package/esm/src/features/auth/identity/repository.d.ts.map +0 -1
  101. package/esm/src/features/auth/identity/repository.js +0 -30
  102. package/esm/src/features/auth/index.d.ts +0 -6
  103. package/esm/src/features/auth/index.d.ts.map +0 -1
  104. package/esm/src/features/auth/index.js +0 -5
  105. package/esm/src/features/auth/manager.d.ts +0 -105
  106. package/esm/src/features/auth/manager.d.ts.map +0 -1
  107. package/esm/src/features/auth/manager.js +0 -181
  108. package/esm/src/features/auth/profile/contract.d.ts +0 -37
  109. package/esm/src/features/auth/profile/contract.d.ts.map +0 -1
  110. package/esm/src/features/auth/profile/contract.js +0 -14
  111. package/esm/src/features/auth/profile/repository.d.ts +0 -11
  112. package/esm/src/features/auth/profile/repository.d.ts.map +0 -1
  113. package/esm/src/features/auth/profile/repository.js +0 -25
  114. package/esm/src/features/auth/repository.d.ts +0 -30
  115. package/esm/src/features/auth/repository.d.ts.map +0 -1
  116. package/esm/src/features/auth/repository.js +0 -69
  117. package/esm/src/features/auth/storage/client_store.d.ts +0 -30
  118. package/esm/src/features/auth/storage/client_store.d.ts.map +0 -1
  119. package/esm/src/features/auth/storage/client_store.js +0 -46
  120. package/esm/src/features/auth/storage/client_token_handler.d.ts +0 -32
  121. package/esm/src/features/auth/storage/client_token_handler.d.ts.map +0 -1
  122. package/esm/src/features/auth/storage/client_token_handler.js +0 -36
  123. package/esm/src/features/auth/storage/server_store.d.ts +0 -24
  124. package/esm/src/features/auth/storage/server_store.d.ts.map +0 -1
  125. package/esm/src/features/auth/storage/server_store.js +0 -34
  126. package/esm/src/features/auth/storage/server_token_handler.d.ts +0 -36
  127. package/esm/src/features/auth/storage/server_token_handler.d.ts.map +0 -1
  128. package/esm/src/features/auth/storage/server_token_handler.js +0 -115
  129. package/esm/src/features/auth/storage/types.d.ts +0 -42
  130. package/esm/src/features/auth/storage/types.d.ts.map +0 -1
  131. package/esm/src/features/auth/storage/types.js +0 -1
  132. package/esm/src/features/contact/contract.d.ts +0 -170
  133. package/esm/src/features/contact/contract.d.ts.map +0 -1
  134. package/esm/src/features/contact/contract.js +0 -49
  135. package/esm/src/features/contact/index.d.ts +0 -2
  136. package/esm/src/features/contact/index.d.ts.map +0 -1
  137. package/esm/src/features/contact/index.js +0 -1
  138. package/esm/src/features/contact/repository.d.ts +0 -58
  139. package/esm/src/features/contact/repository.d.ts.map +0 -1
  140. package/esm/src/features/contact/repository.js +0 -108
  141. package/esm/src/features/payout/contract.d.ts.map +0 -1
  142. package/esm/src/features/payout/contract.js +0 -75
  143. package/esm/src/features/payout/index.d.ts +0 -2
  144. package/esm/src/features/payout/index.d.ts.map +0 -1
  145. package/esm/src/features/payout/index.js +0 -1
  146. package/esm/src/features/payout/repository.d.ts +0 -67
  147. package/esm/src/features/payout/repository.d.ts.map +0 -1
  148. package/esm/src/features/payout/repository.js +0 -179
  149. package/esm/src/features/wallet/contract.d.ts +0 -137
  150. package/esm/src/features/wallet/contract.d.ts.map +0 -1
  151. package/esm/src/features/wallet/contract.js +0 -38
  152. package/esm/src/features/wallet/index.d.ts +0 -2
  153. package/esm/src/features/wallet/index.d.ts.map +0 -1
  154. package/esm/src/features/wallet/index.js +0 -1
  155. package/esm/src/features/wallet/repository.d.ts +0 -57
  156. package/esm/src/features/wallet/repository.d.ts.map +0 -1
  157. package/esm/src/features/wallet/repository.js +0 -93
  158. package/esm/src/models/contact/derivatives/contact.d.ts +0 -172
  159. package/esm/src/models/contact/derivatives/contact.d.ts.map +0 -1
  160. package/esm/src/models/contact/derivatives/contact.js +0 -266
  161. package/esm/src/models/contact/derivatives/contact_info.d.ts +0 -188
  162. package/esm/src/models/contact/derivatives/contact_info.d.ts.map +0 -1
  163. package/esm/src/models/contact/derivatives/contact_info.js +0 -255
  164. package/esm/src/models/contact/index.d.ts +0 -5
  165. package/esm/src/models/contact/index.d.ts.map +0 -1
  166. package/esm/src/models/contact/index.js +0 -4
  167. package/esm/src/models/contact/schemas.d.ts +0 -66
  168. package/esm/src/models/contact/schemas.d.ts.map +0 -1
  169. package/esm/src/models/contact/schemas.js +0 -64
  170. package/esm/src/models/contact/validation.d.ts +0 -37
  171. package/esm/src/models/contact/validation.d.ts.map +0 -1
  172. package/esm/src/models/contact/validation.js +0 -146
  173. package/esm/src/models/index.d.ts +0 -7
  174. package/esm/src/models/index.d.ts.map +0 -1
  175. package/esm/src/models/index.js +0 -6
  176. package/esm/src/models/payout/api.d.ts +0 -29
  177. package/esm/src/models/payout/api.d.ts.map +0 -1
  178. package/esm/src/models/payout/api.js +0 -1
  179. package/esm/src/models/payout/channel.d.ts +0 -58
  180. package/esm/src/models/payout/channel.d.ts.map +0 -1
  181. package/esm/src/models/payout/channel.js +0 -53
  182. package/esm/src/models/payout/derivatives/payout.d.ts +0 -158
  183. package/esm/src/models/payout/derivatives/payout.d.ts.map +0 -1
  184. package/esm/src/models/payout/derivatives/payout.js +0 -271
  185. package/esm/src/models/payout/index.d.ts +0 -7
  186. package/esm/src/models/payout/index.d.ts.map +0 -1
  187. package/esm/src/models/payout/index.js +0 -6
  188. package/esm/src/models/payout/narration.d.ts +0 -164
  189. package/esm/src/models/payout/narration.d.ts.map +0 -1
  190. package/esm/src/models/payout/narration.js +0 -308
  191. package/esm/src/models/payout/schemas.d.ts +0 -156
  192. package/esm/src/models/payout/schemas.d.ts.map +0 -1
  193. package/esm/src/models/payout/schemas.js +0 -105
  194. package/esm/src/models/payout/status.d.ts +0 -33
  195. package/esm/src/models/payout/status.d.ts.map +0 -1
  196. package/esm/src/models/payout/status.js +0 -34
  197. package/esm/src/models/permission.d.ts.map +0 -1
  198. package/esm/src/models/permission.js +0 -50
  199. package/esm/src/models/role.d.ts +0 -21
  200. package/esm/src/models/role.d.ts.map +0 -1
  201. package/esm/src/models/role.js +0 -73
  202. package/esm/src/models/user/authenticated-user.d.ts +0 -77
  203. package/esm/src/models/user/authenticated-user.d.ts.map +0 -1
  204. package/esm/src/models/user/authenticated-user.js +0 -226
  205. package/esm/src/models/user/index.d.ts +0 -4
  206. package/esm/src/models/user/index.d.ts.map +0 -1
  207. package/esm/src/models/user/index.js +0 -3
  208. package/esm/src/models/user/managed-user.d.ts +0 -108
  209. package/esm/src/models/user/managed-user.d.ts.map +0 -1
  210. package/esm/src/models/user/managed-user.js +0 -255
  211. package/esm/src/models/user/profile.d.ts +0 -161
  212. package/esm/src/models/user/profile.d.ts.map +0 -1
  213. package/esm/src/models/user/profile.js +0 -334
  214. package/esm/src/models/wallet/index.d.ts +0 -4
  215. package/esm/src/models/wallet/index.d.ts.map +0 -1
  216. package/esm/src/models/wallet/index.js +0 -3
  217. package/esm/src/models/wallet/schemas.d.ts +0 -95
  218. package/esm/src/models/wallet/schemas.d.ts.map +0 -1
  219. package/esm/src/models/wallet/schemas.js +0 -35
  220. package/esm/src/models/wallet/statement_entry.d.ts +0 -160
  221. package/esm/src/models/wallet/statement_entry.d.ts.map +0 -1
  222. package/esm/src/models/wallet/statement_entry.js +0 -255
  223. package/esm/src/models/wallet/wallet.d.ts.map +0 -1
  224. package/esm/src/models/wallet/wallet.js +0 -279
  225. package/esm/src/shared/base_repository.d.ts +0 -80
  226. package/esm/src/shared/base_repository.d.ts.map +0 -1
  227. package/esm/src/shared/base_repository.js +0 -153
  228. package/esm/src/shared/common_responses.d.ts +0 -13
  229. package/esm/src/shared/common_responses.d.ts.map +0 -1
  230. package/esm/src/shared/common_responses.js +0 -10
  231. package/esm/src/shared/index.d.ts +0 -3
  232. package/esm/src/shared/index.d.ts.map +0 -1
  233. package/esm/src/shared/index.js +0 -2
  234. package/esm/src/shared/token_required_repository.d.ts +0 -78
  235. package/esm/src/shared/token_required_repository.d.ts.map +0 -1
  236. package/esm/src/shared/token_required_repository.js +0 -128
  237. package/script/mod.d.ts +0 -8
  238. package/script/mod.d.ts.map +0 -1
  239. package/script/mod.js +0 -23
  240. package/script/npm/src/mod.d.ts +0 -8
  241. package/script/npm/src/mod.d.ts.map +0 -1
  242. package/script/npm/src/mod.js +0 -23
  243. package/script/npm/src/src/errors/api_error.d.ts +0 -63
  244. package/script/npm/src/src/errors/api_error.d.ts.map +0 -1
  245. package/script/npm/src/src/errors/api_error.js +0 -94
  246. package/script/npm/src/src/errors/index.d.ts +0 -3
  247. package/script/npm/src/src/errors/index.d.ts.map +0 -1
  248. package/script/npm/src/src/errors/index.js +0 -18
  249. package/script/npm/src/src/errors/permission_error.d.ts.map +0 -1
  250. package/script/npm/src/src/errors/permission_error.js +0 -74
  251. package/script/npm/src/src/features/admin/contract.d.ts +0 -842
  252. package/script/npm/src/src/features/admin/contract.d.ts.map +0 -1
  253. package/script/npm/src/src/features/admin/contract.js +0 -213
  254. package/script/npm/src/src/features/admin/index.d.ts +0 -4
  255. package/script/npm/src/src/features/admin/index.d.ts.map +0 -1
  256. package/script/npm/src/src/features/admin/index.js +0 -19
  257. package/script/npm/src/src/features/admin/repository.d.ts +0 -114
  258. package/script/npm/src/src/features/admin/repository.d.ts.map +0 -1
  259. package/script/npm/src/src/features/admin/repository.js +0 -252
  260. package/script/npm/src/src/features/admin/schemas.d.ts +0 -146
  261. package/script/npm/src/src/features/admin/schemas.d.ts.map +0 -1
  262. package/script/npm/src/src/features/admin/schemas.js +0 -209
  263. package/script/npm/src/src/features/auth/access/contract.d.ts +0 -14
  264. package/script/npm/src/src/features/auth/access/contract.d.ts.map +0 -1
  265. package/script/npm/src/src/features/auth/access/contract.js +0 -17
  266. package/script/npm/src/src/features/auth/access/repository.d.ts +0 -11
  267. package/script/npm/src/src/features/auth/access/repository.d.ts.map +0 -1
  268. package/script/npm/src/src/features/auth/access/repository.js +0 -29
  269. package/script/npm/src/src/features/auth/contract.d.ts +0 -112
  270. package/script/npm/src/src/features/auth/contract.d.ts.map +0 -1
  271. package/script/npm/src/src/features/auth/contract.js +0 -46
  272. package/script/npm/src/src/features/auth/identity/contract.d.ts +0 -23
  273. package/script/npm/src/src/features/auth/identity/contract.d.ts.map +0 -1
  274. package/script/npm/src/src/features/auth/identity/contract.js +0 -20
  275. package/script/npm/src/src/features/auth/identity/repository.d.ts +0 -22
  276. package/script/npm/src/src/features/auth/identity/repository.d.ts.map +0 -1
  277. package/script/npm/src/src/features/auth/identity/repository.js +0 -34
  278. package/script/npm/src/src/features/auth/index.d.ts +0 -6
  279. package/script/npm/src/src/features/auth/index.d.ts.map +0 -1
  280. package/script/npm/src/src/features/auth/index.js +0 -21
  281. package/script/npm/src/src/features/auth/manager.d.ts +0 -105
  282. package/script/npm/src/src/features/auth/manager.d.ts.map +0 -1
  283. package/script/npm/src/src/features/auth/manager.js +0 -185
  284. package/script/npm/src/src/features/auth/profile/contract.d.ts.map +0 -1
  285. package/script/npm/src/src/features/auth/profile/contract.js +0 -17
  286. package/script/npm/src/src/features/auth/profile/repository.d.ts +0 -11
  287. package/script/npm/src/src/features/auth/profile/repository.d.ts.map +0 -1
  288. package/script/npm/src/src/features/auth/profile/repository.js +0 -29
  289. package/script/npm/src/src/features/auth/repository.d.ts +0 -30
  290. package/script/npm/src/src/features/auth/repository.d.ts.map +0 -1
  291. package/script/npm/src/src/features/auth/repository.js +0 -73
  292. package/script/npm/src/src/features/auth/storage/client_store.d.ts +0 -30
  293. package/script/npm/src/src/features/auth/storage/client_store.d.ts.map +0 -1
  294. package/script/npm/src/src/features/auth/storage/client_store.js +0 -51
  295. package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts +0 -32
  296. package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts.map +0 -1
  297. package/script/npm/src/src/features/auth/storage/client_token_handler.js +0 -40
  298. package/script/npm/src/src/features/auth/storage/server_store.d.ts +0 -24
  299. package/script/npm/src/src/features/auth/storage/server_store.d.ts.map +0 -1
  300. package/script/npm/src/src/features/auth/storage/server_store.js +0 -38
  301. package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts +0 -36
  302. package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts.map +0 -1
  303. package/script/npm/src/src/features/auth/storage/server_token_handler.js +0 -119
  304. package/script/npm/src/src/features/auth/storage/types.d.ts +0 -42
  305. package/script/npm/src/src/features/auth/storage/types.d.ts.map +0 -1
  306. package/script/npm/src/src/features/auth/storage/types.js +0 -2
  307. package/script/npm/src/src/features/contact/contract.d.ts +0 -170
  308. package/script/npm/src/src/features/contact/contract.d.ts.map +0 -1
  309. package/script/npm/src/src/features/contact/contract.js +0 -52
  310. package/script/npm/src/src/features/contact/index.d.ts +0 -2
  311. package/script/npm/src/src/features/contact/index.d.ts.map +0 -1
  312. package/script/npm/src/src/features/contact/index.js +0 -17
  313. package/script/npm/src/src/features/contact/repository.d.ts +0 -58
  314. package/script/npm/src/src/features/contact/repository.d.ts.map +0 -1
  315. package/script/npm/src/src/features/contact/repository.js +0 -112
  316. package/script/npm/src/src/features/payout/contract.d.ts +0 -623
  317. package/script/npm/src/src/features/payout/contract.d.ts.map +0 -1
  318. package/script/npm/src/src/features/payout/contract.js +0 -78
  319. package/script/npm/src/src/features/payout/index.d.ts +0 -2
  320. package/script/npm/src/src/features/payout/index.d.ts.map +0 -1
  321. package/script/npm/src/src/features/payout/index.js +0 -17
  322. package/script/npm/src/src/features/payout/repository.d.ts +0 -67
  323. package/script/npm/src/src/features/payout/repository.d.ts.map +0 -1
  324. package/script/npm/src/src/features/payout/repository.js +0 -183
  325. package/script/npm/src/src/features/wallet/contract.d.ts.map +0 -1
  326. package/script/npm/src/src/features/wallet/contract.js +0 -41
  327. package/script/npm/src/src/features/wallet/index.d.ts +0 -2
  328. package/script/npm/src/src/features/wallet/index.d.ts.map +0 -1
  329. package/script/npm/src/src/features/wallet/index.js +0 -17
  330. package/script/npm/src/src/features/wallet/repository.d.ts +0 -57
  331. package/script/npm/src/src/features/wallet/repository.d.ts.map +0 -1
  332. package/script/npm/src/src/features/wallet/repository.js +0 -97
  333. package/script/npm/src/src/models/contact/derivatives/contact.d.ts +0 -172
  334. package/script/npm/src/src/models/contact/derivatives/contact.d.ts.map +0 -1
  335. package/script/npm/src/src/models/contact/derivatives/contact.js +0 -270
  336. package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts +0 -188
  337. package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts.map +0 -1
  338. package/script/npm/src/src/models/contact/derivatives/contact_info.js +0 -260
  339. package/script/npm/src/src/models/contact/index.d.ts +0 -5
  340. package/script/npm/src/src/models/contact/index.d.ts.map +0 -1
  341. package/script/npm/src/src/models/contact/index.js +0 -20
  342. package/script/npm/src/src/models/contact/schemas.d.ts +0 -66
  343. package/script/npm/src/src/models/contact/schemas.d.ts.map +0 -1
  344. package/script/npm/src/src/models/contact/schemas.js +0 -67
  345. package/script/npm/src/src/models/contact/validation.d.ts +0 -37
  346. package/script/npm/src/src/models/contact/validation.d.ts.map +0 -1
  347. package/script/npm/src/src/models/contact/validation.js +0 -153
  348. package/script/npm/src/src/models/index.d.ts +0 -7
  349. package/script/npm/src/src/models/index.d.ts.map +0 -1
  350. package/script/npm/src/src/models/index.js +0 -22
  351. package/script/npm/src/src/models/payout/api.d.ts +0 -29
  352. package/script/npm/src/src/models/payout/api.d.ts.map +0 -1
  353. package/script/npm/src/src/models/payout/api.js +0 -2
  354. package/script/npm/src/src/models/payout/channel.d.ts +0 -58
  355. package/script/npm/src/src/models/payout/channel.d.ts.map +0 -1
  356. package/script/npm/src/src/models/payout/channel.js +0 -56
  357. package/script/npm/src/src/models/payout/derivatives/payout.d.ts +0 -158
  358. package/script/npm/src/src/models/payout/derivatives/payout.d.ts.map +0 -1
  359. package/script/npm/src/src/models/payout/derivatives/payout.js +0 -275
  360. package/script/npm/src/src/models/payout/index.d.ts +0 -7
  361. package/script/npm/src/src/models/payout/index.d.ts.map +0 -1
  362. package/script/npm/src/src/models/payout/index.js +0 -22
  363. package/script/npm/src/src/models/payout/narration.d.ts +0 -164
  364. package/script/npm/src/src/models/payout/narration.d.ts.map +0 -1
  365. package/script/npm/src/src/models/payout/narration.js +0 -312
  366. package/script/npm/src/src/models/payout/schemas.d.ts +0 -156
  367. package/script/npm/src/src/models/payout/schemas.d.ts.map +0 -1
  368. package/script/npm/src/src/models/payout/schemas.js +0 -108
  369. package/script/npm/src/src/models/payout/status.d.ts +0 -33
  370. package/script/npm/src/src/models/payout/status.d.ts.map +0 -1
  371. package/script/npm/src/src/models/payout/status.js +0 -37
  372. package/script/npm/src/src/models/permission.d.ts +0 -55
  373. package/script/npm/src/src/models/permission.d.ts.map +0 -1
  374. package/script/npm/src/src/models/permission.js +0 -53
  375. package/script/npm/src/src/models/role.d.ts +0 -21
  376. package/script/npm/src/src/models/role.d.ts.map +0 -1
  377. package/script/npm/src/src/models/role.js +0 -77
  378. package/script/npm/src/src/models/user/authenticated-user.d.ts +0 -77
  379. package/script/npm/src/src/models/user/authenticated-user.d.ts.map +0 -1
  380. package/script/npm/src/src/models/user/authenticated-user.js +0 -230
  381. package/script/npm/src/src/models/user/index.d.ts +0 -4
  382. package/script/npm/src/src/models/user/index.d.ts.map +0 -1
  383. package/script/npm/src/src/models/user/index.js +0 -19
  384. package/script/npm/src/src/models/user/managed-user.d.ts +0 -108
  385. package/script/npm/src/src/models/user/managed-user.d.ts.map +0 -1
  386. package/script/npm/src/src/models/user/managed-user.js +0 -260
  387. package/script/npm/src/src/models/user/profile.d.ts.map +0 -1
  388. package/script/npm/src/src/models/user/profile.js +0 -338
  389. package/script/npm/src/src/models/wallet/index.d.ts +0 -4
  390. package/script/npm/src/src/models/wallet/index.d.ts.map +0 -1
  391. package/script/npm/src/src/models/wallet/index.js +0 -19
  392. package/script/npm/src/src/models/wallet/schemas.d.ts +0 -95
  393. package/script/npm/src/src/models/wallet/schemas.d.ts.map +0 -1
  394. package/script/npm/src/src/models/wallet/schemas.js +0 -38
  395. package/script/npm/src/src/models/wallet/statement_entry.d.ts +0 -160
  396. package/script/npm/src/src/models/wallet/statement_entry.d.ts.map +0 -1
  397. package/script/npm/src/src/models/wallet/statement_entry.js +0 -259
  398. package/script/npm/src/src/models/wallet/wallet.d.ts +0 -147
  399. package/script/npm/src/src/models/wallet/wallet.d.ts.map +0 -1
  400. package/script/npm/src/src/models/wallet/wallet.js +0 -283
  401. package/script/npm/src/src/shared/base_repository.d.ts +0 -80
  402. package/script/npm/src/src/shared/base_repository.d.ts.map +0 -1
  403. package/script/npm/src/src/shared/base_repository.js +0 -157
  404. package/script/npm/src/src/shared/common_responses.d.ts +0 -13
  405. package/script/npm/src/src/shared/common_responses.d.ts.map +0 -1
  406. package/script/npm/src/src/shared/common_responses.js +0 -13
  407. package/script/npm/src/src/shared/index.d.ts +0 -3
  408. package/script/npm/src/src/shared/index.d.ts.map +0 -1
  409. package/script/npm/src/src/shared/index.js +0 -18
  410. package/script/npm/src/src/shared/token_required_repository.d.ts +0 -78
  411. package/script/npm/src/src/shared/token_required_repository.d.ts.map +0 -1
  412. package/script/npm/src/src/shared/token_required_repository.js +0 -132
  413. package/script/package.json +0 -3
@@ -0,0 +1,204 @@
1
+ import { BaseRepository } from "@/lib/api/index.js";
2
+ import { Payout } from "@/modules/payout/payout.model.js";
3
+ import { Amount } from "@temboplus/frontend-core";
4
+ import { PayoutAPI } from "./payout.api-contract.js";
5
+ import { PayoutChannel } from "./payout.dtos.js";
6
+ import { PayoutQuery } from "./payout.query.js";
7
+ import { PayoutFilters } from "./payout.dtos.js";
8
+ import { Paged } from "@/lib/query/index.js";
9
+ import { Wallet } from "../wallet/wallet.model.js";
10
+ import { BeneficiaryInfo } from "../beneficiary/beneficiary-info.model.js";
11
+ /**
12
+ * Input type for payout creation mutation
13
+ */
14
+ export interface CreatePayoutInput {
15
+ /** The wallet to pay from */
16
+ wallet: Wallet;
17
+ /** The payout channel to use (MOBILE or BANK) */
18
+ channel: PayoutChannel;
19
+ /** Contact information for the payout receiver */
20
+ receiver: BeneficiaryInfo;
21
+ /** The amount to pay out */
22
+ amount: Amount;
23
+ /** Optional notes/narration for the payout */
24
+ notes?: string;
25
+ }
26
+ /**
27
+ * Input type for payout approval mutation
28
+ */
29
+ export interface ApprovePayoutInput {
30
+ id: string;
31
+ notes?: string;
32
+ }
33
+ /**
34
+ * Input type for payout rejection mutation
35
+ */
36
+ export interface RejectPayoutInput {
37
+ id: string;
38
+ notes?: string;
39
+ }
40
+ /**
41
+ * Flexible query input type - supports the class, filters interface, URL params, etc.
42
+ */
43
+ export type PayoutQueryInput = PayoutQuery | PayoutFilters | Record<string, string> | URLSearchParams | null | undefined;
44
+ /**
45
+ * Repository class for managing payout operations including creation, approval,
46
+ * rejection, and retrieval of payouts.
47
+ *
48
+ * This repository handles pure API communication without permission checking.
49
+ * Permission validation should be handled at the service layer or route handlers.
50
+ *
51
+ * @extends {BaseRepository<PayoutAPI>}
52
+ *
53
+ * @example
54
+ * ```typescript
55
+ * const repo = new PayoutRepository({ token: userToken });
56
+ * const payouts = await repo.getPayouts();
57
+ * ```
58
+ */
59
+ export declare class PayoutRepository extends BaseRepository<PayoutAPI> {
60
+ /**
61
+ * Creates an instance of PayoutRepository initialized with the payout contract.
62
+ *
63
+ * @param options - Optional configuration
64
+ * @param options.token - Authentication token for API calls
65
+ * @param options.root - Custom API root URL
66
+ *
67
+ * @example
68
+ * ```typescript
69
+ * const repo = new PayoutRepository({
70
+ * token: "user-auth-token"
71
+ * });
72
+ * ```
73
+ */
74
+ constructor(options?: {
75
+ token?: string;
76
+ root?: string;
77
+ });
78
+ /**
79
+ * Get paginated payouts with filtering.
80
+ * Always returns paginated results with metadata.
81
+ *
82
+ * @param query - Query parameters in any supported format
83
+ * @returns Promise resolving to paginated payouts
84
+ *
85
+ * @example
86
+ * ```typescript
87
+ * // From API route with URL search params
88
+ * const { searchParams } = new URL(req.url);
89
+ * const result = await repo.getPayouts(searchParams);
90
+ *
91
+ * // From client with typed params
92
+ * const filters: PayoutFilters = { page: 1, limit: 20, approvalStatus: 'Pending' };
93
+ * const result2 = await repo.getPayouts(filters);
94
+ *
95
+ * // With PayoutQuery instance
96
+ * const query = PayoutQuery.create().wherePending().withPagination(1, 50);
97
+ * const result3 = await repo.getPayouts(query);
98
+ * ```
99
+ */
100
+ getPayouts(query?: PayoutQueryInput): Promise<Paged<Payout>>;
101
+ /**
102
+ * Get all payouts without pagination.
103
+ * Returns a plain array of all matching results.
104
+ *
105
+ * @param query - Query parameters (pagination params will be ignored)
106
+ * @returns Promise resolving to array of all payouts
107
+ *
108
+ * @example
109
+ * ```typescript
110
+ * // Get all pending payouts for a dropdown
111
+ * const allPending = await repo.getAllPayouts({ approvalStatus: 'Pending' });
112
+ *
113
+ * // Get all payouts without any filters
114
+ * const allPayouts = await repo.getAllPayouts();
115
+ * ```
116
+ */
117
+ getAllPayouts(query?: PayoutQueryInput): Promise<Payout[]>;
118
+ /**
119
+ * Convenience method for Next.js API routes.
120
+ * Extracts search params directly from Request object and returns paginated results.
121
+ */
122
+ getPayoutsFromRequest(req: Request): Promise<Paged<Payout>>;
123
+ /**
124
+ * Creates a new payout with the provided input data.
125
+ *
126
+ * @param input - The payout creation data
127
+ * @param input.wallet - The wallet to pay from
128
+ * @param input.channel - The payout channel to use
129
+ * @param input.receiver - Contact information for the payout receiver
130
+ * @param input.amount - The amount to pay out
131
+ * @param input.notes - Optional notes for the payout
132
+ * @returns Promise that resolves to the created payout
133
+ * @throws {APIError} If the input is invalid or if the creation operation fails
134
+ *
135
+ * @example
136
+ * ```typescript
137
+ * const payout = await repo.pay({
138
+ * wallet: selectedWallet,
139
+ * channel: PayoutChannel.MOBILE,
140
+ * receiver: { name: "John Doe", phone: "+255123456789" },
141
+ * amount: Amount.from(10000, "TZS"),
142
+ * notes: "Payment for services"
143
+ * });
144
+ * ```
145
+ */
146
+ pay(input: CreatePayoutInput): Promise<Payout>;
147
+ /**
148
+ * Approves a payout with optional notes.
149
+ *
150
+ * @param input.id - The ID of the payout to approve
151
+ * @param input.notes - Optional notes for the approval
152
+ * @returns Promise that resolves to the approved payout
153
+ * @throws {APIError} If payout is not found, already approved, or if the operation fails
154
+ *
155
+ * @example
156
+ * ```typescript
157
+ * const approvedPayout = await repo.approve({
158
+ * id: "payout-id",
159
+ * notes: "Approved after verification"
160
+ * });
161
+ * ```
162
+ */
163
+ approve(input: ApprovePayoutInput): Promise<Payout>;
164
+ /**
165
+ * Rejects a payout with optional notes.
166
+ *
167
+ * @param input.id - The ID of the payout to reject
168
+ * @param input.notes - Optional notes for the rejection
169
+ * @returns Promise that resolves to the rejected payout
170
+ * @throws {APIError} If payout is not found, already rejected, or if the operation fails
171
+ *
172
+ * @example
173
+ * ```typescript
174
+ * const rejectedPayout = await repo.reject({
175
+ * id: "payout-id",
176
+ * notes: "Insufficient documentation"
177
+ * });
178
+ * ```
179
+ */
180
+ reject(input: RejectPayoutInput): Promise<Payout>;
181
+ /**
182
+ * Retrieves a payout by its ID.
183
+ *
184
+ * @param id - The ID of the payout to retrieve
185
+ * @returns Promise that resolves to the payout instance if found
186
+ * @throws {APIError} If the payout is not found or another error occurs
187
+ *
188
+ * @example
189
+ * ```typescript
190
+ * const payout = await repo.getByID("payout-id");
191
+ * console.log(`Payout status: ${payout.status}`);
192
+ * ```
193
+ */
194
+ getByID(id: string): Promise<Payout>;
195
+ /**
196
+ * Get count of payouts matching a query
197
+ * Uses the same query syntax as getPayouts but only returns the count
198
+ */
199
+ count(query?: PayoutQueryInput): Promise<number>;
200
+ /**
201
+ * Check if any payouts exist matching a query
202
+ */
203
+ exists(query?: PayoutQueryInput): Promise<boolean>;
204
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./profile.dtos.js";
2
+ export * from "./profile.model.js";
3
+ export * from "./profile.repository.js";
@@ -8,13 +8,14 @@ export declare const profileContract: {
8
8
  responses: {
9
9
  200: import("zod").ZodObject<{
10
10
  id: import("zod").ZodString;
11
- firstName: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodString>>;
12
- lastName: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodString>>;
11
+ firstName: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
12
+ lastName: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
13
13
  displayName: import("zod").ZodString;
14
- phone: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodString>>;
14
+ phone: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
15
15
  accountNo: import("zod").ZodString;
16
- email: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodString>>;
17
- }, import("zod").UnknownKeysParam, import("zod").ZodTypeAny, {
16
+ email: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
17
+ autoApprove: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
18
+ }, "strip", import("zod").ZodTypeAny, {
18
19
  id: string;
19
20
  displayName: string;
20
21
  accountNo: string;
@@ -22,6 +23,7 @@ export declare const profileContract: {
22
23
  lastName?: string | null | undefined;
23
24
  phone?: string | null | undefined;
24
25
  email?: string | null | undefined;
26
+ autoApprove?: boolean | null | undefined;
25
27
  }, {
26
28
  id: string;
27
29
  displayName: string;
@@ -30,8 +32,8 @@ export declare const profileContract: {
30
32
  lastName?: string | null | undefined;
31
33
  phone?: string | null | undefined;
32
34
  email?: string | null | undefined;
35
+ autoApprove?: boolean | null | undefined;
33
36
  }>;
34
37
  };
35
38
  };
36
39
  };
37
- //# sourceMappingURL=contract.d.ts.map
@@ -0,0 +1,80 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Zod schema for validating user profile data.
4
+ * Defines validation rules and constraints for each profile field.
5
+ *
6
+ * @const {ProfileType}
7
+ *
8
+ * @property {string} id - Unique identifier for the profile
9
+ * @property {string | null | undefined} firstName - User's first name, can be null or undefined
10
+ * @property {string | null | undefined} lastName - User's last name, can be null or undefined
11
+ * @property {string} displayName - User's display name
12
+ * @property {string | null | undefined} phone - User's contact phone number, can be null or undefined
13
+ * @property {string} accountNo - User's account number
14
+ * @property {string | null | undefined} email - User's email address, can be null or undefined
15
+ * @property {boolean | null | undefined} autoApprove - Auto-approval setting, can be null or undefined
16
+ */
17
+ declare const profileDTOSchema: z.ZodObject<{
18
+ id: z.ZodString;
19
+ firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20
+ lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
21
+ displayName: z.ZodString;
22
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
23
+ accountNo: z.ZodString;
24
+ email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
25
+ autoApprove: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
26
+ }, "strip", z.ZodTypeAny, {
27
+ id: string;
28
+ displayName: string;
29
+ accountNo: string;
30
+ firstName?: string | null | undefined;
31
+ lastName?: string | null | undefined;
32
+ phone?: string | null | undefined;
33
+ email?: string | null | undefined;
34
+ autoApprove?: boolean | null | undefined;
35
+ }, {
36
+ id: string;
37
+ displayName: string;
38
+ accountNo: string;
39
+ firstName?: string | null | undefined;
40
+ lastName?: string | null | undefined;
41
+ phone?: string | null | undefined;
42
+ email?: string | null | undefined;
43
+ autoApprove?: boolean | null | undefined;
44
+ }>;
45
+ /**
46
+ * TypeScript type representing a validated user profile.
47
+ * Use this type for profile instances that have been validated against the schema.
48
+ */
49
+ export type ProfileDTO = z.infer<typeof profileDTOSchema>;
50
+ export declare const ProfileDTOSchemas: {
51
+ profileDTOSchema: z.ZodObject<{
52
+ id: z.ZodString;
53
+ firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54
+ lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55
+ displayName: z.ZodString;
56
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
57
+ accountNo: z.ZodString;
58
+ email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
59
+ autoApprove: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
60
+ }, "strip", z.ZodTypeAny, {
61
+ id: string;
62
+ displayName: string;
63
+ accountNo: string;
64
+ firstName?: string | null | undefined;
65
+ lastName?: string | null | undefined;
66
+ phone?: string | null | undefined;
67
+ email?: string | null | undefined;
68
+ autoApprove?: boolean | null | undefined;
69
+ }, {
70
+ id: string;
71
+ displayName: string;
72
+ accountNo: string;
73
+ firstName?: string | null | undefined;
74
+ lastName?: string | null | undefined;
75
+ phone?: string | null | undefined;
76
+ email?: string | null | undefined;
77
+ autoApprove?: boolean | null | undefined;
78
+ }>;
79
+ };
80
+ export {};
@@ -1,38 +1,42 @@
1
1
  import { z } from "zod";
2
- import { PhoneNumber } from "@temboplus/frontend-core";
3
2
  /**
4
- * Type definition for profile schema using Zod.
5
- * This type helper ensures type safety when implementing the actual schema.
3
+ * Zod schema for Profile JSON serialization
6
4
  */
7
- type ProfileZodSchemaType = z.ZodObject<{
5
+ export declare const ProfileJSONSchema: z.ZodObject<{
8
6
  id: z.ZodString;
9
- firstName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
10
- lastName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
7
+ firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8
+ lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
9
  displayName: z.ZodString;
12
- phone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
10
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
13
11
  accountNo: z.ZodString;
14
- email: z.ZodNullable<z.ZodOptional<z.ZodString>>;
12
+ email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
13
+ autoApprove: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
14
+ version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
15
+ }, "strip", z.ZodTypeAny, {
16
+ id: string;
17
+ displayName: string;
18
+ accountNo: string;
19
+ version: string;
20
+ firstName?: string | null | undefined;
21
+ lastName?: string | null | undefined;
22
+ phone?: string | null | undefined;
23
+ email?: string | null | undefined;
24
+ autoApprove?: boolean | null | undefined;
25
+ }, {
26
+ id: string;
27
+ displayName: string;
28
+ accountNo: string;
29
+ firstName?: string | null | undefined;
30
+ lastName?: string | null | undefined;
31
+ phone?: string | null | undefined;
32
+ email?: string | null | undefined;
33
+ autoApprove?: boolean | null | undefined;
34
+ version?: string | undefined;
15
35
  }>;
16
36
  /**
17
- * Zod schema for validating user profile data.
18
- * Defines validation rules and constraints for each profile field.
19
- *
20
- * @const {ProfileType}
21
- *
22
- * @property {string} id - Unique identifier for the profile
23
- * @property {string | null | undefined} firstName - User's first name, can be null or undefined
24
- * @property {string | null | undefined} lastName - User's last name, can be null or undefined
25
- * @property {string} displayName - User's display name
26
- * @property {string | null | undefined} phone - User's contact phone number, can be null or undefined
27
- * @property {string} accountNo - User's account number
28
- * @property {string | null | undefined} email - User's email address, can be null or undefined
29
- */
30
- export declare const profileSchema: ProfileZodSchemaType;
31
- /**
32
- * TypeScript type representing a validated user profile.
33
- * Use this type for profile instances that have been validated against the schema.
37
+ * Infer the ProfileJSON type from the schema
34
38
  */
35
- export type ProfileType = z.infer<typeof profileSchema>;
39
+ export type ProfileJSON = z.infer<typeof ProfileJSONSchema>;
36
40
  /**
37
41
  * Represents a user profile in the system.
38
42
  *
@@ -48,16 +52,45 @@ export declare class Profile {
48
52
  private _lastName?;
49
53
  /** User's display name, can be used for presentation */
50
54
  private _displayName;
51
- /** User's phone number, stored as a PhoneNumber object */
55
+ /** User's phone number */
52
56
  private _phone?;
53
57
  /** User's account number */
54
58
  private _accountNo;
55
59
  /** User's email address */
56
60
  private _email?;
61
+ /** Auto-approval setting */
62
+ private _autoApprove?;
57
63
  /**
58
64
  * Gets the profile schema used for validation.
59
65
  */
60
- static get schema(): ProfileZodSchemaType;
66
+ static get schema(): z.ZodObject<{
67
+ id: z.ZodString;
68
+ firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
69
+ lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
70
+ displayName: z.ZodString;
71
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
72
+ accountNo: z.ZodString;
73
+ email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
74
+ autoApprove: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
75
+ }, "strip", z.ZodTypeAny, {
76
+ id: string;
77
+ displayName: string;
78
+ accountNo: string;
79
+ firstName?: string | null | undefined;
80
+ lastName?: string | null | undefined;
81
+ phone?: string | null | undefined;
82
+ email?: string | null | undefined;
83
+ autoApprove?: boolean | null | undefined;
84
+ }, {
85
+ id: string;
86
+ displayName: string;
87
+ accountNo: string;
88
+ firstName?: string | null | undefined;
89
+ lastName?: string | null | undefined;
90
+ phone?: string | null | undefined;
91
+ email?: string | null | undefined;
92
+ autoApprove?: boolean | null | undefined;
93
+ }>;
61
94
  /**
62
95
  * Creates a new Profile instance with the provided data.
63
96
  *
@@ -79,6 +112,7 @@ export declare class Profile {
79
112
  phone?: string | null;
80
113
  accountNo: string;
81
114
  email?: string | null;
115
+ autoApprove?: boolean | null;
82
116
  }): Profile | undefined;
83
117
  /**
84
118
  * Gets the profile's unique identifier.
@@ -99,7 +133,7 @@ export declare class Profile {
99
133
  /**
100
134
  * Gets the user's phone number object.
101
135
  */
102
- get phone(): PhoneNumber | null | undefined;
136
+ get phone(): string | null | undefined;
103
137
  /**
104
138
  * Gets the user's account number.
105
139
  */
@@ -109,39 +143,20 @@ export declare class Profile {
109
143
  */
110
144
  get email(): string | null | undefined;
111
145
  /**
112
- * Gets the user's formatted phone number in international format.
146
+ * Gets the auto-approval setting.
113
147
  */
114
- get formattedPhone(): string | null | undefined;
148
+ get autoApprove(): boolean | null | undefined;
115
149
  /**
116
150
  * Gets the user's name for display purposes.
117
151
  * Returns the display name if it exists, otherwise returns the first and last name combined.
118
152
  */
119
153
  getName(): string;
120
- /**
121
- * Creates a plain object representation of the profile for validation or serialization.
122
- *
123
- * @returns A plain object matching the ProfileType interface
124
- */
125
- toObject(): ProfileType;
126
- /**
127
- * Converts the profile to a JSON string.
128
- *
129
- * @returns A JSON string representation of the profile
130
- */
131
- toJSON(): string;
132
154
  /**
133
155
  * Validates the profile data against the Zod schema.
134
156
  *
135
157
  * @returns True if the profile is valid, false otherwise
136
158
  */
137
159
  validate(): boolean;
138
- /**
139
- * Creates a Profile instance from a JSON string.
140
- *
141
- * @param jsonString - JSON string containing profile data
142
- * @returns A new Profile instance, or undefined if parsing failed
143
- */
144
- static fromJSON(jsonString: string): Profile | undefined;
145
160
  /**
146
161
  * Creates a Profile instance from a plain object.
147
162
  *
@@ -156,6 +171,20 @@ export declare class Profile {
156
171
  * @returns Type predicate indicating if the object is a valid Profile
157
172
  */
158
173
  static is(obj: unknown): obj is Profile;
174
+ /**
175
+ * Serializes the Profile instance to a JSON-compatible object
176
+ */
177
+ toJSON(): ProfileJSON;
178
+ /**
179
+ * Serializes the Profile instance to a JSON string
180
+ */
181
+ toJSONString(): string;
182
+ /**
183
+ * Creates a Profile instance from a JSON-compatible object or string
184
+ */
185
+ static fromJSON(json: ProfileJSON | string): Profile | undefined;
186
+ /**
187
+ * Type guard using Zod schema validation
188
+ */
189
+ static isProfileJSON(obj: unknown): obj is ProfileJSON;
159
190
  }
160
- export {};
161
- //# sourceMappingURL=profile.d.ts.map
@@ -0,0 +1,56 @@
1
+ import { BaseRepository } from "@/lib/api/base-repository.js";
2
+ import { profileContract } from "./profile.api-contract.js";
3
+ import { Profile } from "./profile.model.js";
4
+ /**
5
+ * Repository class for managing user profile operations.
6
+ * Handles retrieving and updating user profile information from the API.
7
+ *
8
+ * This repository handles pure API communication without permission checking.
9
+ * Permission validation should be handled at the service layer or route handlers.
10
+ *
11
+ * @extends {BaseRepository<typeof profileContract>}
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * const repo = new ProfileRepository({ token: userToken });
16
+ * const profile = await repo.getCurrentProfile();
17
+ * ```
18
+ */
19
+ export declare class ProfileRepository extends BaseRepository<typeof profileContract> {
20
+ /**
21
+ * Creates an instance of ProfileRepository.
22
+ *
23
+ * @param options - Optional configuration
24
+ * @param options.token - Authentication token for API calls
25
+ * @param options.root - Custom API root URL
26
+ *
27
+ * @example
28
+ * ```typescript
29
+ * const repo = new ProfileRepository({
30
+ * token: "user-auth-token",
31
+ * root: "base-api-url"
32
+ * });
33
+ * ```
34
+ */
35
+ constructor(options?: {
36
+ token?: string;
37
+ root?: string;
38
+ });
39
+ /**
40
+ * Retrieves the current user's profile information.
41
+ *
42
+ * @returns Promise that resolves to the user's profile
43
+ * @throws {APIError} If the request fails, profile data is invalid, or returns an unexpected status
44
+ *
45
+ * @example
46
+ * ```typescript
47
+ * try {
48
+ * const profile = await repo.getCurrentProfile();
49
+ * console.log(`User: ${profile.name}, Email: ${profile.email}`);
50
+ * } catch (error) {
51
+ * console.error("Failed to get profile:", error.message);
52
+ * }
53
+ * ```
54
+ */
55
+ getCurrentProfile(): Promise<Profile>;
56
+ }
@@ -0,0 +1,4 @@
1
+ export * from "./team-member.repository.js";
2
+ export * from "./team-member.dtos.js";
3
+ export * from "./team-member.model.js";
4
+ export * from "./role.model.js";
@@ -0,0 +1,61 @@
1
+ import z from "zod";
2
+ import { RoleDTO } from "./team-member.dtos.js";
3
+ /**
4
+ * Zod schema for Role JSON serialization
5
+ */
6
+ export declare const RoleJSONSchema: z.ZodObject<{
7
+ id: z.ZodString;
8
+ name: z.ZodString;
9
+ description: z.ZodOptional<z.ZodString>;
10
+ access: z.ZodArray<z.ZodString, "many">;
11
+ createdAt: z.ZodString;
12
+ updatedAt: z.ZodString;
13
+ version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
14
+ }, "strip", z.ZodTypeAny, {
15
+ name: string;
16
+ createdAt: string;
17
+ id: string;
18
+ version: string;
19
+ updatedAt: string;
20
+ access: string[];
21
+ description?: string | undefined;
22
+ }, {
23
+ name: string;
24
+ createdAt: string;
25
+ id: string;
26
+ updatedAt: string;
27
+ access: string[];
28
+ version?: string | undefined;
29
+ description?: string | undefined;
30
+ }>;
31
+ /**
32
+ * Infer the RoleJSON type from the schema
33
+ */
34
+ export type RoleJSON = z.infer<typeof RoleJSONSchema>;
35
+ export declare class Role {
36
+ readonly id: string;
37
+ readonly name: string;
38
+ readonly description?: string;
39
+ readonly permissions: ReadonlySet<string>;
40
+ readonly createdAt: Date;
41
+ readonly updatedAt: Date;
42
+ constructor(data: RoleDTO);
43
+ hasPermission(permission: string): boolean;
44
+ static from(data: RoleDTO): Role | undefined;
45
+ /**
46
+ * Serializes the Role instance to a JSON-compatible object
47
+ */
48
+ toJSON(): RoleJSON;
49
+ /**
50
+ * Serializes the Role instance to a JSON string
51
+ */
52
+ toJSONString(): string;
53
+ /**
54
+ * Creates a Role instance from a JSON-compatible object or string
55
+ */
56
+ static fromJSON(json: RoleJSON | string): Role | undefined;
57
+ /**
58
+ * Type guard using Zod schema validation
59
+ */
60
+ static isRoleJSON(obj: unknown): obj is RoleJSON;
61
+ }