@temboplus/afloat 0.1.80 → 0.2.0-beta.1
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/{script/npm/src/src/models/permission.d.ts → dist/modules/login/permission.type.d.ts} +8 -9
- 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 +0 -55
- 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.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,383 @@
|
|
|
1
|
+
import { PayoutDTO, PayoutStatus, PayoutApprovalStatus, PayoutAuthorizer } from "@/modules/payout/payout.dtos.js";
|
|
2
|
+
import { Amount } from "@temboplus/frontend-core";
|
|
3
|
+
import { BeneficiaryInfo } from "../beneficiary/beneficiary-info.model.js";
|
|
4
|
+
import z from "zod";
|
|
5
|
+
/**
|
|
6
|
+
* Zod schema for Payout JSON serialization
|
|
7
|
+
* This mirrors the PayoutDTO structure but is specifically for JSON serialization
|
|
8
|
+
*/
|
|
9
|
+
export declare const PayoutJSONSchema: z.ZodObject<{
|
|
10
|
+
id: z.ZodString;
|
|
11
|
+
profileId: z.ZodString;
|
|
12
|
+
payeeName: z.ZodString;
|
|
13
|
+
channel: z.ZodString;
|
|
14
|
+
msisdn: z.ZodString;
|
|
15
|
+
amount: z.ZodNumber;
|
|
16
|
+
currencyCode: z.ZodString;
|
|
17
|
+
countryCode: z.ZodString;
|
|
18
|
+
description: z.ZodString;
|
|
19
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20
|
+
status: z.ZodNativeEnum<typeof PayoutStatus>;
|
|
21
|
+
statusMessage: z.ZodString;
|
|
22
|
+
partnerReference: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
23
|
+
createdAt: z.ZodString;
|
|
24
|
+
updatedAt: z.ZodString;
|
|
25
|
+
actionedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
26
|
+
approvalStatus: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof PayoutApprovalStatus>>>;
|
|
27
|
+
createdBy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
28
|
+
id: z.ZodString;
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
identity: z.ZodString;
|
|
31
|
+
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
name: string;
|
|
33
|
+
id: string;
|
|
34
|
+
identity: string;
|
|
35
|
+
}, {
|
|
36
|
+
name: string;
|
|
37
|
+
id: string;
|
|
38
|
+
identity: string;
|
|
39
|
+
}>>>;
|
|
40
|
+
actionedBy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
41
|
+
id: z.ZodString;
|
|
42
|
+
name: z.ZodString;
|
|
43
|
+
identity: z.ZodString;
|
|
44
|
+
}, "strip", z.ZodTypeAny, {
|
|
45
|
+
name: string;
|
|
46
|
+
id: string;
|
|
47
|
+
identity: string;
|
|
48
|
+
}, {
|
|
49
|
+
name: string;
|
|
50
|
+
id: string;
|
|
51
|
+
identity: string;
|
|
52
|
+
}>>>;
|
|
53
|
+
version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
54
|
+
}, "strip", z.ZodTypeAny, {
|
|
55
|
+
status: PayoutStatus;
|
|
56
|
+
createdAt: string;
|
|
57
|
+
id: string;
|
|
58
|
+
version: string;
|
|
59
|
+
profileId: string;
|
|
60
|
+
updatedAt: string;
|
|
61
|
+
description: string;
|
|
62
|
+
channel: string;
|
|
63
|
+
msisdn: string;
|
|
64
|
+
amount: number;
|
|
65
|
+
payeeName: string;
|
|
66
|
+
countryCode: string;
|
|
67
|
+
currencyCode: string;
|
|
68
|
+
statusMessage: string;
|
|
69
|
+
notes?: string | null | undefined;
|
|
70
|
+
partnerReference?: string | null | undefined;
|
|
71
|
+
actionedAt?: string | null | undefined;
|
|
72
|
+
approvalStatus?: PayoutApprovalStatus | null | undefined;
|
|
73
|
+
createdBy?: {
|
|
74
|
+
name: string;
|
|
75
|
+
id: string;
|
|
76
|
+
identity: string;
|
|
77
|
+
} | null | undefined;
|
|
78
|
+
actionedBy?: {
|
|
79
|
+
name: string;
|
|
80
|
+
id: string;
|
|
81
|
+
identity: string;
|
|
82
|
+
} | null | undefined;
|
|
83
|
+
}, {
|
|
84
|
+
status: PayoutStatus;
|
|
85
|
+
createdAt: string;
|
|
86
|
+
id: string;
|
|
87
|
+
profileId: string;
|
|
88
|
+
updatedAt: string;
|
|
89
|
+
description: string;
|
|
90
|
+
channel: string;
|
|
91
|
+
msisdn: string;
|
|
92
|
+
amount: number;
|
|
93
|
+
payeeName: string;
|
|
94
|
+
countryCode: string;
|
|
95
|
+
currencyCode: string;
|
|
96
|
+
statusMessage: string;
|
|
97
|
+
version?: string | undefined;
|
|
98
|
+
notes?: string | null | undefined;
|
|
99
|
+
partnerReference?: string | null | undefined;
|
|
100
|
+
actionedAt?: string | null | undefined;
|
|
101
|
+
approvalStatus?: PayoutApprovalStatus | null | undefined;
|
|
102
|
+
createdBy?: {
|
|
103
|
+
name: string;
|
|
104
|
+
id: string;
|
|
105
|
+
identity: string;
|
|
106
|
+
} | null | undefined;
|
|
107
|
+
actionedBy?: {
|
|
108
|
+
name: string;
|
|
109
|
+
id: string;
|
|
110
|
+
identity: string;
|
|
111
|
+
} | null | undefined;
|
|
112
|
+
}>;
|
|
113
|
+
/**
|
|
114
|
+
* Infer the PayoutJSON type from the schema
|
|
115
|
+
*/
|
|
116
|
+
export type PayoutJSON = z.infer<typeof PayoutJSONSchema>;
|
|
117
|
+
/**
|
|
118
|
+
* Payout class that wraps the Zod schema and provides additional functionality
|
|
119
|
+
*/
|
|
120
|
+
export declare class Payout {
|
|
121
|
+
private readonly data;
|
|
122
|
+
/**
|
|
123
|
+
* Private constructor - use static methods to create instances
|
|
124
|
+
*/
|
|
125
|
+
private constructor();
|
|
126
|
+
/** Unique identifier for the payout */
|
|
127
|
+
get id(): string;
|
|
128
|
+
/** Profile identifier associated with this payout */
|
|
129
|
+
get profileId(): string;
|
|
130
|
+
/** Name of the payee/recipient */
|
|
131
|
+
get payeeName(): string;
|
|
132
|
+
/** Payment channel used for this payout */
|
|
133
|
+
get channel(): string;
|
|
134
|
+
/** Mobile number or bank account identifier */
|
|
135
|
+
get msisdn(): string;
|
|
136
|
+
/**
|
|
137
|
+
* Amount to be paid out
|
|
138
|
+
* @returns {Amount} Amount object representing the payout value
|
|
139
|
+
*/
|
|
140
|
+
get amount(): Amount;
|
|
141
|
+
/** Description of the payout purpose */
|
|
142
|
+
get description(): string;
|
|
143
|
+
/** Optional additional notes about the payout */
|
|
144
|
+
get notes(): string | undefined | null;
|
|
145
|
+
/**
|
|
146
|
+
* Current status of the payout
|
|
147
|
+
* Derived from both approval status and transaction status:
|
|
148
|
+
* - Returns REJECTED if approval status is "Rejected"
|
|
149
|
+
* - Returns FAILED if approved but transaction failed
|
|
150
|
+
* - Returns PAID if approved and transaction succeeded
|
|
151
|
+
* - Returns PENDING if awaiting approval
|
|
152
|
+
* - Falls back to transaction status in other cases
|
|
153
|
+
*
|
|
154
|
+
* @returns {PAYOUT_STATUS} Current status of the payout
|
|
155
|
+
* @see {@link PAYOUT_STATUS} for all possible status values
|
|
156
|
+
*/
|
|
157
|
+
get status(): PayoutStatus;
|
|
158
|
+
/** Status message providing details about current state */
|
|
159
|
+
get statusMessage(): string;
|
|
160
|
+
/** Optional reference ID from payment partner */
|
|
161
|
+
get partnerReference(): string | undefined | null;
|
|
162
|
+
/** Timestamp when payout was created */
|
|
163
|
+
get createdAt(): Date;
|
|
164
|
+
/** Timestamp when payout was last updated */
|
|
165
|
+
get updatedAt(): Date;
|
|
166
|
+
/** Timestamp when payout was last updated */
|
|
167
|
+
get actionedAt(): Date | undefined | null;
|
|
168
|
+
/** Current approval status of the payout */
|
|
169
|
+
get approvalStatus(): PayoutApprovalStatus | undefined | null;
|
|
170
|
+
/** Information about who created the payout */
|
|
171
|
+
get createdBy(): PayoutAuthorizer | undefined | null;
|
|
172
|
+
/** Information about who last actioned the payout */
|
|
173
|
+
get actionedBy(): PayoutAuthorizer | undefined | null;
|
|
174
|
+
/**
|
|
175
|
+
* Tries to construct beneficiary information from the payout data.
|
|
176
|
+
*/
|
|
177
|
+
get beneficiaryInfo(): BeneficiaryInfo | undefined;
|
|
178
|
+
/**
|
|
179
|
+
* @deprecated Use beneficiaryInfo instead
|
|
180
|
+
*/
|
|
181
|
+
get contactInfo(): BeneficiaryInfo | undefined;
|
|
182
|
+
/**
|
|
183
|
+
* Creates a Payout instance from raw data
|
|
184
|
+
* @throws {ZodError} if validation fails
|
|
185
|
+
*/
|
|
186
|
+
static create(data: PayoutDTO): Payout;
|
|
187
|
+
/**
|
|
188
|
+
* Creates multiple Payout instances from an array of raw data
|
|
189
|
+
* @throws {ZodError} if validation fails for any item
|
|
190
|
+
*/
|
|
191
|
+
static createMany(dataArray: PayoutDTO[]): Payout[];
|
|
192
|
+
/**
|
|
193
|
+
* Creates a Payout instance from raw data without throwing
|
|
194
|
+
* @returns {Payout | null} Payout instance or null if validation fails
|
|
195
|
+
*/
|
|
196
|
+
static createSafe(data: PayoutDTO): Payout | null;
|
|
197
|
+
/**
|
|
198
|
+
* Checks if an unknown value contains valid data to construct a Payout instance.
|
|
199
|
+
* This is useful when validating raw data structures before instantiation.
|
|
200
|
+
*
|
|
201
|
+
* @param {unknown} obj - The value containing potential payout data
|
|
202
|
+
* @returns {obj is Payout} Type predicate indicating if a Payout can be constructed
|
|
203
|
+
*
|
|
204
|
+
* @example
|
|
205
|
+
* ```typescript
|
|
206
|
+
* const rawData = await fetchPayoutData();
|
|
207
|
+
* if (Payout.canConstruct(rawData)) {
|
|
208
|
+
* const payout = Payout.create(rawData);
|
|
209
|
+
* // TypeScript knows payout is valid here
|
|
210
|
+
* console.log(payout.amount.toString());
|
|
211
|
+
* }
|
|
212
|
+
* ```
|
|
213
|
+
*
|
|
214
|
+
* @throws {never} This method never throws errors
|
|
215
|
+
*
|
|
216
|
+
* @remarks
|
|
217
|
+
* This method performs strict validation against the {@link PayoutData} schema
|
|
218
|
+
*/
|
|
219
|
+
static canConstruct(obj: unknown): obj is Payout;
|
|
220
|
+
/**
|
|
221
|
+
* Validates if an unknown value is a Payout instance.
|
|
222
|
+
* This is a runtime type guard that ensures proper object structure and data validity.
|
|
223
|
+
*
|
|
224
|
+
* @param {unknown} obj - The value to validate
|
|
225
|
+
* @returns {obj is Payout} Type predicate indicating if the value is a valid Payout
|
|
226
|
+
*
|
|
227
|
+
* @example
|
|
228
|
+
* ```typescript
|
|
229
|
+
* const maybePayout = getPayoutFromCache();
|
|
230
|
+
* if (Payout.is(maybePayout)) {
|
|
231
|
+
* // TypeScript knows maybePayout is a Payout here
|
|
232
|
+
* console.log(maybePayout.status);
|
|
233
|
+
* }
|
|
234
|
+
* ```
|
|
235
|
+
*
|
|
236
|
+
* @throws {never} This method never throws errors
|
|
237
|
+
*
|
|
238
|
+
* @remarks
|
|
239
|
+
* This method performs a complete structural validation:
|
|
240
|
+
* 1. Checks if the value is an object
|
|
241
|
+
* 2. Verifies presence of internal data property
|
|
242
|
+
* 3. Validates the data against PayoutData schema
|
|
243
|
+
* 4. Ensures the object is a proper Payout instance
|
|
244
|
+
*
|
|
245
|
+
* Use this method when:
|
|
246
|
+
* - Validating cached Payout instances
|
|
247
|
+
* - Checking serialized Payout objects
|
|
248
|
+
* - Verifying API responses
|
|
249
|
+
* - Type narrowing in conditional blocks
|
|
250
|
+
*/
|
|
251
|
+
static is(obj: unknown): obj is Payout;
|
|
252
|
+
/**
|
|
253
|
+
* Serializes the Payout instance to a JSON-compatible object
|
|
254
|
+
*
|
|
255
|
+
* Converts all Date objects to ISO strings for proper JSON serialization.
|
|
256
|
+
* The resulting object can be safely stringified and stored or transmitted.
|
|
257
|
+
*
|
|
258
|
+
* @returns {PayoutJSON} A plain object containing all payout data
|
|
259
|
+
*
|
|
260
|
+
* @example
|
|
261
|
+
* ```typescript
|
|
262
|
+
* const payout = Payout.create(payoutData);
|
|
263
|
+
* const json = payout.toJSON();
|
|
264
|
+
* // {
|
|
265
|
+
* // id: "payout-123",
|
|
266
|
+
* // amount: 50000,
|
|
267
|
+
* // currencyCode: "TZS",
|
|
268
|
+
* // createdAt: "2024-01-15T10:30:00.000Z",
|
|
269
|
+
* // ...
|
|
270
|
+
* // }
|
|
271
|
+
* ```
|
|
272
|
+
*/
|
|
273
|
+
toJSON(): PayoutJSON;
|
|
274
|
+
/**
|
|
275
|
+
* Serializes the Payout instance to a JSON string
|
|
276
|
+
*
|
|
277
|
+
* @returns {string} JSON string representation of the payout
|
|
278
|
+
*
|
|
279
|
+
* @example
|
|
280
|
+
* ```typescript
|
|
281
|
+
* const payout = Payout.create(payoutData);
|
|
282
|
+
* const jsonString = payout.toJSONString();
|
|
283
|
+
*
|
|
284
|
+
* // Store in localStorage
|
|
285
|
+
* localStorage.setItem('pendingPayout', jsonString);
|
|
286
|
+
*
|
|
287
|
+
* // Or send to server
|
|
288
|
+
* await fetch('/api/cache-payout', {
|
|
289
|
+
* method: 'POST',
|
|
290
|
+
* body: jsonString
|
|
291
|
+
* });
|
|
292
|
+
* ```
|
|
293
|
+
*/
|
|
294
|
+
toJSONString(): string;
|
|
295
|
+
/**
|
|
296
|
+
* Creates a Payout instance from a JSON-compatible object or string
|
|
297
|
+
*
|
|
298
|
+
* This method reconstructs a Payout instance from data that was previously
|
|
299
|
+
* serialized using toJSON(). It validates the input data using Zod schema
|
|
300
|
+
* and converts ISO date strings back to Date objects.
|
|
301
|
+
*
|
|
302
|
+
* @param {PayoutJSON | string} json - Either a PayoutJSON object or a JSON string
|
|
303
|
+
* @returns {Payout | undefined} A Payout instance if valid, undefined otherwise
|
|
304
|
+
*
|
|
305
|
+
* @example
|
|
306
|
+
* ```typescript
|
|
307
|
+
* // From localStorage
|
|
308
|
+
* const stored = localStorage.getItem('pendingPayout');
|
|
309
|
+
* const payout = Payout.fromJSON(stored!);
|
|
310
|
+
*
|
|
311
|
+
* if (payout) {
|
|
312
|
+
* console.log(payout.amount.label); // "TSh 50,000.00"
|
|
313
|
+
* console.log(payout.status); // "PENDING"
|
|
314
|
+
* }
|
|
315
|
+
*
|
|
316
|
+
* // From object
|
|
317
|
+
* const payoutJson = {
|
|
318
|
+
* id: "payout-123",
|
|
319
|
+
* amount: 50000,
|
|
320
|
+
* currencyCode: "TZS",
|
|
321
|
+
* createdAt: "2024-01-15T10:30:00.000Z",
|
|
322
|
+
* ...
|
|
323
|
+
* };
|
|
324
|
+
* const payout = Payout.fromJSON(payoutJson);
|
|
325
|
+
* ```
|
|
326
|
+
*/
|
|
327
|
+
static fromJSON(json: PayoutJSON | string): Payout | undefined;
|
|
328
|
+
/**
|
|
329
|
+
* Type guard using Zod schema validation
|
|
330
|
+
*
|
|
331
|
+
* Checks if an unknown value conforms to the PayoutJSON structure
|
|
332
|
+
* without attempting to create a Payout instance.
|
|
333
|
+
*
|
|
334
|
+
* @param {unknown} obj - The object to validate
|
|
335
|
+
* @returns {boolean} True if the object is a valid PayoutJSON
|
|
336
|
+
*
|
|
337
|
+
* @example
|
|
338
|
+
* ```typescript
|
|
339
|
+
* const data = JSON.parse(localStorage.getItem('payout'));
|
|
340
|
+
*
|
|
341
|
+
* if (Payout.isPayoutJSON(data)) {
|
|
342
|
+
* const payout = Payout.fromJSON(data);
|
|
343
|
+
* // TypeScript knows data is PayoutJSON here
|
|
344
|
+
* }
|
|
345
|
+
* ```
|
|
346
|
+
*/
|
|
347
|
+
static isPayoutJSON(obj: unknown): obj is PayoutJSON;
|
|
348
|
+
/**
|
|
349
|
+
* Creates multiple Payout instances from a JSON array
|
|
350
|
+
*
|
|
351
|
+
* @param {PayoutJSON[] | string} jsonArray - Array of PayoutJSON objects or JSON string
|
|
352
|
+
* @returns {Payout[]} Array of Payout instances (invalid items are filtered out)
|
|
353
|
+
*
|
|
354
|
+
* @example
|
|
355
|
+
* ```typescript
|
|
356
|
+
* // From API response
|
|
357
|
+
* const response = await fetch('/api/payouts');
|
|
358
|
+
* const jsonArray = await response.json();
|
|
359
|
+
* const payouts = Payout.fromJSONArray(jsonArray);
|
|
360
|
+
*
|
|
361
|
+
* // From stored array
|
|
362
|
+
* const stored = localStorage.getItem('recentPayouts');
|
|
363
|
+
* const payouts = Payout.fromJSONArray(stored!);
|
|
364
|
+
* ```
|
|
365
|
+
*/
|
|
366
|
+
static fromJSONArray(jsonArray: PayoutJSON[] | string): Payout[];
|
|
367
|
+
/**
|
|
368
|
+
* Serializes an array of Payout instances to JSON
|
|
369
|
+
*
|
|
370
|
+
* @param {Payout[]} payouts - Array of Payout instances to serialize
|
|
371
|
+
* @returns {PayoutJSON[]} Array of PayoutJSON objects
|
|
372
|
+
*
|
|
373
|
+
* @example
|
|
374
|
+
* ```typescript
|
|
375
|
+
* const payouts = [payout1, payout2, payout3];
|
|
376
|
+
* const jsonArray = Payout.toJSONArray(payouts);
|
|
377
|
+
*
|
|
378
|
+
* // Store or transmit
|
|
379
|
+
* localStorage.setItem('recentPayouts', JSON.stringify(jsonArray));
|
|
380
|
+
* ```
|
|
381
|
+
*/
|
|
382
|
+
static toJSONArray(payouts: Payout[]): PayoutJSON[];
|
|
383
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { QueryBuilder } from "@/lib/query/index.js";
|
|
2
|
+
import { PayoutStatus, PayoutApprovalStatus, PayoutFilters } from "./payout.dtos.js";
|
|
3
|
+
import { Amount } from "@temboplus/frontend-core";
|
|
4
|
+
/**
|
|
5
|
+
* Payout-specific query builder that extends the base QueryBuilder
|
|
6
|
+
* and handles all possible input conversions (DTOs, URL params, etc.)
|
|
7
|
+
*/
|
|
8
|
+
export declare class PayoutQuery extends QueryBuilder {
|
|
9
|
+
/**
|
|
10
|
+
* Create empty payout query with defaults
|
|
11
|
+
*/
|
|
12
|
+
static create(): PayoutQuery;
|
|
13
|
+
/**
|
|
14
|
+
* Create from typed DTO/filters object
|
|
15
|
+
*/
|
|
16
|
+
static fromFilters(filters: PayoutFilters): PayoutQuery;
|
|
17
|
+
/**
|
|
18
|
+
* Create from URL search parameters (strings)
|
|
19
|
+
*/
|
|
20
|
+
static fromUrlParams(params: Record<string, string>): PayoutQuery;
|
|
21
|
+
/**
|
|
22
|
+
* Create from URLSearchParams object
|
|
23
|
+
*/
|
|
24
|
+
static fromSearchParams(searchParams: URLSearchParams): PayoutQuery;
|
|
25
|
+
/**
|
|
26
|
+
* Create from Next.js Request object
|
|
27
|
+
*/
|
|
28
|
+
static fromRequest(request: Request): PayoutQuery;
|
|
29
|
+
/**
|
|
30
|
+
* Create from any supported input type
|
|
31
|
+
*/
|
|
32
|
+
static from(input: QueryBuilder | PayoutFilters | Record<string, string> | URLSearchParams | null | undefined): PayoutQuery;
|
|
33
|
+
/**
|
|
34
|
+
* Type guard for string records
|
|
35
|
+
*/
|
|
36
|
+
private static isStringRecord;
|
|
37
|
+
whereStatus(status: PayoutStatus): this;
|
|
38
|
+
whereApprovalStatus(approvalStatus: PayoutApprovalStatus): this;
|
|
39
|
+
whereChannel(channel: string): this;
|
|
40
|
+
wherePending(): this;
|
|
41
|
+
whereApproved(): this;
|
|
42
|
+
whereRejected(): this;
|
|
43
|
+
wherePaid(): this;
|
|
44
|
+
whereFailed(): this;
|
|
45
|
+
whereAmountBetween(min: Amount, max: Amount): this;
|
|
46
|
+
wherePayee(payeeName: string): this;
|
|
47
|
+
whereMsisdn(msisdn: string): this;
|
|
48
|
+
whereProfileId(profileId: string): this;
|
|
49
|
+
wherePartnerReference(partnerReference: string): this;
|
|
50
|
+
whereSearch(searchTerm: string): this;
|
|
51
|
+
whereCurrencyCode(currencyCode: string): this;
|
|
52
|
+
/**
|
|
53
|
+
* Apply all filters from PayoutFilters object
|
|
54
|
+
*/
|
|
55
|
+
private applyFilters;
|
|
56
|
+
/**
|
|
57
|
+
* Convert to PayoutFilters DTO
|
|
58
|
+
*/
|
|
59
|
+
toFilters(): PayoutFilters;
|
|
60
|
+
/**
|
|
61
|
+
* Convert to user-friendly URL parameters (for browser URLs)
|
|
62
|
+
*/
|
|
63
|
+
toUrlParams(): Record<string, string>;
|
|
64
|
+
/**
|
|
65
|
+
* Convert to URLSearchParams
|
|
66
|
+
*/
|
|
67
|
+
toSearchParams(): URLSearchParams;
|
|
68
|
+
/**
|
|
69
|
+
* Convert to query string
|
|
70
|
+
*/
|
|
71
|
+
toQueryString(): string;
|
|
72
|
+
/**
|
|
73
|
+
* Create new instance with updated pagination
|
|
74
|
+
*/
|
|
75
|
+
withPagination(page: number, limit?: number): PayoutQuery;
|
|
76
|
+
/**
|
|
77
|
+
* Create new instance with updated sorting
|
|
78
|
+
*/
|
|
79
|
+
withSorting(sortBy: string, sortOrder?: "asc" | "desc"): PayoutQuery;
|
|
80
|
+
/**
|
|
81
|
+
* Create new instance with date range
|
|
82
|
+
*/
|
|
83
|
+
withDateRange(startDate?: string | Date, endDate?: string | Date): PayoutQuery;
|
|
84
|
+
/**
|
|
85
|
+
* Create new instance with status filter
|
|
86
|
+
*/
|
|
87
|
+
withStatus(status?: PayoutStatus): PayoutQuery;
|
|
88
|
+
/**
|
|
89
|
+
* Create new instance with approval status filter
|
|
90
|
+
*/
|
|
91
|
+
withApprovalStatus(approvalStatus?: PayoutApprovalStatus): PayoutQuery;
|
|
92
|
+
/**
|
|
93
|
+
* Create new instance with channel filter
|
|
94
|
+
*/
|
|
95
|
+
withChannel(channel?: string): PayoutQuery;
|
|
96
|
+
/**
|
|
97
|
+
* Includes default relations for eager loading.
|
|
98
|
+
* This ensures that related data (createdBy, actionedBy) is fetched automatically.
|
|
99
|
+
* @returns The current query builder instance.
|
|
100
|
+
*/
|
|
101
|
+
includeDefaultRelations(): this;
|
|
102
|
+
/**
|
|
103
|
+
* Reset to first page
|
|
104
|
+
*/
|
|
105
|
+
resetPage(): PayoutQuery;
|
|
106
|
+
/**
|
|
107
|
+
* Check if any filters are applied
|
|
108
|
+
*/
|
|
109
|
+
hasFilters(): boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Get human-readable filter descriptions
|
|
112
|
+
*/
|
|
113
|
+
getActiveFilters(): string[];
|
|
114
|
+
/**
|
|
115
|
+
* Extract filter values from QueryBuilder options
|
|
116
|
+
*/
|
|
117
|
+
private extractFilterValues;
|
|
118
|
+
/**
|
|
119
|
+
* Extract primary sort field
|
|
120
|
+
*/
|
|
121
|
+
private extractSortField;
|
|
122
|
+
/**
|
|
123
|
+
* Extract primary sort order
|
|
124
|
+
*/
|
|
125
|
+
private extractSortOrder;
|
|
126
|
+
/**
|
|
127
|
+
* Type guard for valid statuses
|
|
128
|
+
*/
|
|
129
|
+
private isValidStatus;
|
|
130
|
+
/**
|
|
131
|
+
* Type guard for valid approval statuses
|
|
132
|
+
*/
|
|
133
|
+
private isValidApprovalStatus;
|
|
134
|
+
}
|