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