@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
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import { type ContactData, type ContactType } from "../schemas.js";
|
|
2
|
-
import { type ContactInfo } from "./contact_info.js";
|
|
3
|
-
/**
|
|
4
|
-
* Contact class that wraps the Zod schema and provides additional functionality
|
|
5
|
-
*/
|
|
6
|
-
export declare class Contact {
|
|
7
|
-
private readonly data;
|
|
8
|
-
/**
|
|
9
|
-
* Private constructor - use static methods to create instances
|
|
10
|
-
*/
|
|
11
|
-
private constructor();
|
|
12
|
-
/**
|
|
13
|
-
* Unique identifier for the contact
|
|
14
|
-
*/
|
|
15
|
-
get id(): string;
|
|
16
|
-
/**
|
|
17
|
-
* Profile identifier associated with this contact
|
|
18
|
-
*/
|
|
19
|
-
get profileId(): string;
|
|
20
|
-
/**
|
|
21
|
-
* Display name of the contact
|
|
22
|
-
*/
|
|
23
|
-
get displayName(): string;
|
|
24
|
-
/**
|
|
25
|
-
* Type of contact (Bank or Mobile)
|
|
26
|
-
*/
|
|
27
|
-
get type(): ContactType;
|
|
28
|
-
/**
|
|
29
|
-
* Creation timestamp of the contact
|
|
30
|
-
*/
|
|
31
|
-
get createdAt(): Date;
|
|
32
|
-
/**
|
|
33
|
-
* Update timestamp of the contact
|
|
34
|
-
*/
|
|
35
|
-
get updatedAt(): Date;
|
|
36
|
-
/**
|
|
37
|
-
* Detailed contact information based on contact type
|
|
38
|
-
*
|
|
39
|
-
* @returns {ContactInfo | undefined} Contact information object:
|
|
40
|
-
* - MobileContactInfo for mobile money contacts
|
|
41
|
-
* - BankContactInfo for bank contacts
|
|
42
|
-
* - undefined if contact information cannot be constructed
|
|
43
|
-
*
|
|
44
|
-
* @remarks
|
|
45
|
-
* For mobile contacts, constructs from phone number
|
|
46
|
-
* For bank contacts, constructs from SWIFT code and account number
|
|
47
|
-
*/
|
|
48
|
-
get info(): ContactInfo | undefined;
|
|
49
|
-
/**
|
|
50
|
-
* Payment channel for the contact
|
|
51
|
-
*
|
|
52
|
-
* @returns {string} Channel information:
|
|
53
|
-
* - For valid contacts, returns formatted channel from ContactInfo
|
|
54
|
-
* - For invalid contacts, falls back to account number
|
|
55
|
-
*/
|
|
56
|
-
get channel(): string;
|
|
57
|
-
/**
|
|
58
|
-
* Account number for the contact
|
|
59
|
-
*
|
|
60
|
-
* @returns {string} Account number:
|
|
61
|
-
* - For valid contacts, returns formatted account number from ContactInfo
|
|
62
|
-
* - For invalid contacts, falls back to raw account number
|
|
63
|
-
*/
|
|
64
|
-
get accNo(): string;
|
|
65
|
-
/**
|
|
66
|
-
* Account name for the contact
|
|
67
|
-
* Always returns the display name
|
|
68
|
-
*/
|
|
69
|
-
get accName(): string;
|
|
70
|
-
/**
|
|
71
|
-
* Label for the account number field based on contact type
|
|
72
|
-
*
|
|
73
|
-
* @returns {string} Appropriate label:
|
|
74
|
-
* - "Phone Number" for mobile contacts
|
|
75
|
-
* - "Bank Account Number" for bank contacts
|
|
76
|
-
* - "Account Number" as fallback
|
|
77
|
-
*/
|
|
78
|
-
get accNoLabel(): string;
|
|
79
|
-
/**
|
|
80
|
-
* Label for the channel field based on contact type
|
|
81
|
-
*
|
|
82
|
-
* @returns {string} Appropriate label:
|
|
83
|
-
* - "Channel" for mobile contacts
|
|
84
|
-
* - "Bank" for bank contacts
|
|
85
|
-
* - "Channel" as fallback
|
|
86
|
-
*/
|
|
87
|
-
get channelLabel(): string;
|
|
88
|
-
/**
|
|
89
|
-
* Label for the account name field based on contact type
|
|
90
|
-
*
|
|
91
|
-
* @returns {string} Appropriate label:
|
|
92
|
-
* - "Full Name" for mobile contacts
|
|
93
|
-
* - "Bank Account Name" for bank contacts
|
|
94
|
-
* - "Display Name" as fallback
|
|
95
|
-
*/
|
|
96
|
-
get accNameLabel(): string;
|
|
97
|
-
/**
|
|
98
|
-
* Creates a Contact instance from raw data
|
|
99
|
-
* @throws {ZodError} if validation fails
|
|
100
|
-
*/
|
|
101
|
-
static create(data: ContactData): Contact;
|
|
102
|
-
/**
|
|
103
|
-
* Creates multiple Contact instances from an array of raw data
|
|
104
|
-
* @throws {ZodError} if validation fails for any item
|
|
105
|
-
*/
|
|
106
|
-
static createMany(dataArray: ContactData[]): Contact[];
|
|
107
|
-
/**
|
|
108
|
-
* Creates a Contact instance from raw data without throwing
|
|
109
|
-
* @returns {Contact | null} Contact instance or null if validation fails
|
|
110
|
-
*/
|
|
111
|
-
static createSafe(data: ContactData): Contact | null;
|
|
112
|
-
/**
|
|
113
|
-
* Checks if an unknown value contains valid data to construct a Contact instance.
|
|
114
|
-
* This is useful when validating raw data structures before instantiation.
|
|
115
|
-
*
|
|
116
|
-
* @param {unknown} obj - The value containing potential contact data
|
|
117
|
-
* @returns {obj is Contact} Type predicate indicating if a Contact can be constructed
|
|
118
|
-
*
|
|
119
|
-
* @example
|
|
120
|
-
* ```typescript
|
|
121
|
-
* const rawData = await fetchFromAPI();
|
|
122
|
-
* if (Contact.canConstruct(rawData)) {
|
|
123
|
-
* const contact = Contact.create(rawData);
|
|
124
|
-
* // TypeScript knows contact is valid here
|
|
125
|
-
* console.log(contact.displayName);
|
|
126
|
-
* }
|
|
127
|
-
* ```
|
|
128
|
-
*
|
|
129
|
-
* @throws {never} This method never throws errors
|
|
130
|
-
*
|
|
131
|
-
* @remarks
|
|
132
|
-
* This method performs strict validation against the {@link ContactData} schema.
|
|
133
|
-
*/
|
|
134
|
-
static canConstruct(obj: unknown): obj is Contact;
|
|
135
|
-
/**
|
|
136
|
-
* Validates if an unknown value is a Contact instance.
|
|
137
|
-
* This is a runtime type guard that ensures proper object structure and data validity.
|
|
138
|
-
*
|
|
139
|
-
* @param {unknown} obj - The value to validate
|
|
140
|
-
* @returns {obj is Contact} Type predicate indicating if the value is a valid Contact
|
|
141
|
-
*
|
|
142
|
-
* @example
|
|
143
|
-
* ```typescript
|
|
144
|
-
* const maybeContact = getContactFromCache();
|
|
145
|
-
* if (Contact.is(maybeContact)) {
|
|
146
|
-
* // TypeScript knows maybeContact is a Contact here
|
|
147
|
-
* console.log(maybeContact.displayName);
|
|
148
|
-
* }
|
|
149
|
-
* ```
|
|
150
|
-
*
|
|
151
|
-
* @throws {never} This method never throws errors
|
|
152
|
-
*
|
|
153
|
-
* @remarks
|
|
154
|
-
* This method performs a complete structural validation:
|
|
155
|
-
* 1. Checks if the value is an object
|
|
156
|
-
* 2. Verifies presence of internal data property
|
|
157
|
-
* 3. Validates the data against ContactData schema
|
|
158
|
-
* 4. Ensures the object is a proper Contact instance
|
|
159
|
-
*
|
|
160
|
-
* Use this method when:
|
|
161
|
-
* - Validating cached Contact instances
|
|
162
|
-
* - Checking serialized Contact objects
|
|
163
|
-
* - Verifying API responses
|
|
164
|
-
* - Type narrowing in conditional blocks
|
|
165
|
-
*/
|
|
166
|
-
static is(obj: unknown): obj is Contact;
|
|
167
|
-
/**
|
|
168
|
-
* Converts Payout instance to a plain object
|
|
169
|
-
*/
|
|
170
|
-
toJSON(): ContactData;
|
|
171
|
-
}
|
|
172
|
-
//# sourceMappingURL=contact.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contact.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/models/contact/derivatives/contact.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,WAAW,EACjB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAC;AAE3B;;GAEG;AACH,qBAAa,OAAO;IAClB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAc;IAEnC;;OAEG;IACH,OAAO;IAIP;;OAEG;IACH,IAAI,EAAE,IAAI,MAAM,CAEf;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED;;OAEG;IACH,IAAI,WAAW,IAAI,MAAM,CAExB;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,WAAW,CAEtB;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,IAAI,CAEpB;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,IAAI,CAEpB;IAED;;;;;;;;;;;OAWG;IACH,IAAI,IAAI,IAAI,WAAW,GAAG,SAAS,CAoBlC;IAED;;;;;;OAMG;IACH,IAAI,OAAO,IAAI,MAAM,CAIpB;IAED;;;;;;OAMG;IACH,IAAI,KAAK,IAAI,MAAM,CAIlB;IAED;;;OAGG;IACH,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED;;;;;;;OAOG;IACH,IAAI,UAAU,IAAI,MAAM,CAKvB;IAED;;;;;;;OAOG;IACH,IAAI,YAAY,IAAI,MAAM,CAKzB;IAED;;;;;;;OAOG;IACH,IAAI,YAAY,IAAI,MAAM,CAKzB;IAED;;;OAGG;WACW,MAAM,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO;IAIhD;;;OAGG;WACW,UAAU,CAAC,SAAS,EAAE,WAAW,EAAE,GAAG,OAAO,EAAE;IAI7D;;;OAGG;WACW,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,GAAG,IAAI;IAQ3D;;;;;;;;;;;;;;;;;;;;;OAqBG;WACW,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,OAAO;IAUxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;WACW,EAAE,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,OAAO;IAO9C;;OAEG;IACH,MAAM,IAAI,WAAW;CAGtB"}
|
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Contact = void 0;
|
|
4
|
-
const schemas_js_1 = require("../schemas.js");
|
|
5
|
-
const index_js_1 = require("../index.js");
|
|
6
|
-
const frontend_core_1 = require("@temboplus/frontend-core");
|
|
7
|
-
const contact_info_js_1 = require("./contact_info.js");
|
|
8
|
-
/**
|
|
9
|
-
* Contact class that wraps the Zod schema and provides additional functionality
|
|
10
|
-
*/
|
|
11
|
-
class Contact {
|
|
12
|
-
/**
|
|
13
|
-
* Private constructor - use static methods to create instances
|
|
14
|
-
*/
|
|
15
|
-
constructor(data) {
|
|
16
|
-
Object.defineProperty(this, "data", {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
configurable: true,
|
|
19
|
-
writable: true,
|
|
20
|
-
value: void 0
|
|
21
|
-
});
|
|
22
|
-
this.data = schemas_js_1.ContactSchemas.contactData.parse(data);
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Unique identifier for the contact
|
|
26
|
-
*/
|
|
27
|
-
get id() {
|
|
28
|
-
return this.data.id;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Profile identifier associated with this contact
|
|
32
|
-
*/
|
|
33
|
-
get profileId() {
|
|
34
|
-
return this.data.profileId;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Display name of the contact
|
|
38
|
-
*/
|
|
39
|
-
get displayName() {
|
|
40
|
-
return this.data.displayName;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Type of contact (Bank or Mobile)
|
|
44
|
-
*/
|
|
45
|
-
get type() {
|
|
46
|
-
return this.data.type;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Creation timestamp of the contact
|
|
50
|
-
*/
|
|
51
|
-
get createdAt() {
|
|
52
|
-
return this.data.createdAt;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Update timestamp of the contact
|
|
56
|
-
*/
|
|
57
|
-
get updatedAt() {
|
|
58
|
-
return this.data.updatedAt;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Detailed contact information based on contact type
|
|
62
|
-
*
|
|
63
|
-
* @returns {ContactInfo | undefined} Contact information object:
|
|
64
|
-
* - MobileContactInfo for mobile money contacts
|
|
65
|
-
* - BankContactInfo for bank contacts
|
|
66
|
-
* - undefined if contact information cannot be constructed
|
|
67
|
-
*
|
|
68
|
-
* @remarks
|
|
69
|
-
* For mobile contacts, constructs from phone number
|
|
70
|
-
* For bank contacts, constructs from SWIFT code and account number
|
|
71
|
-
*/
|
|
72
|
-
get info() {
|
|
73
|
-
if (this.data.type === "Mobile") {
|
|
74
|
-
const phone = frontend_core_1.TZPhoneNumber.from(this.data.accountNo);
|
|
75
|
-
if (phone) {
|
|
76
|
-
return new index_js_1.MobileContactInfo(this.data.displayName, phone);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
if (this.data.type === "Bank") {
|
|
80
|
-
const bank = frontend_core_1.Bank.fromSWIFTCode(this.data.channel);
|
|
81
|
-
if (bank) {
|
|
82
|
-
return new contact_info_js_1.BankContactInfo(this.data.displayName, bank, this.data.accountNo);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return undefined;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Payment channel for the contact
|
|
89
|
-
*
|
|
90
|
-
* @returns {string} Channel information:
|
|
91
|
-
* - For valid contacts, returns formatted channel from ContactInfo
|
|
92
|
-
* - For invalid contacts, falls back to account number
|
|
93
|
-
*/
|
|
94
|
-
get channel() {
|
|
95
|
-
const info = this.info;
|
|
96
|
-
if (info)
|
|
97
|
-
return info.channel;
|
|
98
|
-
return this.data.accountNo;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Account number for the contact
|
|
102
|
-
*
|
|
103
|
-
* @returns {string} Account number:
|
|
104
|
-
* - For valid contacts, returns formatted account number from ContactInfo
|
|
105
|
-
* - For invalid contacts, falls back to raw account number
|
|
106
|
-
*/
|
|
107
|
-
get accNo() {
|
|
108
|
-
const info = this.info;
|
|
109
|
-
if (info)
|
|
110
|
-
return info.accNumber;
|
|
111
|
-
return this.data.accountNo;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Account name for the contact
|
|
115
|
-
* Always returns the display name
|
|
116
|
-
*/
|
|
117
|
-
get accName() {
|
|
118
|
-
return this.data.displayName;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Label for the account number field based on contact type
|
|
122
|
-
*
|
|
123
|
-
* @returns {string} Appropriate label:
|
|
124
|
-
* - "Phone Number" for mobile contacts
|
|
125
|
-
* - "Bank Account Number" for bank contacts
|
|
126
|
-
* - "Account Number" as fallback
|
|
127
|
-
*/
|
|
128
|
-
get accNoLabel() {
|
|
129
|
-
const info = this.info;
|
|
130
|
-
if (info instanceof index_js_1.MobileContactInfo)
|
|
131
|
-
return "Phone Number";
|
|
132
|
-
if (info instanceof contact_info_js_1.BankContactInfo)
|
|
133
|
-
return "Bank Account Number";
|
|
134
|
-
return "Account Number";
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Label for the channel field based on contact type
|
|
138
|
-
*
|
|
139
|
-
* @returns {string} Appropriate label:
|
|
140
|
-
* - "Channel" for mobile contacts
|
|
141
|
-
* - "Bank" for bank contacts
|
|
142
|
-
* - "Channel" as fallback
|
|
143
|
-
*/
|
|
144
|
-
get channelLabel() {
|
|
145
|
-
const info = this.info;
|
|
146
|
-
if (info instanceof index_js_1.MobileContactInfo)
|
|
147
|
-
return "Channel";
|
|
148
|
-
if (info instanceof contact_info_js_1.BankContactInfo)
|
|
149
|
-
return "Bank";
|
|
150
|
-
return "Channel";
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Label for the account name field based on contact type
|
|
154
|
-
*
|
|
155
|
-
* @returns {string} Appropriate label:
|
|
156
|
-
* - "Full Name" for mobile contacts
|
|
157
|
-
* - "Bank Account Name" for bank contacts
|
|
158
|
-
* - "Display Name" as fallback
|
|
159
|
-
*/
|
|
160
|
-
get accNameLabel() {
|
|
161
|
-
const info = this.info;
|
|
162
|
-
if (info instanceof index_js_1.MobileContactInfo)
|
|
163
|
-
return "Full Name";
|
|
164
|
-
if (info instanceof contact_info_js_1.BankContactInfo)
|
|
165
|
-
return "Bank Account Name";
|
|
166
|
-
return "Display Name";
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Creates a Contact instance from raw data
|
|
170
|
-
* @throws {ZodError} if validation fails
|
|
171
|
-
*/
|
|
172
|
-
static create(data) {
|
|
173
|
-
return new Contact(data);
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Creates multiple Contact instances from an array of raw data
|
|
177
|
-
* @throws {ZodError} if validation fails for any item
|
|
178
|
-
*/
|
|
179
|
-
static createMany(dataArray) {
|
|
180
|
-
return dataArray.map((data) => new Contact(data));
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Creates a Contact instance from raw data without throwing
|
|
184
|
-
* @returns {Contact | null} Contact instance or null if validation fails
|
|
185
|
-
*/
|
|
186
|
-
static createSafe(data) {
|
|
187
|
-
try {
|
|
188
|
-
return new Contact(data);
|
|
189
|
-
}
|
|
190
|
-
catch {
|
|
191
|
-
return null;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Checks if an unknown value contains valid data to construct a Contact instance.
|
|
196
|
-
* This is useful when validating raw data structures before instantiation.
|
|
197
|
-
*
|
|
198
|
-
* @param {unknown} obj - The value containing potential contact data
|
|
199
|
-
* @returns {obj is Contact} Type predicate indicating if a Contact can be constructed
|
|
200
|
-
*
|
|
201
|
-
* @example
|
|
202
|
-
* ```typescript
|
|
203
|
-
* const rawData = await fetchFromAPI();
|
|
204
|
-
* if (Contact.canConstruct(rawData)) {
|
|
205
|
-
* const contact = Contact.create(rawData);
|
|
206
|
-
* // TypeScript knows contact is valid here
|
|
207
|
-
* console.log(contact.displayName);
|
|
208
|
-
* }
|
|
209
|
-
* ```
|
|
210
|
-
*
|
|
211
|
-
* @throws {never} This method never throws errors
|
|
212
|
-
*
|
|
213
|
-
* @remarks
|
|
214
|
-
* This method performs strict validation against the {@link ContactData} schema.
|
|
215
|
-
*/
|
|
216
|
-
static canConstruct(obj) {
|
|
217
|
-
if (!obj || typeof obj !== "object")
|
|
218
|
-
return false;
|
|
219
|
-
const result = schemas_js_1.ContactSchemas.contactData.safeParse(obj);
|
|
220
|
-
if (!result.success)
|
|
221
|
-
return false;
|
|
222
|
-
const contact = Contact.createSafe(result.data);
|
|
223
|
-
return contact !== null;
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* Validates if an unknown value is a Contact instance.
|
|
227
|
-
* This is a runtime type guard that ensures proper object structure and data validity.
|
|
228
|
-
*
|
|
229
|
-
* @param {unknown} obj - The value to validate
|
|
230
|
-
* @returns {obj is Contact} Type predicate indicating if the value is a valid Contact
|
|
231
|
-
*
|
|
232
|
-
* @example
|
|
233
|
-
* ```typescript
|
|
234
|
-
* const maybeContact = getContactFromCache();
|
|
235
|
-
* if (Contact.is(maybeContact)) {
|
|
236
|
-
* // TypeScript knows maybeContact is a Contact here
|
|
237
|
-
* console.log(maybeContact.displayName);
|
|
238
|
-
* }
|
|
239
|
-
* ```
|
|
240
|
-
*
|
|
241
|
-
* @throws {never} This method never throws errors
|
|
242
|
-
*
|
|
243
|
-
* @remarks
|
|
244
|
-
* This method performs a complete structural validation:
|
|
245
|
-
* 1. Checks if the value is an object
|
|
246
|
-
* 2. Verifies presence of internal data property
|
|
247
|
-
* 3. Validates the data against ContactData schema
|
|
248
|
-
* 4. Ensures the object is a proper Contact instance
|
|
249
|
-
*
|
|
250
|
-
* Use this method when:
|
|
251
|
-
* - Validating cached Contact instances
|
|
252
|
-
* - Checking serialized Contact objects
|
|
253
|
-
* - Verifying API responses
|
|
254
|
-
* - Type narrowing in conditional blocks
|
|
255
|
-
*/
|
|
256
|
-
static is(obj) {
|
|
257
|
-
if (!obj || typeof obj !== "object")
|
|
258
|
-
return false;
|
|
259
|
-
if (!("data" in obj))
|
|
260
|
-
return false;
|
|
261
|
-
return Contact.canConstruct(obj.data);
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* Converts Payout instance to a plain object
|
|
265
|
-
*/
|
|
266
|
-
toJSON() {
|
|
267
|
-
return { ...this.data };
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
exports.Contact = Contact;
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import type { ContactType } from "../index.js";
|
|
2
|
-
import { Bank, TZPhoneNumber } from "@temboplus/frontend-core";
|
|
3
|
-
/**
|
|
4
|
-
* Abstract base class that provides a common interface for different types of contact information.
|
|
5
|
-
* This class defines the structure and validation requirements for both mobile and bank contacts.
|
|
6
|
-
*
|
|
7
|
-
* @abstract
|
|
8
|
-
* @class BaseContactInfo
|
|
9
|
-
* @property {ContactType} type - The type of contact (either "Mobile" or "Bank")
|
|
10
|
-
*/
|
|
11
|
-
declare abstract class BaseContactInfo {
|
|
12
|
-
readonly type: ContactType;
|
|
13
|
-
/**
|
|
14
|
-
* Creates a new instance of BaseContactInfo
|
|
15
|
-
* @param {ContactType} type - The type of contact to create
|
|
16
|
-
*/
|
|
17
|
-
constructor(type: ContactType);
|
|
18
|
-
/**
|
|
19
|
-
* Validates the contact information according to type-specific rules
|
|
20
|
-
* @abstract
|
|
21
|
-
* @returns {boolean} True if the contact information is valid, false otherwise
|
|
22
|
-
*/
|
|
23
|
-
abstract validate(): boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Gets the primary display name for the contact
|
|
26
|
-
* @abstract
|
|
27
|
-
* @returns {string} The contact's display name (personal name for mobile, account name for bank)
|
|
28
|
-
*/
|
|
29
|
-
abstract get displayName(): string;
|
|
30
|
-
/**
|
|
31
|
-
* Gets the primary account/identification number for the contact
|
|
32
|
-
* @abstract
|
|
33
|
-
* @returns {string} The contact's number (phone number for mobile, account number for bank)
|
|
34
|
-
*/
|
|
35
|
-
abstract get accNumber(): string;
|
|
36
|
-
/**
|
|
37
|
-
* Gets the service provider or institution name for the contact
|
|
38
|
-
* @abstract
|
|
39
|
-
* @returns {string} The contact's channel (telecom company for mobile, bank name for bank)
|
|
40
|
-
*/
|
|
41
|
-
abstract get channel(): string;
|
|
42
|
-
/**
|
|
43
|
-
* Gets the localized label for the display name field
|
|
44
|
-
* @abstract
|
|
45
|
-
* @returns {string} The appropriate label for the display name based on contact type
|
|
46
|
-
*/
|
|
47
|
-
abstract get displayNameLabel(): string;
|
|
48
|
-
/**
|
|
49
|
-
* Gets the localized label for the account number field
|
|
50
|
-
* @abstract
|
|
51
|
-
* @returns {string} The appropriate label for the account number based on contact type
|
|
52
|
-
*/
|
|
53
|
-
abstract get accNumberLabel(): string;
|
|
54
|
-
/**
|
|
55
|
-
* Gets the localized label for the channel field
|
|
56
|
-
* @abstract
|
|
57
|
-
* @returns {string} The appropriate label for the channel based on contact type
|
|
58
|
-
*/
|
|
59
|
-
abstract get channelLabel(): string;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Implementation of BaseContactInfo for mobile phone contacts.
|
|
63
|
-
* Handles storage and validation of contact details specific to mobile numbers.
|
|
64
|
-
*
|
|
65
|
-
* @extends BaseContactInfo
|
|
66
|
-
* @class MobileContactInfo
|
|
67
|
-
* @property {string} name - The contact's personal name
|
|
68
|
-
* @property {TZPhoneNumber} phoneNumber - The contact's phone number object
|
|
69
|
-
*/
|
|
70
|
-
export declare class MobileContactInfo extends BaseContactInfo {
|
|
71
|
-
readonly name: string;
|
|
72
|
-
readonly phoneNumber: TZPhoneNumber;
|
|
73
|
-
/**
|
|
74
|
-
* Creates a new mobile contact
|
|
75
|
-
* @param {string} name - The contact's personal name
|
|
76
|
-
* @param {TZPhoneNumber} phoneNumber - The contact's phone number
|
|
77
|
-
*/
|
|
78
|
-
constructor(name: string, phoneNumber: TZPhoneNumber);
|
|
79
|
-
/**
|
|
80
|
-
* Validates the mobile contact information
|
|
81
|
-
* Checks that:
|
|
82
|
-
* - Phone number is defined and valid
|
|
83
|
-
* - Contact name is not empty
|
|
84
|
-
* @returns {boolean} True if all validation checks pass
|
|
85
|
-
*/
|
|
86
|
-
validate(): boolean;
|
|
87
|
-
/**
|
|
88
|
-
* Validates if an unknown value is a valid MobileContactInfo object.
|
|
89
|
-
* Checks both the structural integrity and data validity of name and phone number properties.
|
|
90
|
-
*
|
|
91
|
-
* @param {unknown} obj - The value to validate
|
|
92
|
-
* @returns {obj is MobileContactInfo} Type predicate indicating if the value is a valid MobileContactInfo
|
|
93
|
-
*
|
|
94
|
-
* @example
|
|
95
|
-
* const maybeContact = JSON.parse(someData);
|
|
96
|
-
* if (MobileContactInfo.is(maybeContact)) {
|
|
97
|
-
* // maybeContact is typed as MobileContactInfo
|
|
98
|
-
* console.log(maybeContact.name);
|
|
99
|
-
* console.log(maybeContact.TZPhoneNumber.label);
|
|
100
|
-
* }
|
|
101
|
-
*
|
|
102
|
-
* @remarks
|
|
103
|
-
* - Name must be a non-empty string
|
|
104
|
-
* - Phone number can be either:
|
|
105
|
-
* - A string that can be parsed into a valid TZPhoneNumber
|
|
106
|
-
* - A TZPhoneNumber object with valid properties
|
|
107
|
-
* - Returns false if either property is invalid or missing
|
|
108
|
-
*/
|
|
109
|
-
static is(obj: unknown): obj is MobileContactInfo;
|
|
110
|
-
get displayName(): string;
|
|
111
|
-
/**
|
|
112
|
-
* Gets the phone number formatted according to the 255 standard
|
|
113
|
-
* @returns {string} Formatted phone number
|
|
114
|
-
*/
|
|
115
|
-
get accNumber(): string;
|
|
116
|
-
get channel(): string;
|
|
117
|
-
get displayNameLabel(): string;
|
|
118
|
-
get accNumberLabel(): string;
|
|
119
|
-
get channelLabel(): string;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Implementation of BaseContactInfo for bank account contacts.
|
|
123
|
-
* Handles storage and validation of contact details specific to bank accounts.
|
|
124
|
-
*
|
|
125
|
-
* @extends BaseContactInfo
|
|
126
|
-
* @class BankContactInfo
|
|
127
|
-
* @property {string} accName - The bank account holder's name
|
|
128
|
-
* @property {Bank} bank - The bank object containing institution details
|
|
129
|
-
* @property {string} accNo - The bank account number
|
|
130
|
-
*/
|
|
131
|
-
export declare class BankContactInfo extends BaseContactInfo {
|
|
132
|
-
readonly accName: string;
|
|
133
|
-
readonly bank: Bank;
|
|
134
|
-
readonly accNo: string;
|
|
135
|
-
/**
|
|
136
|
-
* Creates a new bank contact
|
|
137
|
-
* @param {string} accName - The account holder's name
|
|
138
|
-
* @param {Bank} bank - The bank object
|
|
139
|
-
* @param {string} accNo - The account number
|
|
140
|
-
*/
|
|
141
|
-
constructor(accName: string, bank: Bank, accNo: string);
|
|
142
|
-
/**
|
|
143
|
-
* Validates the bank contact information
|
|
144
|
-
* Checks that:
|
|
145
|
-
* - Bank object is valid
|
|
146
|
-
* - Account name meets requirements
|
|
147
|
-
* - Account number meets bank-specific format requirements
|
|
148
|
-
* @returns {boolean} True if all validation checks pass
|
|
149
|
-
*/
|
|
150
|
-
validate(): boolean;
|
|
151
|
-
/**
|
|
152
|
-
* Validates if an unknown value is a valid BankContactInfo object.
|
|
153
|
-
* Checks both the structural integrity and data validity of account name, account number, and bank details.
|
|
154
|
-
*
|
|
155
|
-
* @param {unknown} obj - The value to validate
|
|
156
|
-
* @returns {obj is BankContactInfo} Type predicate indicating if the value is a valid BankContactInfo
|
|
157
|
-
*
|
|
158
|
-
* @example
|
|
159
|
-
* const maybeBank = JSON.parse(someData);
|
|
160
|
-
* if (BankContactInfo.is(maybeBank)) {
|
|
161
|
-
* // maybeBank is typed as BankContactInfo
|
|
162
|
-
* console.log(maybeBank.accName);
|
|
163
|
-
* console.log(maybeBank.accNumber);
|
|
164
|
-
* console.log(maybeBank.bank.name);
|
|
165
|
-
* }
|
|
166
|
-
*
|
|
167
|
-
* @remarks
|
|
168
|
-
* - Account name must be a valid string (validated by {@link validateAccName})
|
|
169
|
-
* - Account number must be a valid string (validated by {@link validateBankAccNo})
|
|
170
|
-
* - Bank must be a valid Bank object (validated by {@link Bank.is})
|
|
171
|
-
* - Returns false if any property is invalid or missing
|
|
172
|
-
* - All properties are required and must pass their respective validations
|
|
173
|
-
*/
|
|
174
|
-
static is(obj: unknown): obj is BankContactInfo;
|
|
175
|
-
get displayName(): string;
|
|
176
|
-
get accNumber(): string;
|
|
177
|
-
get channel(): string;
|
|
178
|
-
get displayNameLabel(): string;
|
|
179
|
-
get accNumberLabel(): string;
|
|
180
|
-
get channelLabel(): string;
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Union type representing either a mobile or bank contact
|
|
184
|
-
* Used for type-safe handling of contact information throughout the application
|
|
185
|
-
*/
|
|
186
|
-
export type ContactInfo = MobileContactInfo | BankContactInfo;
|
|
187
|
-
export {};
|
|
188
|
-
//# sourceMappingURL=contact_info.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contact_info.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/models/contact/derivatives/contact_info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACL,IAAI,EAEJ,aAAa,EACd,MAAM,0BAA0B,CAAC;AAMlC;;;;;;;GAOG;AACH,uBAAe,eAAe;IAC5B,SAAgB,IAAI,EAAE,WAAW,CAAC;IAElC;;;OAGG;gBACS,IAAI,EAAE,WAAW;IAI7B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,IAAI,OAAO;IAE5B;;;;OAIG;IACH,QAAQ,KAAK,WAAW,IAAI,MAAM,CAAC;IAEnC;;;;OAIG;IACH,QAAQ,KAAK,SAAS,IAAI,MAAM,CAAC;IAEjC;;;;OAIG;IACH,QAAQ,KAAK,OAAO,IAAI,MAAM,CAAC;IAE/B;;;;OAIG;IACH,QAAQ,KAAK,gBAAgB,IAAI,MAAM,CAAC;IAExC;;;;OAIG;IACH,QAAQ,KAAK,cAAc,IAAI,MAAM,CAAC;IAEtC;;;;OAIG;IACH,QAAQ,KAAK,YAAY,IAAI,MAAM,CAAC;CACrC;AAED;;;;;;;;GAQG;AACH,qBAAa,iBAAkB,SAAQ,eAAe;aAOlC,IAAI,EAAE,MAAM;aACZ,WAAW,EAAE,aAAa;IAP5C;;;;OAIG;gBAEe,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,aAAa;IAK5C;;;;;;OAMG;IACH,QAAQ,IAAI,OAAO;IAMnB;;;;;;;;;;;;;;;;;;;;;OAqBG;WACW,EAAE,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,iBAAiB;IA6BxD,IAAa,WAAW,IAAI,MAAM,CAEjC;IAED;;;OAGG;IACH,IAAa,SAAS,IAAI,MAAM,CAE/B;IAED,IAAa,OAAO,IAAI,MAAM,CAE7B;IAED,IAAa,gBAAgB,IAAI,MAAM,CAEtC;IAED,IAAa,cAAc,IAAI,MAAM,CAEpC;IAED,IAAa,YAAY,IAAI,MAAM,CAElC;CACF;AAED;;;;;;;;;GASG;AACH,qBAAa,eAAgB,SAAQ,eAAe;aAQhC,OAAO,EAAE,MAAM;aACf,IAAI,EAAE,IAAI;aACV,KAAK,EAAE,MAAM;IAT/B;;;;;OAKG;gBAEe,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,MAAM;IAK/B;;;;;;;OAOG;IACH,QAAQ,IAAI,OAAO;IAMnB;;;;;;;;;;;;;;;;;;;;;;OAsBG;WACW,EAAE,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,eAAe;IA8BtD,IAAa,WAAW,IAAI,MAAM,CAEjC;IAED,IAAa,SAAS,IAAI,MAAM,CAE/B;IAED,IAAa,OAAO,IAAI,MAAM,CAE7B;IAED,IAAa,gBAAgB,IAAI,MAAM,CAEtC;IAED,IAAa,cAAc,IAAI,MAAM,CAEpC;IAED,IAAa,YAAY,IAAI,MAAM,CAElC;CACF;AAED;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,iBAAiB,GAAG,eAAe,CAAC"}
|