@fiado/type-kit 3.42.0 → 3.44.0
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/_test_/unit/platformRbac/auth/dtos.test.ts +42 -0
- package/bin/benefitCenter/dtos/BackofficeLeafOverrideUpsertRequest.d.ts +22 -0
- package/bin/benefitCenter/dtos/BackofficeLeafOverrideUpsertRequest.js +91 -0
- package/bin/benefitCenter/dtos/FieldOverrideRequest.d.ts +19 -0
- package/bin/benefitCenter/dtos/FieldOverrideRequest.js +80 -0
- package/bin/benefitCenter/dtos/InputSchemaOverrideRequest.d.ts +9 -0
- package/bin/benefitCenter/dtos/InputSchemaOverrideRequest.js +29 -0
- package/bin/benefitCenter/enums/LeafOverrideStatusEnum.d.ts +10 -0
- package/bin/benefitCenter/enums/LeafOverrideStatusEnum.js +14 -0
- package/bin/cognitoConnector/dtos/SignUpBackofficeRequest.d.ts +13 -0
- package/bin/cognitoConnector/dtos/SignUpBackofficeRequest.js +71 -0
- package/bin/comission-business/dtos/GenerateReportRequest.d.ts +10 -0
- package/bin/comission-business/dtos/GenerateReportRequest.js +2 -0
- package/bin/comission-business/dtos/GenerateReportResponse.d.ts +6 -0
- package/bin/comission-business/dtos/GenerateReportResponse.js +2 -0
- package/bin/comission-business/enums/PaymentStatusEnum.d.ts +5 -0
- package/bin/comission-business/enums/PaymentStatusEnum.js +9 -0
- package/bin/credit/dtos/CreditBannerStateResponse.d.ts +10 -0
- package/bin/credit/dtos/CreditBannerStateResponse.js +6 -0
- package/bin/credit/dtos/CreditDetailResponse.d.ts +23 -0
- package/bin/credit/dtos/CreditDetailResponse.js +6 -0
- package/bin/credit/dtos/CreditEligibilityResponse.d.ts +9 -0
- package/bin/credit/dtos/CreditEligibilityResponse.js +6 -0
- package/bin/credit/dtos/CreditMovementResponse.d.ts +20 -0
- package/bin/credit/dtos/CreditMovementResponse.js +9 -0
- package/bin/credit/dtos/CreditRequestCreate.d.ts +4 -0
- package/bin/credit/dtos/CreditRequestCreate.js +26 -0
- package/bin/credit/dtos/CreditRequestResponse.d.ts +7 -0
- package/bin/credit/dtos/CreditRequestResponse.js +6 -0
- package/bin/credit/dtos/CreditScheduleResponse.d.ts +18 -0
- package/bin/credit/dtos/CreditScheduleResponse.js +9 -0
- package/bin/credit/dtos/CreditStatementResponse.d.ts +11 -0
- package/bin/credit/dtos/CreditStatementResponse.js +9 -0
- package/bin/credit/dtos/EarlyPaymentRequest.d.ts +7 -0
- package/bin/credit/dtos/EarlyPaymentRequest.js +37 -0
- package/bin/credit/dtos/EarlyPaymentResponse.d.ts +11 -0
- package/bin/credit/dtos/EarlyPaymentResponse.js +6 -0
- package/bin/credit/dtos/internal/CreditBalanceRequest.d.ts +3 -0
- package/bin/credit/dtos/internal/CreditBalanceRequest.js +21 -0
- package/bin/credit/dtos/internal/CreditCollectionRequest.d.ts +11 -0
- package/bin/credit/dtos/internal/CreditCollectionRequest.js +59 -0
- package/bin/credit/dtos/internal/CreditCollectionResponse.d.ts +12 -0
- package/bin/credit/dtos/internal/CreditCollectionResponse.js +6 -0
- package/bin/credit/dtos/internal/CreditDisbursementRequest.d.ts +7 -0
- package/bin/credit/dtos/internal/CreditDisbursementRequest.js +43 -0
- package/bin/credit/dtos/internal/CreditDisbursementResponse.d.ts +8 -0
- package/bin/credit/dtos/internal/CreditDisbursementResponse.js +6 -0
- package/bin/credit/dtos/internal/CreditProfileRequest.d.ts +3 -0
- package/bin/credit/dtos/internal/CreditProfileRequest.js +23 -0
- package/bin/credit/dtos/internal/CreditReversalRequest.d.ts +5 -0
- package/bin/credit/dtos/internal/CreditReversalRequest.js +31 -0
- package/bin/credit/dtos/internal/CreditReversalResponse.d.ts +7 -0
- package/bin/credit/dtos/internal/CreditReversalResponse.js +6 -0
- package/bin/credit/dtos/internal/CreditTransferLoancoRequest.d.ts +8 -0
- package/bin/credit/dtos/internal/CreditTransferLoancoRequest.js +46 -0
- package/bin/credit/dtos/internal/CreditTransferLoancoResponse.d.ts +8 -0
- package/bin/credit/dtos/internal/CreditTransferLoancoResponse.js +6 -0
- package/bin/credit/dtos/internal/DocumentSignRequest.d.ts +3 -0
- package/bin/credit/dtos/internal/DocumentSignRequest.js +21 -0
- package/bin/credit/dtos/internal/LienApplyRequest.d.ts +7 -0
- package/bin/credit/dtos/internal/LienApplyRequest.js +45 -0
- package/bin/credit/enums/CollectionFrequencyEnum.d.ts +5 -0
- package/bin/credit/enums/CollectionFrequencyEnum.js +9 -0
- package/bin/credit/enums/CreditOperationEnum.d.ts +11 -0
- package/bin/credit/enums/CreditOperationEnum.js +15 -0
- package/bin/credit/enums/CreditStatusEnum.d.ts +12 -0
- package/bin/credit/enums/CreditStatusEnum.js +16 -0
- package/bin/credit/enums/DelinquencyLevelEnum.d.ts +9 -0
- package/bin/credit/enums/DelinquencyLevelEnum.js +13 -0
- package/bin/credit/enums/DocumentTypeEnum.d.ts +8 -0
- package/bin/credit/enums/DocumentTypeEnum.js +12 -0
- package/bin/credit/enums/OfferStatusEnum.d.ts +8 -0
- package/bin/credit/enums/OfferStatusEnum.js +12 -0
- package/bin/credit/enums/PaymentTypeEnum.d.ts +9 -0
- package/bin/credit/enums/PaymentTypeEnum.js +13 -0
- package/bin/credit/enums/ReconciliationStatusEnum.d.ts +6 -0
- package/bin/credit/enums/ReconciliationStatusEnum.js +10 -0
- package/bin/credit/enums/TransferStatusEnum.d.ts +8 -0
- package/bin/credit/enums/TransferStatusEnum.js +12 -0
- package/bin/index.d.ts +1 -0
- package/bin/index.js +2 -1
- package/bin/platformRbac/auth/DefineNextChallengeRequest.d.ts +11 -0
- package/bin/platformRbac/auth/DefineNextChallengeRequest.js +44 -0
- package/bin/platformRbac/auth/DefineNextChallengeResponse.d.ts +6 -0
- package/bin/platformRbac/auth/DefineNextChallengeResponse.js +30 -0
- package/bin/platformRbac/auth/NewPasswordRequest.d.ts +4 -0
- package/bin/platformRbac/auth/NewPasswordRequest.js +25 -0
- package/bin/platformRbac/auth/PrepareChallengeRequest.d.ts +6 -0
- package/bin/platformRbac/auth/PrepareChallengeRequest.js +29 -0
- package/bin/platformRbac/auth/PrepareChallengeResponse.d.ts +4 -0
- package/bin/platformRbac/auth/PrepareChallengeResponse.js +24 -0
- package/bin/platformRbac/auth/ResetPasswordRequest.d.ts +5 -0
- package/bin/platformRbac/auth/ResetPasswordRequest.js +30 -0
- package/bin/platformRbac/auth/VerifyChallengeRequest.d.ts +7 -0
- package/bin/platformRbac/auth/VerifyChallengeRequest.js +33 -0
- package/bin/platformRbac/auth/VerifyChallengeResponse.d.ts +3 -0
- package/bin/platformRbac/auth/VerifyChallengeResponse.js +20 -0
- package/bin/platformRbac/enums/ChallengeNameEnum.d.ts +7 -0
- package/bin/platformRbac/enums/ChallengeNameEnum.js +11 -0
- package/bin/platformRbac/enums/MfaMethodEnum.d.ts +4 -0
- package/bin/platformRbac/enums/MfaMethodEnum.js +8 -0
- package/bin/platformRbac/index.d.ts +14 -0
- package/bin/platformRbac/index.js +30 -0
- package/bin/platformRbac/mfa/ChangeMfaMethodRequest.d.ts +5 -0
- package/bin/platformRbac/mfa/ChangeMfaMethodRequest.js +25 -0
- package/bin/platformRbac/mfa/EnrollTotpResponse.d.ts +5 -0
- package/bin/platformRbac/mfa/EnrollTotpResponse.js +28 -0
- package/bin/platformRbac/mfa/MfaStatusResponse.d.ts +6 -0
- package/bin/platformRbac/mfa/MfaStatusResponse.js +30 -0
- package/bin/platformRbac/mfa/VerifyTotpEnrollmentRequest.d.ts +3 -0
- package/bin/platformRbac/mfa/VerifyTotpEnrollmentRequest.js +21 -0
- package/bin/walletFunding/dtos/AuthorizeWalletFundingRequest.d.ts +13 -0
- package/bin/walletFunding/dtos/AuthorizeWalletFundingRequest.js +63 -0
- package/bin/walletFunding/dtos/AuthorizeWalletFundingResponse.d.ts +10 -0
- package/bin/walletFunding/dtos/AuthorizeWalletFundingResponse.js +6 -0
- package/bin/walletFunding/dtos/CancelFundingReferenceRequest.d.ts +5 -0
- package/bin/walletFunding/dtos/CancelFundingReferenceRequest.js +31 -0
- package/bin/walletFunding/dtos/CancelFundingReferenceResponse.d.ts +7 -0
- package/bin/walletFunding/dtos/CancelFundingReferenceResponse.js +6 -0
- package/bin/walletFunding/dtos/CancelWalletFundingRequest.d.ts +3 -0
- package/bin/walletFunding/dtos/CancelWalletFundingRequest.js +21 -0
- package/bin/walletFunding/dtos/CancelWalletFundingResponse.d.ts +7 -0
- package/bin/walletFunding/dtos/CancelWalletFundingResponse.js +6 -0
- package/bin/walletFunding/dtos/CreateFundingReferenceRequest.d.ts +13 -0
- package/bin/walletFunding/dtos/CreateFundingReferenceRequest.js +65 -0
- package/bin/walletFunding/dtos/CreateFundingReferenceResponse.d.ts +10 -0
- package/bin/walletFunding/dtos/CreateFundingReferenceResponse.js +6 -0
- package/bin/walletFunding/dtos/CreditWalletFundingRequest.d.ts +10 -0
- package/bin/walletFunding/dtos/CreditWalletFundingRequest.js +55 -0
- package/bin/walletFunding/dtos/CreditWalletFundingResponse.d.ts +8 -0
- package/bin/walletFunding/dtos/CreditWalletFundingResponse.js +6 -0
- package/bin/walletFunding/dtos/FundingProviderReferenceData.d.ts +12 -0
- package/bin/walletFunding/dtos/FundingProviderReferenceData.js +9 -0
- package/bin/walletFunding/dtos/ListFundingReferencesRequest.d.ts +5 -0
- package/bin/walletFunding/dtos/ListFundingReferencesRequest.js +27 -0
- package/bin/walletFunding/dtos/ListFundingReferencesResponse.d.ts +4 -0
- package/bin/walletFunding/dtos/ListFundingReferencesResponse.js +6 -0
- package/bin/walletFunding/dtos/ListWalletFundingReferencesRequest.d.ts +6 -0
- package/bin/walletFunding/dtos/ListWalletFundingReferencesRequest.js +28 -0
- package/bin/walletFunding/dtos/ListWalletFundingReferencesResponse.d.ts +16 -0
- package/bin/walletFunding/dtos/ListWalletFundingReferencesResponse.js +9 -0
- package/bin/walletFunding/dtos/ReverseWalletFundingRequest.d.ts +9 -0
- package/bin/walletFunding/dtos/ReverseWalletFundingRequest.js +51 -0
- package/bin/walletFunding/dtos/ReverseWalletFundingResponse.d.ts +7 -0
- package/bin/walletFunding/dtos/ReverseWalletFundingResponse.js +6 -0
- package/bin/walletFunding/dtos/ValidateWalletFundingRequest.d.ts +9 -0
- package/bin/walletFunding/dtos/ValidateWalletFundingRequest.js +51 -0
- package/bin/walletFunding/dtos/ValidateWalletFundingResponse.d.ts +6 -0
- package/bin/walletFunding/dtos/ValidateWalletFundingResponse.js +6 -0
- package/bin/walletFunding/dtos/index.d.ts +19 -0
- package/bin/walletFunding/dtos/index.js +35 -0
- package/bin/walletFunding/enums/FundingMethodEnum.d.ts +3 -0
- package/bin/walletFunding/enums/FundingMethodEnum.js +7 -0
- package/bin/walletFunding/enums/WalletFundingErrorCodeEnum.d.ts +16 -0
- package/bin/walletFunding/enums/WalletFundingErrorCodeEnum.js +20 -0
- package/bin/walletFunding/enums/WalletFundingModeEnum.d.ts +4 -0
- package/bin/walletFunding/enums/WalletFundingModeEnum.js +8 -0
- package/bin/walletFunding/enums/WalletFundingPaymentStatusEnum.d.ts +6 -0
- package/bin/walletFunding/enums/WalletFundingPaymentStatusEnum.js +10 -0
- package/bin/walletFunding/enums/WalletFundingReferenceStatusEnum.d.ts +6 -0
- package/bin/walletFunding/enums/WalletFundingReferenceStatusEnum.js +10 -0
- package/bin/walletFunding/enums/WalletFundingRefundReasonEnum.d.ts +8 -0
- package/bin/walletFunding/enums/WalletFundingRefundReasonEnum.js +12 -0
- package/bin/walletFunding/enums/index.d.ts +6 -0
- package/bin/walletFunding/enums/index.js +22 -0
- package/bin/walletFunding/index.d.ts +2 -0
- package/bin/{rbac → walletFunding}/index.js +2 -1
- package/docs/superpowers/plans/2026-05-22-http-client-inversify-v8.md +243 -0
- package/docs/superpowers/specs/2026-05-22-inversify-v8-migration-design.md +191 -0
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/platformRbac/auth/DefineNextChallengeRequest.ts +25 -0
- package/src/platformRbac/auth/DefineNextChallengeResponse.ts +14 -0
- package/src/platformRbac/auth/NewPasswordRequest.ts +10 -0
- package/src/platformRbac/auth/PrepareChallengeRequest.ts +13 -0
- package/src/platformRbac/auth/PrepareChallengeResponse.ts +9 -0
- package/src/platformRbac/auth/ResetPasswordRequest.ts +14 -0
- package/src/platformRbac/auth/VerifyChallengeRequest.ts +16 -0
- package/src/platformRbac/auth/VerifyChallengeResponse.ts +6 -0
- package/src/platformRbac/enums/ChallengeNameEnum.ts +7 -0
- package/src/platformRbac/enums/MfaMethodEnum.ts +4 -0
- package/src/platformRbac/index.ts +17 -0
- package/src/platformRbac/mfa/ChangeMfaMethodRequest.ts +10 -0
- package/src/platformRbac/mfa/EnrollTotpResponse.ts +12 -0
- package/src/platformRbac/mfa/MfaStatusResponse.ts +14 -0
- package/src/platformRbac/mfa/VerifyTotpEnrollmentRequest.ts +7 -0
- package/src/walletFunding/dtos/AuthorizeWalletFundingRequest.ts +18 -0
- package/src/walletFunding/dtos/AuthorizeWalletFundingResponse.ts +11 -0
- package/src/walletFunding/dtos/CancelFundingReferenceRequest.ts +7 -0
- package/src/walletFunding/dtos/CancelFundingReferenceResponse.ts +8 -0
- package/src/walletFunding/dtos/CancelWalletFundingRequest.ts +5 -0
- package/src/walletFunding/dtos/CancelWalletFundingResponse.ts +8 -0
- package/src/walletFunding/dtos/CreateFundingReferenceRequest.ts +18 -0
- package/src/walletFunding/dtos/CreateFundingReferenceResponse.ts +11 -0
- package/src/walletFunding/dtos/CreditWalletFundingRequest.ts +12 -0
- package/src/walletFunding/dtos/CreditWalletFundingResponse.ts +9 -0
- package/src/walletFunding/dtos/FundingProviderReferenceData.ts +10 -0
- package/src/walletFunding/dtos/ListFundingReferencesRequest.ts +7 -0
- package/src/walletFunding/dtos/ListFundingReferencesResponse.ts +5 -0
- package/src/walletFunding/dtos/ListWalletFundingReferencesRequest.ts +8 -0
- package/src/walletFunding/dtos/ListWalletFundingReferencesResponse.ts +18 -0
- package/src/walletFunding/dtos/ReverseWalletFundingRequest.ts +11 -0
- package/src/walletFunding/dtos/ReverseWalletFundingResponse.ts +8 -0
- package/src/walletFunding/dtos/ValidateWalletFundingRequest.ts +11 -0
- package/src/walletFunding/dtos/ValidateWalletFundingResponse.ts +7 -0
- package/src/walletFunding/dtos/index.ts +19 -0
- package/src/walletFunding/enums/FundingMethodEnum.ts +3 -0
- package/src/walletFunding/enums/WalletFundingErrorCodeEnum.ts +16 -0
- package/src/walletFunding/enums/WalletFundingModeEnum.ts +4 -0
- package/src/walletFunding/enums/WalletFundingPaymentStatusEnum.ts +6 -0
- package/src/walletFunding/enums/WalletFundingReferenceStatusEnum.ts +6 -0
- package/src/walletFunding/enums/WalletFundingRefundReasonEnum.ts +8 -0
- package/src/walletFunding/enums/index.ts +6 -0
- package/src/walletFunding/index.ts +2 -0
- package/bin/cognitoBackofficeConnector/dtos/PoolConfigResponse.d.ts +0 -20
- package/bin/cognitoBackofficeConnector/dtos/PoolConfigResponse.js +0 -11
- package/bin/cognitoBackofficeConnector/dtos/PoolsListResponse.d.ts +0 -4
- package/bin/cognitoBackofficeConnector/dtos/PoolsListResponse.js +0 -6
- package/bin/rbac/enums/PoolKind.d.ts +0 -16
- package/bin/rbac/enums/PoolKind.js +0 -20
- package/bin/rbac/index.d.ts +0 -1
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# Migración a inversify v8 (última) con soporte gradual de lambdas en v6
|
|
2
|
+
|
|
3
|
+
Fecha: 2026-05-22
|
|
4
|
+
Estado: diseño aprobado (estrategia), pendiente de revisión del spec
|
|
5
|
+
Versión objetivo: inversify **8.x** (la última, hoy 8.1.0). Se salta v7; se va de v6 directo a v8.
|
|
6
|
+
|
|
7
|
+
## 1. Contexto y objetivo
|
|
8
|
+
|
|
9
|
+
Las libs compartidas (`@fiado/api-invoker`, `@fiado/gateway-adapter`,
|
|
10
|
+
`@fiado/http-client`) dependen hoy de `inversify ^6.x` como dependencia normal.
|
|
11
|
+
122 repos de lambdas las consumen y todos declaran `inversify` directamente,
|
|
12
|
+
repartidos entre el major 1 (~80 repos, `^1.x`) y el major 3 (~30, `^3.x`).
|
|
13
|
+
Las libs se publican a npm público (`registry.npmjs.org`).
|
|
14
|
+
|
|
15
|
+
**Objetivo:** subir las libs a inversify 8 y migrar las 122 lambdas **de forma
|
|
16
|
+
gradual**, manteniendo las lambdas no migradas funcionando en inversify 6,
|
|
17
|
+
incluyendo la capacidad de sacar hotfixes a las libs para esas lambdas v6.
|
|
18
|
+
|
|
19
|
+
## 2. Restricciones técnicas (la causa raíz)
|
|
20
|
+
|
|
21
|
+
- **La DI cruza la frontera lib↔lambda.** Cada lambda hace
|
|
22
|
+
`const c = new Container(); c.load(gatewayAdapterBindings); c.load(apiInvokerBindings)`
|
|
23
|
+
y además `c.bind("IHttpRequest").to(AxiosHttpRequest)`. Los `ContainerModule`
|
|
24
|
+
y las clases `@injectable` viajan desde la lib al container de la lambda.
|
|
25
|
+
- **Consecuencia:** el `ContainerModule`/decoradores producidos por la lib y el
|
|
26
|
+
`Container` de la lambda **deben ser de la misma versión de inversify**.
|
|
27
|
+
inversify 6 y 8 no se pueden mezclar en un mismo container (cambian la firma
|
|
28
|
+
del callback de `ContainerModule`, se elimina el namespace `interfaces`, y
|
|
29
|
+
cambian APIs de binding). Por eso **no existe una sola versión de lib que
|
|
30
|
+
sirva para ambos** sin un shim frágil.
|
|
31
|
+
- **Atomicidad de la migración por lambda:** una lambda no puede mezclar
|
|
32
|
+
`gateway-adapter` v6 con `api-invoker` v8. Debe subir **en un solo PR**:
|
|
33
|
+
`inversify` 6→8 + el set completo de libs que tocan su container
|
|
34
|
+
(`api-invoker`, `gateway-adapter`, `http-client`).
|
|
35
|
+
- **Ciclo entre libs:** `gateway-adapter` depende de `api-invoker` y
|
|
36
|
+
`api-invoker` depende de `gateway-adapter`. No se pueden publicar "uno a la
|
|
37
|
+
vez"; sus majors nuevos se publican coordinados (ver §5).
|
|
38
|
+
- **Libs sin inversify:** `logger` y `type-kit` no usan el container ni
|
|
39
|
+
decoradores → **no se tocan** en esta migración.
|
|
40
|
+
|
|
41
|
+
## 3. Estrategia elegida: majors paralelos (dual-track)
|
|
42
|
+
|
|
43
|
+
Sacar un **major nuevo** de cada lib del set, construido sobre inversify 8.
|
|
44
|
+
Los majors v6 actuales quedan como **línea de mantenimiento** para backports.
|
|
45
|
+
Cada lambda migra cuando le toca, en un PR atómico. Cada container en runtime
|
|
46
|
+
ve **una sola** versión de inversify.
|
|
47
|
+
|
|
48
|
+
Líneas resultantes por lib (los majors de NUESTRAS libs son independientes del
|
|
49
|
+
número de versión de inversify):
|
|
50
|
+
|
|
51
|
+
| Lib | Línea v6 (mantenimiento) | Línea v8 (nueva) |
|
|
52
|
+
|----------------|--------------------------|----------------------|
|
|
53
|
+
| http-client | 1.x | 2.0.0 |
|
|
54
|
+
| gateway-adapter| 1.x | 2.0.0 |
|
|
55
|
+
| api-invoker | 3.x | 4.0.0 |
|
|
56
|
+
| logger | — (sin cambio) | — |
|
|
57
|
+
| type-kit | — (sin cambio) | — |
|
|
58
|
+
|
|
59
|
+
(Estrategias descartadas: desacoplar las libs de inversify por completo —
|
|
60
|
+
refactor enorme incompatible con "gradual"; peerDependency + shim dual-API —
|
|
61
|
+
frágil por las diferencias de API entre v6 y v8.)
|
|
62
|
+
|
|
63
|
+
## 4. Breaking changes confirmados (v6 → v8)
|
|
64
|
+
|
|
65
|
+
Verificado contra las guías oficiales ([migrating-from-v6](https://inversify.io/docs/guides/migrating-from-v6/)
|
|
66
|
+
y [migrating-from-v7](https://inversify.io/docs/guides/migrating-from-v7/)).
|
|
67
|
+
Lo que toca este código:
|
|
68
|
+
|
|
69
|
+
1. **`ContainerModule`**: el callback recibe ahora un objeto
|
|
70
|
+
`ContainerModuleLoadOptions`; se usa `options.bind(...)`. Afecta
|
|
71
|
+
`apiInvokerBindings` y `gatewayAdapterBindings`.
|
|
72
|
+
```ts
|
|
73
|
+
// v6
|
|
74
|
+
export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) => {
|
|
75
|
+
bind<IDirectoryApi>("IDirectoryApi").to(DirectoryApi);
|
|
76
|
+
});
|
|
77
|
+
// v8
|
|
78
|
+
export const apiInvokerBindings = new ContainerModule((options) => {
|
|
79
|
+
options.bind<IDirectoryApi>("IDirectoryApi").to(DirectoryApi);
|
|
80
|
+
});
|
|
81
|
+
```
|
|
82
|
+
2. **Namespace `interfaces` eliminado**: importar los tipos directamente.
|
|
83
|
+
`interfaces.Context → ResolutionContext`, `interfaces.Factory → Factory`,
|
|
84
|
+
`interfaces.Newable → Newable`, `interfaces.Request → BindingConstraints`.
|
|
85
|
+
Afecta `import { ContainerModule, interfaces } from "inversify"`.
|
|
86
|
+
3. **`toAutoFactory` eliminado** → reescribir con `toFactory`:
|
|
87
|
+
```ts
|
|
88
|
+
// v6 (auth-business)
|
|
89
|
+
.toAutoFactory("EventBridgeMessageSubscriber")
|
|
90
|
+
// v8
|
|
91
|
+
.toFactory((ctx) => () => ctx.get("EventBridgeMessageSubscriber"))
|
|
92
|
+
```
|
|
93
|
+
También: `toProvider → toFactory` (con función async),
|
|
94
|
+
`toConstructor → toConstantValue`, `toFunction → toConstantValue`.
|
|
95
|
+
4. **`container.load()` SIGUE SIENDO SÍNCRONO en v8** (convención "sync-first":
|
|
96
|
+
el nombre por defecto es sync, el async es `loadAsync()`). Como nuestros
|
|
97
|
+
módulos de binding son síncronos, **el patrón `const container = new
|
|
98
|
+
Container(); container.load(...); export { container }` se conserva** — NO
|
|
99
|
+
hay que volverlo async. (En v7 sí era async; v8 lo revirtió, a nuestro favor.)
|
|
100
|
+
`container.get()` también sigue síncrono.
|
|
101
|
+
5. **Opciones del `Container`**: `autoBindInjectable → autobind`;
|
|
102
|
+
`container.createChild()` → `new Container({ parent })`. Revisar usos.
|
|
103
|
+
6. **`@injectable`/`@inject` sin cambios**; nuevo `@injectFromBase` solo si una
|
|
104
|
+
clase hereda de una base injectable (revisar herencia).
|
|
105
|
+
7. **inversify 8 es ESM-only**, pero proyectos CommonJS lo consumen vía
|
|
106
|
+
`require(esm)` en **Node 20+**. ⇒ todas las lambdas deben correr en runtime
|
|
107
|
+
**Node 20.x o superior**. Verificar el runtime de cada lambda antes de migrar.
|
|
108
|
+
|
|
109
|
+
Entregable de esta fase: un **codemod / guía** reproducible para
|
|
110
|
+
`container.config.ts` (reescritura de `toAutoFactory`, import de `interfaces`,
|
|
111
|
+
firma de `ContainerModule`), ya que el patrón se repite en las 122 lambdas.
|
|
112
|
+
|
|
113
|
+
## 5. Orden de trabajo en las libs (un proyecto a la vez)
|
|
114
|
+
|
|
115
|
+
Para cada lib, antes de tocar: `git checkout develop && git pull`.
|
|
116
|
+
|
|
117
|
+
1. **http-client** (hoja, solo `@injectable` en `AxiosHttpRequest`):
|
|
118
|
+
migrar a v8, publicar **2.0.0**. dist-tag `latest` → 2.x, `legacy-v6` → 1.x.
|
|
119
|
+
2. **gateway-adapter + api-invoker** (ciclo): migrar el código de ambos a v8 en
|
|
120
|
+
ramas, desarrollando con enlaces locales (`npm link` / `file:`) para que
|
|
121
|
+
compilen uno contra otro. Publicar coordinado con prerelease:
|
|
122
|
+
- `gateway-adapter@2.0.0-rc.0` con dep `@fiado/api-invoker@^4.0.0-rc`
|
|
123
|
+
- `api-invoker@4.0.0-rc.0` con dep `@fiado/gateway-adapter@^2.0.0-rc`
|
|
124
|
+
- validar en 1 lambda piloto, luego promover a `2.0.0` / `4.0.0` finales.
|
|
125
|
+
3. **logger / type-kit**: sin cambios.
|
|
126
|
+
|
|
127
|
+
> **Publicación en espera:** no se publica ninguna lib a npm hasta terminar los
|
|
128
|
+
> cambios y tener el visto bueno explícito del usuario.
|
|
129
|
+
|
|
130
|
+
## 6. Política de branching y backport (soporte v6)
|
|
131
|
+
|
|
132
|
+
- Cortar una rama de mantenimiento por línea v6 en el último release v6:
|
|
133
|
+
`release/3.x` en api-invoker (desde 3.18.0), `release/1.x` en
|
|
134
|
+
gateway-adapter y http-client. `develop` pasa a ser la línea v8.
|
|
135
|
+
- **Hotfix que toca una lib mientras una lambda sigue en v6:**
|
|
136
|
+
1. El fix se hace en la línea natural y se hace `git cherry-pick` a la otra.
|
|
137
|
+
La mayoría de hotfixes (lógica de negocio, no inversify) tienen archivos
|
|
138
|
+
idénticos entre líneas → cherry-pick limpio.
|
|
139
|
+
2. Publicar patch en la línea v6 (ej. `3.18.1`) y, si aplica, en la nueva.
|
|
140
|
+
3. La lambda v6 (pineada `^3.x`) hace `npm update` y recibe el fix: cero
|
|
141
|
+
cambio de inversify, cero cambio en su `container.config.ts`.
|
|
142
|
+
- **Disciplina clave:** mantener el major nuevo como un **diff quirúrgico** sobre
|
|
143
|
+
v6 (tocar solo archivos que tocan inversify) para que los cherry-picks no
|
|
144
|
+
choquen.
|
|
145
|
+
- **Ventana de soporte:** se backportea **solo al último major v6** (api-invoker
|
|
146
|
+
3.x). Las ~80 lambdas aún en `^1.x` deben consolidarse a `^3` como parte de
|
|
147
|
+
(o antes de) la migración, porque hoy ya no pueden recibir fixes limpios.
|
|
148
|
+
|
|
149
|
+
## 7. Playbook de migración por lambda (gradual)
|
|
150
|
+
|
|
151
|
+
Por cada lambda, en un PR atómico:
|
|
152
|
+
|
|
153
|
+
1. `inversify` 6→8 y `reflect-metadata` a la versión alineada.
|
|
154
|
+
2. Subir el set de libs nuevas: `api-invoker` `^4`, `gateway-adapter` `^2`,
|
|
155
|
+
`http-client` `^2`.
|
|
156
|
+
3. Aplicar el codemod/guía a `container.config.ts`: reescribir `toAutoFactory`
|
|
157
|
+
→ `toFactory`, ajustar imports del namespace `interfaces`. El patrón
|
|
158
|
+
síncrono `export { container }` **no cambia** (load/get siguen sync en v8).
|
|
159
|
+
4. Verificar que el runtime de la lambda sea **Node ≥20** (inversify 8 ESM-only).
|
|
160
|
+
5. Correr tests + smoke test del handler. Merge y deploy.
|
|
161
|
+
|
|
162
|
+
Las lambdas no migradas siguen en v6 sin cambios.
|
|
163
|
+
|
|
164
|
+
## 8. Riesgos
|
|
165
|
+
|
|
166
|
+
- **Divergencia de líneas v6/v8** si el major nuevo refactoriza de más →
|
|
167
|
+
mitigado con el "diff quirúrgico".
|
|
168
|
+
- **Ciclo api-invoker↔gateway-adapter** en el publish → mitigado con prerelease
|
|
169
|
+
rc + dist-tags.
|
|
170
|
+
- **Cola de migración larga** (122 lambdas) → mantener línea v6 viva y priorizar
|
|
171
|
+
consolidar los `^1.x` a `^3.x`.
|
|
172
|
+
- **Runtime Node <20**: inversify 8 es ESM-only; lambdas en Node 18 o menor no
|
|
173
|
+
podrán hacer `require(esm)`. Mitigación: auditar y subir a Node 20+ el runtime
|
|
174
|
+
de cada lambda como prerrequisito de su PR de migración.
|
|
175
|
+
- **Saltar v7→v8 directo** acumula breaking changes; mitigado validando lib por
|
|
176
|
+
lib con su smoke test antes de avanzar. (El cambio más riesgoso de v7 —`load`
|
|
177
|
+
async— quedó revertido en v8, así que el bootstrap síncrono se conserva.)
|
|
178
|
+
|
|
179
|
+
## 9. Criterios de éxito
|
|
180
|
+
|
|
181
|
+
- http-client@2, gateway-adapter@2, api-invoker@4 construidos sobre inversify 8
|
|
182
|
+
y validados en 1 lambda piloto (publicación pendiente de visto bueno).
|
|
183
|
+
- Línea v6 (`release/*`) capaz de recibir y publicar un hotfix backporteado.
|
|
184
|
+
- Guía/codemod de `container.config.ts` documentada y reutilizable.
|
|
185
|
+
- Lambdas no migradas siguen desplegando sin cambios.
|
|
186
|
+
|
|
187
|
+
## Seguridad (fuera de alcance, pero a atender)
|
|
188
|
+
|
|
189
|
+
`fiado-api-invoker/.npmrc` contiene un token de publicación de npm en texto
|
|
190
|
+
plano. Si está versionado, debe **revocarse/rotarse** en npmjs.com y moverse a
|
|
191
|
+
una variable de entorno / secret de CI.
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -81,4 +81,5 @@ export * as CognitoBackofficeConnector from './cognitoBackofficeConnector';
|
|
|
81
81
|
// platform-rbac-business — migrar Permission/Scope/AuthContext/RoleAssignmentInfo a `rbac/`).
|
|
82
82
|
export * as PlatformRbac from './platformRbac';
|
|
83
83
|
export * as Remittance from './remittance';
|
|
84
|
+
export * as WalletFunding from './walletFunding';
|
|
84
85
|
export * from './messaging';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { Type } from 'class-transformer';
|
|
3
|
+
import { IsArray, IsBoolean, IsEnum, IsString, ValidateNested } from 'class-validator';
|
|
4
|
+
import { ChallengeNameEnum } from '../enums/ChallengeNameEnum';
|
|
5
|
+
|
|
6
|
+
export class ChallengeResultEntry {
|
|
7
|
+
@IsEnum(ChallengeNameEnum)
|
|
8
|
+
challengeName!: ChallengeNameEnum;
|
|
9
|
+
|
|
10
|
+
@IsBoolean()
|
|
11
|
+
challengeResult!: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export class DefineNextChallengeRequest {
|
|
15
|
+
@IsString()
|
|
16
|
+
cognitoSub!: string;
|
|
17
|
+
|
|
18
|
+
@IsBoolean()
|
|
19
|
+
userNotFound!: boolean;
|
|
20
|
+
|
|
21
|
+
@IsArray()
|
|
22
|
+
@ValidateNested({ each: true })
|
|
23
|
+
@Type(() => ChallengeResultEntry)
|
|
24
|
+
session!: ChallengeResultEntry[];
|
|
25
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IsBoolean, IsEnum, IsOptional } from 'class-validator';
|
|
2
|
+
import { ChallengeNameEnum } from '../enums/ChallengeNameEnum';
|
|
3
|
+
|
|
4
|
+
export class DefineNextChallengeResponse {
|
|
5
|
+
@IsOptional()
|
|
6
|
+
@IsEnum(ChallengeNameEnum)
|
|
7
|
+
nextChallenge?: ChallengeNameEnum;
|
|
8
|
+
|
|
9
|
+
@IsBoolean()
|
|
10
|
+
issueTokens!: boolean;
|
|
11
|
+
|
|
12
|
+
@IsBoolean()
|
|
13
|
+
failAuthentication!: boolean;
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IsEmail, IsEnum, IsString } from 'class-validator';
|
|
2
|
+
import { ChallengeNameEnum } from '../enums/ChallengeNameEnum';
|
|
3
|
+
|
|
4
|
+
export class PrepareChallengeRequest {
|
|
5
|
+
@IsString()
|
|
6
|
+
cognitoSub!: string;
|
|
7
|
+
|
|
8
|
+
@IsEnum(ChallengeNameEnum)
|
|
9
|
+
challengeName!: ChallengeNameEnum;
|
|
10
|
+
|
|
11
|
+
@IsEmail()
|
|
12
|
+
email!: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IsEmail, IsString, Length, MinLength } from 'class-validator';
|
|
2
|
+
|
|
3
|
+
export class ResetPasswordRequest {
|
|
4
|
+
@IsEmail()
|
|
5
|
+
email!: string;
|
|
6
|
+
|
|
7
|
+
@IsString()
|
|
8
|
+
@Length(6, 6)
|
|
9
|
+
otpCode!: string;
|
|
10
|
+
|
|
11
|
+
@IsString()
|
|
12
|
+
@MinLength(8)
|
|
13
|
+
newPassword!: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IsEnum, IsObject, IsString } from 'class-validator';
|
|
2
|
+
import { ChallengeNameEnum } from '../enums/ChallengeNameEnum';
|
|
3
|
+
|
|
4
|
+
export class VerifyChallengeRequest {
|
|
5
|
+
@IsString()
|
|
6
|
+
cognitoSub!: string;
|
|
7
|
+
|
|
8
|
+
@IsEnum(ChallengeNameEnum)
|
|
9
|
+
challengeName!: ChallengeNameEnum;
|
|
10
|
+
|
|
11
|
+
@IsString()
|
|
12
|
+
challengeAnswer!: string;
|
|
13
|
+
|
|
14
|
+
@IsObject()
|
|
15
|
+
privateChallengeParameters!: Record<string, string>;
|
|
16
|
+
}
|
|
@@ -15,3 +15,20 @@ export { PermissionCategory } from './enums/PermissionCategory';
|
|
|
15
15
|
export type { AuthContext } from './dtos/AuthContext';
|
|
16
16
|
export type { RoleAssignmentInfo } from './dtos/RoleAssignmentInfo';
|
|
17
17
|
export type { PermissionMeta } from './dtos/PermissionMeta';
|
|
18
|
+
|
|
19
|
+
// Fase 1 — Custom Auth Challenge (Email OTP + TOTP) + MFA self-service.
|
|
20
|
+
// Class values (no type-only) — los DTOs llevan decoradores class-validator y se hidratan con plainToInstance en runtime.
|
|
21
|
+
export * from './enums/MfaMethodEnum';
|
|
22
|
+
export * from './enums/ChallengeNameEnum';
|
|
23
|
+
export * from './auth/DefineNextChallengeRequest';
|
|
24
|
+
export * from './auth/DefineNextChallengeResponse';
|
|
25
|
+
export * from './auth/PrepareChallengeRequest';
|
|
26
|
+
export * from './auth/PrepareChallengeResponse';
|
|
27
|
+
export * from './auth/VerifyChallengeRequest';
|
|
28
|
+
export * from './auth/VerifyChallengeResponse';
|
|
29
|
+
export * from './auth/NewPasswordRequest';
|
|
30
|
+
export * from './auth/ResetPasswordRequest';
|
|
31
|
+
export * from './mfa/EnrollTotpResponse';
|
|
32
|
+
export * from './mfa/VerifyTotpEnrollmentRequest';
|
|
33
|
+
export * from './mfa/ChangeMfaMethodRequest';
|
|
34
|
+
export * from './mfa/MfaStatusResponse';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IsArray, IsEnum, IsNumber } from 'class-validator';
|
|
2
|
+
import { MfaMethodEnum } from '../enums/MfaMethodEnum';
|
|
3
|
+
|
|
4
|
+
export class MfaStatusResponse {
|
|
5
|
+
@IsEnum(MfaMethodEnum)
|
|
6
|
+
currentMethod!: MfaMethodEnum;
|
|
7
|
+
|
|
8
|
+
@IsArray()
|
|
9
|
+
@IsEnum(MfaMethodEnum, { each: true })
|
|
10
|
+
availableMethods!: MfaMethodEnum[];
|
|
11
|
+
|
|
12
|
+
@IsNumber()
|
|
13
|
+
recoveryCodesRemaining!: number;
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IsString, IsEnum, IsOptional, IsNumber, IsPositive,
|
|
3
|
+
Length, Min, Max, IsLatitude, IsLongitude, MaxLength,
|
|
4
|
+
} from "class-validator";
|
|
5
|
+
import { FundingMethodEnum } from "../enums/FundingMethodEnum";
|
|
6
|
+
import { WalletFundingModeEnum } from "../enums/WalletFundingModeEnum";
|
|
7
|
+
|
|
8
|
+
export class AuthorizeWalletFundingRequest {
|
|
9
|
+
@IsString() @MaxLength(64) directoryId!: string;
|
|
10
|
+
@IsEnum(FundingMethodEnum) method!: FundingMethodEnum;
|
|
11
|
+
@IsEnum(WalletFundingModeEnum) mode!: WalletFundingModeEnum;
|
|
12
|
+
@IsOptional() @IsNumber() @IsPositive() amount?: number;
|
|
13
|
+
@IsString() @Length(3, 3) currencyCode!: string;
|
|
14
|
+
@IsNumber() @Min(1) @Max(30) expirationDays!: number;
|
|
15
|
+
@IsString() @MaxLength(64) idempotencyKey!: string;
|
|
16
|
+
@IsOptional() @IsLatitude() latitude?: number;
|
|
17
|
+
@IsOptional() @IsLongitude() longitude?: number;
|
|
18
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BenefitPaymentStatusEnum } from "../../benefitCenter/enums/BenefitPaymentStatusEnum";
|
|
2
|
+
import { WalletFundingErrorCodeEnum } from "../enums/WalletFundingErrorCodeEnum";
|
|
3
|
+
import { FundingProviderReferenceData } from "./FundingProviderReferenceData";
|
|
4
|
+
|
|
5
|
+
export class AuthorizeWalletFundingResponse {
|
|
6
|
+
status!: BenefitPaymentStatusEnum;
|
|
7
|
+
errorCode?: WalletFundingErrorCodeEnum;
|
|
8
|
+
fundingId?: string;
|
|
9
|
+
expiresAt?: string;
|
|
10
|
+
providerData?: FundingProviderReferenceData;
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BenefitPaymentStatusEnum } from "../../benefitCenter/enums/BenefitPaymentStatusEnum";
|
|
2
|
+
import { WalletFundingErrorCodeEnum } from "../enums/WalletFundingErrorCodeEnum";
|
|
3
|
+
|
|
4
|
+
export class CancelFundingReferenceResponse {
|
|
5
|
+
fundingId!: string;
|
|
6
|
+
status!: BenefitPaymentStatusEnum;
|
|
7
|
+
errorCode?: WalletFundingErrorCodeEnum;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BenefitPaymentStatusEnum } from "../../benefitCenter/enums/BenefitPaymentStatusEnum";
|
|
2
|
+
import { WalletFundingErrorCodeEnum } from "../enums/WalletFundingErrorCodeEnum";
|
|
3
|
+
|
|
4
|
+
export class CancelWalletFundingResponse {
|
|
5
|
+
status!: BenefitPaymentStatusEnum;
|
|
6
|
+
errorCode?: WalletFundingErrorCodeEnum;
|
|
7
|
+
fundingId?: string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IsString, IsEmail, IsEnum, IsOptional, IsNumber, IsPositive,
|
|
3
|
+
Length, IsDateString, MaxLength,
|
|
4
|
+
} from "class-validator";
|
|
5
|
+
import { WalletFundingModeEnum } from "../enums/WalletFundingModeEnum";
|
|
6
|
+
|
|
7
|
+
export class CreateFundingReferenceRequest {
|
|
8
|
+
@IsString() @MaxLength(64) fundingId!: string;
|
|
9
|
+
@IsString() @MaxLength(64) directoryId!: string;
|
|
10
|
+
@IsString() @MaxLength(64) walletAccountId!: string;
|
|
11
|
+
@IsString() @MaxLength(128) name!: string;
|
|
12
|
+
@IsEmail() email!: string;
|
|
13
|
+
@IsEnum(WalletFundingModeEnum) mode!: WalletFundingModeEnum;
|
|
14
|
+
@IsOptional() @IsNumber() @IsPositive() amount?: number;
|
|
15
|
+
@IsString() @Length(3, 3) currencyCode!: string;
|
|
16
|
+
@IsDateString() expiresAt!: string;
|
|
17
|
+
@IsString() @MaxLength(64) idempotencyKey!: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BenefitPaymentStatusEnum } from "../../benefitCenter/enums/BenefitPaymentStatusEnum";
|
|
2
|
+
import { WalletFundingErrorCodeEnum } from "../enums/WalletFundingErrorCodeEnum";
|
|
3
|
+
import { FundingProviderReferenceData } from "./FundingProviderReferenceData";
|
|
4
|
+
|
|
5
|
+
export class CreateFundingReferenceResponse {
|
|
6
|
+
fundingId!: string;
|
|
7
|
+
status!: BenefitPaymentStatusEnum;
|
|
8
|
+
errorCode?: WalletFundingErrorCodeEnum;
|
|
9
|
+
expiresAt?: string;
|
|
10
|
+
providerData?: FundingProviderReferenceData;
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IsString, IsNumber, IsPositive, Length, IsDateString, MaxLength } from "class-validator";
|
|
2
|
+
|
|
3
|
+
export class CreditWalletFundingRequest {
|
|
4
|
+
@IsString() @MaxLength(64) directoryId!: string;
|
|
5
|
+
@IsString() @MaxLength(64) walletAccountId!: string;
|
|
6
|
+
@IsNumber() @IsPositive() amount!: number;
|
|
7
|
+
@IsString() @Length(3, 3) currencyCode!: string;
|
|
8
|
+
@IsString() @MaxLength(32) providerName!: string;
|
|
9
|
+
@IsString() @MaxLength(128) providerReference!: string;
|
|
10
|
+
@IsString() @MaxLength(64) providerTxId!: string;
|
|
11
|
+
@IsDateString() paidAt!: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BenefitPaymentStatusEnum } from "../../benefitCenter/enums/BenefitPaymentStatusEnum";
|
|
2
|
+
import { WalletFundingErrorCodeEnum } from "../enums/WalletFundingErrorCodeEnum";
|
|
3
|
+
|
|
4
|
+
export class CreditWalletFundingResponse {
|
|
5
|
+
status!: BenefitPaymentStatusEnum;
|
|
6
|
+
errorCode?: WalletFundingErrorCodeEnum;
|
|
7
|
+
transactionNumber?: string;
|
|
8
|
+
noAuthorization?: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export class FundingProviderReferenceItem {
|
|
2
|
+
reference!: string;
|
|
3
|
+
centers!: Array<{ name: string; logo: string }>;
|
|
4
|
+
centerId!: number | string;
|
|
5
|
+
barcode!: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export class FundingProviderReferenceData {
|
|
9
|
+
references!: FundingProviderReferenceItem[];
|
|
10
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IsString, IsOptional, IsEnum, MaxLength } from "class-validator";
|
|
2
|
+
import { WalletFundingReferenceStatusEnum } from "../enums/WalletFundingReferenceStatusEnum";
|
|
3
|
+
|
|
4
|
+
export class ListFundingReferencesRequest {
|
|
5
|
+
@IsString() @MaxLength(64) directoryId!: string;
|
|
6
|
+
@IsOptional() @IsEnum(WalletFundingReferenceStatusEnum) status?: WalletFundingReferenceStatusEnum;
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IsOptional, IsEnum } from "class-validator";
|
|
2
|
+
import { WalletFundingReferenceStatusEnum } from "../enums/WalletFundingReferenceStatusEnum";
|
|
3
|
+
import { FundingMethodEnum } from "../enums/FundingMethodEnum";
|
|
4
|
+
|
|
5
|
+
export class ListWalletFundingReferencesRequest {
|
|
6
|
+
@IsOptional() @IsEnum(WalletFundingReferenceStatusEnum) status?: WalletFundingReferenceStatusEnum;
|
|
7
|
+
@IsOptional() @IsEnum(FundingMethodEnum) method?: FundingMethodEnum;
|
|
8
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { WalletFundingReferenceStatusEnum } from "../enums/WalletFundingReferenceStatusEnum";
|
|
2
|
+
import { WalletFundingModeEnum } from "../enums/WalletFundingModeEnum";
|
|
3
|
+
import { FundingProviderReferenceData } from "./FundingProviderReferenceData";
|
|
4
|
+
|
|
5
|
+
export class WalletFundingReferenceListItem {
|
|
6
|
+
fundingId!: string;
|
|
7
|
+
mode!: WalletFundingModeEnum;
|
|
8
|
+
amount?: number;
|
|
9
|
+
currencyCode!: string;
|
|
10
|
+
status!: WalletFundingReferenceStatusEnum;
|
|
11
|
+
expiresAt!: string;
|
|
12
|
+
createdAt!: string;
|
|
13
|
+
providerData!: FundingProviderReferenceData;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export class ListWalletFundingReferencesResponse {
|
|
17
|
+
items!: WalletFundingReferenceListItem[];
|
|
18
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IsString, IsNumber, IsPositive, Length, MaxLength } from "class-validator";
|
|
2
|
+
|
|
3
|
+
export class ReverseWalletFundingRequest {
|
|
4
|
+
@IsString() @MaxLength(64) directoryId!: string;
|
|
5
|
+
@IsString() @MaxLength(64) walletAccountId!: string;
|
|
6
|
+
@IsNumber() @IsPositive() amount!: number;
|
|
7
|
+
@IsString() @Length(3, 3) currencyCode!: string;
|
|
8
|
+
@IsString() @MaxLength(32) providerName!: string;
|
|
9
|
+
@IsString() @MaxLength(128) providerReference!: string;
|
|
10
|
+
@IsString() @MaxLength(64) providerTxId!: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BenefitPaymentStatusEnum } from "../../benefitCenter/enums/BenefitPaymentStatusEnum";
|
|
2
|
+
import { WalletFundingErrorCodeEnum } from "../enums/WalletFundingErrorCodeEnum";
|
|
3
|
+
|
|
4
|
+
export class ReverseWalletFundingResponse {
|
|
5
|
+
status!: BenefitPaymentStatusEnum;
|
|
6
|
+
errorCode?: WalletFundingErrorCodeEnum;
|
|
7
|
+
transactionNumber?: string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IsString, IsNumber, IsPositive, Length, MaxLength } from "class-validator";
|
|
2
|
+
|
|
3
|
+
export class ValidateWalletFundingRequest {
|
|
4
|
+
@IsString() @MaxLength(64) directoryId!: string;
|
|
5
|
+
@IsString() @MaxLength(64) walletAccountId!: string;
|
|
6
|
+
@IsNumber() @IsPositive() amount!: number;
|
|
7
|
+
@IsString() @Length(3, 3) currencyCode!: string;
|
|
8
|
+
@IsString() @MaxLength(32) providerName!: string;
|
|
9
|
+
@IsString() @MaxLength(128) providerReference!: string;
|
|
10
|
+
@IsString() @MaxLength(64) providerTxId!: string;
|
|
11
|
+
}
|