@temboplus/afloat 0.1.77-beta.9 → 0.1.79
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/LICENSE +7 -0
- package/README.md +42 -246
- package/esm/mod.d.ts +8 -0
- package/esm/mod.d.ts.map +1 -0
- package/esm/mod.js +7 -0
- package/esm/package.json +3 -0
- package/{dist/lib/error/error.api.d.ts → esm/src/errors/api_error.d.ts} +1 -0
- package/esm/src/errors/api_error.d.ts.map +1 -0
- package/esm/src/errors/api_error.js +90 -0
- package/esm/src/errors/index.d.ts +3 -0
- package/esm/src/errors/index.d.ts.map +1 -0
- package/esm/src/errors/index.js +2 -0
- package/{dist/lib/error/error.permission.d.ts → esm/src/errors/permission_error.d.ts} +2 -1
- package/esm/src/errors/permission_error.d.ts.map +1 -0
- package/esm/src/errors/permission_error.js +70 -0
- package/{dist/modules/team-member/team-member.contract.d.ts → esm/src/features/admin/contract.d.ts} +158 -233
- package/esm/src/features/admin/contract.d.ts.map +1 -0
- package/esm/src/features/admin/contract.js +210 -0
- package/esm/src/features/admin/index.d.ts +4 -0
- package/esm/src/features/admin/index.d.ts.map +1 -0
- package/esm/src/features/admin/index.js +3 -0
- package/esm/src/features/admin/repository.d.ts +114 -0
- package/esm/src/features/admin/repository.d.ts.map +1 -0
- package/esm/src/features/admin/repository.js +248 -0
- package/esm/src/features/admin/schemas.d.ts +146 -0
- package/esm/src/features/admin/schemas.d.ts.map +1 -0
- package/esm/src/features/admin/schemas.js +206 -0
- package/esm/src/features/auth/access/contract.d.ts +14 -0
- package/esm/src/features/auth/access/contract.d.ts.map +1 -0
- package/esm/src/features/auth/access/contract.js +14 -0
- package/esm/src/features/auth/access/repository.d.ts +11 -0
- package/esm/src/features/auth/access/repository.d.ts.map +1 -0
- package/esm/src/features/auth/access/repository.js +25 -0
- package/{dist/modules/auth/auth.contract.d.ts → esm/src/features/auth/contract.d.ts} +19 -16
- package/esm/src/features/auth/contract.d.ts.map +1 -0
- package/esm/src/features/auth/contract.js +43 -0
- package/esm/src/features/auth/identity/contract.d.ts +23 -0
- package/esm/src/features/auth/identity/contract.d.ts.map +1 -0
- package/esm/src/features/auth/identity/contract.js +17 -0
- package/esm/src/features/auth/identity/repository.d.ts +22 -0
- package/esm/src/features/auth/identity/repository.d.ts.map +1 -0
- package/esm/src/features/auth/identity/repository.js +30 -0
- package/esm/src/features/auth/index.d.ts +6 -0
- package/esm/src/features/auth/index.d.ts.map +1 -0
- package/esm/src/features/auth/index.js +5 -0
- package/esm/src/features/auth/manager.d.ts +105 -0
- package/esm/src/features/auth/manager.d.ts.map +1 -0
- package/esm/src/features/auth/manager.js +181 -0
- package/{dist/modules/profile/profile.api-contract.d.ts → esm/src/features/auth/profile/contract.d.ts} +6 -8
- package/esm/src/features/auth/profile/contract.d.ts.map +1 -0
- package/esm/src/features/auth/profile/contract.js +14 -0
- package/esm/src/features/auth/profile/repository.d.ts +11 -0
- package/esm/src/features/auth/profile/repository.d.ts.map +1 -0
- package/esm/src/features/auth/profile/repository.js +25 -0
- package/esm/src/features/auth/repository.d.ts +30 -0
- package/esm/src/features/auth/repository.d.ts.map +1 -0
- package/esm/src/features/auth/repository.js +69 -0
- package/{dist/modules/auth/storage/client-store.d.ts → esm/src/features/auth/storage/client_store.d.ts} +2 -1
- package/esm/src/features/auth/storage/client_store.d.ts.map +1 -0
- package/esm/src/features/auth/storage/client_store.js +46 -0
- package/{dist/modules/auth/storage/client-token-handler.d.ts → esm/src/features/auth/storage/client_token_handler.d.ts} +1 -0
- package/esm/src/features/auth/storage/client_token_handler.d.ts.map +1 -0
- package/esm/src/features/auth/storage/client_token_handler.js +36 -0
- package/esm/src/features/auth/storage/server_store.d.ts +24 -0
- package/esm/src/features/auth/storage/server_store.d.ts.map +1 -0
- package/esm/src/features/auth/storage/server_store.js +34 -0
- package/esm/src/features/auth/storage/server_token_handler.d.ts +36 -0
- package/esm/src/features/auth/storage/server_token_handler.d.ts.map +1 -0
- package/esm/src/features/auth/storage/server_token_handler.js +115 -0
- package/{dist/modules → esm/src/features}/auth/storage/types.d.ts +2 -1
- package/esm/src/features/auth/storage/types.d.ts.map +1 -0
- package/esm/src/features/auth/storage/types.js +1 -0
- package/{dist/modules/contact/contact.api-contract.d.ts → esm/src/features/contact/contract.d.ts} +55 -88
- package/esm/src/features/contact/contract.d.ts.map +1 -0
- package/esm/src/features/contact/contract.js +49 -0
- package/esm/src/features/contact/index.d.ts +2 -0
- package/esm/src/features/contact/index.d.ts.map +1 -0
- package/esm/src/features/contact/index.js +1 -0
- package/esm/src/features/contact/repository.d.ts +58 -0
- package/esm/src/features/contact/repository.d.ts.map +1 -0
- package/esm/src/features/contact/repository.js +108 -0
- package/{dist/modules/payout/payout.api-contract.d.ts → esm/src/features/payout/contract.d.ts} +197 -340
- package/esm/src/features/payout/contract.d.ts.map +1 -0
- package/esm/src/features/payout/contract.js +75 -0
- package/esm/src/features/payout/index.d.ts +2 -0
- package/esm/src/features/payout/index.d.ts.map +1 -0
- package/esm/src/features/payout/index.js +1 -0
- package/esm/src/features/payout/repository.d.ts +67 -0
- package/esm/src/features/payout/repository.d.ts.map +1 -0
- package/esm/src/features/payout/repository.js +163 -0
- package/{dist/modules/wallet/wallet.contract.d.ts → esm/src/features/wallet/contract.d.ts} +11 -13
- package/esm/src/features/wallet/contract.d.ts.map +1 -0
- package/esm/src/features/wallet/contract.js +38 -0
- package/esm/src/features/wallet/index.d.ts +2 -0
- package/esm/src/features/wallet/index.d.ts.map +1 -0
- package/esm/src/features/wallet/index.js +1 -0
- package/esm/src/features/wallet/repository.d.ts +57 -0
- package/esm/src/features/wallet/repository.d.ts.map +1 -0
- package/esm/src/features/wallet/repository.js +93 -0
- package/esm/src/models/contact/derivatives/contact.d.ts +172 -0
- package/esm/src/models/contact/derivatives/contact.d.ts.map +1 -0
- package/esm/src/models/contact/derivatives/contact.js +266 -0
- package/esm/src/models/contact/derivatives/contact_info.d.ts +188 -0
- package/esm/src/models/contact/derivatives/contact_info.d.ts.map +1 -0
- package/esm/src/models/contact/derivatives/contact_info.js +255 -0
- package/esm/src/models/contact/index.d.ts +5 -0
- package/esm/src/models/contact/index.d.ts.map +1 -0
- package/esm/src/models/contact/index.js +4 -0
- package/esm/src/models/contact/schemas.d.ts +66 -0
- package/esm/src/models/contact/schemas.d.ts.map +1 -0
- package/esm/src/models/contact/schemas.js +64 -0
- package/esm/src/models/contact/validation.d.ts +37 -0
- package/esm/src/models/contact/validation.d.ts.map +1 -0
- package/esm/src/models/contact/validation.js +146 -0
- package/esm/src/models/index.d.ts +7 -0
- package/esm/src/models/index.d.ts.map +1 -0
- package/esm/src/models/index.js +6 -0
- package/esm/src/models/payout/api.d.ts +29 -0
- package/esm/src/models/payout/api.d.ts.map +1 -0
- package/esm/src/models/payout/api.js +1 -0
- package/esm/src/models/payout/channel.d.ts +58 -0
- package/esm/src/models/payout/channel.d.ts.map +1 -0
- package/esm/src/models/payout/channel.js +53 -0
- package/esm/src/models/payout/derivatives/payout.d.ts +158 -0
- package/esm/src/models/payout/derivatives/payout.d.ts.map +1 -0
- package/esm/src/models/payout/derivatives/payout.js +271 -0
- package/esm/src/models/payout/index.d.ts +7 -0
- package/esm/src/models/payout/index.d.ts.map +1 -0
- package/esm/src/models/payout/index.js +6 -0
- package/esm/src/models/payout/narration.d.ts +164 -0
- package/esm/src/models/payout/narration.d.ts.map +1 -0
- package/esm/src/models/payout/narration.js +308 -0
- package/esm/src/models/payout/schemas.d.ts +156 -0
- package/esm/src/models/payout/schemas.d.ts.map +1 -0
- package/esm/src/models/payout/schemas.js +105 -0
- package/esm/src/models/payout/status.d.ts +33 -0
- package/esm/src/models/payout/status.d.ts.map +1 -0
- package/esm/src/models/payout/status.js +34 -0
- package/{dist/modules/login/permission.type.d.ts → esm/src/models/permission.d.ts} +9 -8
- package/esm/src/models/permission.d.ts.map +1 -0
- package/esm/src/models/permission.js +50 -0
- package/esm/src/models/role.d.ts +21 -0
- package/esm/src/models/role.d.ts.map +1 -0
- package/esm/src/models/role.js +73 -0
- package/esm/src/models/user/authenticated-user.d.ts +77 -0
- package/esm/src/models/user/authenticated-user.d.ts.map +1 -0
- package/esm/src/models/user/authenticated-user.js +226 -0
- package/esm/src/models/user/index.d.ts +4 -0
- package/esm/src/models/user/index.d.ts.map +1 -0
- package/esm/src/models/user/index.js +3 -0
- package/esm/src/models/user/managed-user.d.ts +108 -0
- package/esm/src/models/user/managed-user.d.ts.map +1 -0
- package/esm/src/models/user/managed-user.js +255 -0
- package/{dist/modules/profile/profile.model.d.ts → esm/src/models/user/profile.d.ts} +52 -81
- package/esm/src/models/user/profile.d.ts.map +1 -0
- package/esm/src/models/user/profile.js +334 -0
- package/esm/src/models/wallet/index.d.ts +4 -0
- package/esm/src/models/wallet/index.d.ts.map +1 -0
- package/esm/src/models/wallet/index.js +3 -0
- package/esm/src/models/wallet/schemas.d.ts +95 -0
- package/esm/src/models/wallet/schemas.d.ts.map +1 -0
- package/esm/src/models/wallet/schemas.js +35 -0
- package/esm/src/models/wallet/statement_entry.d.ts +160 -0
- package/esm/src/models/wallet/statement_entry.d.ts.map +1 -0
- package/esm/src/models/wallet/statement_entry.js +255 -0
- package/{dist/modules/wallet/wallet.model.d.ts → esm/src/models/wallet/wallet.d.ts} +37 -31
- package/esm/src/models/wallet/wallet.d.ts.map +1 -0
- package/esm/src/models/wallet/wallet.js +279 -0
- package/esm/src/shared/base_repository.d.ts +80 -0
- package/esm/src/shared/base_repository.d.ts.map +1 -0
- package/esm/src/shared/base_repository.js +153 -0
- package/esm/src/shared/common_responses.d.ts +13 -0
- package/esm/src/shared/common_responses.d.ts.map +1 -0
- package/esm/src/shared/common_responses.js +10 -0
- package/esm/src/shared/index.d.ts +3 -0
- package/esm/src/shared/index.d.ts.map +1 -0
- package/esm/src/shared/index.js +2 -0
- package/esm/src/shared/token_required_repository.d.ts +78 -0
- package/esm/src/shared/token_required_repository.d.ts.map +1 -0
- package/esm/src/shared/token_required_repository.js +128 -0
- package/package.json +23 -49
- package/script/mod.d.ts +8 -0
- package/script/mod.d.ts.map +1 -0
- package/script/mod.js +23 -0
- package/script/npm/src/mod.d.ts +8 -0
- package/script/npm/src/mod.d.ts.map +1 -0
- package/script/npm/src/mod.js +23 -0
- package/script/npm/src/src/errors/api_error.d.ts +63 -0
- package/script/npm/src/src/errors/api_error.d.ts.map +1 -0
- package/script/npm/src/src/errors/api_error.js +94 -0
- package/script/npm/src/src/errors/index.d.ts +3 -0
- package/script/npm/src/src/errors/index.d.ts.map +1 -0
- package/script/npm/src/src/errors/index.js +18 -0
- package/script/npm/src/src/errors/permission_error.d.ts +48 -0
- package/script/npm/src/src/errors/permission_error.d.ts.map +1 -0
- package/script/npm/src/src/errors/permission_error.js +74 -0
- package/script/npm/src/src/features/admin/contract.d.ts +842 -0
- package/script/npm/src/src/features/admin/contract.d.ts.map +1 -0
- package/script/npm/src/src/features/admin/contract.js +213 -0
- package/script/npm/src/src/features/admin/index.d.ts +4 -0
- package/script/npm/src/src/features/admin/index.d.ts.map +1 -0
- package/script/npm/src/src/features/admin/index.js +19 -0
- package/script/npm/src/src/features/admin/repository.d.ts +114 -0
- package/script/npm/src/src/features/admin/repository.d.ts.map +1 -0
- package/script/npm/src/src/features/admin/repository.js +252 -0
- package/script/npm/src/src/features/admin/schemas.d.ts +146 -0
- package/script/npm/src/src/features/admin/schemas.d.ts.map +1 -0
- package/script/npm/src/src/features/admin/schemas.js +209 -0
- package/script/npm/src/src/features/auth/access/contract.d.ts +14 -0
- package/script/npm/src/src/features/auth/access/contract.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/access/contract.js +17 -0
- package/script/npm/src/src/features/auth/access/repository.d.ts +11 -0
- package/script/npm/src/src/features/auth/access/repository.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/access/repository.js +29 -0
- package/script/npm/src/src/features/auth/contract.d.ts +112 -0
- package/script/npm/src/src/features/auth/contract.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/contract.js +46 -0
- package/script/npm/src/src/features/auth/identity/contract.d.ts +23 -0
- package/script/npm/src/src/features/auth/identity/contract.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/identity/contract.js +20 -0
- package/script/npm/src/src/features/auth/identity/repository.d.ts +22 -0
- package/script/npm/src/src/features/auth/identity/repository.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/identity/repository.js +34 -0
- package/script/npm/src/src/features/auth/index.d.ts +6 -0
- package/script/npm/src/src/features/auth/index.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/index.js +21 -0
- package/script/npm/src/src/features/auth/manager.d.ts +105 -0
- package/script/npm/src/src/features/auth/manager.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/manager.js +185 -0
- package/script/npm/src/src/features/auth/profile/contract.d.ts +37 -0
- package/script/npm/src/src/features/auth/profile/contract.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/profile/contract.js +17 -0
- package/script/npm/src/src/features/auth/profile/repository.d.ts +11 -0
- package/script/npm/src/src/features/auth/profile/repository.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/profile/repository.js +29 -0
- package/script/npm/src/src/features/auth/repository.d.ts +30 -0
- package/script/npm/src/src/features/auth/repository.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/repository.js +73 -0
- package/script/npm/src/src/features/auth/storage/client_store.d.ts +30 -0
- package/script/npm/src/src/features/auth/storage/client_store.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/storage/client_store.js +51 -0
- package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts +32 -0
- package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/storage/client_token_handler.js +40 -0
- package/script/npm/src/src/features/auth/storage/server_store.d.ts +24 -0
- package/script/npm/src/src/features/auth/storage/server_store.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/storage/server_store.js +38 -0
- package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts +36 -0
- package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/storage/server_token_handler.js +119 -0
- package/script/npm/src/src/features/auth/storage/types.d.ts +42 -0
- package/script/npm/src/src/features/auth/storage/types.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/storage/types.js +2 -0
- package/script/npm/src/src/features/contact/contract.d.ts +170 -0
- package/script/npm/src/src/features/contact/contract.d.ts.map +1 -0
- package/script/npm/src/src/features/contact/contract.js +52 -0
- package/script/npm/src/src/features/contact/index.d.ts +2 -0
- package/script/npm/src/src/features/contact/index.d.ts.map +1 -0
- package/script/npm/src/src/features/contact/index.js +17 -0
- package/script/npm/src/src/features/contact/repository.d.ts +58 -0
- package/script/npm/src/src/features/contact/repository.d.ts.map +1 -0
- package/script/npm/src/src/features/contact/repository.js +112 -0
- package/script/npm/src/src/features/payout/contract.d.ts +623 -0
- package/script/npm/src/src/features/payout/contract.d.ts.map +1 -0
- package/script/npm/src/src/features/payout/contract.js +78 -0
- package/script/npm/src/src/features/payout/index.d.ts +2 -0
- package/script/npm/src/src/features/payout/index.d.ts.map +1 -0
- package/script/npm/src/src/features/payout/index.js +17 -0
- package/script/npm/src/src/features/payout/repository.d.ts +67 -0
- package/script/npm/src/src/features/payout/repository.d.ts.map +1 -0
- package/script/npm/src/src/features/payout/repository.js +167 -0
- package/script/npm/src/src/features/wallet/contract.d.ts +137 -0
- package/script/npm/src/src/features/wallet/contract.d.ts.map +1 -0
- package/script/npm/src/src/features/wallet/contract.js +41 -0
- package/script/npm/src/src/features/wallet/index.d.ts +2 -0
- package/script/npm/src/src/features/wallet/index.d.ts.map +1 -0
- package/script/npm/src/src/features/wallet/index.js +17 -0
- package/script/npm/src/src/features/wallet/repository.d.ts +57 -0
- package/script/npm/src/src/features/wallet/repository.d.ts.map +1 -0
- package/script/npm/src/src/features/wallet/repository.js +97 -0
- package/script/npm/src/src/models/contact/derivatives/contact.d.ts +172 -0
- package/script/npm/src/src/models/contact/derivatives/contact.d.ts.map +1 -0
- package/script/npm/src/src/models/contact/derivatives/contact.js +270 -0
- package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts +188 -0
- package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts.map +1 -0
- package/script/npm/src/src/models/contact/derivatives/contact_info.js +260 -0
- package/script/npm/src/src/models/contact/index.d.ts +5 -0
- package/script/npm/src/src/models/contact/index.d.ts.map +1 -0
- package/script/npm/src/src/models/contact/index.js +20 -0
- package/script/npm/src/src/models/contact/schemas.d.ts +66 -0
- package/script/npm/src/src/models/contact/schemas.d.ts.map +1 -0
- package/script/npm/src/src/models/contact/schemas.js +67 -0
- package/script/npm/src/src/models/contact/validation.d.ts +37 -0
- package/script/npm/src/src/models/contact/validation.d.ts.map +1 -0
- package/script/npm/src/src/models/contact/validation.js +153 -0
- package/script/npm/src/src/models/index.d.ts +7 -0
- package/script/npm/src/src/models/index.d.ts.map +1 -0
- package/script/npm/src/src/models/index.js +22 -0
- package/script/npm/src/src/models/payout/api.d.ts +29 -0
- package/script/npm/src/src/models/payout/api.d.ts.map +1 -0
- package/script/npm/src/src/models/payout/api.js +2 -0
- package/script/npm/src/src/models/payout/channel.d.ts +58 -0
- package/script/npm/src/src/models/payout/channel.d.ts.map +1 -0
- package/script/npm/src/src/models/payout/channel.js +56 -0
- package/script/npm/src/src/models/payout/derivatives/payout.d.ts +158 -0
- package/script/npm/src/src/models/payout/derivatives/payout.d.ts.map +1 -0
- package/script/npm/src/src/models/payout/derivatives/payout.js +275 -0
- package/script/npm/src/src/models/payout/index.d.ts +7 -0
- package/script/npm/src/src/models/payout/index.d.ts.map +1 -0
- package/script/npm/src/src/models/payout/index.js +22 -0
- package/script/npm/src/src/models/payout/narration.d.ts +164 -0
- package/script/npm/src/src/models/payout/narration.d.ts.map +1 -0
- package/script/npm/src/src/models/payout/narration.js +312 -0
- package/script/npm/src/src/models/payout/schemas.d.ts +156 -0
- package/script/npm/src/src/models/payout/schemas.d.ts.map +1 -0
- package/script/npm/src/src/models/payout/schemas.js +108 -0
- package/script/npm/src/src/models/payout/status.d.ts +33 -0
- package/script/npm/src/src/models/payout/status.d.ts.map +1 -0
- package/script/npm/src/src/models/payout/status.js +37 -0
- package/script/npm/src/src/models/permission.d.ts +55 -0
- package/script/npm/src/src/models/permission.d.ts.map +1 -0
- package/script/npm/src/src/models/permission.js +53 -0
- package/script/npm/src/src/models/role.d.ts +21 -0
- package/script/npm/src/src/models/role.d.ts.map +1 -0
- package/script/npm/src/src/models/role.js +77 -0
- package/script/npm/src/src/models/user/authenticated-user.d.ts +77 -0
- package/script/npm/src/src/models/user/authenticated-user.d.ts.map +1 -0
- package/script/npm/src/src/models/user/authenticated-user.js +230 -0
- package/script/npm/src/src/models/user/index.d.ts +4 -0
- package/script/npm/src/src/models/user/index.d.ts.map +1 -0
- package/script/npm/src/src/models/user/index.js +19 -0
- package/script/npm/src/src/models/user/managed-user.d.ts +108 -0
- package/script/npm/src/src/models/user/managed-user.d.ts.map +1 -0
- package/script/npm/src/src/models/user/managed-user.js +260 -0
- package/script/npm/src/src/models/user/profile.d.ts +161 -0
- package/script/npm/src/src/models/user/profile.d.ts.map +1 -0
- package/script/npm/src/src/models/user/profile.js +338 -0
- package/script/npm/src/src/models/wallet/index.d.ts +4 -0
- package/script/npm/src/src/models/wallet/index.d.ts.map +1 -0
- package/script/npm/src/src/models/wallet/index.js +19 -0
- package/script/npm/src/src/models/wallet/schemas.d.ts +95 -0
- package/script/npm/src/src/models/wallet/schemas.d.ts.map +1 -0
- package/script/npm/src/src/models/wallet/schemas.js +38 -0
- package/script/npm/src/src/models/wallet/statement_entry.d.ts +160 -0
- package/script/npm/src/src/models/wallet/statement_entry.d.ts.map +1 -0
- package/script/npm/src/src/models/wallet/statement_entry.js +259 -0
- package/script/npm/src/src/models/wallet/wallet.d.ts +147 -0
- package/script/npm/src/src/models/wallet/wallet.d.ts.map +1 -0
- package/script/npm/src/src/models/wallet/wallet.js +283 -0
- package/script/npm/src/src/shared/base_repository.d.ts +80 -0
- package/script/npm/src/src/shared/base_repository.d.ts.map +1 -0
- package/script/npm/src/src/shared/base_repository.js +157 -0
- package/script/npm/src/src/shared/common_responses.d.ts +13 -0
- package/script/npm/src/src/shared/common_responses.d.ts.map +1 -0
- package/script/npm/src/src/shared/common_responses.js +13 -0
- package/script/npm/src/src/shared/index.d.ts +3 -0
- package/script/npm/src/src/shared/index.d.ts.map +1 -0
- package/script/npm/src/src/shared/index.js +18 -0
- package/script/npm/src/src/shared/token_required_repository.d.ts +78 -0
- package/script/npm/src/src/shared/token_required_repository.d.ts.map +1 -0
- package/script/npm/src/src/shared/token_required_repository.js +132 -0
- package/script/package.json +3 -0
- package/dist/index.cjs.js +0 -2
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.d.ts +0 -10
- package/dist/index.esm.js +0 -2
- package/dist/index.esm.js.map +0 -1
- package/dist/lib/api/base-repository.d.ts +0 -175
- package/dist/lib/api/index.d.ts +0 -1
- package/dist/lib/error/error.utils.d.ts +0 -22
- package/dist/lib/error/index.d.ts +0 -3
- package/dist/lib/query/index.d.ts +0 -4
- package/dist/lib/query/pagination/pagination.d.ts +0 -73
- package/dist/lib/query/pagination/pagination.schemas.d.ts +0 -83
- package/dist/lib/query/query.builder.d.ts +0 -71
- package/dist/lib/query/query.types.d.ts +0 -36
- package/dist/modules/auth/auth.manager.d.ts +0 -249
- package/dist/modules/auth/auth.repository.d.ts +0 -83
- package/dist/modules/auth/auth.store.d.ts +0 -139
- package/dist/modules/auth/company-membership.model.d.ts +0 -171
- package/dist/modules/auth/index.d.ts +0 -4
- package/dist/modules/auth/user.model.d.ts +0 -363
- package/dist/modules/contact/contact-info.model.d.ts +0 -485
- package/dist/modules/contact/contact-input-handler.d.ts +0 -16
- package/dist/modules/contact/contact.dtos.d.ts +0 -84
- package/dist/modules/contact/contact.model.d.ts +0 -441
- package/dist/modules/contact/contact.repository.d.ts +0 -116
- package/dist/modules/contact/index.d.ts +0 -4
- package/dist/modules/login/index.d.ts +0 -4
- package/dist/modules/login/login.api-contract.d.ts +0 -51
- package/dist/modules/login/login.dtos.d.ts +0 -85
- package/dist/modules/login/login.model.d.ts +0 -168
- package/dist/modules/login/login.repository.d.ts +0 -58
- package/dist/modules/payout/index.d.ts +0 -5
- package/dist/modules/payout/payout-channel-handler.d.ts +0 -82
- package/dist/modules/payout/payout.dtos.d.ts +0 -605
- package/dist/modules/payout/payout.model.d.ts +0 -379
- package/dist/modules/payout/payout.query.d.ts +0 -133
- package/dist/modules/payout/payout.repository.d.ts +0 -181
- package/dist/modules/profile/index.d.ts +0 -3
- package/dist/modules/profile/profile.dtos.d.ts +0 -80
- package/dist/modules/profile/profile.repository.d.ts +0 -56
- package/dist/modules/team-member/index.d.ts +0 -4
- package/dist/modules/team-member/role.model.d.ts +0 -61
- package/dist/modules/team-member/team-member.dtos.d.ts +0 -261
- package/dist/modules/team-member/team-member.model.d.ts +0 -237
- package/dist/modules/team-member/team-member.repository.d.ts +0 -179
- package/dist/modules/wallet/index.d.ts +0 -7
- package/dist/modules/wallet/narration.model.d.ts +0 -225
- package/dist/modules/wallet/statement-entry.model.d.ts +0 -299
- package/dist/modules/wallet/wallet-manager.session.d.ts +0 -143
- package/dist/modules/wallet/wallet.dtos.d.ts +0 -204
- package/dist/modules/wallet/wallet.query.d.ts +0 -95
- package/dist/modules/wallet/wallet.repository.d.ts +0 -205
- package/dist/modules/wallet/wallet.utils.d.ts +0 -17
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Payout = void 0;
|
|
4
|
+
const frontend_core_1 = require("@temboplus/frontend-core");
|
|
5
|
+
const schemas_js_1 = require("../schemas.js");
|
|
6
|
+
const index_js_1 = require("../../contact/index.js");
|
|
7
|
+
const status_js_1 = require("../status.js");
|
|
8
|
+
const channel_js_1 = require("../channel.js");
|
|
9
|
+
/**
|
|
10
|
+
* Payout class that wraps the Zod schema and provides additional functionality
|
|
11
|
+
*/
|
|
12
|
+
class Payout {
|
|
13
|
+
/**
|
|
14
|
+
* Private constructor - use static methods to create instances
|
|
15
|
+
*/
|
|
16
|
+
constructor(data) {
|
|
17
|
+
Object.defineProperty(this, "data", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
configurable: true,
|
|
20
|
+
writable: true,
|
|
21
|
+
value: void 0
|
|
22
|
+
});
|
|
23
|
+
this.data = schemas_js_1.PayoutSchemas.payoutData.parse(data);
|
|
24
|
+
}
|
|
25
|
+
// Getters for all properties
|
|
26
|
+
/** Unique identifier for the payout */
|
|
27
|
+
get id() {
|
|
28
|
+
return this.data.id;
|
|
29
|
+
}
|
|
30
|
+
/** Profile identifier associated with this payout */
|
|
31
|
+
get profileId() {
|
|
32
|
+
return this.data.profileId;
|
|
33
|
+
}
|
|
34
|
+
/** Name of the payee/recipient */
|
|
35
|
+
get payeeName() {
|
|
36
|
+
return this.data.payeeName;
|
|
37
|
+
}
|
|
38
|
+
/** Payment channel used for this payout */
|
|
39
|
+
get channel() {
|
|
40
|
+
return this.data.channel;
|
|
41
|
+
}
|
|
42
|
+
/** Mobile number or bank account identifier */
|
|
43
|
+
get msisdn() {
|
|
44
|
+
return this.data.msisdn;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Amount to be paid out
|
|
48
|
+
* @returns {Amount} Amount object representing the payout value
|
|
49
|
+
*/
|
|
50
|
+
get amount() {
|
|
51
|
+
return frontend_core_1.Amount.from(this.data.amount);
|
|
52
|
+
}
|
|
53
|
+
/** Description of the payout purpose */
|
|
54
|
+
get description() {
|
|
55
|
+
return this.data.description;
|
|
56
|
+
}
|
|
57
|
+
/** Optional additional notes about the payout */
|
|
58
|
+
get notes() {
|
|
59
|
+
return this.data.notes;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Current status of the payout
|
|
63
|
+
* Derived from both approval status and transaction status:
|
|
64
|
+
* - Returns REJECTED if approval status is "Rejected"
|
|
65
|
+
* - Returns FAILED if approved but transaction failed
|
|
66
|
+
* - Returns PAID if approved and transaction succeeded
|
|
67
|
+
* - Returns PENDING if awaiting approval
|
|
68
|
+
* - Falls back to transaction status in other cases
|
|
69
|
+
*
|
|
70
|
+
* @returns {PAYOUT_STATUS} Current status of the payout
|
|
71
|
+
* @see {@link PAYOUT_STATUS} for all possible status values
|
|
72
|
+
*/
|
|
73
|
+
get status() {
|
|
74
|
+
if (this.data.approvalStatus === "Rejected") {
|
|
75
|
+
return status_js_1.PAYOUT_STATUS.REJECTED;
|
|
76
|
+
}
|
|
77
|
+
if (this.data.approvalStatus === "Approved") {
|
|
78
|
+
if (this.data.status === "FAILED") {
|
|
79
|
+
return status_js_1.PAYOUT_STATUS.FAILED;
|
|
80
|
+
}
|
|
81
|
+
return status_js_1.PAYOUT_STATUS.PAID;
|
|
82
|
+
}
|
|
83
|
+
if (this.data.approvalStatus === "Pending") {
|
|
84
|
+
return status_js_1.PAYOUT_STATUS.PENDING;
|
|
85
|
+
}
|
|
86
|
+
return this.data.status;
|
|
87
|
+
}
|
|
88
|
+
/** Status message providing details about current state */
|
|
89
|
+
get statusMessage() {
|
|
90
|
+
return this.data.statusMessage;
|
|
91
|
+
}
|
|
92
|
+
/** Optional reference ID from payment partner */
|
|
93
|
+
get partnerReference() {
|
|
94
|
+
return this.data.partnerReference;
|
|
95
|
+
}
|
|
96
|
+
/** Timestamp when payout was created */
|
|
97
|
+
get createdAt() {
|
|
98
|
+
return this.data.createdAt;
|
|
99
|
+
}
|
|
100
|
+
/** Timestamp when payout was last updated */
|
|
101
|
+
get updatedAt() {
|
|
102
|
+
return this.data.updatedAt;
|
|
103
|
+
}
|
|
104
|
+
/** Timestamp when payout was last updated */
|
|
105
|
+
get actionedAt() {
|
|
106
|
+
try {
|
|
107
|
+
// deno-lint-ignore no-explicit-any
|
|
108
|
+
return this.data.actionedAt ?? undefined;
|
|
109
|
+
}
|
|
110
|
+
catch (_) {
|
|
111
|
+
return undefined;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/** Current approval status of the payout */
|
|
115
|
+
get approvalStatus() {
|
|
116
|
+
return this.data.approvalStatus;
|
|
117
|
+
}
|
|
118
|
+
/** Information about who created the payout */
|
|
119
|
+
get createdBy() {
|
|
120
|
+
return this.data.createdBy;
|
|
121
|
+
}
|
|
122
|
+
/** Information about who last actioned the payout */
|
|
123
|
+
get actionedBy() {
|
|
124
|
+
return this.data.actionedBy;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Constructs contact information based on payout channel
|
|
128
|
+
*
|
|
129
|
+
* @returns {ContactInfo | undefined} Contact information object:
|
|
130
|
+
* - MobileContactInfo for mobile money payouts
|
|
131
|
+
* - BankContactInfo for bank transfers
|
|
132
|
+
* - undefined if contact info cannot be constructed
|
|
133
|
+
*
|
|
134
|
+
* @remarks
|
|
135
|
+
* For bank payouts, expects msisdn in format "SWIFTCODE:ACCOUNTNUMBER"
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```ts
|
|
139
|
+
* // Mobile payout
|
|
140
|
+
* payout.contactInfo // Returns MobileContactInfo with phone details
|
|
141
|
+
*
|
|
142
|
+
* // Bank payout
|
|
143
|
+
* payout.contactInfo // Returns BankContactInfo with bank and account details
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
get contactInfo() {
|
|
147
|
+
let contactInfo;
|
|
148
|
+
// extracting mobile contact information
|
|
149
|
+
const phone = frontend_core_1.TZPhoneNumber.from(this.data.msisdn);
|
|
150
|
+
if (phone) {
|
|
151
|
+
contactInfo = new index_js_1.MobileContactInfo(this.data.payeeName, phone);
|
|
152
|
+
}
|
|
153
|
+
// extracting bank contact information
|
|
154
|
+
const isBankPayout = this.data.channel === channel_js_1.createPayoutChannelCode.bank() ||
|
|
155
|
+
this.data.channel === channel_js_1.createPayoutChannelCode.verto();
|
|
156
|
+
if (isBankPayout) {
|
|
157
|
+
// getting bank information from payout msisdn
|
|
158
|
+
const text = this.data.msisdn.trim().split(":");
|
|
159
|
+
try {
|
|
160
|
+
const swiftcode = text[0];
|
|
161
|
+
const accNo = text[1];
|
|
162
|
+
const bank = frontend_core_1.Bank.fromSWIFTCode(swiftcode);
|
|
163
|
+
if (bank) {
|
|
164
|
+
contactInfo = new index_js_1.BankContactInfo(this.data.payeeName, bank, accNo);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
catch (_) {
|
|
168
|
+
//
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return contactInfo;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Creates a Payout instance from raw data
|
|
175
|
+
* @throws {ZodError} if validation fails
|
|
176
|
+
*/
|
|
177
|
+
static create(data) {
|
|
178
|
+
return new Payout(data);
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Creates multiple Payout instances from an array of raw data
|
|
182
|
+
* @throws {ZodError} if validation fails for any item
|
|
183
|
+
*/
|
|
184
|
+
static createMany(dataArray) {
|
|
185
|
+
return dataArray.map((data) => new Payout(data));
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Creates a Payout instance from raw data without throwing
|
|
189
|
+
* @returns {Payout | null} Payout instance or null if validation fails
|
|
190
|
+
*/
|
|
191
|
+
static createSafe(data) {
|
|
192
|
+
try {
|
|
193
|
+
return new Payout(data);
|
|
194
|
+
}
|
|
195
|
+
catch {
|
|
196
|
+
return null;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Checks if an unknown value contains valid data to construct a Payout instance.
|
|
201
|
+
* This is useful when validating raw data structures before instantiation.
|
|
202
|
+
*
|
|
203
|
+
* @param {unknown} obj - The value containing potential payout data
|
|
204
|
+
* @returns {obj is Payout} Type predicate indicating if a Payout can be constructed
|
|
205
|
+
*
|
|
206
|
+
* @example
|
|
207
|
+
* ```typescript
|
|
208
|
+
* const rawData = await fetchPayoutData();
|
|
209
|
+
* if (Payout.canConstruct(rawData)) {
|
|
210
|
+
* const payout = Payout.create(rawData);
|
|
211
|
+
* // TypeScript knows payout is valid here
|
|
212
|
+
* console.log(payout.amount.toString());
|
|
213
|
+
* }
|
|
214
|
+
* ```
|
|
215
|
+
*
|
|
216
|
+
* @throws {never} This method never throws errors
|
|
217
|
+
*
|
|
218
|
+
* @remarks
|
|
219
|
+
* This method performs strict validation against the {@link PayoutData} schema
|
|
220
|
+
*/
|
|
221
|
+
static canConstruct(obj) {
|
|
222
|
+
if (!obj || typeof obj !== "object")
|
|
223
|
+
return false;
|
|
224
|
+
const result = schemas_js_1.PayoutSchemas.payoutData.safeParse(obj);
|
|
225
|
+
if (!result.success)
|
|
226
|
+
return false;
|
|
227
|
+
const payout = Payout.createSafe(result.data);
|
|
228
|
+
return payout !== null;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Validates if an unknown value is a Payout instance.
|
|
232
|
+
* This is a runtime type guard that ensures proper object structure and data validity.
|
|
233
|
+
*
|
|
234
|
+
* @param {unknown} obj - The value to validate
|
|
235
|
+
* @returns {obj is Payout} Type predicate indicating if the value is a valid Payout
|
|
236
|
+
*
|
|
237
|
+
* @example
|
|
238
|
+
* ```typescript
|
|
239
|
+
* const maybePayout = getPayoutFromCache();
|
|
240
|
+
* if (Payout.is(maybePayout)) {
|
|
241
|
+
* // TypeScript knows maybePayout is a Payout here
|
|
242
|
+
* console.log(maybePayout.status);
|
|
243
|
+
* }
|
|
244
|
+
* ```
|
|
245
|
+
*
|
|
246
|
+
* @throws {never} This method never throws errors
|
|
247
|
+
*
|
|
248
|
+
* @remarks
|
|
249
|
+
* This method performs a complete structural validation:
|
|
250
|
+
* 1. Checks if the value is an object
|
|
251
|
+
* 2. Verifies presence of internal data property
|
|
252
|
+
* 3. Validates the data against PayoutData schema
|
|
253
|
+
* 4. Ensures the object is a proper Payout instance
|
|
254
|
+
*
|
|
255
|
+
* Use this method when:
|
|
256
|
+
* - Validating cached Payout instances
|
|
257
|
+
* - Checking serialized Payout objects
|
|
258
|
+
* - Verifying API responses
|
|
259
|
+
* - Type narrowing in conditional blocks
|
|
260
|
+
*/
|
|
261
|
+
static is(obj) {
|
|
262
|
+
if (!obj || typeof obj !== "object")
|
|
263
|
+
return false;
|
|
264
|
+
if (!("data" in obj))
|
|
265
|
+
return false;
|
|
266
|
+
return Payout.canConstruct(obj.data);
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Converts Payout instance to a plain object
|
|
270
|
+
*/
|
|
271
|
+
toJSON() {
|
|
272
|
+
return { ...this.data };
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
exports.Payout = Payout;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/src/models/payout/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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("./status.js"), exports);
|
|
18
|
+
__exportStar(require("./schemas.js"), exports);
|
|
19
|
+
__exportStar(require("./channel.js"), exports);
|
|
20
|
+
__exportStar(require("./api.js"), exports);
|
|
21
|
+
__exportStar(require("./narration.js"), exports);
|
|
22
|
+
__exportStar(require("./derivatives/payout.js"), exports);
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { BankContactInfo, type ContactInfo, MobileContactInfo } from "@temboplus/afloat";
|
|
2
|
+
/** Prefix for Ecobank mobile transfer narrations */
|
|
3
|
+
export declare const ECOBANK_PREFIX = "MOBILE TRANSFER ";
|
|
4
|
+
/** Current format prefix for bank payout narrations */
|
|
5
|
+
export declare const BANK_NARR_PREFIX: string;
|
|
6
|
+
/** Legacy format prefix for bank payout narrations */
|
|
7
|
+
export declare const LEGACY_BANK_NARR_PREFIX: string;
|
|
8
|
+
/** Current format prefix for mobile money payout narrations */
|
|
9
|
+
export declare const MOBILE_NARR_PREFIX: string;
|
|
10
|
+
/** Legacy format prefix for mobile money payout narrations */
|
|
11
|
+
export declare const LEGACY_MOBILE_NARR_PREFIX: string;
|
|
12
|
+
/**
|
|
13
|
+
* Handles payout narration generation and parsing for the Afloat platform.
|
|
14
|
+
*
|
|
15
|
+
* This class provides functionality to:
|
|
16
|
+
* - Generate standardized default narrations for mobile money and bank payouts
|
|
17
|
+
* - Parse existing narrations to extract contact information
|
|
18
|
+
* - Format narration text for different display contexts
|
|
19
|
+
* - Handle both current and legacy narration formats for backward compatibility
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* // Generate default narration for a mobile contact
|
|
24
|
+
* const mobileContact = new MobileContactInfo("John Doe", phoneNumber);
|
|
25
|
+
* const narration = Narration.generateDefaultPayoutNarration(mobileContact);
|
|
26
|
+
* // Result: "PAYOUT TO MOBILE +255123456789 JOHN DOE"
|
|
27
|
+
*
|
|
28
|
+
* // Parse narration to extract contact details
|
|
29
|
+
* const existingNarration = new Narration("PAYOUT TO BANK CRDB 1234567890 Jane Smith");
|
|
30
|
+
* const contact = existingNarration.getContactDetails();
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare class Narration {
|
|
34
|
+
/** The raw narration text */
|
|
35
|
+
text: string;
|
|
36
|
+
/**
|
|
37
|
+
* Creates a new Narration instance.
|
|
38
|
+
*
|
|
39
|
+
* @param text - The narration text to wrap
|
|
40
|
+
*/
|
|
41
|
+
constructor(text: string);
|
|
42
|
+
/**
|
|
43
|
+
* Returns a medium-length version of the narration text suitable for table columns.
|
|
44
|
+
* Truncates to 47 characters + "..." if longer than 50 characters.
|
|
45
|
+
*
|
|
46
|
+
* @returns Truncated narration text for medium-width displays
|
|
47
|
+
*/
|
|
48
|
+
get mediumText(): string;
|
|
49
|
+
/**
|
|
50
|
+
* Returns a short version of the narration text suitable for compact displays.
|
|
51
|
+
* Truncates to 32 characters + "..." if longer than 35 characters.
|
|
52
|
+
*
|
|
53
|
+
* @returns Truncated narration text for narrow displays
|
|
54
|
+
*/
|
|
55
|
+
get shortText(): string;
|
|
56
|
+
/**
|
|
57
|
+
* Generates a default payout narration based on contact information.
|
|
58
|
+
* Automatically determines whether to generate mobile or bank narration based on contact type.
|
|
59
|
+
*
|
|
60
|
+
* @param data - Contact information (either MobileContactInfo or BankContactInfo)
|
|
61
|
+
* @returns Formatted default narration string in uppercase, or empty string if contact type is unrecognized
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```typescript
|
|
65
|
+
* const mobileContact = new MobileContactInfo("John Doe", phoneNumber);
|
|
66
|
+
* const narration = Narration.generateDefaultPayoutNarration(mobileContact);
|
|
67
|
+
* // Returns: "PAYOUT TO MOBILE +255123456789 JOHN DOE"
|
|
68
|
+
*
|
|
69
|
+
* const bankContact = new BankContactInfo("Jane Smith", bank, "1234567890");
|
|
70
|
+
* const narration = Narration.generateDefaultPayoutNarration(bankContact);
|
|
71
|
+
* // Returns: "PAYOUT TO BANK CRDB 1234567890 JANE SMITH"
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
static generateDefaultPayoutNarration(data: ContactInfo): string;
|
|
75
|
+
/**
|
|
76
|
+
* Generates a standardized mobile money payout narration.
|
|
77
|
+
* Format: "PAYOUT TO MOBILE {phone_number} {name}"
|
|
78
|
+
*
|
|
79
|
+
* @param data - Mobile contact information containing phone number and name
|
|
80
|
+
* @returns Formatted mobile payout narration in uppercase
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```typescript
|
|
84
|
+
* const contact = new MobileContactInfo("John Doe", phoneNumber);
|
|
85
|
+
* const narration = Narration.generateMobilePayoutNarration(contact);
|
|
86
|
+
* // Returns: "PAYOUT TO MOBILE +255123456789 JOHN DOE"
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
static generateMobilePayoutNarration(data: MobileContactInfo): string;
|
|
90
|
+
/**
|
|
91
|
+
* Generates a standardized bank payout narration.
|
|
92
|
+
* Format: "PAYOUT TO BANK {bank_short_name} {account_number} {account_name}"
|
|
93
|
+
*
|
|
94
|
+
* @param data - Bank contact information containing bank details, account number, and account name
|
|
95
|
+
* @returns Formatted bank payout narration in uppercase
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```typescript
|
|
99
|
+
* const contact = new BankContactInfo("Jane Smith", bank, "1234567890");
|
|
100
|
+
* const narration = Narration.generateBankPayoutNarration(contact);
|
|
101
|
+
* // Returns: "PAYOUT TO BANK CRDB 1234567890 JANE SMITH"
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
static generateBankPayoutNarration(data: BankContactInfo): string;
|
|
105
|
+
/**
|
|
106
|
+
* Extracts contact information from the narration text.
|
|
107
|
+
* Attempts to parse both bank and mobile contact details from the narration.
|
|
108
|
+
*
|
|
109
|
+
* @returns Parsed ContactInfo (BankContactInfo or MobileContactInfo) if successful, undefined otherwise
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```typescript
|
|
113
|
+
* const narration = new Narration("PAYOUT TO BANK CRDB 1234567890 Jane Smith");
|
|
114
|
+
* const contact = narration.getContactDetails();
|
|
115
|
+
* // Returns: BankContactInfo instance with parsed details
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
getContactDetails: () => ContactInfo | undefined;
|
|
119
|
+
/**
|
|
120
|
+
* Extracts bank contact information from the narration text.
|
|
121
|
+
* Handles both current format ("PAYOUT TO BANK") and legacy format ("TO_BANK").
|
|
122
|
+
* Also handles Ecobank-prefixed narrations by stripping the prefix.
|
|
123
|
+
*
|
|
124
|
+
* Current format: "PAYOUT TO BANK {bank_name} {account_number} {account_name}"
|
|
125
|
+
* Legacy format: "TO_BANK => {json_object}"
|
|
126
|
+
*
|
|
127
|
+
* @returns BankContactInfo if parsing is successful, undefined otherwise
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```typescript
|
|
131
|
+
* // Current format
|
|
132
|
+
* const narration = new Narration("PAYOUT TO BANK CRDB 1234567890 Jane Smith");
|
|
133
|
+
* const contact = narration.getBankContactDetails();
|
|
134
|
+
*
|
|
135
|
+
* // Legacy format
|
|
136
|
+
* const legacyNarration = new Narration('TO_BANK => {"account_number":"1234567890","account_name":"Jane Smith","swift_code":"CORUTZTZ"}');
|
|
137
|
+
* const legacyContact = narration.getBankContactDetails();
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
getBankContactDetails: () => BankContactInfo | undefined;
|
|
141
|
+
/**
|
|
142
|
+
* Extracts mobile contact information from the narration text.
|
|
143
|
+
* Handles both current format ("PAYOUT TO MOBILE") and legacy format ("TO_MOMO").
|
|
144
|
+
* Also handles Ecobank-prefixed narrations by stripping the prefix.
|
|
145
|
+
*
|
|
146
|
+
* Current format: "PAYOUT TO MOBILE {phone_number} {name}"
|
|
147
|
+
* Legacy format: "TO_MOMO => {json_object}"
|
|
148
|
+
*
|
|
149
|
+
* @returns MobileContactInfo if parsing is successful, undefined otherwise
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```typescript
|
|
153
|
+
* // Current format
|
|
154
|
+
* const narration = new Narration("PAYOUT TO MOBILE +255123456789 John Doe");
|
|
155
|
+
* const contact = narration.getMobileContactDetails();
|
|
156
|
+
*
|
|
157
|
+
* // Legacy format
|
|
158
|
+
* const legacyNarration = new Narration('TO_MOMO => {"phone_number":"+255123456789","username":"John Doe"}');
|
|
159
|
+
* const legacyContact = narration.getMobileContactDetails();
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
getMobileContactDetails: () => MobileContactInfo | undefined;
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=narration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"narration.d.ts","sourceRoot":"","sources":["../../../../../../src/src/models/payout/narration.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,KAAK,WAAW,EAChB,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAG3B,oDAAoD;AACpD,eAAO,MAAM,cAAc,qBAAqB,CAAC;AAEjD,uDAAuD;AACvD,eAAO,MAAM,gBAAgB,EAAE,MAAyB,CAAC;AACzD,sDAAsD;AACtD,eAAO,MAAM,uBAAuB,EAAE,MAAkB,CAAC;AAEzD,+DAA+D;AAC/D,eAAO,MAAM,kBAAkB,EAAE,MAA2B,CAAC;AAC7D,8DAA8D;AAC9D,eAAO,MAAM,yBAAyB,EAAE,MAAkB,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,SAAS;IACpB,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;gBACS,IAAI,EAAE,MAAM;IAIxB;;;;;OAKG;IACH,IAAI,UAAU,WAMb;IAED;;;;;OAKG;IACH,IAAI,SAAS,WAMZ;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,8BAA8B,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM;IAUhE;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,6BAA6B,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM;IAKrE;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,2BAA2B,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM;IAKjE;;;;;;;;;;;;OAYG;IACH,iBAAiB,QAAO,WAAW,GAAG,SAAS,CAM7C;IAEF;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,qBAAqB,QAAO,eAAe,GAAG,SAAS,CAqCrD;IAEF;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,uBAAuB,QAAO,iBAAiB,GAAG,SAAS,CAuCzD;CACH"}
|