@temboplus/afloat 0.1.81 → 0.2.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +246 -42
- package/dist/index.cjs.js +2 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.esm.js +2 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/lib/api/base-repository.d.ts +177 -0
- package/dist/lib/api/index.d.ts +1 -0
- package/{esm/src/errors/api_error.d.ts → dist/lib/error/error.api.d.ts} +0 -1
- package/{script/npm/src/src/errors/permission_error.d.ts → dist/lib/error/error.permission.d.ts} +1 -2
- package/dist/lib/error/error.utils.d.ts +22 -0
- package/dist/lib/error/index.d.ts +3 -0
- package/dist/lib/query/index.d.ts +4 -0
- package/dist/lib/query/pagination/pagination.d.ts +73 -0
- package/dist/lib/query/pagination/pagination.schemas.d.ts +83 -0
- package/dist/lib/query/query.builder.d.ts +75 -0
- package/dist/lib/query/query.types.d.ts +36 -0
- package/{esm/src/features/auth/contract.d.ts → dist/modules/auth/auth.contract.d.ts} +16 -19
- package/dist/modules/auth/auth.repository.d.ts +83 -0
- package/dist/modules/auth/company-membership.model.d.ts +171 -0
- package/dist/modules/auth/index.d.ts +3 -0
- package/dist/modules/auth/user.model.d.ts +363 -0
- package/dist/modules/beneficiary/beneficiary-info.model.d.ts +178 -0
- package/dist/modules/beneficiary/beneficiary-input-handler.d.ts +16 -0
- package/dist/modules/beneficiary/beneficiary.api-contract.d.ts +203 -0
- package/dist/modules/beneficiary/beneficiary.dtos.d.ts +84 -0
- package/dist/modules/beneficiary/beneficiary.model.d.ts +441 -0
- package/dist/modules/beneficiary/beneficiary.repository.d.ts +116 -0
- package/dist/modules/beneficiary/index.d.ts +6 -0
- package/dist/modules/login/index.d.ts +4 -0
- package/dist/modules/login/login.api-contract.d.ts +51 -0
- package/dist/modules/login/login.dtos.d.ts +85 -0
- package/dist/modules/login/login.model.d.ts +168 -0
- package/dist/modules/login/login.repository.d.ts +58 -0
- package/{esm/src/models/permission.d.ts → dist/modules/login/permission.type.d.ts} +9 -10
- package/dist/modules/payout/index.d.ts +5 -0
- package/dist/modules/payout/payout-channel-handler.d.ts +82 -0
- package/{esm/src/features/payout/contract.d.ts → dist/modules/payout/payout.api-contract.d.ts} +350 -207
- package/dist/modules/payout/payout.dtos.d.ts +607 -0
- package/dist/modules/payout/payout.model.d.ts +383 -0
- package/dist/modules/payout/payout.query.d.ts +134 -0
- package/dist/modules/payout/payout.repository.d.ts +204 -0
- package/dist/modules/profile/index.d.ts +3 -0
- package/{script/npm/src/src/features/auth/profile/contract.d.ts → dist/modules/profile/profile.api-contract.d.ts} +8 -6
- package/dist/modules/profile/profile.dtos.d.ts +80 -0
- package/{script/npm/src/src/models/user/profile.d.ts → dist/modules/profile/profile.model.d.ts} +81 -52
- package/dist/modules/profile/profile.repository.d.ts +56 -0
- package/dist/modules/team-member/index.d.ts +4 -0
- package/dist/modules/team-member/role.model.d.ts +61 -0
- package/{esm/src/features/admin/contract.d.ts → dist/modules/team-member/team-member.contract.d.ts} +229 -154
- package/dist/modules/team-member/team-member.dtos.d.ts +261 -0
- package/dist/modules/team-member/team-member.model.d.ts +237 -0
- package/dist/modules/team-member/team-member.repository.d.ts +179 -0
- package/dist/modules/wallet/index.d.ts +6 -0
- package/dist/modules/wallet/narration.model.d.ts +225 -0
- package/dist/modules/wallet/statement-entry.model.d.ts +299 -0
- package/{script/npm/src/src/features/wallet/contract.d.ts → dist/modules/wallet/wallet.contract.d.ts} +17 -15
- package/dist/modules/wallet/wallet.dtos.d.ts +204 -0
- package/{esm/src/models/wallet/wallet.d.ts → dist/modules/wallet/wallet.model.d.ts} +34 -40
- package/dist/modules/wallet/wallet.query.d.ts +95 -0
- package/dist/modules/wallet/wallet.repository.d.ts +205 -0
- package/dist/modules/wallet/wallet.utils.d.ts +17 -0
- package/package.json +49 -23
- package/LICENSE +0 -7
- package/esm/mod.d.ts +0 -8
- package/esm/mod.d.ts.map +0 -1
- package/esm/mod.js +0 -7
- package/esm/package.json +0 -3
- package/esm/src/errors/api_error.d.ts.map +0 -1
- package/esm/src/errors/api_error.js +0 -90
- package/esm/src/errors/index.d.ts +0 -3
- package/esm/src/errors/index.d.ts.map +0 -1
- package/esm/src/errors/index.js +0 -2
- package/esm/src/errors/permission_error.d.ts +0 -48
- package/esm/src/errors/permission_error.d.ts.map +0 -1
- package/esm/src/errors/permission_error.js +0 -70
- package/esm/src/features/admin/contract.d.ts.map +0 -1
- package/esm/src/features/admin/contract.js +0 -210
- package/esm/src/features/admin/index.d.ts +0 -4
- package/esm/src/features/admin/index.d.ts.map +0 -1
- package/esm/src/features/admin/index.js +0 -3
- package/esm/src/features/admin/repository.d.ts +0 -114
- package/esm/src/features/admin/repository.d.ts.map +0 -1
- package/esm/src/features/admin/repository.js +0 -248
- package/esm/src/features/admin/schemas.d.ts +0 -146
- package/esm/src/features/admin/schemas.d.ts.map +0 -1
- package/esm/src/features/admin/schemas.js +0 -206
- package/esm/src/features/auth/access/contract.d.ts +0 -14
- package/esm/src/features/auth/access/contract.d.ts.map +0 -1
- package/esm/src/features/auth/access/contract.js +0 -14
- package/esm/src/features/auth/access/repository.d.ts +0 -11
- package/esm/src/features/auth/access/repository.d.ts.map +0 -1
- package/esm/src/features/auth/access/repository.js +0 -25
- package/esm/src/features/auth/contract.d.ts.map +0 -1
- package/esm/src/features/auth/contract.js +0 -43
- package/esm/src/features/auth/identity/contract.d.ts +0 -23
- package/esm/src/features/auth/identity/contract.d.ts.map +0 -1
- package/esm/src/features/auth/identity/contract.js +0 -17
- package/esm/src/features/auth/identity/repository.d.ts +0 -22
- package/esm/src/features/auth/identity/repository.d.ts.map +0 -1
- package/esm/src/features/auth/identity/repository.js +0 -30
- package/esm/src/features/auth/index.d.ts +0 -6
- package/esm/src/features/auth/index.d.ts.map +0 -1
- package/esm/src/features/auth/index.js +0 -5
- package/esm/src/features/auth/manager.d.ts +0 -105
- package/esm/src/features/auth/manager.d.ts.map +0 -1
- package/esm/src/features/auth/manager.js +0 -181
- package/esm/src/features/auth/profile/contract.d.ts +0 -37
- package/esm/src/features/auth/profile/contract.d.ts.map +0 -1
- package/esm/src/features/auth/profile/contract.js +0 -14
- package/esm/src/features/auth/profile/repository.d.ts +0 -11
- package/esm/src/features/auth/profile/repository.d.ts.map +0 -1
- package/esm/src/features/auth/profile/repository.js +0 -25
- package/esm/src/features/auth/repository.d.ts +0 -30
- package/esm/src/features/auth/repository.d.ts.map +0 -1
- package/esm/src/features/auth/repository.js +0 -69
- package/esm/src/features/auth/storage/client_store.d.ts +0 -30
- package/esm/src/features/auth/storage/client_store.d.ts.map +0 -1
- package/esm/src/features/auth/storage/client_store.js +0 -46
- package/esm/src/features/auth/storage/client_token_handler.d.ts +0 -32
- package/esm/src/features/auth/storage/client_token_handler.d.ts.map +0 -1
- package/esm/src/features/auth/storage/client_token_handler.js +0 -36
- package/esm/src/features/auth/storage/server_store.d.ts +0 -24
- package/esm/src/features/auth/storage/server_store.d.ts.map +0 -1
- package/esm/src/features/auth/storage/server_store.js +0 -34
- package/esm/src/features/auth/storage/server_token_handler.d.ts +0 -36
- package/esm/src/features/auth/storage/server_token_handler.d.ts.map +0 -1
- package/esm/src/features/auth/storage/server_token_handler.js +0 -115
- package/esm/src/features/auth/storage/types.d.ts +0 -42
- package/esm/src/features/auth/storage/types.d.ts.map +0 -1
- package/esm/src/features/auth/storage/types.js +0 -1
- package/esm/src/features/contact/contract.d.ts +0 -170
- package/esm/src/features/contact/contract.d.ts.map +0 -1
- package/esm/src/features/contact/contract.js +0 -49
- package/esm/src/features/contact/index.d.ts +0 -2
- package/esm/src/features/contact/index.d.ts.map +0 -1
- package/esm/src/features/contact/index.js +0 -1
- package/esm/src/features/contact/repository.d.ts +0 -58
- package/esm/src/features/contact/repository.d.ts.map +0 -1
- package/esm/src/features/contact/repository.js +0 -108
- package/esm/src/features/payout/contract.d.ts.map +0 -1
- package/esm/src/features/payout/contract.js +0 -75
- package/esm/src/features/payout/index.d.ts +0 -2
- package/esm/src/features/payout/index.d.ts.map +0 -1
- package/esm/src/features/payout/index.js +0 -1
- package/esm/src/features/payout/repository.d.ts +0 -67
- package/esm/src/features/payout/repository.d.ts.map +0 -1
- package/esm/src/features/payout/repository.js +0 -179
- package/esm/src/features/wallet/contract.d.ts +0 -137
- package/esm/src/features/wallet/contract.d.ts.map +0 -1
- package/esm/src/features/wallet/contract.js +0 -38
- package/esm/src/features/wallet/index.d.ts +0 -2
- package/esm/src/features/wallet/index.d.ts.map +0 -1
- package/esm/src/features/wallet/index.js +0 -1
- package/esm/src/features/wallet/repository.d.ts +0 -57
- package/esm/src/features/wallet/repository.d.ts.map +0 -1
- package/esm/src/features/wallet/repository.js +0 -93
- package/esm/src/models/contact/derivatives/contact.d.ts +0 -172
- package/esm/src/models/contact/derivatives/contact.d.ts.map +0 -1
- package/esm/src/models/contact/derivatives/contact.js +0 -266
- package/esm/src/models/contact/derivatives/contact_info.d.ts +0 -188
- package/esm/src/models/contact/derivatives/contact_info.d.ts.map +0 -1
- package/esm/src/models/contact/derivatives/contact_info.js +0 -255
- package/esm/src/models/contact/index.d.ts +0 -5
- package/esm/src/models/contact/index.d.ts.map +0 -1
- package/esm/src/models/contact/index.js +0 -4
- package/esm/src/models/contact/schemas.d.ts +0 -66
- package/esm/src/models/contact/schemas.d.ts.map +0 -1
- package/esm/src/models/contact/schemas.js +0 -64
- package/esm/src/models/contact/validation.d.ts +0 -37
- package/esm/src/models/contact/validation.d.ts.map +0 -1
- package/esm/src/models/contact/validation.js +0 -146
- package/esm/src/models/index.d.ts +0 -7
- package/esm/src/models/index.d.ts.map +0 -1
- package/esm/src/models/index.js +0 -6
- package/esm/src/models/payout/api.d.ts +0 -29
- package/esm/src/models/payout/api.d.ts.map +0 -1
- package/esm/src/models/payout/api.js +0 -1
- package/esm/src/models/payout/channel.d.ts +0 -58
- package/esm/src/models/payout/channel.d.ts.map +0 -1
- package/esm/src/models/payout/channel.js +0 -53
- package/esm/src/models/payout/derivatives/payout.d.ts +0 -158
- package/esm/src/models/payout/derivatives/payout.d.ts.map +0 -1
- package/esm/src/models/payout/derivatives/payout.js +0 -271
- package/esm/src/models/payout/index.d.ts +0 -7
- package/esm/src/models/payout/index.d.ts.map +0 -1
- package/esm/src/models/payout/index.js +0 -6
- package/esm/src/models/payout/narration.d.ts +0 -164
- package/esm/src/models/payout/narration.d.ts.map +0 -1
- package/esm/src/models/payout/narration.js +0 -308
- package/esm/src/models/payout/schemas.d.ts +0 -156
- package/esm/src/models/payout/schemas.d.ts.map +0 -1
- package/esm/src/models/payout/schemas.js +0 -105
- package/esm/src/models/payout/status.d.ts +0 -33
- package/esm/src/models/payout/status.d.ts.map +0 -1
- package/esm/src/models/payout/status.js +0 -34
- package/esm/src/models/permission.d.ts.map +0 -1
- package/esm/src/models/permission.js +0 -50
- package/esm/src/models/role.d.ts +0 -21
- package/esm/src/models/role.d.ts.map +0 -1
- package/esm/src/models/role.js +0 -73
- package/esm/src/models/user/authenticated-user.d.ts +0 -77
- package/esm/src/models/user/authenticated-user.d.ts.map +0 -1
- package/esm/src/models/user/authenticated-user.js +0 -226
- package/esm/src/models/user/index.d.ts +0 -4
- package/esm/src/models/user/index.d.ts.map +0 -1
- package/esm/src/models/user/index.js +0 -3
- package/esm/src/models/user/managed-user.d.ts +0 -108
- package/esm/src/models/user/managed-user.d.ts.map +0 -1
- package/esm/src/models/user/managed-user.js +0 -255
- package/esm/src/models/user/profile.d.ts +0 -161
- package/esm/src/models/user/profile.d.ts.map +0 -1
- package/esm/src/models/user/profile.js +0 -334
- package/esm/src/models/wallet/index.d.ts +0 -4
- package/esm/src/models/wallet/index.d.ts.map +0 -1
- package/esm/src/models/wallet/index.js +0 -3
- package/esm/src/models/wallet/schemas.d.ts +0 -95
- package/esm/src/models/wallet/schemas.d.ts.map +0 -1
- package/esm/src/models/wallet/schemas.js +0 -35
- package/esm/src/models/wallet/statement_entry.d.ts +0 -160
- package/esm/src/models/wallet/statement_entry.d.ts.map +0 -1
- package/esm/src/models/wallet/statement_entry.js +0 -255
- package/esm/src/models/wallet/wallet.d.ts.map +0 -1
- package/esm/src/models/wallet/wallet.js +0 -279
- package/esm/src/shared/base_repository.d.ts +0 -80
- package/esm/src/shared/base_repository.d.ts.map +0 -1
- package/esm/src/shared/base_repository.js +0 -153
- package/esm/src/shared/common_responses.d.ts +0 -13
- package/esm/src/shared/common_responses.d.ts.map +0 -1
- package/esm/src/shared/common_responses.js +0 -10
- package/esm/src/shared/index.d.ts +0 -3
- package/esm/src/shared/index.d.ts.map +0 -1
- package/esm/src/shared/index.js +0 -2
- package/esm/src/shared/token_required_repository.d.ts +0 -78
- package/esm/src/shared/token_required_repository.d.ts.map +0 -1
- package/esm/src/shared/token_required_repository.js +0 -128
- package/script/mod.d.ts +0 -8
- package/script/mod.d.ts.map +0 -1
- package/script/mod.js +0 -23
- package/script/npm/src/mod.d.ts +0 -8
- package/script/npm/src/mod.d.ts.map +0 -1
- package/script/npm/src/mod.js +0 -23
- package/script/npm/src/src/errors/api_error.d.ts +0 -63
- package/script/npm/src/src/errors/api_error.d.ts.map +0 -1
- package/script/npm/src/src/errors/api_error.js +0 -94
- package/script/npm/src/src/errors/index.d.ts +0 -3
- package/script/npm/src/src/errors/index.d.ts.map +0 -1
- package/script/npm/src/src/errors/index.js +0 -18
- package/script/npm/src/src/errors/permission_error.d.ts.map +0 -1
- package/script/npm/src/src/errors/permission_error.js +0 -74
- package/script/npm/src/src/features/admin/contract.d.ts +0 -842
- package/script/npm/src/src/features/admin/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/admin/contract.js +0 -213
- package/script/npm/src/src/features/admin/index.d.ts +0 -4
- package/script/npm/src/src/features/admin/index.d.ts.map +0 -1
- package/script/npm/src/src/features/admin/index.js +0 -19
- package/script/npm/src/src/features/admin/repository.d.ts +0 -114
- package/script/npm/src/src/features/admin/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/admin/repository.js +0 -252
- package/script/npm/src/src/features/admin/schemas.d.ts +0 -146
- package/script/npm/src/src/features/admin/schemas.d.ts.map +0 -1
- package/script/npm/src/src/features/admin/schemas.js +0 -209
- package/script/npm/src/src/features/auth/access/contract.d.ts +0 -14
- package/script/npm/src/src/features/auth/access/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/access/contract.js +0 -17
- package/script/npm/src/src/features/auth/access/repository.d.ts +0 -11
- package/script/npm/src/src/features/auth/access/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/access/repository.js +0 -29
- package/script/npm/src/src/features/auth/contract.d.ts +0 -112
- package/script/npm/src/src/features/auth/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/contract.js +0 -46
- package/script/npm/src/src/features/auth/identity/contract.d.ts +0 -23
- package/script/npm/src/src/features/auth/identity/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/identity/contract.js +0 -20
- package/script/npm/src/src/features/auth/identity/repository.d.ts +0 -22
- package/script/npm/src/src/features/auth/identity/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/identity/repository.js +0 -34
- package/script/npm/src/src/features/auth/index.d.ts +0 -6
- package/script/npm/src/src/features/auth/index.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/index.js +0 -21
- package/script/npm/src/src/features/auth/manager.d.ts +0 -105
- package/script/npm/src/src/features/auth/manager.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/manager.js +0 -185
- package/script/npm/src/src/features/auth/profile/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/profile/contract.js +0 -17
- package/script/npm/src/src/features/auth/profile/repository.d.ts +0 -11
- package/script/npm/src/src/features/auth/profile/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/profile/repository.js +0 -29
- package/script/npm/src/src/features/auth/repository.d.ts +0 -30
- package/script/npm/src/src/features/auth/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/repository.js +0 -73
- package/script/npm/src/src/features/auth/storage/client_store.d.ts +0 -30
- package/script/npm/src/src/features/auth/storage/client_store.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/storage/client_store.js +0 -51
- package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts +0 -32
- package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/storage/client_token_handler.js +0 -40
- package/script/npm/src/src/features/auth/storage/server_store.d.ts +0 -24
- package/script/npm/src/src/features/auth/storage/server_store.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/storage/server_store.js +0 -38
- package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts +0 -36
- package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/storage/server_token_handler.js +0 -119
- package/script/npm/src/src/features/auth/storage/types.d.ts +0 -42
- package/script/npm/src/src/features/auth/storage/types.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/storage/types.js +0 -2
- package/script/npm/src/src/features/contact/contract.d.ts +0 -170
- package/script/npm/src/src/features/contact/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/contact/contract.js +0 -52
- package/script/npm/src/src/features/contact/index.d.ts +0 -2
- package/script/npm/src/src/features/contact/index.d.ts.map +0 -1
- package/script/npm/src/src/features/contact/index.js +0 -17
- package/script/npm/src/src/features/contact/repository.d.ts +0 -58
- package/script/npm/src/src/features/contact/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/contact/repository.js +0 -112
- package/script/npm/src/src/features/payout/contract.d.ts +0 -623
- package/script/npm/src/src/features/payout/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/payout/contract.js +0 -78
- package/script/npm/src/src/features/payout/index.d.ts +0 -2
- package/script/npm/src/src/features/payout/index.d.ts.map +0 -1
- package/script/npm/src/src/features/payout/index.js +0 -17
- package/script/npm/src/src/features/payout/repository.d.ts +0 -67
- package/script/npm/src/src/features/payout/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/payout/repository.js +0 -183
- package/script/npm/src/src/features/wallet/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/wallet/contract.js +0 -41
- package/script/npm/src/src/features/wallet/index.d.ts +0 -2
- package/script/npm/src/src/features/wallet/index.d.ts.map +0 -1
- package/script/npm/src/src/features/wallet/index.js +0 -17
- package/script/npm/src/src/features/wallet/repository.d.ts +0 -57
- package/script/npm/src/src/features/wallet/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/wallet/repository.js +0 -97
- package/script/npm/src/src/models/contact/derivatives/contact.d.ts +0 -172
- package/script/npm/src/src/models/contact/derivatives/contact.d.ts.map +0 -1
- package/script/npm/src/src/models/contact/derivatives/contact.js +0 -270
- package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts +0 -188
- package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts.map +0 -1
- package/script/npm/src/src/models/contact/derivatives/contact_info.js +0 -260
- package/script/npm/src/src/models/contact/index.d.ts +0 -5
- package/script/npm/src/src/models/contact/index.d.ts.map +0 -1
- package/script/npm/src/src/models/contact/index.js +0 -20
- package/script/npm/src/src/models/contact/schemas.d.ts +0 -66
- package/script/npm/src/src/models/contact/schemas.d.ts.map +0 -1
- package/script/npm/src/src/models/contact/schemas.js +0 -67
- package/script/npm/src/src/models/contact/validation.d.ts +0 -37
- package/script/npm/src/src/models/contact/validation.d.ts.map +0 -1
- package/script/npm/src/src/models/contact/validation.js +0 -153
- package/script/npm/src/src/models/index.d.ts +0 -7
- package/script/npm/src/src/models/index.d.ts.map +0 -1
- package/script/npm/src/src/models/index.js +0 -22
- package/script/npm/src/src/models/payout/api.d.ts +0 -29
- package/script/npm/src/src/models/payout/api.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/api.js +0 -2
- package/script/npm/src/src/models/payout/channel.d.ts +0 -58
- package/script/npm/src/src/models/payout/channel.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/channel.js +0 -56
- package/script/npm/src/src/models/payout/derivatives/payout.d.ts +0 -158
- package/script/npm/src/src/models/payout/derivatives/payout.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/derivatives/payout.js +0 -275
- package/script/npm/src/src/models/payout/index.d.ts +0 -7
- package/script/npm/src/src/models/payout/index.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/index.js +0 -22
- package/script/npm/src/src/models/payout/narration.d.ts +0 -164
- package/script/npm/src/src/models/payout/narration.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/narration.js +0 -312
- package/script/npm/src/src/models/payout/schemas.d.ts +0 -156
- package/script/npm/src/src/models/payout/schemas.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/schemas.js +0 -108
- package/script/npm/src/src/models/payout/status.d.ts +0 -33
- package/script/npm/src/src/models/payout/status.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/status.js +0 -37
- package/script/npm/src/src/models/permission.d.ts +0 -55
- package/script/npm/src/src/models/permission.d.ts.map +0 -1
- package/script/npm/src/src/models/permission.js +0 -53
- package/script/npm/src/src/models/role.d.ts +0 -21
- package/script/npm/src/src/models/role.d.ts.map +0 -1
- package/script/npm/src/src/models/role.js +0 -77
- package/script/npm/src/src/models/user/authenticated-user.d.ts +0 -77
- package/script/npm/src/src/models/user/authenticated-user.d.ts.map +0 -1
- package/script/npm/src/src/models/user/authenticated-user.js +0 -230
- package/script/npm/src/src/models/user/index.d.ts +0 -4
- package/script/npm/src/src/models/user/index.d.ts.map +0 -1
- package/script/npm/src/src/models/user/index.js +0 -19
- package/script/npm/src/src/models/user/managed-user.d.ts +0 -108
- package/script/npm/src/src/models/user/managed-user.d.ts.map +0 -1
- package/script/npm/src/src/models/user/managed-user.js +0 -260
- package/script/npm/src/src/models/user/profile.d.ts.map +0 -1
- package/script/npm/src/src/models/user/profile.js +0 -338
- package/script/npm/src/src/models/wallet/index.d.ts +0 -4
- package/script/npm/src/src/models/wallet/index.d.ts.map +0 -1
- package/script/npm/src/src/models/wallet/index.js +0 -19
- package/script/npm/src/src/models/wallet/schemas.d.ts +0 -95
- package/script/npm/src/src/models/wallet/schemas.d.ts.map +0 -1
- package/script/npm/src/src/models/wallet/schemas.js +0 -38
- package/script/npm/src/src/models/wallet/statement_entry.d.ts +0 -160
- package/script/npm/src/src/models/wallet/statement_entry.d.ts.map +0 -1
- package/script/npm/src/src/models/wallet/statement_entry.js +0 -259
- package/script/npm/src/src/models/wallet/wallet.d.ts +0 -147
- package/script/npm/src/src/models/wallet/wallet.d.ts.map +0 -1
- package/script/npm/src/src/models/wallet/wallet.js +0 -283
- package/script/npm/src/src/shared/base_repository.d.ts +0 -80
- package/script/npm/src/src/shared/base_repository.d.ts.map +0 -1
- package/script/npm/src/src/shared/base_repository.js +0 -157
- package/script/npm/src/src/shared/common_responses.d.ts +0 -13
- package/script/npm/src/src/shared/common_responses.d.ts.map +0 -1
- package/script/npm/src/src/shared/common_responses.js +0 -13
- package/script/npm/src/src/shared/index.d.ts +0 -3
- package/script/npm/src/src/shared/index.d.ts.map +0 -1
- package/script/npm/src/src/shared/index.js +0 -18
- package/script/npm/src/src/shared/token_required_repository.d.ts +0 -78
- package/script/npm/src/src/shared/token_required_repository.d.ts.map +0 -1
- package/script/npm/src/src/shared/token_required_repository.js +0 -132
- package/script/package.json +0 -3
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Collection of team management schemas for export.
|
|
4
|
+
* Provides access to all team member and role validation schemas.
|
|
5
|
+
*/
|
|
6
|
+
export declare const TeamManagementDTOSchemas: {
|
|
7
|
+
role: z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
description: z.ZodOptional<z.ZodString>;
|
|
11
|
+
access: z.ZodArray<z.ZodString, "many">;
|
|
12
|
+
createdAt: z.ZodString;
|
|
13
|
+
updatedAt: z.ZodString;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
name: string;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
id: string;
|
|
18
|
+
updatedAt: string;
|
|
19
|
+
access: string[];
|
|
20
|
+
description?: string | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
name: string;
|
|
23
|
+
createdAt: string;
|
|
24
|
+
id: string;
|
|
25
|
+
updatedAt: string;
|
|
26
|
+
access: string[];
|
|
27
|
+
description?: string | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
teamMember: z.ZodObject<{
|
|
30
|
+
id: z.ZodString;
|
|
31
|
+
name: z.ZodString;
|
|
32
|
+
identity: z.ZodString;
|
|
33
|
+
type: z.ZodString;
|
|
34
|
+
profileId: z.ZodString;
|
|
35
|
+
roleId: z.ZodString;
|
|
36
|
+
resetPassword: z.ZodBoolean;
|
|
37
|
+
isActive: z.ZodBoolean;
|
|
38
|
+
isArchived: z.ZodBoolean;
|
|
39
|
+
role: z.ZodOptional<z.ZodObject<{
|
|
40
|
+
id: z.ZodString;
|
|
41
|
+
name: z.ZodString;
|
|
42
|
+
description: z.ZodOptional<z.ZodString>;
|
|
43
|
+
access: z.ZodArray<z.ZodString, "many">;
|
|
44
|
+
createdAt: z.ZodString;
|
|
45
|
+
updatedAt: z.ZodString;
|
|
46
|
+
}, "strip", z.ZodTypeAny, {
|
|
47
|
+
name: string;
|
|
48
|
+
createdAt: string;
|
|
49
|
+
id: string;
|
|
50
|
+
updatedAt: string;
|
|
51
|
+
access: string[];
|
|
52
|
+
description?: string | undefined;
|
|
53
|
+
}, {
|
|
54
|
+
name: string;
|
|
55
|
+
createdAt: string;
|
|
56
|
+
id: string;
|
|
57
|
+
updatedAt: string;
|
|
58
|
+
access: string[];
|
|
59
|
+
description?: string | undefined;
|
|
60
|
+
}>>;
|
|
61
|
+
createdAt: z.ZodString;
|
|
62
|
+
updatedAt: z.ZodString;
|
|
63
|
+
}, "strip", z.ZodTypeAny, {
|
|
64
|
+
type: string;
|
|
65
|
+
name: string;
|
|
66
|
+
createdAt: string;
|
|
67
|
+
id: string;
|
|
68
|
+
profileId: string;
|
|
69
|
+
identity: string;
|
|
70
|
+
roleId: string;
|
|
71
|
+
isActive: boolean;
|
|
72
|
+
isArchived: boolean;
|
|
73
|
+
resetPassword: boolean;
|
|
74
|
+
updatedAt: string;
|
|
75
|
+
role?: {
|
|
76
|
+
name: string;
|
|
77
|
+
createdAt: string;
|
|
78
|
+
id: string;
|
|
79
|
+
updatedAt: string;
|
|
80
|
+
access: string[];
|
|
81
|
+
description?: string | undefined;
|
|
82
|
+
} | undefined;
|
|
83
|
+
}, {
|
|
84
|
+
type: string;
|
|
85
|
+
name: string;
|
|
86
|
+
createdAt: string;
|
|
87
|
+
id: string;
|
|
88
|
+
profileId: string;
|
|
89
|
+
identity: string;
|
|
90
|
+
roleId: string;
|
|
91
|
+
isActive: boolean;
|
|
92
|
+
isArchived: boolean;
|
|
93
|
+
resetPassword: boolean;
|
|
94
|
+
updatedAt: string;
|
|
95
|
+
role?: {
|
|
96
|
+
name: string;
|
|
97
|
+
createdAt: string;
|
|
98
|
+
id: string;
|
|
99
|
+
updatedAt: string;
|
|
100
|
+
access: string[];
|
|
101
|
+
description?: string | undefined;
|
|
102
|
+
} | undefined;
|
|
103
|
+
}>;
|
|
104
|
+
teamMemberQueryParams: z.ZodObject<{
|
|
105
|
+
id: z.ZodOptional<z.ZodString>;
|
|
106
|
+
name: z.ZodOptional<z.ZodString>;
|
|
107
|
+
identity: z.ZodOptional<z.ZodString>;
|
|
108
|
+
type: z.ZodOptional<z.ZodString>;
|
|
109
|
+
profileId: z.ZodOptional<z.ZodString>;
|
|
110
|
+
roleId: z.ZodOptional<z.ZodString>;
|
|
111
|
+
resetPassword: z.ZodOptional<z.ZodNumber>;
|
|
112
|
+
isActive: z.ZodOptional<z.ZodNumber>;
|
|
113
|
+
isArchived: z.ZodOptional<z.ZodNumber>;
|
|
114
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
115
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
116
|
+
eager: z.ZodOptional<z.ZodString>;
|
|
117
|
+
}, "strip", z.ZodTypeAny, {
|
|
118
|
+
type?: string | undefined;
|
|
119
|
+
name?: string | undefined;
|
|
120
|
+
createdAt?: string | undefined;
|
|
121
|
+
eager?: string | undefined;
|
|
122
|
+
id?: string | undefined;
|
|
123
|
+
profileId?: string | undefined;
|
|
124
|
+
identity?: string | undefined;
|
|
125
|
+
roleId?: string | undefined;
|
|
126
|
+
isActive?: number | undefined;
|
|
127
|
+
isArchived?: number | undefined;
|
|
128
|
+
resetPassword?: number | undefined;
|
|
129
|
+
updatedAt?: string | undefined;
|
|
130
|
+
}, {
|
|
131
|
+
type?: string | undefined;
|
|
132
|
+
name?: string | undefined;
|
|
133
|
+
createdAt?: string | undefined;
|
|
134
|
+
eager?: string | undefined;
|
|
135
|
+
id?: string | undefined;
|
|
136
|
+
profileId?: string | undefined;
|
|
137
|
+
identity?: string | undefined;
|
|
138
|
+
roleId?: string | undefined;
|
|
139
|
+
isActive?: number | undefined;
|
|
140
|
+
isArchived?: number | undefined;
|
|
141
|
+
resetPassword?: number | undefined;
|
|
142
|
+
updatedAt?: string | undefined;
|
|
143
|
+
}>;
|
|
144
|
+
createTeamMemberRequest: z.ZodObject<{
|
|
145
|
+
name: z.ZodString;
|
|
146
|
+
identity: z.ZodString;
|
|
147
|
+
password: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
|
|
148
|
+
roleId: z.ZodOptional<z.ZodString>;
|
|
149
|
+
resetPassword: z.ZodOptional<z.ZodBoolean>;
|
|
150
|
+
}, "strip", z.ZodTypeAny, {
|
|
151
|
+
name: string;
|
|
152
|
+
identity: string;
|
|
153
|
+
roleId?: string | undefined;
|
|
154
|
+
resetPassword?: boolean | undefined;
|
|
155
|
+
password?: string | undefined;
|
|
156
|
+
}, {
|
|
157
|
+
name: string;
|
|
158
|
+
identity: string;
|
|
159
|
+
roleId?: string | undefined;
|
|
160
|
+
resetPassword?: boolean | undefined;
|
|
161
|
+
password?: string | undefined;
|
|
162
|
+
}>;
|
|
163
|
+
updateTeamMemberRequest: z.ZodObject<{
|
|
164
|
+
name: z.ZodOptional<z.ZodString>;
|
|
165
|
+
roleId: z.ZodOptional<z.ZodString>;
|
|
166
|
+
password: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
|
|
167
|
+
resetPassword: z.ZodOptional<z.ZodBoolean>;
|
|
168
|
+
isActive: z.ZodOptional<z.ZodBoolean>;
|
|
169
|
+
}, "strip", z.ZodTypeAny, {
|
|
170
|
+
name?: string | undefined;
|
|
171
|
+
roleId?: string | undefined;
|
|
172
|
+
isActive?: boolean | undefined;
|
|
173
|
+
resetPassword?: boolean | undefined;
|
|
174
|
+
password?: string | undefined;
|
|
175
|
+
}, {
|
|
176
|
+
name?: string | undefined;
|
|
177
|
+
roleId?: string | undefined;
|
|
178
|
+
isActive?: boolean | undefined;
|
|
179
|
+
resetPassword?: boolean | undefined;
|
|
180
|
+
password?: string | undefined;
|
|
181
|
+
}>;
|
|
182
|
+
resetPasswordRequest: z.ZodObject<{
|
|
183
|
+
newPassword: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
|
|
184
|
+
sendNotification: z.ZodOptional<z.ZodBoolean>;
|
|
185
|
+
}, "strip", z.ZodTypeAny, {
|
|
186
|
+
newPassword?: string | undefined;
|
|
187
|
+
sendNotification?: boolean | undefined;
|
|
188
|
+
}, {
|
|
189
|
+
newPassword?: string | undefined;
|
|
190
|
+
sendNotification?: boolean | undefined;
|
|
191
|
+
}>;
|
|
192
|
+
createTeamMemberResponse: z.ZodObject<{
|
|
193
|
+
id: z.ZodString;
|
|
194
|
+
name: z.ZodString;
|
|
195
|
+
identity: z.ZodString;
|
|
196
|
+
type: z.ZodString;
|
|
197
|
+
profileId: z.ZodString;
|
|
198
|
+
resetPassword: z.ZodBoolean;
|
|
199
|
+
roleId: z.ZodString;
|
|
200
|
+
isActive: z.ZodBoolean;
|
|
201
|
+
isArchived: z.ZodBoolean;
|
|
202
|
+
createdAt: z.ZodString;
|
|
203
|
+
updatedAt: z.ZodString;
|
|
204
|
+
}, "strip", z.ZodTypeAny, {
|
|
205
|
+
type: string;
|
|
206
|
+
name: string;
|
|
207
|
+
createdAt: string;
|
|
208
|
+
id: string;
|
|
209
|
+
profileId: string;
|
|
210
|
+
identity: string;
|
|
211
|
+
roleId: string;
|
|
212
|
+
isActive: boolean;
|
|
213
|
+
isArchived: boolean;
|
|
214
|
+
resetPassword: boolean;
|
|
215
|
+
updatedAt: string;
|
|
216
|
+
}, {
|
|
217
|
+
type: string;
|
|
218
|
+
name: string;
|
|
219
|
+
createdAt: string;
|
|
220
|
+
id: string;
|
|
221
|
+
profileId: string;
|
|
222
|
+
identity: string;
|
|
223
|
+
roleId: string;
|
|
224
|
+
isActive: boolean;
|
|
225
|
+
isArchived: boolean;
|
|
226
|
+
resetPassword: boolean;
|
|
227
|
+
updatedAt: string;
|
|
228
|
+
}>;
|
|
229
|
+
password: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
|
|
230
|
+
};
|
|
231
|
+
/**
|
|
232
|
+
* TypeScript type for a validated role object.
|
|
233
|
+
* Use this type for role instances that have been validated against the schema.
|
|
234
|
+
*/
|
|
235
|
+
export type RoleDTO = z.infer<typeof TeamManagementDTOSchemas.role>;
|
|
236
|
+
/**
|
|
237
|
+
* TypeScript type for a create team member request object.
|
|
238
|
+
* Use this type for team member creation requests that have been validated against the schema.
|
|
239
|
+
*/
|
|
240
|
+
export type CreateTeamMemberRequestDTO = z.infer<typeof TeamManagementDTOSchemas.createTeamMemberRequest>;
|
|
241
|
+
/**
|
|
242
|
+
* TypeScript type for an update team member request object.
|
|
243
|
+
* Use this type for team member update requests that have been validated against the schema.
|
|
244
|
+
*/
|
|
245
|
+
export type UpdateTeamMemberRequestDTO = z.infer<typeof TeamManagementDTOSchemas.updateTeamMemberRequest>;
|
|
246
|
+
/**
|
|
247
|
+
* TypeScript type for a reset password request object.
|
|
248
|
+
* Use this type for password reset requests that have been validated against the schema.
|
|
249
|
+
*/
|
|
250
|
+
export type ResetPasswordRequestDTO = z.infer<typeof TeamManagementDTOSchemas.resetPasswordRequest>;
|
|
251
|
+
/**
|
|
252
|
+
* TypeScript type for a create team member response object.
|
|
253
|
+
* Use this type for team member creation responses that have been validated against the schema.
|
|
254
|
+
*/
|
|
255
|
+
export type CreateTeamMemberResponseDTO = z.infer<typeof TeamManagementDTOSchemas.createTeamMemberResponse>;
|
|
256
|
+
/**
|
|
257
|
+
* TypeScript type for team member query parameters.
|
|
258
|
+
* Use this type for query parameter objects that have been validated against the schema.
|
|
259
|
+
* All fields are optional to allow flexible filtering and searching.
|
|
260
|
+
*/
|
|
261
|
+
export type TeamMemberQueryParamsDTO = z.infer<typeof TeamManagementDTOSchemas.teamMemberQueryParams>;
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import { Role } from "./role.model.js";
|
|
3
|
+
import { RoleDTO } from "./team-member.dtos.js";
|
|
4
|
+
export interface TeamMemberData {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
identity: string;
|
|
8
|
+
type: string;
|
|
9
|
+
profileId: string;
|
|
10
|
+
roleId: string;
|
|
11
|
+
resetPassword: boolean;
|
|
12
|
+
isActive: boolean;
|
|
13
|
+
isArchived: boolean;
|
|
14
|
+
role?: RoleDTO;
|
|
15
|
+
createdAt: string;
|
|
16
|
+
updatedAt: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Zod schema for TeamMember JSON serialization
|
|
20
|
+
*/
|
|
21
|
+
export declare const TeamMemberJSONSchema: z.ZodObject<{
|
|
22
|
+
id: z.ZodString;
|
|
23
|
+
name: z.ZodString;
|
|
24
|
+
identity: z.ZodString;
|
|
25
|
+
type: z.ZodString;
|
|
26
|
+
profileId: z.ZodString;
|
|
27
|
+
roleId: z.ZodString;
|
|
28
|
+
resetPassword: z.ZodBoolean;
|
|
29
|
+
isActive: z.ZodBoolean;
|
|
30
|
+
isArchived: z.ZodBoolean;
|
|
31
|
+
role: z.ZodOptional<z.ZodObject<{
|
|
32
|
+
id: z.ZodString;
|
|
33
|
+
name: z.ZodString;
|
|
34
|
+
description: z.ZodOptional<z.ZodString>;
|
|
35
|
+
access: z.ZodArray<z.ZodString, "many">;
|
|
36
|
+
createdAt: z.ZodString;
|
|
37
|
+
updatedAt: z.ZodString;
|
|
38
|
+
version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
name: string;
|
|
41
|
+
createdAt: string;
|
|
42
|
+
id: string;
|
|
43
|
+
version: string;
|
|
44
|
+
updatedAt: string;
|
|
45
|
+
access: string[];
|
|
46
|
+
description?: string | undefined;
|
|
47
|
+
}, {
|
|
48
|
+
name: string;
|
|
49
|
+
createdAt: string;
|
|
50
|
+
id: string;
|
|
51
|
+
updatedAt: string;
|
|
52
|
+
access: string[];
|
|
53
|
+
version?: string | undefined;
|
|
54
|
+
description?: string | undefined;
|
|
55
|
+
}>>;
|
|
56
|
+
createdAt: z.ZodString;
|
|
57
|
+
updatedAt: z.ZodString;
|
|
58
|
+
version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
type: string;
|
|
61
|
+
name: string;
|
|
62
|
+
createdAt: string;
|
|
63
|
+
id: string;
|
|
64
|
+
version: string;
|
|
65
|
+
profileId: string;
|
|
66
|
+
identity: string;
|
|
67
|
+
roleId: string;
|
|
68
|
+
isActive: boolean;
|
|
69
|
+
isArchived: boolean;
|
|
70
|
+
resetPassword: boolean;
|
|
71
|
+
updatedAt: string;
|
|
72
|
+
role?: {
|
|
73
|
+
name: string;
|
|
74
|
+
createdAt: string;
|
|
75
|
+
id: string;
|
|
76
|
+
version: string;
|
|
77
|
+
updatedAt: string;
|
|
78
|
+
access: string[];
|
|
79
|
+
description?: string | undefined;
|
|
80
|
+
} | undefined;
|
|
81
|
+
}, {
|
|
82
|
+
type: string;
|
|
83
|
+
name: string;
|
|
84
|
+
createdAt: string;
|
|
85
|
+
id: string;
|
|
86
|
+
profileId: string;
|
|
87
|
+
identity: string;
|
|
88
|
+
roleId: string;
|
|
89
|
+
isActive: boolean;
|
|
90
|
+
isArchived: boolean;
|
|
91
|
+
resetPassword: boolean;
|
|
92
|
+
updatedAt: string;
|
|
93
|
+
version?: string | undefined;
|
|
94
|
+
role?: {
|
|
95
|
+
name: string;
|
|
96
|
+
createdAt: string;
|
|
97
|
+
id: string;
|
|
98
|
+
updatedAt: string;
|
|
99
|
+
access: string[];
|
|
100
|
+
version?: string | undefined;
|
|
101
|
+
description?: string | undefined;
|
|
102
|
+
} | undefined;
|
|
103
|
+
}>;
|
|
104
|
+
export type TeamMemberJSON = z.infer<typeof TeamMemberJSONSchema>;
|
|
105
|
+
/**
|
|
106
|
+
* Represents a team member from the admin management perspective.
|
|
107
|
+
*
|
|
108
|
+
* This is how administrators view and manage people in the system.
|
|
109
|
+
* When a team member logs in, they become a User (authenticated session).
|
|
110
|
+
*
|
|
111
|
+
* TeamMember includes management metadata like:
|
|
112
|
+
* - isActive, isArchived (account status)
|
|
113
|
+
* - createdAt, updatedAt (audit trail)
|
|
114
|
+
* - role (their assigned role with permissions)
|
|
115
|
+
*/
|
|
116
|
+
export declare class TeamMember {
|
|
117
|
+
readonly id: string;
|
|
118
|
+
readonly name: string;
|
|
119
|
+
readonly identity: string;
|
|
120
|
+
readonly type: string;
|
|
121
|
+
readonly profileId: string;
|
|
122
|
+
readonly roleId: string;
|
|
123
|
+
readonly resetPassword: boolean;
|
|
124
|
+
readonly isActive: boolean;
|
|
125
|
+
readonly isArchived: boolean;
|
|
126
|
+
readonly role?: Role;
|
|
127
|
+
readonly createdAt: Date;
|
|
128
|
+
readonly updatedAt: Date;
|
|
129
|
+
readonly permissions: ReadonlySet<string>;
|
|
130
|
+
private constructor();
|
|
131
|
+
/**
|
|
132
|
+
* Creates a TeamMember instance from a DTO.
|
|
133
|
+
*
|
|
134
|
+
* @param data - Team member data from the API
|
|
135
|
+
* @returns A new TeamMember instance, or undefined if data is invalid
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```typescript
|
|
139
|
+
* const member = TeamMember.from({
|
|
140
|
+
* id: "member-123",
|
|
141
|
+
* name: "John Doe",
|
|
142
|
+
* identity: "john@example.com",
|
|
143
|
+
* roleId: "role-456",
|
|
144
|
+
* // ... other fields
|
|
145
|
+
* });
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
static from(data: TeamMemberData): TeamMember | undefined;
|
|
149
|
+
/**
|
|
150
|
+
* Creates a TeamMember instance from a JSON string.
|
|
151
|
+
*
|
|
152
|
+
* @param jsonString - JSON string containing team member data
|
|
153
|
+
* @returns A new TeamMember instance, or undefined if parsing failed
|
|
154
|
+
*/
|
|
155
|
+
static fromJson(jsonString: string): TeamMember | undefined;
|
|
156
|
+
/**
|
|
157
|
+
* Creates multiple TeamMember instances from an array of data.
|
|
158
|
+
*
|
|
159
|
+
* @param dataArray - Array of team member data
|
|
160
|
+
* @returns Array of TeamMember instances (filters out invalid entries)
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* ```typescript
|
|
164
|
+
* const members = TeamMember.createMany(apiResponse.data);
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
static createMany(dataArray: any[]): TeamMember[];
|
|
168
|
+
/**
|
|
169
|
+
* Check if team member has a specific permission
|
|
170
|
+
*/
|
|
171
|
+
can(permission: string): boolean;
|
|
172
|
+
/**
|
|
173
|
+
* Check if team member has any of the specified permissions
|
|
174
|
+
*/
|
|
175
|
+
canAny(permissions: string[]): boolean;
|
|
176
|
+
/**
|
|
177
|
+
* Check if team member has all of the specified permissions
|
|
178
|
+
*/
|
|
179
|
+
canAll(permissions: string[]): boolean;
|
|
180
|
+
/**
|
|
181
|
+
* Check if team member account is active
|
|
182
|
+
*/
|
|
183
|
+
isAccountActive(): boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Check if team member account is archived
|
|
186
|
+
*/
|
|
187
|
+
isAccountArchived(): boolean;
|
|
188
|
+
/**
|
|
189
|
+
* Check if team member needs to reset password
|
|
190
|
+
*/
|
|
191
|
+
needsPasswordReset(): boolean;
|
|
192
|
+
/**
|
|
193
|
+
* Get comprehensive account status
|
|
194
|
+
*/
|
|
195
|
+
getAccountStatus(): {
|
|
196
|
+
status: "active" | "inactive" | "archived" | "password_reset_required";
|
|
197
|
+
label: string;
|
|
198
|
+
color: "success" | "warning" | "error" | "default";
|
|
199
|
+
description: string;
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* Get role display name
|
|
203
|
+
*/
|
|
204
|
+
getRoleName(): string;
|
|
205
|
+
/**
|
|
206
|
+
* Get formatted creation date
|
|
207
|
+
*/
|
|
208
|
+
getCreatedDate(): string;
|
|
209
|
+
/**
|
|
210
|
+
* Get time since last update
|
|
211
|
+
*/
|
|
212
|
+
getLastUpdateInfo(): string;
|
|
213
|
+
/**
|
|
214
|
+
* Serializes the TeamMember instance to a JSON-compatible object
|
|
215
|
+
*/
|
|
216
|
+
toJSON(): TeamMemberJSON;
|
|
217
|
+
/**
|
|
218
|
+
* Serializes the TeamMember instance to a JSON string
|
|
219
|
+
*/
|
|
220
|
+
toJSONString(): string;
|
|
221
|
+
/**
|
|
222
|
+
* Creates a TeamMember instance from a JSON-compatible object or string
|
|
223
|
+
*/
|
|
224
|
+
static fromJSON(json: TeamMemberJSON | string): TeamMember | undefined;
|
|
225
|
+
/**
|
|
226
|
+
* Type guard using Zod schema validation
|
|
227
|
+
*/
|
|
228
|
+
static isTeamMemberJSON(obj: unknown): obj is TeamMemberJSON;
|
|
229
|
+
/**
|
|
230
|
+
* Creates multiple TeamMember instances from a JSON array
|
|
231
|
+
*/
|
|
232
|
+
static fromJSONArray(jsonArray: TeamMemberJSON[] | string): TeamMember[];
|
|
233
|
+
/**
|
|
234
|
+
* Serializes an array of TeamMember instances to JSON
|
|
235
|
+
*/
|
|
236
|
+
static toJSONArray(members: TeamMember[]): TeamMemberJSON[];
|
|
237
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { BaseRepository } from "@/lib/api/base-repository.js";
|
|
2
|
+
import { teamManagementContract } from "./team-member.contract.js";
|
|
3
|
+
import { Role } from "./role.model.js";
|
|
4
|
+
import { CreateTeamMemberRequestDTO, CreateTeamMemberResponseDTO, UpdateTeamMemberRequestDTO, ResetPasswordRequestDTO, TeamMemberQueryParamsDTO } from "./team-member.dtos.js";
|
|
5
|
+
import { TeamMember } from "./team-member.model.js";
|
|
6
|
+
/**
|
|
7
|
+
* Repository class for managing team members through API interactions.
|
|
8
|
+
* Handles team member creation, updates, archiving, and role management.
|
|
9
|
+
*
|
|
10
|
+
* This repository handles pure API communication without permission checking.
|
|
11
|
+
* Permission validation should be handled at the service layer or route handlers.
|
|
12
|
+
*
|
|
13
|
+
* @extends {BaseRepository<typeof teamManagementContract>}
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const repo = new TeamMemberRepository({ token: adminToken });
|
|
18
|
+
* const members = await repo.getAllTeamMembers();
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare class TeamMemberRepository extends BaseRepository<typeof teamManagementContract> {
|
|
22
|
+
/**
|
|
23
|
+
* Creates an instance of TeamMemberRepository using the team management contract.
|
|
24
|
+
*
|
|
25
|
+
* @param options - Optional configuration
|
|
26
|
+
* @param options.token - Authentication token for API calls
|
|
27
|
+
* @param options.root - Custom API root URL
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* const repo = new TeamMemberRepository({
|
|
32
|
+
* token: "admin-auth-token",
|
|
33
|
+
* root: "https://api-staging.afloat.money/v1"
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
constructor(options?: {
|
|
38
|
+
token?: string;
|
|
39
|
+
root?: string;
|
|
40
|
+
});
|
|
41
|
+
/**
|
|
42
|
+
* Creates a new team member account.
|
|
43
|
+
*
|
|
44
|
+
* @param input - The data required to create a new team member
|
|
45
|
+
* @returns Promise that resolves to the newly created team member response
|
|
46
|
+
* @throws {APIError} If the creation operation fails
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* const newMember = await repo.createTeamMember({
|
|
51
|
+
* identity: "newmember@example.com",
|
|
52
|
+
* name: "New Member",
|
|
53
|
+
* roleId: "role-id"
|
|
54
|
+
* });
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
createTeamMember(input: CreateTeamMemberRequestDTO): Promise<CreateTeamMemberResponseDTO>;
|
|
58
|
+
/**
|
|
59
|
+
* Updates an existing team member by ID.
|
|
60
|
+
*
|
|
61
|
+
* @param id - The unique identifier of the team member to update
|
|
62
|
+
* @param input - The data to update the team member with
|
|
63
|
+
* @returns Promise that resolves to the updated team member
|
|
64
|
+
* @throws {APIError} If the update operation fails
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```typescript
|
|
68
|
+
* const updatedMember = await repo.updateTeamMember("member-id", {
|
|
69
|
+
* name: "Updated Name",
|
|
70
|
+
* roleId: "new-role-id"
|
|
71
|
+
* });
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
updateTeamMember(id: string, input: UpdateTeamMemberRequestDTO): Promise<TeamMember>;
|
|
75
|
+
/**
|
|
76
|
+
* Archives (soft deletes) a team member by ID.
|
|
77
|
+
*
|
|
78
|
+
* @param id - The unique identifier of the team member to archive
|
|
79
|
+
* @returns Promise that resolves to the updated team member object
|
|
80
|
+
* @throws {APIError} If the archive operation fails
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```typescript
|
|
84
|
+
* const archivedMember = await repo.archiveTeamMember("member-id");
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
archiveTeamMember(id: string): Promise<TeamMember>;
|
|
88
|
+
/**
|
|
89
|
+
* Unarchives a previously archived team member by ID.
|
|
90
|
+
*
|
|
91
|
+
* @param id - The unique identifier of the team member to unarchive
|
|
92
|
+
* @returns Promise that resolves to the updated team member object
|
|
93
|
+
* @throws {APIError} If the unarchive operation fails
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```typescript
|
|
97
|
+
* const restoredMember = await repo.unArchiveTeamMember("member-id");
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
unArchiveTeamMember(id: string): Promise<TeamMember>;
|
|
101
|
+
/**
|
|
102
|
+
* Resets a team member's password.
|
|
103
|
+
*
|
|
104
|
+
* @param id - The unique identifier of the team member
|
|
105
|
+
* @param input - Optional password reset configuration
|
|
106
|
+
* @returns Promise that resolves to success status
|
|
107
|
+
* @throws {APIError} If the password reset operation fails
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```typescript
|
|
111
|
+
* const result = await repo.resetTeamMemberPassword("member-id", {
|
|
112
|
+
* sendNotification: true
|
|
113
|
+
* });
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
resetTeamMemberPassword(id: string, input?: ResetPasswordRequestDTO): Promise<{
|
|
117
|
+
success: boolean;
|
|
118
|
+
}>;
|
|
119
|
+
/**
|
|
120
|
+
* Retrieves all team members.
|
|
121
|
+
* Results are ordered in descending order by creation date by default.
|
|
122
|
+
*
|
|
123
|
+
* @param query - Optional query parameters for filtering and eager loading
|
|
124
|
+
* @returns Promise that resolves to an array of team members
|
|
125
|
+
* @throws {APIError} If the fetch operation fails
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```typescript
|
|
129
|
+
* // Get all team members with role information
|
|
130
|
+
* const members = await repo.getAllTeamMembers({ eager: "role" });
|
|
131
|
+
*
|
|
132
|
+
* // Get team members with custom query
|
|
133
|
+
* const activeMembers = await repo.getAllTeamMembers({ isActive: 1 });
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
getAllTeamMembers(query?: TeamMemberQueryParamsDTO): Promise<TeamMember[]>;
|
|
137
|
+
/**
|
|
138
|
+
* Retrieves a specific team member by ID.
|
|
139
|
+
*
|
|
140
|
+
* @param id - The unique identifier of the team member to retrieve
|
|
141
|
+
* @param query - Optional query parameters for eager loading
|
|
142
|
+
* @returns Promise that resolves to the team member
|
|
143
|
+
* @throws {APIError} If the team member is not found or fetch operation fails
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```typescript
|
|
147
|
+
* const member = await repo.getTeamMember("member-id", { eager: "role" });
|
|
148
|
+
* console.log(`Member: ${member.name}, Role: ${member.role?.name}`);
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
getTeamMember(id: string, query?: TeamMemberQueryParamsDTO): Promise<TeamMember>;
|
|
152
|
+
/**
|
|
153
|
+
* Retrieves all available roles in the system.
|
|
154
|
+
*
|
|
155
|
+
* @returns Promise that resolves to an array of roles
|
|
156
|
+
* @throws {APIError} If the fetch operation fails
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```typescript
|
|
160
|
+
* const roles = await repo.getAllRoles();
|
|
161
|
+
* roles.forEach(role => console.log(`Role: ${role.name}`));
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
getAllRoles(): Promise<Role[]>;
|
|
165
|
+
/**
|
|
166
|
+
* Retrieves a specific role by ID.
|
|
167
|
+
*
|
|
168
|
+
* @param id - The unique identifier of the role to retrieve
|
|
169
|
+
* @returns Promise that resolves to the role
|
|
170
|
+
* @throws {APIError} If the role is not found or fetch operation fails
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```typescript
|
|
174
|
+
* const role = await repo.getRole("role-id");
|
|
175
|
+
* console.log(`Role: ${role.name}, Permissions: ${role.permissions.size}`);
|
|
176
|
+
* ```
|
|
177
|
+
*/
|
|
178
|
+
getRole(id: string): Promise<Role>;
|
|
179
|
+
}
|