@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.
- package/README.md +246 -42
- package/dist/index.cjs.js +2 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.esm.js +2 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/lib/api/base-repository.d.ts +177 -0
- package/dist/lib/api/index.d.ts +1 -0
- package/{esm/src/errors/api_error.d.ts → dist/lib/error/error.api.d.ts} +0 -1
- package/{script/npm/src/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/lib/query/index.d.ts +4 -0
- package/dist/lib/query/pagination/pagination.d.ts +73 -0
- package/dist/lib/query/pagination/pagination.schemas.d.ts +83 -0
- package/dist/lib/query/query.builder.d.ts +75 -0
- package/dist/lib/query/query.types.d.ts +36 -0
- package/{esm/src/features/auth/contract.d.ts → dist/modules/auth/auth.contract.d.ts} +16 -19
- package/dist/modules/auth/auth.repository.d.ts +83 -0
- package/dist/modules/auth/company-membership.model.d.ts +171 -0
- package/dist/modules/auth/index.d.ts +3 -0
- package/dist/modules/auth/user.model.d.ts +363 -0
- package/dist/modules/beneficiary/beneficiary-info.model.d.ts +178 -0
- package/dist/modules/beneficiary/beneficiary-input-handler.d.ts +16 -0
- package/dist/modules/beneficiary/beneficiary.api-contract.d.ts +203 -0
- package/dist/modules/beneficiary/beneficiary.dtos.d.ts +84 -0
- package/dist/modules/beneficiary/beneficiary.model.d.ts +441 -0
- package/dist/modules/beneficiary/beneficiary.repository.d.ts +116 -0
- package/dist/modules/beneficiary/index.d.ts +6 -0
- package/dist/modules/login/index.d.ts +4 -0
- package/dist/modules/login/login.api-contract.d.ts +51 -0
- package/dist/modules/login/login.dtos.d.ts +85 -0
- package/dist/modules/login/login.model.d.ts +168 -0
- package/dist/modules/login/login.repository.d.ts +58 -0
- package/{esm/src/models/permission.d.ts → dist/modules/login/permission.type.d.ts} +9 -10
- package/dist/modules/payout/index.d.ts +5 -0
- package/dist/modules/payout/payout-channel-handler.d.ts +82 -0
- package/{esm/src/features/payout/contract.d.ts → dist/modules/payout/payout.api-contract.d.ts} +350 -207
- package/dist/modules/payout/payout.dtos.d.ts +607 -0
- package/dist/modules/payout/payout.model.d.ts +383 -0
- package/dist/modules/payout/payout.query.d.ts +134 -0
- package/dist/modules/payout/payout.repository.d.ts +204 -0
- package/dist/modules/profile/index.d.ts +3 -0
- package/{script/npm/src/src/features/auth/profile/contract.d.ts → dist/modules/profile/profile.api-contract.d.ts} +8 -6
- package/dist/modules/profile/profile.dtos.d.ts +80 -0
- package/{script/npm/src/src/models/user/profile.d.ts → dist/modules/profile/profile.model.d.ts} +81 -52
- package/dist/modules/profile/profile.repository.d.ts +56 -0
- package/dist/modules/team-member/index.d.ts +4 -0
- package/dist/modules/team-member/role.model.d.ts +61 -0
- package/{esm/src/features/admin/contract.d.ts → dist/modules/team-member/team-member.contract.d.ts} +229 -154
- package/dist/modules/team-member/team-member.dtos.d.ts +261 -0
- package/dist/modules/team-member/team-member.model.d.ts +237 -0
- package/dist/modules/team-member/team-member.repository.d.ts +179 -0
- package/dist/modules/wallet/index.d.ts +6 -0
- package/dist/modules/wallet/narration.model.d.ts +225 -0
- package/dist/modules/wallet/statement-entry.model.d.ts +299 -0
- package/{script/npm/src/src/features/wallet/contract.d.ts → dist/modules/wallet/wallet.contract.d.ts} +17 -15
- package/dist/modules/wallet/wallet.dtos.d.ts +204 -0
- package/{esm/src/models/wallet/wallet.d.ts → dist/modules/wallet/wallet.model.d.ts} +34 -40
- package/dist/modules/wallet/wallet.query.d.ts +95 -0
- package/dist/modules/wallet/wallet.repository.d.ts +205 -0
- package/dist/modules/wallet/wallet.utils.d.ts +17 -0
- package/package.json +49 -23
- package/LICENSE +0 -7
- 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 +0 -14
- 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 +0 -32
- 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 +0 -170
- 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 -179
- 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_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/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 -146
- 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 -158
- package/esm/src/models/payout/derivatives/payout.d.ts.map +0 -1
- package/esm/src/models/payout/derivatives/payout.js +0 -271
- package/esm/src/models/payout/index.d.ts +0 -7
- package/esm/src/models/payout/index.d.ts.map +0 -1
- package/esm/src/models/payout/index.js +0 -6
- package/esm/src/models/payout/narration.d.ts +0 -164
- package/esm/src/models/payout/narration.d.ts.map +0 -1
- package/esm/src/models/payout/narration.js +0 -308
- 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 +0 -77
- 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 +0 -108
- 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.map +0 -1
- package/esm/src/models/wallet/wallet.js +0 -279
- package/esm/src/shared/base_repository.d.ts +0 -80
- 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/mod.d.ts +0 -8
- package/script/mod.d.ts.map +0 -1
- package/script/mod.js +0 -23
- package/script/npm/src/mod.d.ts +0 -8
- package/script/npm/src/mod.d.ts.map +0 -1
- package/script/npm/src/mod.js +0 -23
- package/script/npm/src/src/errors/api_error.d.ts +0 -63
- package/script/npm/src/src/errors/api_error.d.ts.map +0 -1
- package/script/npm/src/src/errors/api_error.js +0 -94
- package/script/npm/src/src/errors/index.d.ts +0 -3
- package/script/npm/src/src/errors/index.d.ts.map +0 -1
- package/script/npm/src/src/errors/index.js +0 -18
- package/script/npm/src/src/errors/permission_error.d.ts.map +0 -1
- package/script/npm/src/src/errors/permission_error.js +0 -74
- package/script/npm/src/src/features/admin/contract.d.ts +0 -842
- package/script/npm/src/src/features/admin/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/admin/contract.js +0 -213
- package/script/npm/src/src/features/admin/index.d.ts +0 -4
- package/script/npm/src/src/features/admin/index.d.ts.map +0 -1
- package/script/npm/src/src/features/admin/index.js +0 -19
- package/script/npm/src/src/features/admin/repository.d.ts +0 -114
- package/script/npm/src/src/features/admin/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/admin/repository.js +0 -252
- package/script/npm/src/src/features/admin/schemas.d.ts +0 -146
- package/script/npm/src/src/features/admin/schemas.d.ts.map +0 -1
- package/script/npm/src/src/features/admin/schemas.js +0 -209
- package/script/npm/src/src/features/auth/access/contract.d.ts +0 -14
- package/script/npm/src/src/features/auth/access/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/access/contract.js +0 -17
- package/script/npm/src/src/features/auth/access/repository.d.ts +0 -11
- package/script/npm/src/src/features/auth/access/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/access/repository.js +0 -29
- package/script/npm/src/src/features/auth/contract.d.ts +0 -112
- package/script/npm/src/src/features/auth/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/contract.js +0 -46
- package/script/npm/src/src/features/auth/identity/contract.d.ts +0 -23
- package/script/npm/src/src/features/auth/identity/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/identity/contract.js +0 -20
- package/script/npm/src/src/features/auth/identity/repository.d.ts +0 -22
- package/script/npm/src/src/features/auth/identity/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/identity/repository.js +0 -34
- package/script/npm/src/src/features/auth/index.d.ts +0 -6
- package/script/npm/src/src/features/auth/index.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/index.js +0 -21
- package/script/npm/src/src/features/auth/manager.d.ts +0 -105
- package/script/npm/src/src/features/auth/manager.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/manager.js +0 -185
- package/script/npm/src/src/features/auth/profile/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/profile/contract.js +0 -17
- package/script/npm/src/src/features/auth/profile/repository.d.ts +0 -11
- package/script/npm/src/src/features/auth/profile/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/profile/repository.js +0 -29
- package/script/npm/src/src/features/auth/repository.d.ts +0 -30
- package/script/npm/src/src/features/auth/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/repository.js +0 -73
- package/script/npm/src/src/features/auth/storage/client_store.d.ts +0 -30
- package/script/npm/src/src/features/auth/storage/client_store.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/storage/client_store.js +0 -51
- package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts +0 -32
- package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/storage/client_token_handler.js +0 -40
- package/script/npm/src/src/features/auth/storage/server_store.d.ts +0 -24
- package/script/npm/src/src/features/auth/storage/server_store.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/storage/server_store.js +0 -38
- package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts +0 -36
- package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/storage/server_token_handler.js +0 -119
- package/script/npm/src/src/features/auth/storage/types.d.ts +0 -42
- package/script/npm/src/src/features/auth/storage/types.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/storage/types.js +0 -2
- package/script/npm/src/src/features/contact/contract.d.ts +0 -170
- package/script/npm/src/src/features/contact/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/contact/contract.js +0 -52
- package/script/npm/src/src/features/contact/index.d.ts +0 -2
- package/script/npm/src/src/features/contact/index.d.ts.map +0 -1
- package/script/npm/src/src/features/contact/index.js +0 -17
- package/script/npm/src/src/features/contact/repository.d.ts +0 -58
- package/script/npm/src/src/features/contact/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/contact/repository.js +0 -112
- package/script/npm/src/src/features/payout/contract.d.ts +0 -623
- package/script/npm/src/src/features/payout/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/payout/contract.js +0 -78
- package/script/npm/src/src/features/payout/index.d.ts +0 -2
- package/script/npm/src/src/features/payout/index.d.ts.map +0 -1
- package/script/npm/src/src/features/payout/index.js +0 -17
- package/script/npm/src/src/features/payout/repository.d.ts +0 -67
- package/script/npm/src/src/features/payout/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/payout/repository.js +0 -183
- package/script/npm/src/src/features/wallet/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/wallet/contract.js +0 -41
- package/script/npm/src/src/features/wallet/index.d.ts +0 -2
- package/script/npm/src/src/features/wallet/index.d.ts.map +0 -1
- package/script/npm/src/src/features/wallet/index.js +0 -17
- package/script/npm/src/src/features/wallet/repository.d.ts +0 -57
- package/script/npm/src/src/features/wallet/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/wallet/repository.js +0 -97
- package/script/npm/src/src/models/contact/derivatives/contact.d.ts +0 -172
- package/script/npm/src/src/models/contact/derivatives/contact.d.ts.map +0 -1
- package/script/npm/src/src/models/contact/derivatives/contact.js +0 -270
- package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts +0 -188
- package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts.map +0 -1
- package/script/npm/src/src/models/contact/derivatives/contact_info.js +0 -260
- package/script/npm/src/src/models/contact/index.d.ts +0 -5
- package/script/npm/src/src/models/contact/index.d.ts.map +0 -1
- package/script/npm/src/src/models/contact/index.js +0 -20
- package/script/npm/src/src/models/contact/schemas.d.ts +0 -66
- package/script/npm/src/src/models/contact/schemas.d.ts.map +0 -1
- package/script/npm/src/src/models/contact/schemas.js +0 -67
- package/script/npm/src/src/models/contact/validation.d.ts +0 -37
- package/script/npm/src/src/models/contact/validation.d.ts.map +0 -1
- package/script/npm/src/src/models/contact/validation.js +0 -153
- package/script/npm/src/src/models/index.d.ts +0 -7
- package/script/npm/src/src/models/index.d.ts.map +0 -1
- package/script/npm/src/src/models/index.js +0 -22
- package/script/npm/src/src/models/payout/api.d.ts +0 -29
- package/script/npm/src/src/models/payout/api.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/api.js +0 -2
- package/script/npm/src/src/models/payout/channel.d.ts +0 -58
- package/script/npm/src/src/models/payout/channel.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/channel.js +0 -56
- package/script/npm/src/src/models/payout/derivatives/payout.d.ts +0 -158
- package/script/npm/src/src/models/payout/derivatives/payout.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/derivatives/payout.js +0 -275
- package/script/npm/src/src/models/payout/index.d.ts +0 -7
- package/script/npm/src/src/models/payout/index.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/index.js +0 -22
- package/script/npm/src/src/models/payout/narration.d.ts +0 -164
- package/script/npm/src/src/models/payout/narration.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/narration.js +0 -312
- package/script/npm/src/src/models/payout/schemas.d.ts +0 -156
- package/script/npm/src/src/models/payout/schemas.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/schemas.js +0 -108
- package/script/npm/src/src/models/payout/status.d.ts +0 -33
- package/script/npm/src/src/models/payout/status.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/status.js +0 -37
- package/script/npm/src/src/models/permission.d.ts +0 -55
- package/script/npm/src/src/models/permission.d.ts.map +0 -1
- package/script/npm/src/src/models/permission.js +0 -53
- package/script/npm/src/src/models/role.d.ts +0 -21
- package/script/npm/src/src/models/role.d.ts.map +0 -1
- package/script/npm/src/src/models/role.js +0 -77
- package/script/npm/src/src/models/user/authenticated-user.d.ts +0 -77
- package/script/npm/src/src/models/user/authenticated-user.d.ts.map +0 -1
- package/script/npm/src/src/models/user/authenticated-user.js +0 -230
- package/script/npm/src/src/models/user/index.d.ts +0 -4
- package/script/npm/src/src/models/user/index.d.ts.map +0 -1
- package/script/npm/src/src/models/user/index.js +0 -19
- package/script/npm/src/src/models/user/managed-user.d.ts +0 -108
- package/script/npm/src/src/models/user/managed-user.d.ts.map +0 -1
- package/script/npm/src/src/models/user/managed-user.js +0 -260
- package/script/npm/src/src/models/user/profile.d.ts.map +0 -1
- package/script/npm/src/src/models/user/profile.js +0 -338
- package/script/npm/src/src/models/wallet/index.d.ts +0 -4
- package/script/npm/src/src/models/wallet/index.d.ts.map +0 -1
- package/script/npm/src/src/models/wallet/index.js +0 -19
- package/script/npm/src/src/models/wallet/schemas.d.ts +0 -95
- package/script/npm/src/src/models/wallet/schemas.d.ts.map +0 -1
- package/script/npm/src/src/models/wallet/schemas.js +0 -38
- package/script/npm/src/src/models/wallet/statement_entry.d.ts +0 -160
- package/script/npm/src/src/models/wallet/statement_entry.d.ts.map +0 -1
- package/script/npm/src/src/models/wallet/statement_entry.js +0 -259
- package/script/npm/src/src/models/wallet/wallet.d.ts +0 -147
- package/script/npm/src/src/models/wallet/wallet.d.ts.map +0 -1
- package/script/npm/src/src/models/wallet/wallet.js +0 -283
- package/script/npm/src/src/shared/base_repository.d.ts +0 -80
- package/script/npm/src/src/shared/base_repository.d.ts.map +0 -1
- package/script/npm/src/src/shared/base_repository.js +0 -157
- package/script/npm/src/src/shared/common_responses.d.ts +0 -13
- package/script/npm/src/src/shared/common_responses.d.ts.map +0 -1
- package/script/npm/src/src/shared/common_responses.js +0 -13
- package/script/npm/src/src/shared/index.d.ts +0 -3
- package/script/npm/src/src/shared/index.d.ts.map +0 -1
- package/script/npm/src/src/shared/index.js +0 -18
- package/script/npm/src/src/shared/token_required_repository.d.ts +0 -78
- package/script/npm/src/src/shared/token_required_repository.d.ts.map +0 -1
- package/script/npm/src/src/shared/token_required_repository.js +0 -132
- package/script/package.json +0 -3
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Zod schema definition for validating Wallet data structures.
|
|
4
|
+
* Ensures data integrity for wallet objects, including runtime validation
|
|
5
|
+
* of country codes against the imported ISO2CountryCodesSet.
|
|
6
|
+
*/
|
|
7
|
+
declare const walletSchema: z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
profileId: z.ZodString;
|
|
10
|
+
accountNo: z.ZodString;
|
|
11
|
+
accountName: z.ZodString;
|
|
12
|
+
channel: z.ZodString;
|
|
13
|
+
countryCode: z.ZodEffects<z.ZodDefault<z.ZodString>, import("@temboplus/frontend-core").ISO2CountryCode, string | undefined>;
|
|
14
|
+
currencyCode: z.ZodEffects<z.ZodDefault<z.ZodString>, import("@temboplus/frontend-core").CurrencyCode, string | undefined>;
|
|
15
|
+
createdAt: z.ZodString;
|
|
16
|
+
updatedAt: z.ZodString;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
createdAt: string;
|
|
19
|
+
id: string;
|
|
20
|
+
accountNo: string;
|
|
21
|
+
profileId: string;
|
|
22
|
+
updatedAt: string;
|
|
23
|
+
channel: string;
|
|
24
|
+
countryCode: import("@temboplus/frontend-core").ISO2CountryCode;
|
|
25
|
+
currencyCode: import("@temboplus/frontend-core").CurrencyCode;
|
|
26
|
+
accountName: string;
|
|
27
|
+
}, {
|
|
28
|
+
createdAt: string;
|
|
29
|
+
id: string;
|
|
30
|
+
accountNo: string;
|
|
31
|
+
profileId: string;
|
|
32
|
+
updatedAt: string;
|
|
33
|
+
channel: string;
|
|
34
|
+
accountName: string;
|
|
35
|
+
countryCode?: string | undefined;
|
|
36
|
+
currencyCode?: string | undefined;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* Zod schema definition for validating Wallet data structures.
|
|
40
|
+
* Ensures data integrity for wallet objects, including runtime validation
|
|
41
|
+
* of country codes against the imported ISO2CountryCodesSet.
|
|
42
|
+
*/
|
|
43
|
+
declare const walletQuerySchema: z.ZodObject<{
|
|
44
|
+
id: z.ZodOptional<z.ZodString>;
|
|
45
|
+
profileId: z.ZodOptional<z.ZodString>;
|
|
46
|
+
accountNo: z.ZodOptional<z.ZodString>;
|
|
47
|
+
accountName: z.ZodOptional<z.ZodString>;
|
|
48
|
+
channel: z.ZodOptional<z.ZodString>;
|
|
49
|
+
countryCode: z.ZodOptional<z.ZodEffects<z.ZodDefault<z.ZodString>, string, string | undefined>>;
|
|
50
|
+
currencyCode: z.ZodOptional<z.ZodEffects<z.ZodDefault<z.ZodString>, string, string | undefined>>;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
id?: string | undefined;
|
|
53
|
+
accountNo?: string | undefined;
|
|
54
|
+
profileId?: string | undefined;
|
|
55
|
+
channel?: string | undefined;
|
|
56
|
+
countryCode?: string | undefined;
|
|
57
|
+
currencyCode?: string | undefined;
|
|
58
|
+
accountName?: string | undefined;
|
|
59
|
+
}, {
|
|
60
|
+
id?: string | undefined;
|
|
61
|
+
accountNo?: string | undefined;
|
|
62
|
+
profileId?: string | undefined;
|
|
63
|
+
channel?: string | undefined;
|
|
64
|
+
countryCode?: string | undefined;
|
|
65
|
+
currencyCode?: string | undefined;
|
|
66
|
+
accountName?: string | undefined;
|
|
67
|
+
}>;
|
|
68
|
+
/**
|
|
69
|
+
* Schema definition for a statement entry.
|
|
70
|
+
*/
|
|
71
|
+
declare const statementEntrySchema: z.ZodObject<{
|
|
72
|
+
accountNo: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
73
|
+
debitOrCredit: z.ZodString;
|
|
74
|
+
tranRefNo: z.ZodString;
|
|
75
|
+
narration: z.ZodString;
|
|
76
|
+
txnDate: z.ZodDate;
|
|
77
|
+
valueDate: z.ZodDate;
|
|
78
|
+
amountCredited: z.ZodNumber;
|
|
79
|
+
amountDebited: z.ZodNumber;
|
|
80
|
+
balance: z.ZodNumber;
|
|
81
|
+
currencyCode: z.ZodDefault<z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>>;
|
|
82
|
+
}, "strip", z.ZodTypeAny, {
|
|
83
|
+
currencyCode: string;
|
|
84
|
+
debitOrCredit: string;
|
|
85
|
+
tranRefNo: string;
|
|
86
|
+
narration: string;
|
|
87
|
+
txnDate: Date;
|
|
88
|
+
valueDate: Date;
|
|
89
|
+
amountCredited: number;
|
|
90
|
+
amountDebited: number;
|
|
91
|
+
balance: number;
|
|
92
|
+
accountNo?: string | undefined;
|
|
93
|
+
}, {
|
|
94
|
+
debitOrCredit: string;
|
|
95
|
+
tranRefNo: string;
|
|
96
|
+
narration: string;
|
|
97
|
+
txnDate: Date;
|
|
98
|
+
valueDate: Date;
|
|
99
|
+
amountCredited: number;
|
|
100
|
+
amountDebited: number;
|
|
101
|
+
balance: number;
|
|
102
|
+
accountNo?: string | undefined;
|
|
103
|
+
currencyCode?: string | undefined;
|
|
104
|
+
}>;
|
|
105
|
+
/**
|
|
106
|
+
* Collection of wallet-related schemas for export.
|
|
107
|
+
* Provides access to both wallet and statement entry validation schemas.
|
|
108
|
+
*/
|
|
109
|
+
export declare const WalletDTOSchemas: {
|
|
110
|
+
walletDTO: z.ZodObject<{
|
|
111
|
+
id: z.ZodString;
|
|
112
|
+
profileId: z.ZodString;
|
|
113
|
+
accountNo: z.ZodString;
|
|
114
|
+
accountName: z.ZodString;
|
|
115
|
+
channel: z.ZodString;
|
|
116
|
+
countryCode: z.ZodEffects<z.ZodDefault<z.ZodString>, import("@temboplus/frontend-core").ISO2CountryCode, string | undefined>;
|
|
117
|
+
currencyCode: z.ZodEffects<z.ZodDefault<z.ZodString>, import("@temboplus/frontend-core").CurrencyCode, string | undefined>;
|
|
118
|
+
createdAt: z.ZodString;
|
|
119
|
+
updatedAt: z.ZodString;
|
|
120
|
+
}, "strip", z.ZodTypeAny, {
|
|
121
|
+
createdAt: string;
|
|
122
|
+
id: string;
|
|
123
|
+
accountNo: string;
|
|
124
|
+
profileId: string;
|
|
125
|
+
updatedAt: string;
|
|
126
|
+
channel: string;
|
|
127
|
+
countryCode: import("@temboplus/frontend-core").ISO2CountryCode;
|
|
128
|
+
currencyCode: import("@temboplus/frontend-core").CurrencyCode;
|
|
129
|
+
accountName: string;
|
|
130
|
+
}, {
|
|
131
|
+
createdAt: string;
|
|
132
|
+
id: string;
|
|
133
|
+
accountNo: string;
|
|
134
|
+
profileId: string;
|
|
135
|
+
updatedAt: string;
|
|
136
|
+
channel: string;
|
|
137
|
+
accountName: string;
|
|
138
|
+
countryCode?: string | undefined;
|
|
139
|
+
currencyCode?: string | undefined;
|
|
140
|
+
}>;
|
|
141
|
+
walletQuery: z.ZodObject<{
|
|
142
|
+
id: z.ZodOptional<z.ZodString>;
|
|
143
|
+
profileId: z.ZodOptional<z.ZodString>;
|
|
144
|
+
accountNo: z.ZodOptional<z.ZodString>;
|
|
145
|
+
accountName: z.ZodOptional<z.ZodString>;
|
|
146
|
+
channel: z.ZodOptional<z.ZodString>;
|
|
147
|
+
countryCode: z.ZodOptional<z.ZodEffects<z.ZodDefault<z.ZodString>, string, string | undefined>>;
|
|
148
|
+
currencyCode: z.ZodOptional<z.ZodEffects<z.ZodDefault<z.ZodString>, string, string | undefined>>;
|
|
149
|
+
}, "strip", z.ZodTypeAny, {
|
|
150
|
+
id?: string | undefined;
|
|
151
|
+
accountNo?: string | undefined;
|
|
152
|
+
profileId?: string | undefined;
|
|
153
|
+
channel?: string | undefined;
|
|
154
|
+
countryCode?: string | undefined;
|
|
155
|
+
currencyCode?: string | undefined;
|
|
156
|
+
accountName?: string | undefined;
|
|
157
|
+
}, {
|
|
158
|
+
id?: string | undefined;
|
|
159
|
+
accountNo?: string | undefined;
|
|
160
|
+
profileId?: string | undefined;
|
|
161
|
+
channel?: string | undefined;
|
|
162
|
+
countryCode?: string | undefined;
|
|
163
|
+
currencyCode?: string | undefined;
|
|
164
|
+
accountName?: string | undefined;
|
|
165
|
+
}>;
|
|
166
|
+
statementEntry: z.ZodObject<{
|
|
167
|
+
accountNo: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
168
|
+
debitOrCredit: z.ZodString;
|
|
169
|
+
tranRefNo: z.ZodString;
|
|
170
|
+
narration: z.ZodString;
|
|
171
|
+
txnDate: z.ZodDate;
|
|
172
|
+
valueDate: z.ZodDate;
|
|
173
|
+
amountCredited: z.ZodNumber;
|
|
174
|
+
amountDebited: z.ZodNumber;
|
|
175
|
+
balance: z.ZodNumber;
|
|
176
|
+
currencyCode: z.ZodDefault<z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>>;
|
|
177
|
+
}, "strip", z.ZodTypeAny, {
|
|
178
|
+
currencyCode: string;
|
|
179
|
+
debitOrCredit: string;
|
|
180
|
+
tranRefNo: string;
|
|
181
|
+
narration: string;
|
|
182
|
+
txnDate: Date;
|
|
183
|
+
valueDate: Date;
|
|
184
|
+
amountCredited: number;
|
|
185
|
+
amountDebited: number;
|
|
186
|
+
balance: number;
|
|
187
|
+
accountNo?: string | undefined;
|
|
188
|
+
}, {
|
|
189
|
+
debitOrCredit: string;
|
|
190
|
+
tranRefNo: string;
|
|
191
|
+
narration: string;
|
|
192
|
+
txnDate: Date;
|
|
193
|
+
valueDate: Date;
|
|
194
|
+
amountCredited: number;
|
|
195
|
+
amountDebited: number;
|
|
196
|
+
balance: number;
|
|
197
|
+
accountNo?: string | undefined;
|
|
198
|
+
currencyCode?: string | undefined;
|
|
199
|
+
}>;
|
|
200
|
+
};
|
|
201
|
+
export type WalletDTO = z.infer<typeof walletSchema>;
|
|
202
|
+
export type WalletQueryDTO = z.infer<typeof walletQuerySchema>;
|
|
203
|
+
export type WalletStatementEntryDTO = z.infer<typeof statementEntrySchema>;
|
|
204
|
+
export {};
|
|
@@ -1,46 +1,44 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
1
|
import { type CurrencyCode, type ISO2CountryCode } from "@temboplus/frontend-core";
|
|
2
|
+
import { WalletDTOSchemas } from "@/modules/wallet/wallet.dtos.js";
|
|
3
|
+
import z from "zod";
|
|
3
4
|
/**
|
|
4
|
-
* Zod schema
|
|
5
|
-
* Ensures data integrity for wallet objects, including runtime validation
|
|
6
|
-
* of country codes against the imported ISO2CountryCodesSet.
|
|
5
|
+
* Zod schema for Wallet JSON serialization
|
|
7
6
|
*/
|
|
8
|
-
declare const
|
|
7
|
+
export declare const WalletJSONSchema: z.ZodObject<{
|
|
9
8
|
id: z.ZodString;
|
|
10
9
|
profileId: z.ZodString;
|
|
11
10
|
accountNo: z.ZodString;
|
|
12
11
|
accountName: z.ZodString;
|
|
13
12
|
channel: z.ZodString;
|
|
14
|
-
countryCode: z.
|
|
15
|
-
currencyCode: z.
|
|
13
|
+
countryCode: z.ZodString;
|
|
14
|
+
currencyCode: z.ZodString;
|
|
16
15
|
createdAt: z.ZodString;
|
|
17
16
|
updatedAt: z.ZodString;
|
|
17
|
+
version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
18
18
|
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
createdAt: string;
|
|
19
20
|
id: string;
|
|
20
21
|
accountNo: string;
|
|
21
|
-
|
|
22
|
+
version: string;
|
|
22
23
|
profileId: string;
|
|
23
|
-
createdAt: string;
|
|
24
24
|
updatedAt: string;
|
|
25
|
-
|
|
25
|
+
channel: string;
|
|
26
26
|
countryCode: string;
|
|
27
27
|
currencyCode: string;
|
|
28
|
+
accountName: string;
|
|
28
29
|
}, {
|
|
30
|
+
createdAt: string;
|
|
29
31
|
id: string;
|
|
30
32
|
accountNo: string;
|
|
31
|
-
channel: string;
|
|
32
33
|
profileId: string;
|
|
33
|
-
createdAt: string;
|
|
34
34
|
updatedAt: string;
|
|
35
|
+
channel: string;
|
|
36
|
+
countryCode: string;
|
|
37
|
+
currencyCode: string;
|
|
35
38
|
accountName: string;
|
|
36
|
-
|
|
37
|
-
currencyCode?: string | undefined;
|
|
39
|
+
version?: string | undefined;
|
|
38
40
|
}>;
|
|
39
|
-
|
|
40
|
-
* TypeScript type representing the validated data structure for a Wallet.
|
|
41
|
-
* Derived from the walletSchema. Note: countryCode is inferred as string.
|
|
42
|
-
*/
|
|
43
|
-
type WalletDataType = z.infer<typeof walletSchema>;
|
|
41
|
+
export type WalletJSON = z.infer<typeof WalletJSONSchema>;
|
|
44
42
|
/**
|
|
45
43
|
* Represents a digital Wallet entity.
|
|
46
44
|
*
|
|
@@ -61,7 +59,7 @@ export declare class Wallet {
|
|
|
61
59
|
* Retrieves the Zod schema used for Wallet validation.
|
|
62
60
|
* @returns The Zod schema object for Wallet.
|
|
63
61
|
*/
|
|
64
|
-
static get schema(): typeof
|
|
62
|
+
static get schema(): typeof WalletDTOSchemas.walletDTO;
|
|
65
63
|
/**
|
|
66
64
|
* Private constructor enforces instantiation via static factory methods.
|
|
67
65
|
* @param data - The validated wallet data object (countryCode is string).
|
|
@@ -104,30 +102,12 @@ export declare class Wallet {
|
|
|
104
102
|
* @returns The last update Date object.
|
|
105
103
|
*/
|
|
106
104
|
get updatedAtDate(): Date;
|
|
107
|
-
/**
|
|
108
|
-
* Creates a plain data object representation of the Wallet instance.
|
|
109
|
-
* Suitable for serialization or validation.
|
|
110
|
-
* @returns A plain object conforming to the WalletDataType structure.
|
|
111
|
-
*/
|
|
112
|
-
toObject(): WalletDataType;
|
|
113
|
-
/**
|
|
114
|
-
* Serializes the Wallet instance into a JSON string.
|
|
115
|
-
* @returns A JSON string representation of the wallet data.
|
|
116
|
-
*/
|
|
117
|
-
toJSON(): string;
|
|
118
105
|
/**
|
|
119
106
|
* Validates the Wallet instance's current data against the defined schema.
|
|
120
107
|
* This includes checking the countryCode against ISO2CountryCodesSet.
|
|
121
108
|
* @returns True if the current instance data is valid, otherwise false.
|
|
122
109
|
*/
|
|
123
110
|
validate(): boolean;
|
|
124
|
-
/**
|
|
125
|
-
* Creates a Wallet instance from a JSON string.
|
|
126
|
-
* Performs parsing and validation, including the countryCode runtime check.
|
|
127
|
-
* @param jsonString - A JSON string containing wallet data.
|
|
128
|
-
* @returns A new Wallet instance if parsing and validation succeed, otherwise undefined.
|
|
129
|
-
*/
|
|
130
|
-
static fromJSON(jsonString: string): Wallet | undefined;
|
|
131
111
|
/**
|
|
132
112
|
* Creates a Wallet instance from a plain JavaScript object.
|
|
133
113
|
* Validates the input object using the Wallet schema, including the countryCode runtime check.
|
|
@@ -142,6 +122,20 @@ export declare class Wallet {
|
|
|
142
122
|
* @returns True if the object resembles a Wallet instance, false otherwise.
|
|
143
123
|
*/
|
|
144
124
|
static is(obj: unknown): obj is Wallet;
|
|
125
|
+
/**
|
|
126
|
+
* Serializes the Wallet instance to a JSON-compatible object
|
|
127
|
+
*/
|
|
128
|
+
toJSON(): WalletJSON;
|
|
129
|
+
/**
|
|
130
|
+
* Serializes the Wallet instance to a JSON string
|
|
131
|
+
*/
|
|
132
|
+
toJSONString(): string;
|
|
133
|
+
/**
|
|
134
|
+
* Creates a Wallet instance from a JSON-compatible object or string
|
|
135
|
+
*/
|
|
136
|
+
static fromJSON(json: WalletJSON | string): Wallet | undefined;
|
|
137
|
+
/**
|
|
138
|
+
* Type guard using Zod schema validation
|
|
139
|
+
*/
|
|
140
|
+
static isWalletJSON(obj: unknown): obj is WalletJSON;
|
|
145
141
|
}
|
|
146
|
-
export {};
|
|
147
|
-
//# sourceMappingURL=wallet.d.ts.map
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { QueryBuilder } from "@/lib/query/index.js";
|
|
2
|
+
import { WalletQueryDTO } from "./wallet.dtos.js";
|
|
3
|
+
/**
|
|
4
|
+
* Wallet-specific query builder that extends the base QueryBuilder
|
|
5
|
+
* and handles all possible input conversions (DTOs, URL params, etc.)
|
|
6
|
+
*/
|
|
7
|
+
export declare class WalletQuery extends QueryBuilder {
|
|
8
|
+
/**
|
|
9
|
+
* Create empty wallet query with defaults
|
|
10
|
+
*/
|
|
11
|
+
static create(): WalletQuery;
|
|
12
|
+
/**
|
|
13
|
+
* Create from typed DTO/filters object
|
|
14
|
+
*/
|
|
15
|
+
static fromFilters(filters: WalletQueryDTO): WalletQuery;
|
|
16
|
+
/**
|
|
17
|
+
* Create from URL search parameters (strings)
|
|
18
|
+
*/
|
|
19
|
+
static fromUrlParams(params: Record<string, string>): WalletQuery;
|
|
20
|
+
/**
|
|
21
|
+
* Create from URLSearchParams object
|
|
22
|
+
*/
|
|
23
|
+
static fromSearchParams(searchParams: URLSearchParams): WalletQuery;
|
|
24
|
+
/**
|
|
25
|
+
* Create from Next.js Request object
|
|
26
|
+
*/
|
|
27
|
+
static fromRequest(request: Request): WalletQuery;
|
|
28
|
+
/**
|
|
29
|
+
* Create from any supported input type
|
|
30
|
+
*/
|
|
31
|
+
static from(input: QueryBuilder | WalletQueryDTO | Record<string, string> | URLSearchParams | null | undefined): WalletQuery;
|
|
32
|
+
/**
|
|
33
|
+
* Type guard for string records
|
|
34
|
+
*/
|
|
35
|
+
private static isStringRecord;
|
|
36
|
+
whereId(id: string): this;
|
|
37
|
+
whereProfileId(profileId: string): this;
|
|
38
|
+
whereAccountNo(accountNo: string): this;
|
|
39
|
+
whereAccountName(accountName: string): this;
|
|
40
|
+
whereChannel(channel: string): this;
|
|
41
|
+
whereCountryCode(countryCode: string): this;
|
|
42
|
+
whereCurrencyCode(currencyCode: string): this;
|
|
43
|
+
/**
|
|
44
|
+
* Apply all filters from WalletQueryDTO object
|
|
45
|
+
*/
|
|
46
|
+
private applyFilters;
|
|
47
|
+
/**
|
|
48
|
+
* Convert to WalletQueryDTO
|
|
49
|
+
*/
|
|
50
|
+
toFilters(): WalletQueryDTO;
|
|
51
|
+
/**
|
|
52
|
+
* Convert to URL-safe string parameters
|
|
53
|
+
*/
|
|
54
|
+
toUrlParams(): Record<string, string>;
|
|
55
|
+
/**
|
|
56
|
+
* Convert to URLSearchParams
|
|
57
|
+
*/
|
|
58
|
+
toSearchParams(): URLSearchParams;
|
|
59
|
+
/**
|
|
60
|
+
* Convert to query string
|
|
61
|
+
*/
|
|
62
|
+
toQueryString(): string;
|
|
63
|
+
/**
|
|
64
|
+
* Create new instance with wallet ID filter
|
|
65
|
+
*/
|
|
66
|
+
withId(id: string): WalletQuery;
|
|
67
|
+
/**
|
|
68
|
+
* Create new instance with profile ID filter
|
|
69
|
+
*/
|
|
70
|
+
withProfileId(profileId: string): WalletQuery;
|
|
71
|
+
/**
|
|
72
|
+
* Create new instance with account number filter
|
|
73
|
+
*/
|
|
74
|
+
withAccountNo(accountNo: string): WalletQuery;
|
|
75
|
+
/**
|
|
76
|
+
* Create new instance with country code filter
|
|
77
|
+
*/
|
|
78
|
+
withCountryCode(countryCode: string): WalletQuery;
|
|
79
|
+
/**
|
|
80
|
+
* Create new instance with currency code filter
|
|
81
|
+
*/
|
|
82
|
+
withCurrencyCode(currencyCode: string): WalletQuery;
|
|
83
|
+
/**
|
|
84
|
+
* Check if any filters are applied
|
|
85
|
+
*/
|
|
86
|
+
hasFilters(): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Get human-readable filter descriptions
|
|
89
|
+
*/
|
|
90
|
+
getActiveFilters(): string[];
|
|
91
|
+
/**
|
|
92
|
+
* Extract filter values from QueryBuilder options
|
|
93
|
+
*/
|
|
94
|
+
private extractFilterValues;
|
|
95
|
+
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { Amount } from "@temboplus/frontend-core";
|
|
2
|
+
import { WalletStatementEntry } from "./statement-entry.model.js";
|
|
3
|
+
import { Wallet } from "./wallet.model.js";
|
|
4
|
+
import { contract } from "./wallet.contract.js";
|
|
5
|
+
import { BaseRepository } from "@/lib/api/base-repository.js";
|
|
6
|
+
import { WalletQuery } from "./wallet.query.js";
|
|
7
|
+
import { WalletQueryDTO } from "./wallet.dtos.js";
|
|
8
|
+
/**
|
|
9
|
+
* Flexible query input type - supports the class, filters interface, URL params, etc.
|
|
10
|
+
*/
|
|
11
|
+
export type WalletQueryInput = WalletQuery | WalletQueryDTO | Record<string, string> | URLSearchParams | null | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Repository class for managing wallet operations including balance checking,
|
|
14
|
+
* statement generation, and wallet information retrieval.
|
|
15
|
+
*
|
|
16
|
+
* This repository handles pure API communication without permission checking.
|
|
17
|
+
* Permission validation should be handled at the service layer or route handlers.
|
|
18
|
+
*
|
|
19
|
+
* @extends {BaseRepository<typeof contract>}
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* // Direct token usage
|
|
24
|
+
* const repo = new WalletRepository({ token: userToken });
|
|
25
|
+
* const balance = await repo.getBalance({ wallet });
|
|
26
|
+
*
|
|
27
|
+
* // Service locator usage
|
|
28
|
+
* const repo = new WalletRepository();
|
|
29
|
+
* const wallets = await repo.getWallets();
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare class WalletRepository extends BaseRepository<typeof contract> {
|
|
33
|
+
/**
|
|
34
|
+
* Creates an instance of WalletRepository initialized with the wallet contract.
|
|
35
|
+
*
|
|
36
|
+
* @param options - Optional configuration
|
|
37
|
+
* @param options.root - Custom API root URL
|
|
38
|
+
* @param options.token - Authentication token for API calls
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```typescript
|
|
42
|
+
* const repo = new WalletRepository({
|
|
43
|
+
* token: "user-auth-token",
|
|
44
|
+
* root: "base-api-url"
|
|
45
|
+
* });
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
constructor(options?: {
|
|
49
|
+
root?: string;
|
|
50
|
+
token?: string;
|
|
51
|
+
});
|
|
52
|
+
/**
|
|
53
|
+
* Retrieves the current available balance for a specific wallet.
|
|
54
|
+
*
|
|
55
|
+
* Supports two input methods:
|
|
56
|
+
* 1. Direct wallet object (preferred for performance)
|
|
57
|
+
* 2. Account number lookup (requires additional API call to fetch wallet details)
|
|
58
|
+
*
|
|
59
|
+
* @param props - The request properties (must provide either wallet or accountNo)
|
|
60
|
+
* @param props.wallet - The wallet object for which to retrieve the balance (preferred method)
|
|
61
|
+
* @param props.accountNo - Alternative: account number to lookup wallet and fetch balance
|
|
62
|
+
* @returns Promise that resolves to the available balance as an Amount object
|
|
63
|
+
* @throws {Error} If neither wallet nor accountNo is provided
|
|
64
|
+
* @throws {Error} If accountNo is provided but no matching wallet is found
|
|
65
|
+
* @throws {Error} If the balance fetch operation fails due to network or server errors
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* // Method 1: Using wallet object (recommended - faster)
|
|
70
|
+
* try {
|
|
71
|
+
* const wallet = await repo.getWallets().then(w => w[0]);
|
|
72
|
+
* const balance = await repo.getBalance({ wallet });
|
|
73
|
+
* console.log(`Available balance: ${balance.label}`);
|
|
74
|
+
* } catch (error) {
|
|
75
|
+
* console.error('Failed to fetch balance:', error.message);
|
|
76
|
+
* }
|
|
77
|
+
*
|
|
78
|
+
* // Method 2: Using account number (requires wallet lookup)
|
|
79
|
+
* try {
|
|
80
|
+
* const balance = await repo.getBalance({ accountNo: '123456789' });
|
|
81
|
+
* console.log(`Available balance: ${balance.label}`);
|
|
82
|
+
* } catch (error) {
|
|
83
|
+
* console.error('Failed to fetch balance:', error.message);
|
|
84
|
+
* }
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
getBalance(props: {
|
|
88
|
+
wallet?: Wallet;
|
|
89
|
+
accountNo?: string;
|
|
90
|
+
}): Promise<Amount>;
|
|
91
|
+
/**
|
|
92
|
+
* Retrieves all wallets associated with the authenticated user.
|
|
93
|
+
*
|
|
94
|
+
* Supports flexible filtering through WalletQuery or plain filter objects.
|
|
95
|
+
*
|
|
96
|
+
* @param query - Optional query parameters for filtering wallets
|
|
97
|
+
* @returns Promise that resolves to an array of validated Wallet instances
|
|
98
|
+
* @throws {Error} If the wallet fetch operation fails or data is invalid
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```typescript
|
|
102
|
+
* // Get all wallets
|
|
103
|
+
* const allWallets = await repo.getWallets();
|
|
104
|
+
*
|
|
105
|
+
* // Get specific wallet by account number
|
|
106
|
+
* const specificWallet = await repo.getWallets({ accountNo: '123456789' });
|
|
107
|
+
*
|
|
108
|
+
* // Get wallets with multiple filters using WalletQuery
|
|
109
|
+
* const query = WalletQuery.create()
|
|
110
|
+
* .whereCountryCode('TZ')
|
|
111
|
+
* .whereCurrencyCode('TZS');
|
|
112
|
+
* const tzWallets = await repo.getWallets(query);
|
|
113
|
+
*
|
|
114
|
+
* // Get wallets with filters object
|
|
115
|
+
* const usdWallets = await repo.getWallets({ currencyCode: 'USD' });
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
getWallets(query?: WalletQueryInput): Promise<Wallet[]>;
|
|
119
|
+
/**
|
|
120
|
+
* Retrieves a single wallet by its ID.
|
|
121
|
+
*
|
|
122
|
+
* Since the API doesn't have a dedicated /id endpoint, this method queries
|
|
123
|
+
* the list endpoint with the ID filter and returns the first result.
|
|
124
|
+
*
|
|
125
|
+
* @param id - The unique identifier of the wallet to retrieve
|
|
126
|
+
* @returns Promise that resolves to the wallet if found, undefined otherwise
|
|
127
|
+
* @throws {Error} If the fetch operation fails
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```typescript
|
|
131
|
+
* const wallet = await repo.getByID("wallet-id");
|
|
132
|
+
* if (wallet) {
|
|
133
|
+
* console.log(`Wallet: ${wallet.accountName}`);
|
|
134
|
+
* } else {
|
|
135
|
+
* console.log('Wallet not found');
|
|
136
|
+
* }
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
getByID(id: string): Promise<Wallet | undefined>;
|
|
140
|
+
/**
|
|
141
|
+
* Retrieves wallet statement entries for a specified date range.
|
|
142
|
+
*
|
|
143
|
+
* Supports two input methods:
|
|
144
|
+
* 1. Direct wallet object (preferred for performance and currency context)
|
|
145
|
+
* 2. Account number lookup (requires additional API call to determine currency)
|
|
146
|
+
*
|
|
147
|
+
* If no date range is provided, defaults to the current month.
|
|
148
|
+
* Returns statement entries with enhanced narration objects containing payout detection
|
|
149
|
+
* and parsing capabilities.
|
|
150
|
+
*
|
|
151
|
+
* @param props - The statement request properties
|
|
152
|
+
* @param props.wallet - The wallet to get statement for (preferred method)
|
|
153
|
+
* @param props.accountNo - Alternative: account number to lookup wallet and fetch statement
|
|
154
|
+
* @param props.range - Optional date range (defaults to current month)
|
|
155
|
+
* @param props.range.startDate - Start date for statement period
|
|
156
|
+
* @param props.range.endDate - End date for statement period
|
|
157
|
+
* @returns Promise that resolves to an array of validated WalletStatementEntry instances with Narration objects
|
|
158
|
+
* @throws {Error} If neither wallet nor accountNo is provided
|
|
159
|
+
* @throws {Error} If accountNo is provided but no matching wallet is found
|
|
160
|
+
* @throws {Error} If the statement fetch operation fails or data is invalid
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* ```typescript
|
|
164
|
+
* // Method 1: Using wallet object (recommended)
|
|
165
|
+
* const wallet = await repo.getWallets().then(w => w[0]);
|
|
166
|
+
* const currentMonthEntries = await repo.getStatement({ wallet });
|
|
167
|
+
*
|
|
168
|
+
* // Method 2: Using account number
|
|
169
|
+
* const entriesForAccount = await repo.getStatement({
|
|
170
|
+
* accountNo: '123456789'
|
|
171
|
+
* });
|
|
172
|
+
*
|
|
173
|
+
* // Custom date range with wallet
|
|
174
|
+
* const customRangeEntries = await repo.getStatement({
|
|
175
|
+
* wallet,
|
|
176
|
+
* range: {
|
|
177
|
+
* startDate: new Date('2024-01-01'),
|
|
178
|
+
* endDate: new Date('2024-01-31')
|
|
179
|
+
* }
|
|
180
|
+
* });
|
|
181
|
+
*
|
|
182
|
+
* // Process payout transactions
|
|
183
|
+
* const payoutEntries = currentMonthEntries.filter(entry => entry.isPayout);
|
|
184
|
+
* payoutEntries.forEach(entry => {
|
|
185
|
+
* console.log(`Payout ID: ${entry.payoutId}, Amount: ${entry.amountDebited.label}`);
|
|
186
|
+
* });
|
|
187
|
+
* ```
|
|
188
|
+
*/
|
|
189
|
+
getStatement(props: {
|
|
190
|
+
range?: {
|
|
191
|
+
startDate: Date;
|
|
192
|
+
endDate: Date;
|
|
193
|
+
};
|
|
194
|
+
wallet?: Wallet;
|
|
195
|
+
accountNo?: string;
|
|
196
|
+
}): Promise<WalletStatementEntry[]>;
|
|
197
|
+
/**
|
|
198
|
+
* Check if a wallet exists with the given query
|
|
199
|
+
*/
|
|
200
|
+
exists(query?: WalletQueryInput): Promise<boolean>;
|
|
201
|
+
/**
|
|
202
|
+
* Get count of wallets matching a query
|
|
203
|
+
*/
|
|
204
|
+
count(query?: WalletQueryInput): Promise<number>;
|
|
205
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CountryCode } from "@temboplus/frontend-core";
|
|
2
|
+
import { Wallet } from "./wallet.model.js";
|
|
3
|
+
export declare const WalletUtils: {
|
|
4
|
+
/**
|
|
5
|
+
* Gets unique countries from a list of wallets
|
|
6
|
+
* @param wallets Array of wallets
|
|
7
|
+
* @returns Array of unique country codes
|
|
8
|
+
*/
|
|
9
|
+
getUniqueCountries(wallets: Wallet[]): CountryCode[];
|
|
10
|
+
/**
|
|
11
|
+
* Gets wallets for a specific country
|
|
12
|
+
* @param wallets Array of wallets
|
|
13
|
+
* @param countryCode Country code to filter by
|
|
14
|
+
* @returns Array of wallets for the specified country
|
|
15
|
+
*/
|
|
16
|
+
getWalletsByCountry(wallets: Wallet[], countryCode: CountryCode): Wallet[];
|
|
17
|
+
};
|