@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,338 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Profile = exports.profileSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const frontend_core_1 = require("@temboplus/frontend-core");
|
|
6
|
-
/**
|
|
7
|
-
* Zod schema for validating user profile data.
|
|
8
|
-
* Defines validation rules and constraints for each profile field.
|
|
9
|
-
*
|
|
10
|
-
* @const {ProfileType}
|
|
11
|
-
*
|
|
12
|
-
* @property {string} id - Unique identifier for the profile
|
|
13
|
-
* @property {string | null | undefined} firstName - User's first name, can be null or undefined
|
|
14
|
-
* @property {string | null | undefined} lastName - User's last name, can be null or undefined
|
|
15
|
-
* @property {string} displayName - User's display name
|
|
16
|
-
* @property {string | null | undefined} phone - User's contact phone number, can be null or undefined
|
|
17
|
-
* @property {string} accountNo - User's account number
|
|
18
|
-
* @property {string | null | undefined} email - User's email address, can be null or undefined
|
|
19
|
-
*/
|
|
20
|
-
exports.profileSchema = zod_1.z.object({
|
|
21
|
-
id: zod_1.z.string(),
|
|
22
|
-
firstName: zod_1.z.string().optional().nullable(),
|
|
23
|
-
lastName: zod_1.z.string().optional().nullable(),
|
|
24
|
-
displayName: zod_1.z.string(),
|
|
25
|
-
phone: zod_1.z.string().optional().nullable(),
|
|
26
|
-
accountNo: zod_1.z.string().min(1),
|
|
27
|
-
email: zod_1.z.string().email().optional().nullable(),
|
|
28
|
-
});
|
|
29
|
-
/**
|
|
30
|
-
* Represents a user profile in the system.
|
|
31
|
-
*
|
|
32
|
-
* This class provides methods for creating, validating, and manipulating user profile data.
|
|
33
|
-
* It integrates with the Zod schema validation for data integrity.
|
|
34
|
-
*/
|
|
35
|
-
class Profile {
|
|
36
|
-
/**
|
|
37
|
-
* Gets the profile schema used for validation.
|
|
38
|
-
*/
|
|
39
|
-
static get schema() {
|
|
40
|
-
return exports.profileSchema;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Creates a new Profile instance with the provided data.
|
|
44
|
-
*
|
|
45
|
-
* Private constructor to enforce use of static factory methods.
|
|
46
|
-
*
|
|
47
|
-
* @param data - Object containing profile information
|
|
48
|
-
*/
|
|
49
|
-
constructor(data) {
|
|
50
|
-
/** Unique identifier for the profile */
|
|
51
|
-
Object.defineProperty(this, "_id", {
|
|
52
|
-
enumerable: true,
|
|
53
|
-
configurable: true,
|
|
54
|
-
writable: true,
|
|
55
|
-
value: void 0
|
|
56
|
-
});
|
|
57
|
-
/** User's first name */
|
|
58
|
-
Object.defineProperty(this, "_firstName", {
|
|
59
|
-
enumerable: true,
|
|
60
|
-
configurable: true,
|
|
61
|
-
writable: true,
|
|
62
|
-
value: void 0
|
|
63
|
-
});
|
|
64
|
-
/** User's last name */
|
|
65
|
-
Object.defineProperty(this, "_lastName", {
|
|
66
|
-
enumerable: true,
|
|
67
|
-
configurable: true,
|
|
68
|
-
writable: true,
|
|
69
|
-
value: void 0
|
|
70
|
-
});
|
|
71
|
-
/** User's display name, can be used for presentation */
|
|
72
|
-
Object.defineProperty(this, "_displayName", {
|
|
73
|
-
enumerable: true,
|
|
74
|
-
configurable: true,
|
|
75
|
-
writable: true,
|
|
76
|
-
value: void 0
|
|
77
|
-
});
|
|
78
|
-
/** User's phone number, stored as a PhoneNumber object */
|
|
79
|
-
Object.defineProperty(this, "_phone", {
|
|
80
|
-
enumerable: true,
|
|
81
|
-
configurable: true,
|
|
82
|
-
writable: true,
|
|
83
|
-
value: void 0
|
|
84
|
-
});
|
|
85
|
-
/** User's account number */
|
|
86
|
-
Object.defineProperty(this, "_accountNo", {
|
|
87
|
-
enumerable: true,
|
|
88
|
-
configurable: true,
|
|
89
|
-
writable: true,
|
|
90
|
-
value: void 0
|
|
91
|
-
});
|
|
92
|
-
/** User's email address */
|
|
93
|
-
Object.defineProperty(this, "_email", {
|
|
94
|
-
enumerable: true,
|
|
95
|
-
configurable: true,
|
|
96
|
-
writable: true,
|
|
97
|
-
value: void 0
|
|
98
|
-
});
|
|
99
|
-
this._id = data.id;
|
|
100
|
-
this._firstName = data.firstName;
|
|
101
|
-
this._lastName = data.lastName;
|
|
102
|
-
this._displayName = data.displayName;
|
|
103
|
-
this._phone = data.phone;
|
|
104
|
-
this._accountNo = data.accountNo;
|
|
105
|
-
this._email = data.email;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Creates a new Profile instance with the provided data.
|
|
109
|
-
*
|
|
110
|
-
* @param data - Object containing profile information.
|
|
111
|
-
*/
|
|
112
|
-
static create(data) {
|
|
113
|
-
let phoneObj = undefined;
|
|
114
|
-
if (data.phone !== undefined && data.phone !== null) {
|
|
115
|
-
let phoneString = data.phone ?? "";
|
|
116
|
-
if (!phoneString.startsWith("+"))
|
|
117
|
-
phoneString = "+" + phoneString;
|
|
118
|
-
phoneObj = frontend_core_1.PhoneNumber.from(phoneString);
|
|
119
|
-
if (!phoneObj) {
|
|
120
|
-
console.error("Failed to parse phone number:", data.phone);
|
|
121
|
-
return undefined;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
phoneObj = data.phone; // Preserve null or undefined
|
|
126
|
-
}
|
|
127
|
-
return new Profile({
|
|
128
|
-
id: data.id,
|
|
129
|
-
firstName: data.firstName,
|
|
130
|
-
lastName: data.lastName,
|
|
131
|
-
displayName: data.displayName,
|
|
132
|
-
phone: phoneObj,
|
|
133
|
-
accountNo: data.accountNo,
|
|
134
|
-
email: data.email,
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Gets the profile's unique identifier.
|
|
139
|
-
*/
|
|
140
|
-
get id() {
|
|
141
|
-
return this._id;
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Gets the user's first name.
|
|
145
|
-
*/
|
|
146
|
-
get firstName() {
|
|
147
|
-
return this._firstName;
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Gets the user's last name.
|
|
151
|
-
*/
|
|
152
|
-
get lastName() {
|
|
153
|
-
return this._lastName;
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Gets the user's display name.
|
|
157
|
-
*/
|
|
158
|
-
get displayName() {
|
|
159
|
-
return this._displayName;
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Gets the user's phone number object.
|
|
163
|
-
*/
|
|
164
|
-
get phone() {
|
|
165
|
-
return this._phone;
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Gets the user's account number.
|
|
169
|
-
*/
|
|
170
|
-
get accountNo() {
|
|
171
|
-
return this._accountNo;
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Gets the user's email address.
|
|
175
|
-
*/
|
|
176
|
-
get email() {
|
|
177
|
-
return this._email;
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Gets the user's formatted phone number in international format.
|
|
181
|
-
*/
|
|
182
|
-
get formattedPhone() {
|
|
183
|
-
if (this._phone === undefined) {
|
|
184
|
-
return undefined;
|
|
185
|
-
}
|
|
186
|
-
return this._phone?.label ?? null;
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* Gets the user's name for display purposes.
|
|
190
|
-
* Returns the display name if it exists, otherwise returns the first and last name combined.
|
|
191
|
-
*/
|
|
192
|
-
getName() {
|
|
193
|
-
if (this._displayName && this._displayName.trim() !== "") {
|
|
194
|
-
return this._displayName;
|
|
195
|
-
}
|
|
196
|
-
const firstName = this._firstName ?? "";
|
|
197
|
-
const lastName = this._lastName ?? "";
|
|
198
|
-
return `${firstName} ${lastName}`.trim();
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Creates a plain object representation of the profile for validation or serialization.
|
|
202
|
-
*
|
|
203
|
-
* @returns A plain object matching the ProfileType interface
|
|
204
|
-
*/
|
|
205
|
-
toObject() {
|
|
206
|
-
// Handle the phone specially to ensure we preserve undefined vs null
|
|
207
|
-
let phoneString = undefined;
|
|
208
|
-
if (this._phone !== undefined) {
|
|
209
|
-
phoneString = this._phone?.label ?? null;
|
|
210
|
-
}
|
|
211
|
-
return {
|
|
212
|
-
id: this._id,
|
|
213
|
-
firstName: this._firstName,
|
|
214
|
-
lastName: this._lastName,
|
|
215
|
-
displayName: this._displayName,
|
|
216
|
-
phone: phoneString,
|
|
217
|
-
accountNo: this._accountNo,
|
|
218
|
-
email: this._email,
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* Converts the profile to a JSON string.
|
|
223
|
-
*
|
|
224
|
-
* @returns A JSON string representation of the profile
|
|
225
|
-
*/
|
|
226
|
-
toJSON() {
|
|
227
|
-
return JSON.stringify(this.toObject());
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
* Validates the profile data against the Zod schema.
|
|
231
|
-
*
|
|
232
|
-
* @returns True if the profile is valid, false otherwise
|
|
233
|
-
*/
|
|
234
|
-
validate() {
|
|
235
|
-
try {
|
|
236
|
-
const result = Profile.schema.safeParse(this.toObject());
|
|
237
|
-
return result.success;
|
|
238
|
-
}
|
|
239
|
-
catch (error) {
|
|
240
|
-
console.error("Profile validation error:", error);
|
|
241
|
-
return false;
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* Creates a Profile instance from a JSON string.
|
|
246
|
-
*
|
|
247
|
-
* @param jsonString - JSON string containing profile data
|
|
248
|
-
* @returns A new Profile instance, or undefined if parsing failed
|
|
249
|
-
*/
|
|
250
|
-
static fromJSON(jsonString) {
|
|
251
|
-
try {
|
|
252
|
-
const data = JSON.parse(jsonString);
|
|
253
|
-
return Profile.from(data);
|
|
254
|
-
}
|
|
255
|
-
catch (error) {
|
|
256
|
-
console.error("Error parsing profile JSON:", error);
|
|
257
|
-
return undefined;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
/**
|
|
261
|
-
* Creates a Profile instance from a plain object.
|
|
262
|
-
*
|
|
263
|
-
* @param data - Object containing profile data
|
|
264
|
-
* @returns A new Profile instance, or undefined if parsing failed
|
|
265
|
-
*/
|
|
266
|
-
// deno-lint-ignore no-explicit-any
|
|
267
|
-
static from(data) {
|
|
268
|
-
try {
|
|
269
|
-
if (!data) {
|
|
270
|
-
console.error("Data is null or undefined");
|
|
271
|
-
return undefined;
|
|
272
|
-
}
|
|
273
|
-
if (typeof data !== "object") {
|
|
274
|
-
console.error("Data is not an object");
|
|
275
|
-
return undefined;
|
|
276
|
-
}
|
|
277
|
-
if (!data.id || !data.accountNo || !data.displayName) {
|
|
278
|
-
console.error("Missing required profile fields");
|
|
279
|
-
return undefined;
|
|
280
|
-
}
|
|
281
|
-
return Profile.create({
|
|
282
|
-
id: data.id,
|
|
283
|
-
firstName: data.firstName,
|
|
284
|
-
lastName: data.lastName,
|
|
285
|
-
displayName: data.displayName,
|
|
286
|
-
phone: data.phone,
|
|
287
|
-
accountNo: data.accountNo,
|
|
288
|
-
email: data.email,
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
catch (error) {
|
|
292
|
-
console.error("Error creating profile from object:", error);
|
|
293
|
-
return undefined;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
/**
|
|
297
|
-
* Type guard to check if an unknown object is a valid Profile instance.
|
|
298
|
-
*
|
|
299
|
-
* @param obj - The object to check
|
|
300
|
-
* @returns Type predicate indicating if the object is a valid Profile
|
|
301
|
-
*/
|
|
302
|
-
static is(obj) {
|
|
303
|
-
if (!obj || typeof obj !== "object")
|
|
304
|
-
return false;
|
|
305
|
-
const maybeProfile = obj;
|
|
306
|
-
// Check required properties
|
|
307
|
-
if (typeof maybeProfile._id !== "string" ||
|
|
308
|
-
typeof maybeProfile._displayName !== "string" ||
|
|
309
|
-
typeof maybeProfile._accountNo !== "string") {
|
|
310
|
-
return false;
|
|
311
|
-
}
|
|
312
|
-
// Check nullable/optional properties have the right type when present
|
|
313
|
-
if (maybeProfile._firstName !== null &&
|
|
314
|
-
maybeProfile._firstName !== undefined &&
|
|
315
|
-
typeof maybeProfile._firstName !== "string") {
|
|
316
|
-
return false;
|
|
317
|
-
}
|
|
318
|
-
if (maybeProfile._lastName !== null &&
|
|
319
|
-
maybeProfile._lastName !== undefined &&
|
|
320
|
-
typeof maybeProfile._lastName !== "string") {
|
|
321
|
-
return false;
|
|
322
|
-
}
|
|
323
|
-
if (maybeProfile._email !== null &&
|
|
324
|
-
maybeProfile._email !== undefined &&
|
|
325
|
-
typeof maybeProfile._email !== "string") {
|
|
326
|
-
return false;
|
|
327
|
-
}
|
|
328
|
-
// Check phone number
|
|
329
|
-
const phone = maybeProfile._phone;
|
|
330
|
-
if (phone !== null &&
|
|
331
|
-
phone !== undefined &&
|
|
332
|
-
!frontend_core_1.PhoneNumber.is(phone)) {
|
|
333
|
-
return false;
|
|
334
|
-
}
|
|
335
|
-
return true;
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
exports.Profile = Profile;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/src/models/wallet/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./statement_entry.js"), exports);
|
|
18
|
-
__exportStar(require("./wallet.js"), exports);
|
|
19
|
-
__exportStar(require("./schemas.js"), exports);
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
/**
|
|
3
|
-
* Collection of wallet-related schemas for export.
|
|
4
|
-
* Provides access to both wallet and statement entry validation schemas.
|
|
5
|
-
*/
|
|
6
|
-
export declare const WalletSchemas: {
|
|
7
|
-
wallet: z.ZodObject<{
|
|
8
|
-
id: z.ZodString;
|
|
9
|
-
profileId: z.ZodString;
|
|
10
|
-
accountNo: z.ZodString;
|
|
11
|
-
accountName: z.ZodString;
|
|
12
|
-
channel: z.ZodString;
|
|
13
|
-
countryCode: z.ZodEffects<z.ZodDefault<z.ZodString>, string, string | undefined>;
|
|
14
|
-
currencyCode: z.ZodEffects<z.ZodDefault<z.ZodString>, string, string | undefined>;
|
|
15
|
-
createdAt: z.ZodString;
|
|
16
|
-
updatedAt: z.ZodString;
|
|
17
|
-
}, "strip", z.ZodTypeAny, {
|
|
18
|
-
id: string;
|
|
19
|
-
accountNo: string;
|
|
20
|
-
channel: string;
|
|
21
|
-
profileId: string;
|
|
22
|
-
createdAt: string;
|
|
23
|
-
updatedAt: string;
|
|
24
|
-
accountName: string;
|
|
25
|
-
countryCode: string;
|
|
26
|
-
currencyCode: string;
|
|
27
|
-
}, {
|
|
28
|
-
id: string;
|
|
29
|
-
accountNo: string;
|
|
30
|
-
channel: string;
|
|
31
|
-
profileId: string;
|
|
32
|
-
createdAt: string;
|
|
33
|
-
updatedAt: string;
|
|
34
|
-
accountName: string;
|
|
35
|
-
countryCode?: string | undefined;
|
|
36
|
-
currencyCode?: string | undefined;
|
|
37
|
-
}>;
|
|
38
|
-
walletQuery: z.ZodObject<{
|
|
39
|
-
id: z.ZodOptional<z.ZodString>;
|
|
40
|
-
profileId: z.ZodOptional<z.ZodString>;
|
|
41
|
-
accountNo: z.ZodOptional<z.ZodString>;
|
|
42
|
-
accountName: z.ZodOptional<z.ZodString>;
|
|
43
|
-
channel: z.ZodOptional<z.ZodString>;
|
|
44
|
-
countryCode: z.ZodOptional<z.ZodEffects<z.ZodDefault<z.ZodString>, string, string | undefined>>;
|
|
45
|
-
currencyCode: z.ZodOptional<z.ZodEffects<z.ZodDefault<z.ZodString>, string, string | undefined>>;
|
|
46
|
-
}, "strip", z.ZodTypeAny, {
|
|
47
|
-
id?: string | undefined;
|
|
48
|
-
accountNo?: string | undefined;
|
|
49
|
-
channel?: string | undefined;
|
|
50
|
-
profileId?: string | undefined;
|
|
51
|
-
accountName?: string | undefined;
|
|
52
|
-
countryCode?: string | undefined;
|
|
53
|
-
currencyCode?: string | undefined;
|
|
54
|
-
}, {
|
|
55
|
-
id?: string | undefined;
|
|
56
|
-
accountNo?: string | undefined;
|
|
57
|
-
channel?: string | undefined;
|
|
58
|
-
profileId?: string | undefined;
|
|
59
|
-
accountName?: string | undefined;
|
|
60
|
-
countryCode?: string | undefined;
|
|
61
|
-
currencyCode?: string | undefined;
|
|
62
|
-
}>;
|
|
63
|
-
statementEntry: z.ZodObject<{
|
|
64
|
-
accountNo: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
65
|
-
debitOrCredit: z.ZodString;
|
|
66
|
-
tranRefNo: z.ZodString;
|
|
67
|
-
narration: z.ZodString;
|
|
68
|
-
txnDate: z.ZodDate;
|
|
69
|
-
valueDate: z.ZodDate;
|
|
70
|
-
amountCredited: z.ZodNumber;
|
|
71
|
-
amountDebited: z.ZodNumber;
|
|
72
|
-
balance: z.ZodNumber;
|
|
73
|
-
}, "strip", z.ZodTypeAny, {
|
|
74
|
-
debitOrCredit: string;
|
|
75
|
-
tranRefNo: string;
|
|
76
|
-
narration: string;
|
|
77
|
-
txnDate: Date;
|
|
78
|
-
valueDate: Date;
|
|
79
|
-
amountCredited: number;
|
|
80
|
-
amountDebited: number;
|
|
81
|
-
balance: number;
|
|
82
|
-
accountNo?: string | undefined;
|
|
83
|
-
}, {
|
|
84
|
-
debitOrCredit: string;
|
|
85
|
-
tranRefNo: string;
|
|
86
|
-
narration: string;
|
|
87
|
-
txnDate: Date;
|
|
88
|
-
valueDate: Date;
|
|
89
|
-
amountCredited: number;
|
|
90
|
-
amountDebited: number;
|
|
91
|
-
balance: number;
|
|
92
|
-
accountNo?: string | undefined;
|
|
93
|
-
}>;
|
|
94
|
-
};
|
|
95
|
-
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../../../src/src/models/wallet/schemas.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA+BxB;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIzB,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WalletSchemas = void 0;
|
|
4
|
-
const wallet_js_1 = require("./wallet.js");
|
|
5
|
-
const statement_entry_js_1 = require("./statement_entry.js");
|
|
6
|
-
const frontend_core_1 = require("@temboplus/frontend-core");
|
|
7
|
-
const zod_1 = require("zod");
|
|
8
|
-
/**
|
|
9
|
-
* Zod schema definition for validating Wallet data structures.
|
|
10
|
-
* Ensures data integrity for wallet objects, including runtime validation
|
|
11
|
-
* of country codes against the imported ISO2CountryCodesSet.
|
|
12
|
-
*/
|
|
13
|
-
const walletQuerySchema = zod_1.z.object({
|
|
14
|
-
id: zod_1.z.string().optional(),
|
|
15
|
-
profileId: zod_1.z.string().optional(),
|
|
16
|
-
accountNo: zod_1.z.string().optional(),
|
|
17
|
-
accountName: zod_1.z.string().optional(),
|
|
18
|
-
channel: zod_1.z.string().optional(),
|
|
19
|
-
// Validate countryCode as a string present in the imported Set
|
|
20
|
-
countryCode: zod_1.z.string().default("TZ")
|
|
21
|
-
.refine((code) => frontend_core_1.ISO2CountryCodesSet.has(code), { message: "Provided country code is not a valid ISO2 code." }).optional(),
|
|
22
|
-
// Validate currencyCode as a string present in the imported Set
|
|
23
|
-
currencyCode: zod_1.z.string().default("TZS")
|
|
24
|
-
.refine((code) => {
|
|
25
|
-
const currency = frontend_core_1.Currency.from(code);
|
|
26
|
-
return currency !== undefined &&
|
|
27
|
-
frontend_core_1.ValidCurrencyCodesSet.has(currency.code);
|
|
28
|
-
}, { message: "Provided currency code is not a valid currency code." }).optional(),
|
|
29
|
-
});
|
|
30
|
-
/**
|
|
31
|
-
* Collection of wallet-related schemas for export.
|
|
32
|
-
* Provides access to both wallet and statement entry validation schemas.
|
|
33
|
-
*/
|
|
34
|
-
exports.WalletSchemas = {
|
|
35
|
-
wallet: wallet_js_1.Wallet.schema,
|
|
36
|
-
walletQuery: walletQuerySchema,
|
|
37
|
-
statementEntry: statement_entry_js_1.WalletStatementEntry.schema,
|
|
38
|
-
};
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
/**
|
|
3
|
-
* Schema definition for a statement entry.
|
|
4
|
-
*/
|
|
5
|
-
declare const statementEntrySchema: z.ZodObject<{
|
|
6
|
-
accountNo: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
7
|
-
debitOrCredit: z.ZodString;
|
|
8
|
-
tranRefNo: z.ZodString;
|
|
9
|
-
narration: z.ZodString;
|
|
10
|
-
txnDate: z.ZodDate;
|
|
11
|
-
valueDate: z.ZodDate;
|
|
12
|
-
amountCredited: z.ZodNumber;
|
|
13
|
-
amountDebited: z.ZodNumber;
|
|
14
|
-
balance: z.ZodNumber;
|
|
15
|
-
}, "strip", z.ZodTypeAny, {
|
|
16
|
-
debitOrCredit: string;
|
|
17
|
-
tranRefNo: string;
|
|
18
|
-
narration: string;
|
|
19
|
-
txnDate: Date;
|
|
20
|
-
valueDate: Date;
|
|
21
|
-
amountCredited: number;
|
|
22
|
-
amountDebited: number;
|
|
23
|
-
balance: number;
|
|
24
|
-
accountNo?: string | undefined;
|
|
25
|
-
}, {
|
|
26
|
-
debitOrCredit: string;
|
|
27
|
-
tranRefNo: string;
|
|
28
|
-
narration: string;
|
|
29
|
-
txnDate: Date;
|
|
30
|
-
valueDate: Date;
|
|
31
|
-
amountCredited: number;
|
|
32
|
-
amountDebited: number;
|
|
33
|
-
balance: number;
|
|
34
|
-
accountNo?: string | undefined;
|
|
35
|
-
}>;
|
|
36
|
-
type WalletStatementEntryDTO = z.infer<typeof statementEntrySchema>;
|
|
37
|
-
/**
|
|
38
|
-
* Represents a single entry in a Wallet's statement history.
|
|
39
|
-
*
|
|
40
|
-
* This class provides methods for creating, validating, and accessing statement entry data.
|
|
41
|
-
* It integrates with the Zod schema validation for data integrity.
|
|
42
|
-
*/
|
|
43
|
-
export declare class WalletStatementEntry {
|
|
44
|
-
private _accountNo?;
|
|
45
|
-
private _debitOrCredit;
|
|
46
|
-
private _tranRefNo;
|
|
47
|
-
private _narration;
|
|
48
|
-
private _txnDate;
|
|
49
|
-
private _valueDate;
|
|
50
|
-
private _amountCredited;
|
|
51
|
-
private _amountDebited;
|
|
52
|
-
private _balance;
|
|
53
|
-
/**
|
|
54
|
-
* Gets the statement entry schema used for validation.
|
|
55
|
-
*/
|
|
56
|
-
static get schema(): z.ZodObject<{
|
|
57
|
-
accountNo: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
58
|
-
debitOrCredit: z.ZodString;
|
|
59
|
-
tranRefNo: z.ZodString;
|
|
60
|
-
narration: z.ZodString;
|
|
61
|
-
txnDate: z.ZodDate;
|
|
62
|
-
valueDate: z.ZodDate;
|
|
63
|
-
amountCredited: z.ZodNumber;
|
|
64
|
-
amountDebited: z.ZodNumber;
|
|
65
|
-
balance: z.ZodNumber;
|
|
66
|
-
}, "strip", z.ZodTypeAny, {
|
|
67
|
-
debitOrCredit: string;
|
|
68
|
-
tranRefNo: string;
|
|
69
|
-
narration: string;
|
|
70
|
-
txnDate: Date;
|
|
71
|
-
valueDate: Date;
|
|
72
|
-
amountCredited: number;
|
|
73
|
-
amountDebited: number;
|
|
74
|
-
balance: number;
|
|
75
|
-
accountNo?: string | undefined;
|
|
76
|
-
}, {
|
|
77
|
-
debitOrCredit: string;
|
|
78
|
-
tranRefNo: string;
|
|
79
|
-
narration: string;
|
|
80
|
-
txnDate: Date;
|
|
81
|
-
valueDate: Date;
|
|
82
|
-
amountCredited: number;
|
|
83
|
-
amountDebited: number;
|
|
84
|
-
balance: number;
|
|
85
|
-
accountNo?: string | undefined;
|
|
86
|
-
}>;
|
|
87
|
-
/**
|
|
88
|
-
* Private constructor to enforce use of static factory methods.
|
|
89
|
-
* Assumes data is already validated and dates are Date objects.
|
|
90
|
-
* @param data - Object containing statement entry information conforming to WalletStatementItem.
|
|
91
|
-
*/
|
|
92
|
-
private constructor();
|
|
93
|
-
/**
|
|
94
|
-
* Creates a new WalletStatementEntry instance after validating the input data.
|
|
95
|
-
* Handles date coercion via the schema.
|
|
96
|
-
*
|
|
97
|
-
* @param data - Object containing statement entry information. Dates can be strings or Date objects.
|
|
98
|
-
* @returns A new WalletStatementEntry instance, or undefined if validation fails.
|
|
99
|
-
*/
|
|
100
|
-
static create(data: {
|
|
101
|
-
accountNo?: string | null;
|
|
102
|
-
cbaRefNo?: string | null;
|
|
103
|
-
debitOrCredit: string;
|
|
104
|
-
tranRefNo: string;
|
|
105
|
-
narration: string;
|
|
106
|
-
txnDate: string | Date;
|
|
107
|
-
valueDate: string | Date;
|
|
108
|
-
amountCredited: number;
|
|
109
|
-
amountDebited: number;
|
|
110
|
-
balance: number;
|
|
111
|
-
}): WalletStatementEntry | undefined;
|
|
112
|
-
get accountNo(): string | undefined;
|
|
113
|
-
get debitOrCredit(): string;
|
|
114
|
-
get tranRefNo(): string;
|
|
115
|
-
get narration(): string;
|
|
116
|
-
get txnDate(): Date;
|
|
117
|
-
get valueDate(): Date;
|
|
118
|
-
get amountCredited(): number;
|
|
119
|
-
get amountDebited(): number;
|
|
120
|
-
get balance(): number;
|
|
121
|
-
/**
|
|
122
|
-
* Creates a plain object representation of the statement entry for validation or serialization.
|
|
123
|
-
* @returns A plain object matching the WalletStatementItem interface.
|
|
124
|
-
*/
|
|
125
|
-
toObject(): WalletStatementEntryDTO;
|
|
126
|
-
/**
|
|
127
|
-
* Converts the statement entry to a JSON string.
|
|
128
|
-
* Dates will be serialized to ISO strings automatically by JSON.stringify.
|
|
129
|
-
* @returns A JSON string representation of the statement entry.
|
|
130
|
-
*/
|
|
131
|
-
toJSON(): string;
|
|
132
|
-
/**
|
|
133
|
-
* Validates the current statement entry instance data against the Zod schema.
|
|
134
|
-
* @returns True if the statement entry instance data is valid, false otherwise.
|
|
135
|
-
*/
|
|
136
|
-
validate(): boolean;
|
|
137
|
-
/**
|
|
138
|
-
* Creates a WalletStatementEntry instance from a JSON string.
|
|
139
|
-
* Validates the data after parsing, including date coercion.
|
|
140
|
-
* @param jsonString - JSON string containing statement entry data.
|
|
141
|
-
* @returns A new WalletStatementEntry instance, or undefined if parsing or validation fails.
|
|
142
|
-
*/
|
|
143
|
-
static fromJSON(jsonString: string): WalletStatementEntry | undefined;
|
|
144
|
-
/**
|
|
145
|
-
* Creates a WalletStatementEntry instance from a plain object.
|
|
146
|
-
* Validates the data using the schema, including date coercion.
|
|
147
|
-
* @param data - Object containing statement entry data. Dates can be strings or Date objects.
|
|
148
|
-
* @returns A new WalletStatementEntry instance, or undefined if the object is invalid.
|
|
149
|
-
*/
|
|
150
|
-
static from(data: any): WalletStatementEntry | undefined;
|
|
151
|
-
/**
|
|
152
|
-
* Type guard to check if an unknown object is a valid WalletStatementEntry instance.
|
|
153
|
-
* Performs structural checks (duck typing).
|
|
154
|
-
* @param obj - The object to check.
|
|
155
|
-
* @returns Type predicate indicating if the object is a WalletStatementEntry instance.
|
|
156
|
-
*/
|
|
157
|
-
static is(obj: unknown): obj is WalletStatementEntry;
|
|
158
|
-
}
|
|
159
|
-
export {};
|
|
160
|
-
//# sourceMappingURL=statement_entry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"statement_entry.d.ts","sourceRoot":"","sources":["../../../../../../src/src/models/wallet/statement_entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB;;GAEG;AACH,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcxB,CAAC;AAEH,KAAK,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEpE;;;;;GAKG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,UAAU,CAAC,CAAS;IAC5B,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,QAAQ,CAAO;IACvB,OAAO,CAAC,UAAU,CAAO;IACzB,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAS;IAEzB;;OAEG;IACH,MAAM,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAEhB;IAED;;;;OAIG;IACH,OAAO;IAYP;;;;;;OAMG;IACH,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;QAClB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACzB,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;QACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;QACzB,cAAc,EAAE,MAAM,CAAC;QACvB,aAAa,EAAE,MAAM,CAAC;QACtB,OAAO,EAAE,MAAM,CAAC;KACjB,GAAG,oBAAoB,GAAG,SAAS;IAgBpC,IAAI,SAAS,IAAI,MAAM,GAAG,SAAS,CAElC;IACD,IAAI,aAAa,IAAI,MAAM,CAE1B;IACD,IAAI,SAAS,IAAI,MAAM,CAEtB;IACD,IAAI,SAAS,IAAI,MAAM,CAEtB;IACD,IAAI,OAAO,IAAI,IAAI,CAElB;IACD,IAAI,SAAS,IAAI,IAAI,CAEpB;IACD,IAAI,cAAc,IAAI,MAAM,CAE3B;IACD,IAAI,aAAa,IAAI,MAAM,CAE1B;IACD,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED;;;OAGG;IACH,QAAQ,IAAI,uBAAuB;IAcnC;;;;OAIG;IACH,MAAM,IAAI,MAAM;IAIhB;;;OAGG;IACH,QAAQ,IAAI,OAAO;IAWnB;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS;IAWrE;;;;;OAKG;IAEH,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,GAAG,oBAAoB,GAAG,SAAS;IAsBxD;;;;;OAKG;IACH,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,oBAAoB;CAmBrD"}
|