@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,363 @@
|
|
|
1
|
+
import { Permission } from "../login/permission.type.js";
|
|
2
|
+
import { Profile } from "../profile/profile.model.js";
|
|
3
|
+
import { LogIn } from "../login/login.model.js";
|
|
4
|
+
import { CompanyMembership } from "./company-membership.model.js";
|
|
5
|
+
import { Role } from "../team-member/role.model.js";
|
|
6
|
+
import z from "zod";
|
|
7
|
+
/**
|
|
8
|
+
* Zod schema for User JSON serialization
|
|
9
|
+
* Composes the schemas from nested objects
|
|
10
|
+
*/
|
|
11
|
+
export declare const UserJSONSchema: z.ZodObject<{
|
|
12
|
+
logIn: z.ZodObject<{
|
|
13
|
+
id: z.ZodString;
|
|
14
|
+
profileId: z.ZodString;
|
|
15
|
+
name: z.ZodString;
|
|
16
|
+
identity: z.ZodString;
|
|
17
|
+
type: z.ZodString;
|
|
18
|
+
roleId: z.ZodString;
|
|
19
|
+
isActive: z.ZodBoolean;
|
|
20
|
+
isArchived: z.ZodBoolean;
|
|
21
|
+
resetPassword: z.ZodBoolean;
|
|
22
|
+
createdAt: z.ZodString;
|
|
23
|
+
updatedAt: z.ZodString;
|
|
24
|
+
access: z.ZodArray<z.ZodString, "many">;
|
|
25
|
+
version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
26
|
+
}, "strip", z.ZodTypeAny, {
|
|
27
|
+
type: string;
|
|
28
|
+
name: string;
|
|
29
|
+
createdAt: string;
|
|
30
|
+
id: string;
|
|
31
|
+
version: string;
|
|
32
|
+
profileId: string;
|
|
33
|
+
identity: string;
|
|
34
|
+
roleId: string;
|
|
35
|
+
isActive: boolean;
|
|
36
|
+
isArchived: boolean;
|
|
37
|
+
resetPassword: boolean;
|
|
38
|
+
updatedAt: string;
|
|
39
|
+
access: string[];
|
|
40
|
+
}, {
|
|
41
|
+
type: string;
|
|
42
|
+
name: string;
|
|
43
|
+
createdAt: string;
|
|
44
|
+
id: string;
|
|
45
|
+
profileId: string;
|
|
46
|
+
identity: string;
|
|
47
|
+
roleId: string;
|
|
48
|
+
isActive: boolean;
|
|
49
|
+
isArchived: boolean;
|
|
50
|
+
resetPassword: boolean;
|
|
51
|
+
updatedAt: string;
|
|
52
|
+
access: string[];
|
|
53
|
+
version?: string | undefined;
|
|
54
|
+
}>;
|
|
55
|
+
companyProfile: z.ZodObject<{
|
|
56
|
+
id: z.ZodString;
|
|
57
|
+
firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
58
|
+
lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
59
|
+
displayName: z.ZodString;
|
|
60
|
+
phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
61
|
+
accountNo: z.ZodString;
|
|
62
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
63
|
+
autoApprove: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
64
|
+
version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
65
|
+
}, "strip", z.ZodTypeAny, {
|
|
66
|
+
id: string;
|
|
67
|
+
displayName: string;
|
|
68
|
+
accountNo: string;
|
|
69
|
+
version: string;
|
|
70
|
+
firstName?: string | null | undefined;
|
|
71
|
+
lastName?: string | null | undefined;
|
|
72
|
+
phone?: string | null | undefined;
|
|
73
|
+
email?: string | null | undefined;
|
|
74
|
+
autoApprove?: boolean | null | undefined;
|
|
75
|
+
}, {
|
|
76
|
+
id: string;
|
|
77
|
+
displayName: string;
|
|
78
|
+
accountNo: string;
|
|
79
|
+
firstName?: string | null | undefined;
|
|
80
|
+
lastName?: string | null | undefined;
|
|
81
|
+
phone?: string | null | undefined;
|
|
82
|
+
email?: string | null | undefined;
|
|
83
|
+
autoApprove?: boolean | null | undefined;
|
|
84
|
+
version?: string | undefined;
|
|
85
|
+
}>;
|
|
86
|
+
role: z.ZodOptional<z.ZodObject<{
|
|
87
|
+
id: z.ZodString;
|
|
88
|
+
name: z.ZodString;
|
|
89
|
+
description: z.ZodOptional<z.ZodString>;
|
|
90
|
+
access: z.ZodArray<z.ZodString, "many">;
|
|
91
|
+
createdAt: z.ZodString;
|
|
92
|
+
updatedAt: z.ZodString;
|
|
93
|
+
version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
94
|
+
}, "strip", z.ZodTypeAny, {
|
|
95
|
+
name: string;
|
|
96
|
+
createdAt: string;
|
|
97
|
+
id: string;
|
|
98
|
+
version: string;
|
|
99
|
+
updatedAt: string;
|
|
100
|
+
access: string[];
|
|
101
|
+
description?: string | undefined;
|
|
102
|
+
}, {
|
|
103
|
+
name: string;
|
|
104
|
+
createdAt: string;
|
|
105
|
+
id: string;
|
|
106
|
+
updatedAt: string;
|
|
107
|
+
access: string[];
|
|
108
|
+
version?: string | undefined;
|
|
109
|
+
description?: string | undefined;
|
|
110
|
+
}>>;
|
|
111
|
+
token: z.ZodString;
|
|
112
|
+
version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
113
|
+
}, "strip", z.ZodTypeAny, {
|
|
114
|
+
token: string;
|
|
115
|
+
version: string;
|
|
116
|
+
companyProfile: {
|
|
117
|
+
id: string;
|
|
118
|
+
displayName: string;
|
|
119
|
+
accountNo: string;
|
|
120
|
+
version: string;
|
|
121
|
+
firstName?: string | null | undefined;
|
|
122
|
+
lastName?: string | null | undefined;
|
|
123
|
+
phone?: string | null | undefined;
|
|
124
|
+
email?: string | null | undefined;
|
|
125
|
+
autoApprove?: boolean | null | undefined;
|
|
126
|
+
};
|
|
127
|
+
logIn: {
|
|
128
|
+
type: string;
|
|
129
|
+
name: string;
|
|
130
|
+
createdAt: string;
|
|
131
|
+
id: string;
|
|
132
|
+
version: string;
|
|
133
|
+
profileId: string;
|
|
134
|
+
identity: string;
|
|
135
|
+
roleId: string;
|
|
136
|
+
isActive: boolean;
|
|
137
|
+
isArchived: boolean;
|
|
138
|
+
resetPassword: boolean;
|
|
139
|
+
updatedAt: string;
|
|
140
|
+
access: string[];
|
|
141
|
+
};
|
|
142
|
+
role?: {
|
|
143
|
+
name: string;
|
|
144
|
+
createdAt: string;
|
|
145
|
+
id: string;
|
|
146
|
+
version: string;
|
|
147
|
+
updatedAt: string;
|
|
148
|
+
access: string[];
|
|
149
|
+
description?: string | undefined;
|
|
150
|
+
} | undefined;
|
|
151
|
+
}, {
|
|
152
|
+
token: string;
|
|
153
|
+
companyProfile: {
|
|
154
|
+
id: string;
|
|
155
|
+
displayName: string;
|
|
156
|
+
accountNo: string;
|
|
157
|
+
firstName?: string | null | undefined;
|
|
158
|
+
lastName?: string | null | undefined;
|
|
159
|
+
phone?: string | null | undefined;
|
|
160
|
+
email?: string | null | undefined;
|
|
161
|
+
autoApprove?: boolean | null | undefined;
|
|
162
|
+
version?: string | undefined;
|
|
163
|
+
};
|
|
164
|
+
logIn: {
|
|
165
|
+
type: string;
|
|
166
|
+
name: string;
|
|
167
|
+
createdAt: string;
|
|
168
|
+
id: string;
|
|
169
|
+
profileId: string;
|
|
170
|
+
identity: string;
|
|
171
|
+
roleId: string;
|
|
172
|
+
isActive: boolean;
|
|
173
|
+
isArchived: boolean;
|
|
174
|
+
resetPassword: boolean;
|
|
175
|
+
updatedAt: string;
|
|
176
|
+
access: string[];
|
|
177
|
+
version?: string | undefined;
|
|
178
|
+
};
|
|
179
|
+
version?: string | undefined;
|
|
180
|
+
role?: {
|
|
181
|
+
name: string;
|
|
182
|
+
createdAt: string;
|
|
183
|
+
id: string;
|
|
184
|
+
updatedAt: string;
|
|
185
|
+
access: string[];
|
|
186
|
+
version?: string | undefined;
|
|
187
|
+
description?: string | undefined;
|
|
188
|
+
} | undefined;
|
|
189
|
+
}>;
|
|
190
|
+
/**
|
|
191
|
+
* Infer the UserJSON type from the schema
|
|
192
|
+
*/
|
|
193
|
+
export type UserJSON = z.infer<typeof UserJSONSchema>;
|
|
194
|
+
export type UserData = {
|
|
195
|
+
logIn: LogIn;
|
|
196
|
+
companyProfile: Profile;
|
|
197
|
+
role?: Role;
|
|
198
|
+
token: string;
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* Represents the currently authenticated user session.
|
|
202
|
+
*
|
|
203
|
+
* This class combines:
|
|
204
|
+
* - LogIn: User account data (identity, permissions, resetPassword, etc.)
|
|
205
|
+
* - CompanyMembership: User's relationship to their company (company profile + role)
|
|
206
|
+
* - Token: Session authentication token
|
|
207
|
+
*
|
|
208
|
+
* The User represents "who is logged in right now" with their full context.
|
|
209
|
+
*
|
|
210
|
+
* Note: The role in CompanyMembership may be undefined if the user doesn't have
|
|
211
|
+
* permission to view role details (Permissions.Role.ViewRole).
|
|
212
|
+
*/
|
|
213
|
+
export declare class User {
|
|
214
|
+
private readonly _logIn;
|
|
215
|
+
private readonly _membership;
|
|
216
|
+
private readonly _token;
|
|
217
|
+
private readonly _permissionMap;
|
|
218
|
+
private constructor();
|
|
219
|
+
/**
|
|
220
|
+
* Creates a User instance from the provided data.
|
|
221
|
+
*
|
|
222
|
+
* @param data - User session data
|
|
223
|
+
* @returns A new User instance, or undefined if data is invalid
|
|
224
|
+
*
|
|
225
|
+
* @example
|
|
226
|
+
* ```typescript
|
|
227
|
+
* const user = User.from({
|
|
228
|
+
* logIn: logIn,
|
|
229
|
+
* companyProfile: profile,
|
|
230
|
+
* role: role, // optional
|
|
231
|
+
* token: "auth-token"
|
|
232
|
+
* });
|
|
233
|
+
* ```
|
|
234
|
+
*/
|
|
235
|
+
static from(data: UserData): User | undefined;
|
|
236
|
+
/**
|
|
237
|
+
* Gets the user's login data.
|
|
238
|
+
*/
|
|
239
|
+
get logIn(): LogIn;
|
|
240
|
+
/**
|
|
241
|
+
* Gets the user's company membership (includes company profile and role).
|
|
242
|
+
*/
|
|
243
|
+
get membership(): CompanyMembership;
|
|
244
|
+
/**
|
|
245
|
+
* Gets the user's authentication token.
|
|
246
|
+
*/
|
|
247
|
+
get token(): string;
|
|
248
|
+
/**
|
|
249
|
+
* Convenience getter for the user's ID.
|
|
250
|
+
*/
|
|
251
|
+
get id(): string;
|
|
252
|
+
/**
|
|
253
|
+
* Convenience getter for the user's name.
|
|
254
|
+
*/
|
|
255
|
+
get name(): string;
|
|
256
|
+
/**
|
|
257
|
+
* Convenience getter for the user's identity (email).
|
|
258
|
+
*/
|
|
259
|
+
get identity(): string;
|
|
260
|
+
/**
|
|
261
|
+
* Convenience getter for the user's role ID.
|
|
262
|
+
*/
|
|
263
|
+
get roleId(): string;
|
|
264
|
+
/**
|
|
265
|
+
* Convenience getter for whether the user must reset their password.
|
|
266
|
+
*/
|
|
267
|
+
get resetPassword(): boolean;
|
|
268
|
+
/**
|
|
269
|
+
* Convenience getter for the company profile.
|
|
270
|
+
*/
|
|
271
|
+
get profile(): Profile;
|
|
272
|
+
/**
|
|
273
|
+
* Convenience getter for the user's role (may be undefined).
|
|
274
|
+
*/
|
|
275
|
+
get role(): Role | undefined;
|
|
276
|
+
/**
|
|
277
|
+
* Convenience getter for permissions array.
|
|
278
|
+
*/
|
|
279
|
+
get access(): ReadonlyArray<string>;
|
|
280
|
+
/**
|
|
281
|
+
* Checks if the user has a specific permission.
|
|
282
|
+
*
|
|
283
|
+
* @param permission - The permission to check
|
|
284
|
+
* @returns true if the user has the permission
|
|
285
|
+
*/
|
|
286
|
+
can(permission: Permission): boolean;
|
|
287
|
+
/**
|
|
288
|
+
* Checks if the user has any of the specified permissions.
|
|
289
|
+
*
|
|
290
|
+
* @param permissions - Array of permissions to check
|
|
291
|
+
* @returns true if the user has at least one permission
|
|
292
|
+
*/
|
|
293
|
+
canAny(permissions: Permission[]): boolean;
|
|
294
|
+
/**
|
|
295
|
+
* Checks if the user has all of the specified permissions.
|
|
296
|
+
*
|
|
297
|
+
* @param permissions - Array of permissions to check
|
|
298
|
+
* @returns true if the user has all permissions
|
|
299
|
+
*/
|
|
300
|
+
canAll(permissions: Permission[]): boolean;
|
|
301
|
+
/**
|
|
302
|
+
* Checks if the user can manage team members.
|
|
303
|
+
*/
|
|
304
|
+
canManageTeam(): boolean;
|
|
305
|
+
/**
|
|
306
|
+
* Checks if the user can view role details.
|
|
307
|
+
*/
|
|
308
|
+
canViewRoles(): boolean;
|
|
309
|
+
/**
|
|
310
|
+
* Serializes the User instance to a JSON-compatible object
|
|
311
|
+
*
|
|
312
|
+
* This method creates a complete snapshot of the user session including
|
|
313
|
+
* all nested objects (LogIn, Profile, Role). All data can be reconstructed
|
|
314
|
+
* from this JSON representation without needing backend calls.
|
|
315
|
+
*
|
|
316
|
+
* @returns {UserJSON} A plain object containing all necessary User data
|
|
317
|
+
*
|
|
318
|
+
* @example
|
|
319
|
+
* ```typescript
|
|
320
|
+
* const user = User.from({ ... });
|
|
321
|
+
* const json = user.toJSON();
|
|
322
|
+
* // Store in localStorage
|
|
323
|
+
* localStorage.setItem('currentUser', JSON.stringify(json));
|
|
324
|
+
* ```
|
|
325
|
+
*/
|
|
326
|
+
toJSON(): UserJSON;
|
|
327
|
+
/**
|
|
328
|
+
* Serializes the User instance to a JSON string
|
|
329
|
+
*
|
|
330
|
+
* @returns {string} JSON string representation of the User
|
|
331
|
+
*/
|
|
332
|
+
toJSONString(): string;
|
|
333
|
+
/**
|
|
334
|
+
* Creates a User instance from a JSON-compatible object or string
|
|
335
|
+
*
|
|
336
|
+
* This static method reconstructs a complete User instance from data that was
|
|
337
|
+
* previously serialized using toJSON(). It validates the input data and
|
|
338
|
+
* ensures all nested objects (LogIn, Profile, Role) are properly reconstructed.
|
|
339
|
+
*
|
|
340
|
+
* @param {UserJSON | string} json - Either a UserJSON object or a JSON string
|
|
341
|
+
* @returns {User | undefined} A User instance if valid, undefined otherwise
|
|
342
|
+
*
|
|
343
|
+
* @example
|
|
344
|
+
* ```typescript
|
|
345
|
+
* // From localStorage
|
|
346
|
+
* const stored = localStorage.getItem('currentUser');
|
|
347
|
+
* const user = User.fromJSON(stored!);
|
|
348
|
+
*
|
|
349
|
+
* // From object
|
|
350
|
+
* const userJson = {
|
|
351
|
+
* logIn: { id: "...", ... },
|
|
352
|
+
* companyProfile: { id: "...", ... },
|
|
353
|
+
* token: "..."
|
|
354
|
+
* };
|
|
355
|
+
* const user = User.fromJSON(userJson);
|
|
356
|
+
* ```
|
|
357
|
+
*/
|
|
358
|
+
static fromJSON(json: UserJSON | string): User | undefined;
|
|
359
|
+
/**
|
|
360
|
+
* Type guard using Zod schema validation
|
|
361
|
+
*/
|
|
362
|
+
static isUserJSON(obj: unknown): obj is UserJSON;
|
|
363
|
+
}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { BeneficiaryType, BeneficiaryDTO } from "@/modules/beneficiary/beneficiary.dtos.js";
|
|
2
|
+
import { PayoutDTO } from "@/modules/payout/payout.dtos.js";
|
|
3
|
+
import { Bank, ISO2CountryCode, PhoneNumber } from "@temboplus/frontend-core";
|
|
4
|
+
import type { BankSwiftCode, MNOId } from "@temboplus/frontend-core";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
export declare const MobileBeneficiaryInfoJSONSchema: z.ZodObject<{
|
|
7
|
+
type: z.ZodLiteral<"Mobile">;
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
phoneNumber: z.ZodString;
|
|
10
|
+
mnoId: z.ZodString;
|
|
11
|
+
version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
type: "Mobile";
|
|
14
|
+
name: string;
|
|
15
|
+
version: string;
|
|
16
|
+
phoneNumber: string;
|
|
17
|
+
mnoId: string;
|
|
18
|
+
}, {
|
|
19
|
+
type: "Mobile";
|
|
20
|
+
name: string;
|
|
21
|
+
phoneNumber: string;
|
|
22
|
+
mnoId: string;
|
|
23
|
+
version?: string | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const BankBeneficiaryInfoJSONSchema: z.ZodObject<{
|
|
26
|
+
type: z.ZodLiteral<"Bank">;
|
|
27
|
+
accName: z.ZodString;
|
|
28
|
+
swiftCode: z.ZodString;
|
|
29
|
+
countryCode: z.ZodString;
|
|
30
|
+
accNo: z.ZodString;
|
|
31
|
+
version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
type: "Bank";
|
|
34
|
+
version: string;
|
|
35
|
+
countryCode: string;
|
|
36
|
+
accName: string;
|
|
37
|
+
swiftCode: string;
|
|
38
|
+
accNo: string;
|
|
39
|
+
}, {
|
|
40
|
+
type: "Bank";
|
|
41
|
+
countryCode: string;
|
|
42
|
+
accName: string;
|
|
43
|
+
swiftCode: string;
|
|
44
|
+
accNo: string;
|
|
45
|
+
version?: string | undefined;
|
|
46
|
+
}>;
|
|
47
|
+
export declare const BeneficiaryInfoJSONSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
48
|
+
type: z.ZodLiteral<"Mobile">;
|
|
49
|
+
name: z.ZodString;
|
|
50
|
+
phoneNumber: z.ZodString;
|
|
51
|
+
mnoId: z.ZodString;
|
|
52
|
+
version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
type: "Mobile";
|
|
55
|
+
name: string;
|
|
56
|
+
version: string;
|
|
57
|
+
phoneNumber: string;
|
|
58
|
+
mnoId: string;
|
|
59
|
+
}, {
|
|
60
|
+
type: "Mobile";
|
|
61
|
+
name: string;
|
|
62
|
+
phoneNumber: string;
|
|
63
|
+
mnoId: string;
|
|
64
|
+
version?: string | undefined;
|
|
65
|
+
}>, z.ZodObject<{
|
|
66
|
+
type: z.ZodLiteral<"Bank">;
|
|
67
|
+
accName: z.ZodString;
|
|
68
|
+
swiftCode: z.ZodString;
|
|
69
|
+
countryCode: z.ZodString;
|
|
70
|
+
accNo: z.ZodString;
|
|
71
|
+
version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
type: "Bank";
|
|
74
|
+
version: string;
|
|
75
|
+
countryCode: string;
|
|
76
|
+
accName: string;
|
|
77
|
+
swiftCode: string;
|
|
78
|
+
accNo: string;
|
|
79
|
+
}, {
|
|
80
|
+
type: "Bank";
|
|
81
|
+
countryCode: string;
|
|
82
|
+
accName: string;
|
|
83
|
+
swiftCode: string;
|
|
84
|
+
accNo: string;
|
|
85
|
+
version?: string | undefined;
|
|
86
|
+
}>]>;
|
|
87
|
+
export type MobileBeneficiaryInfoJSON = z.infer<typeof MobileBeneficiaryInfoJSONSchema>;
|
|
88
|
+
export type BankBeneficiaryInfoJSON = z.infer<typeof BankBeneficiaryInfoJSONSchema>;
|
|
89
|
+
export type BeneficiaryInfoJSON = z.infer<typeof BeneficiaryInfoJSONSchema>;
|
|
90
|
+
/**
|
|
91
|
+
* Abstract base class for beneficiary information.
|
|
92
|
+
*/
|
|
93
|
+
declare abstract class BaseBeneficiaryInfo {
|
|
94
|
+
readonly type: BeneficiaryType;
|
|
95
|
+
readonly countryCode: ISO2CountryCode;
|
|
96
|
+
constructor(type: BeneficiaryType, countryCode: ISO2CountryCode);
|
|
97
|
+
abstract get channelId(): MNOId | BankSwiftCode;
|
|
98
|
+
abstract get channelName(): string;
|
|
99
|
+
abstract get accountName(): string;
|
|
100
|
+
abstract get accountNumber(): string;
|
|
101
|
+
abstract get accountNameLabel(): string;
|
|
102
|
+
abstract get accountNumberLabel(): string;
|
|
103
|
+
abstract get channelLabel(): string;
|
|
104
|
+
abstract validate(): boolean;
|
|
105
|
+
abstract toJSON(): BeneficiaryInfoJSON;
|
|
106
|
+
toJSONString(): string;
|
|
107
|
+
get isMobile(): boolean;
|
|
108
|
+
get isBank(): boolean;
|
|
109
|
+
get displayName(): string;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Mobile beneficiary information implementation.
|
|
113
|
+
*/
|
|
114
|
+
export declare class MobileBeneficiaryInfo extends BaseBeneficiaryInfo {
|
|
115
|
+
readonly name: string;
|
|
116
|
+
readonly phoneNumber: PhoneNumber;
|
|
117
|
+
readonly mnoId: MNOId;
|
|
118
|
+
constructor(name: string, phoneNumber: PhoneNumber, mnoId?: MNOId);
|
|
119
|
+
static from(data: {
|
|
120
|
+
name: string;
|
|
121
|
+
phoneNumber: PhoneNumber;
|
|
122
|
+
mnoId?: MNOId;
|
|
123
|
+
}): MobileBeneficiaryInfo | undefined;
|
|
124
|
+
static fromBeneficiaryDTO(info: BeneficiaryDTO): MobileBeneficiaryInfo | undefined;
|
|
125
|
+
static fromPayoutDTO(info: PayoutDTO): MobileBeneficiaryInfo | undefined;
|
|
126
|
+
static is(obj: unknown): obj is MobileBeneficiaryInfo;
|
|
127
|
+
validate(): boolean;
|
|
128
|
+
getValidationDetails(): {
|
|
129
|
+
isValid: boolean;
|
|
130
|
+
errors: string[];
|
|
131
|
+
warnings: string[];
|
|
132
|
+
};
|
|
133
|
+
get accountName(): string;
|
|
134
|
+
get accountNumber(): string;
|
|
135
|
+
get accountNameLabel(): string;
|
|
136
|
+
get accountNumberLabel(): string;
|
|
137
|
+
get channelLabel(): string;
|
|
138
|
+
get channelId(): MNOId;
|
|
139
|
+
get channelName(): string;
|
|
140
|
+
toJSON(): MobileBeneficiaryInfoJSON;
|
|
141
|
+
static fromJSON(json: MobileBeneficiaryInfoJSON | string): MobileBeneficiaryInfo | undefined;
|
|
142
|
+
static fromJSONString(jsonString: string): MobileBeneficiaryInfo | undefined;
|
|
143
|
+
static isMobileBeneficiaryInfoJSON(obj: unknown): obj is MobileBeneficiaryInfoJSON;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Bank beneficiary information implementation.
|
|
147
|
+
*/
|
|
148
|
+
export declare class BankBeneficiaryInfo extends BaseBeneficiaryInfo {
|
|
149
|
+
readonly accName: string;
|
|
150
|
+
readonly bank: Bank;
|
|
151
|
+
readonly accNo: string;
|
|
152
|
+
constructor(accName: string, bank: Bank, accNo: string);
|
|
153
|
+
static from(data: {
|
|
154
|
+
accName: string;
|
|
155
|
+
bank: Bank;
|
|
156
|
+
accNo: string;
|
|
157
|
+
}): BankBeneficiaryInfo | undefined;
|
|
158
|
+
static fromBeneficiaryDTO(info: BeneficiaryDTO): BankBeneficiaryInfo | undefined;
|
|
159
|
+
static fromPayoutDTO(info: PayoutDTO): BankBeneficiaryInfo | undefined;
|
|
160
|
+
static is(obj: unknown): obj is BankBeneficiaryInfo;
|
|
161
|
+
validate(): boolean;
|
|
162
|
+
get accountName(): string;
|
|
163
|
+
get accountNumber(): string;
|
|
164
|
+
get accountNameLabel(): string;
|
|
165
|
+
get accountNumberLabel(): string;
|
|
166
|
+
get channelLabel(): string;
|
|
167
|
+
get channelId(): BankSwiftCode;
|
|
168
|
+
get channelName(): string;
|
|
169
|
+
toJSON(): BankBeneficiaryInfoJSON;
|
|
170
|
+
static fromJSON(json: BankBeneficiaryInfoJSON | string): BankBeneficiaryInfo | undefined;
|
|
171
|
+
static fromJSONString(jsonString: string): BankBeneficiaryInfo | undefined;
|
|
172
|
+
static isBankBeneficiaryInfoJSON(obj: unknown): obj is BankBeneficiaryInfoJSON;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Union type representing either a mobile or bank beneficiary.
|
|
176
|
+
*/
|
|
177
|
+
export type BeneficiaryInfo = MobileBeneficiaryInfo | BankBeneficiaryInfo;
|
|
178
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BeneficiaryInfo } from "@/modules/beneficiary/beneficiary-info.model.js";
|
|
2
|
+
import { BeneficiaryInputDTO } from "./beneficiary.dtos.js";
|
|
3
|
+
/**
|
|
4
|
+
* Factory for resolving and validating a raw `BeneficiaryInput` into a typed and valid version.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ValidatedBeneficiaryInputFactory {
|
|
7
|
+
private handlers;
|
|
8
|
+
/**
|
|
9
|
+
* Resolves a raw beneficiary input into a valid and strongly-typed `BeneficiaryInput`.
|
|
10
|
+
*
|
|
11
|
+
* @param {BeneficiaryInputDTO} data - The unvalidated input object
|
|
12
|
+
* @returns {BeneficiaryInputDTO} - A valid and converted input ready for use
|
|
13
|
+
* @throws {Error} - If the input cannot be handled by any handler
|
|
14
|
+
*/
|
|
15
|
+
resolve(data: BeneficiaryInfo): BeneficiaryInputDTO;
|
|
16
|
+
}
|