@fiado/type-kit 3.8.1 → 3.11.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.
Files changed (92) hide show
  1. package/bin/benefitCenter/dtos/AuthorizeBenefitsMarketplaceTransactionRequest.d.ts +44 -0
  2. package/bin/benefitCenter/dtos/AuthorizeBenefitsMarketplaceTransactionRequest.js +95 -0
  3. package/bin/benefitCenter/dtos/BenefitPaymentRequest.d.ts +31 -0
  4. package/bin/benefitCenter/dtos/BenefitPaymentRequest.js +83 -0
  5. package/bin/benefitCenter/dtos/BenefitPaymentResponse.d.ts +23 -0
  6. package/bin/benefitCenter/dtos/BenefitPaymentResponse.js +15 -0
  7. package/bin/benefitCenter/dtos/FavoriteUpsertContext.d.ts +24 -0
  8. package/bin/benefitCenter/dtos/FavoriteUpsertContext.js +18 -0
  9. package/bin/benefitCenter/enums/BenefitPaymentErrorCodeEnum.d.ts +17 -0
  10. package/bin/benefitCenter/enums/BenefitPaymentErrorCodeEnum.js +21 -0
  11. package/bin/benefitCenter/enums/BenefitPaymentStatusEnum.d.ts +12 -0
  12. package/bin/benefitCenter/enums/BenefitPaymentStatusEnum.js +16 -0
  13. package/bin/benefitCenter/index.d.ts +6 -0
  14. package/bin/benefitCenter/index.js +7 -0
  15. package/bin/cognitoConnector/dtos/SignUpBackofficeRequest.d.ts +13 -0
  16. package/bin/cognitoConnector/dtos/SignUpBackofficeRequest.js +71 -0
  17. package/bin/comission-business/dtos/GenerateReportRequest.d.ts +10 -0
  18. package/bin/comission-business/dtos/GenerateReportRequest.js +2 -0
  19. package/bin/comission-business/dtos/GenerateReportResponse.d.ts +6 -0
  20. package/bin/comission-business/dtos/GenerateReportResponse.js +2 -0
  21. package/bin/comission-business/enums/PaymentStatusEnum.d.ts +5 -0
  22. package/bin/comission-business/enums/PaymentStatusEnum.js +9 -0
  23. package/bin/credit/dtos/CreditBannerStateResponse.d.ts +10 -0
  24. package/bin/credit/dtos/CreditBannerStateResponse.js +6 -0
  25. package/bin/credit/dtos/CreditDetailResponse.d.ts +23 -0
  26. package/bin/credit/dtos/CreditDetailResponse.js +6 -0
  27. package/bin/credit/dtos/CreditEligibilityResponse.d.ts +9 -0
  28. package/bin/credit/dtos/CreditEligibilityResponse.js +6 -0
  29. package/bin/credit/dtos/CreditMovementResponse.d.ts +20 -0
  30. package/bin/credit/dtos/CreditMovementResponse.js +9 -0
  31. package/bin/credit/dtos/CreditRequestCreate.d.ts +4 -0
  32. package/bin/credit/dtos/CreditRequestCreate.js +26 -0
  33. package/bin/credit/dtos/CreditRequestResponse.d.ts +7 -0
  34. package/bin/credit/dtos/CreditRequestResponse.js +6 -0
  35. package/bin/credit/dtos/CreditScheduleResponse.d.ts +18 -0
  36. package/bin/credit/dtos/CreditScheduleResponse.js +9 -0
  37. package/bin/credit/dtos/CreditStatementResponse.d.ts +11 -0
  38. package/bin/credit/dtos/CreditStatementResponse.js +9 -0
  39. package/bin/credit/dtos/EarlyPaymentRequest.d.ts +7 -0
  40. package/bin/credit/dtos/EarlyPaymentRequest.js +37 -0
  41. package/bin/credit/dtos/EarlyPaymentResponse.d.ts +11 -0
  42. package/bin/credit/dtos/EarlyPaymentResponse.js +6 -0
  43. package/bin/credit/dtos/internal/CreditBalanceRequest.d.ts +3 -0
  44. package/bin/credit/dtos/internal/CreditBalanceRequest.js +21 -0
  45. package/bin/credit/dtos/internal/CreditCollectionRequest.d.ts +11 -0
  46. package/bin/credit/dtos/internal/CreditCollectionRequest.js +59 -0
  47. package/bin/credit/dtos/internal/CreditCollectionResponse.d.ts +12 -0
  48. package/bin/credit/dtos/internal/CreditCollectionResponse.js +6 -0
  49. package/bin/credit/dtos/internal/CreditDisbursementRequest.d.ts +7 -0
  50. package/bin/credit/dtos/internal/CreditDisbursementRequest.js +43 -0
  51. package/bin/credit/dtos/internal/CreditDisbursementResponse.d.ts +8 -0
  52. package/bin/credit/dtos/internal/CreditDisbursementResponse.js +6 -0
  53. package/bin/credit/dtos/internal/CreditProfileRequest.d.ts +3 -0
  54. package/bin/credit/dtos/internal/CreditProfileRequest.js +23 -0
  55. package/bin/credit/dtos/internal/CreditReversalRequest.d.ts +5 -0
  56. package/bin/credit/dtos/internal/CreditReversalRequest.js +31 -0
  57. package/bin/credit/dtos/internal/CreditReversalResponse.d.ts +7 -0
  58. package/bin/credit/dtos/internal/CreditReversalResponse.js +6 -0
  59. package/bin/credit/dtos/internal/CreditTransferLoancoRequest.d.ts +8 -0
  60. package/bin/credit/dtos/internal/CreditTransferLoancoRequest.js +46 -0
  61. package/bin/credit/dtos/internal/CreditTransferLoancoResponse.d.ts +8 -0
  62. package/bin/credit/dtos/internal/CreditTransferLoancoResponse.js +6 -0
  63. package/bin/credit/dtos/internal/DocumentSignRequest.d.ts +3 -0
  64. package/bin/credit/dtos/internal/DocumentSignRequest.js +21 -0
  65. package/bin/credit/dtos/internal/LienApplyRequest.d.ts +7 -0
  66. package/bin/credit/dtos/internal/LienApplyRequest.js +45 -0
  67. package/bin/credit/enums/CollectionFrequencyEnum.d.ts +5 -0
  68. package/bin/credit/enums/CollectionFrequencyEnum.js +9 -0
  69. package/bin/credit/enums/CreditOperationEnum.d.ts +11 -0
  70. package/bin/credit/enums/CreditOperationEnum.js +15 -0
  71. package/bin/credit/enums/CreditStatusEnum.d.ts +12 -0
  72. package/bin/credit/enums/CreditStatusEnum.js +16 -0
  73. package/bin/credit/enums/DelinquencyLevelEnum.d.ts +9 -0
  74. package/bin/credit/enums/DelinquencyLevelEnum.js +13 -0
  75. package/bin/credit/enums/DocumentTypeEnum.d.ts +8 -0
  76. package/bin/credit/enums/DocumentTypeEnum.js +12 -0
  77. package/bin/credit/enums/OfferStatusEnum.d.ts +8 -0
  78. package/bin/credit/enums/OfferStatusEnum.js +12 -0
  79. package/bin/credit/enums/PaymentTypeEnum.d.ts +9 -0
  80. package/bin/credit/enums/PaymentTypeEnum.js +13 -0
  81. package/bin/credit/enums/ReconciliationStatusEnum.d.ts +6 -0
  82. package/bin/credit/enums/ReconciliationStatusEnum.js +10 -0
  83. package/bin/credit/enums/TransferStatusEnum.d.ts +8 -0
  84. package/bin/credit/enums/TransferStatusEnum.js +12 -0
  85. package/package.json +1 -1
  86. package/src/benefitCenter/dtos/AuthorizeBenefitsMarketplaceTransactionRequest.ts +101 -0
  87. package/src/benefitCenter/dtos/BenefitPaymentRequest.ts +78 -0
  88. package/src/benefitCenter/dtos/BenefitPaymentResponse.ts +28 -0
  89. package/src/benefitCenter/dtos/FavoriteUpsertContext.ts +26 -0
  90. package/src/benefitCenter/enums/BenefitPaymentErrorCodeEnum.ts +17 -0
  91. package/src/benefitCenter/enums/BenefitPaymentStatusEnum.ts +12 -0
  92. package/src/benefitCenter/index.ts +7 -0
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CollectionFrequencyEnum = void 0;
4
+ var CollectionFrequencyEnum;
5
+ (function (CollectionFrequencyEnum) {
6
+ CollectionFrequencyEnum["WEEKLY"] = "WEEKLY";
7
+ CollectionFrequencyEnum["BIWEEKLY"] = "BIWEEKLY";
8
+ CollectionFrequencyEnum["MONTHLY"] = "MONTHLY";
9
+ })(CollectionFrequencyEnum || (exports.CollectionFrequencyEnum = CollectionFrequencyEnum = {}));
@@ -0,0 +1,11 @@
1
+ export declare enum CreditOperationEnum {
2
+ DISBURSEMENT = "DISBURSEMENT",
3
+ COLLECTION = "COLLECTION",
4
+ COLLECTION_PARTIAL = "COLLECTION_PARTIAL",
5
+ COLLECTION_LIEN = "COLLECTION_LIEN",
6
+ EARLY_PAYMENT = "EARLY_PAYMENT",
7
+ TRANSFER_LOANCO = "TRANSFER_LOANCO",
8
+ REVERSAL = "REVERSAL",
9
+ INTEREST_ACCRUAL = "INTEREST_ACCRUAL",
10
+ FEE_CHARGE = "FEE_CHARGE"
11
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreditOperationEnum = void 0;
4
+ var CreditOperationEnum;
5
+ (function (CreditOperationEnum) {
6
+ CreditOperationEnum["DISBURSEMENT"] = "DISBURSEMENT";
7
+ CreditOperationEnum["COLLECTION"] = "COLLECTION";
8
+ CreditOperationEnum["COLLECTION_PARTIAL"] = "COLLECTION_PARTIAL";
9
+ CreditOperationEnum["COLLECTION_LIEN"] = "COLLECTION_LIEN";
10
+ CreditOperationEnum["EARLY_PAYMENT"] = "EARLY_PAYMENT";
11
+ CreditOperationEnum["TRANSFER_LOANCO"] = "TRANSFER_LOANCO";
12
+ CreditOperationEnum["REVERSAL"] = "REVERSAL";
13
+ CreditOperationEnum["INTEREST_ACCRUAL"] = "INTEREST_ACCRUAL";
14
+ CreditOperationEnum["FEE_CHARGE"] = "FEE_CHARGE";
15
+ })(CreditOperationEnum || (exports.CreditOperationEnum = CreditOperationEnum = {}));
@@ -0,0 +1,12 @@
1
+ export declare enum CreditStatusEnum {
2
+ PENDING_APPROVAL = "PENDING_APPROVAL",
3
+ APPROVED = "APPROVED",
4
+ ACTIVE = "ACTIVE",
5
+ CURRENT = "CURRENT",
6
+ DELINQUENT = "DELINQUENT",
7
+ DEFAULTED = "DEFAULTED",
8
+ PAID_OFF = "PAID_OFF",
9
+ CANCELLED = "CANCELLED",
10
+ RETURNED_TO_LOANCO = "RETURNED_TO_LOANCO",
11
+ WRITTEN_OFF = "WRITTEN_OFF"
12
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreditStatusEnum = void 0;
4
+ var CreditStatusEnum;
5
+ (function (CreditStatusEnum) {
6
+ CreditStatusEnum["PENDING_APPROVAL"] = "PENDING_APPROVAL";
7
+ CreditStatusEnum["APPROVED"] = "APPROVED";
8
+ CreditStatusEnum["ACTIVE"] = "ACTIVE";
9
+ CreditStatusEnum["CURRENT"] = "CURRENT";
10
+ CreditStatusEnum["DELINQUENT"] = "DELINQUENT";
11
+ CreditStatusEnum["DEFAULTED"] = "DEFAULTED";
12
+ CreditStatusEnum["PAID_OFF"] = "PAID_OFF";
13
+ CreditStatusEnum["CANCELLED"] = "CANCELLED";
14
+ CreditStatusEnum["RETURNED_TO_LOANCO"] = "RETURNED_TO_LOANCO";
15
+ CreditStatusEnum["WRITTEN_OFF"] = "WRITTEN_OFF";
16
+ })(CreditStatusEnum || (exports.CreditStatusEnum = CreditStatusEnum = {}));
@@ -0,0 +1,9 @@
1
+ export declare enum DelinquencyLevelEnum {
2
+ CURRENT = "CURRENT",
3
+ EARLY_1_7 = "EARLY_1_7",
4
+ EARLY_8_14 = "EARLY_8_14",
5
+ LATE_15_30 = "LATE_15_30",
6
+ LATE_31_60 = "LATE_31_60",
7
+ SEVERE_61_90 = "SEVERE_61_90",
8
+ DEFAULT_90_PLUS = "DEFAULT_90_PLUS"
9
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DelinquencyLevelEnum = void 0;
4
+ var DelinquencyLevelEnum;
5
+ (function (DelinquencyLevelEnum) {
6
+ DelinquencyLevelEnum["CURRENT"] = "CURRENT";
7
+ DelinquencyLevelEnum["EARLY_1_7"] = "EARLY_1_7";
8
+ DelinquencyLevelEnum["EARLY_8_14"] = "EARLY_8_14";
9
+ DelinquencyLevelEnum["LATE_15_30"] = "LATE_15_30";
10
+ DelinquencyLevelEnum["LATE_31_60"] = "LATE_31_60";
11
+ DelinquencyLevelEnum["SEVERE_61_90"] = "SEVERE_61_90";
12
+ DelinquencyLevelEnum["DEFAULT_90_PLUS"] = "DEFAULT_90_PLUS";
13
+ })(DelinquencyLevelEnum || (exports.DelinquencyLevelEnum = DelinquencyLevelEnum = {}));
@@ -0,0 +1,8 @@
1
+ export declare enum DocumentTypeEnum {
2
+ CREDIT_CONTRACT = "CREDIT_CONTRACT",
3
+ CREDIT_STATEMENT = "CREDIT_STATEMENT",
4
+ CREDIT_AMORTIZATION = "CREDIT_AMORTIZATION",
5
+ CREDIT_COVER_SHEET = "CREDIT_COVER_SHEET",
6
+ ONBOARDING_CONTRACT = "ONBOARDING_CONTRACT",
7
+ ONBOARDING_IFPE = "ONBOARDING_IFPE"
8
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DocumentTypeEnum = void 0;
4
+ var DocumentTypeEnum;
5
+ (function (DocumentTypeEnum) {
6
+ DocumentTypeEnum["CREDIT_CONTRACT"] = "CREDIT_CONTRACT";
7
+ DocumentTypeEnum["CREDIT_STATEMENT"] = "CREDIT_STATEMENT";
8
+ DocumentTypeEnum["CREDIT_AMORTIZATION"] = "CREDIT_AMORTIZATION";
9
+ DocumentTypeEnum["CREDIT_COVER_SHEET"] = "CREDIT_COVER_SHEET";
10
+ DocumentTypeEnum["ONBOARDING_CONTRACT"] = "ONBOARDING_CONTRACT";
11
+ DocumentTypeEnum["ONBOARDING_IFPE"] = "ONBOARDING_IFPE";
12
+ })(DocumentTypeEnum || (exports.DocumentTypeEnum = DocumentTypeEnum = {}));
@@ -0,0 +1,8 @@
1
+ export declare enum OfferStatusEnum {
2
+ NOT_ELIGIBLE = "NOT_ELIGIBLE",
3
+ PRE_QUALIFIED = "PRE_QUALIFIED",
4
+ OFFER_AVAILABLE = "OFFER_AVAILABLE",
5
+ OFFER_CONFIGURED = "OFFER_CONFIGURED",
6
+ OFFER_ACCEPTED = "OFFER_ACCEPTED",
7
+ OFFER_EXPIRED = "OFFER_EXPIRED"
8
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OfferStatusEnum = void 0;
4
+ var OfferStatusEnum;
5
+ (function (OfferStatusEnum) {
6
+ OfferStatusEnum["NOT_ELIGIBLE"] = "NOT_ELIGIBLE";
7
+ OfferStatusEnum["PRE_QUALIFIED"] = "PRE_QUALIFIED";
8
+ OfferStatusEnum["OFFER_AVAILABLE"] = "OFFER_AVAILABLE";
9
+ OfferStatusEnum["OFFER_CONFIGURED"] = "OFFER_CONFIGURED";
10
+ OfferStatusEnum["OFFER_ACCEPTED"] = "OFFER_ACCEPTED";
11
+ OfferStatusEnum["OFFER_EXPIRED"] = "OFFER_EXPIRED";
12
+ })(OfferStatusEnum || (exports.OfferStatusEnum = OfferStatusEnum = {}));
@@ -0,0 +1,9 @@
1
+ export declare enum PaymentTypeEnum {
2
+ REGULAR = "REGULAR",
3
+ PARTIAL = "PARTIAL",
4
+ EARLY_ANTICIPATED = "EARLY_ANTICIPATED",
5
+ EARLY_ADVANCED = "EARLY_ADVANCED",
6
+ EARLY_SETTLEMENT = "EARLY_SETTLEMENT",
7
+ LIEN = "LIEN",
8
+ REVERSAL = "REVERSAL"
9
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PaymentTypeEnum = void 0;
4
+ var PaymentTypeEnum;
5
+ (function (PaymentTypeEnum) {
6
+ PaymentTypeEnum["REGULAR"] = "REGULAR";
7
+ PaymentTypeEnum["PARTIAL"] = "PARTIAL";
8
+ PaymentTypeEnum["EARLY_ANTICIPATED"] = "EARLY_ANTICIPATED";
9
+ PaymentTypeEnum["EARLY_ADVANCED"] = "EARLY_ADVANCED";
10
+ PaymentTypeEnum["EARLY_SETTLEMENT"] = "EARLY_SETTLEMENT";
11
+ PaymentTypeEnum["LIEN"] = "LIEN";
12
+ PaymentTypeEnum["REVERSAL"] = "REVERSAL";
13
+ })(PaymentTypeEnum || (exports.PaymentTypeEnum = PaymentTypeEnum = {}));
@@ -0,0 +1,6 @@
1
+ export declare enum ReconciliationStatusEnum {
2
+ PENDING = "PENDING",
3
+ MATCHED = "MATCHED",
4
+ DISCREPANCY = "DISCREPANCY",
5
+ RESOLVED = "RESOLVED"
6
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReconciliationStatusEnum = void 0;
4
+ var ReconciliationStatusEnum;
5
+ (function (ReconciliationStatusEnum) {
6
+ ReconciliationStatusEnum["PENDING"] = "PENDING";
7
+ ReconciliationStatusEnum["MATCHED"] = "MATCHED";
8
+ ReconciliationStatusEnum["DISCREPANCY"] = "DISCREPANCY";
9
+ ReconciliationStatusEnum["RESOLVED"] = "RESOLVED";
10
+ })(ReconciliationStatusEnum || (exports.ReconciliationStatusEnum = ReconciliationStatusEnum = {}));
@@ -0,0 +1,8 @@
1
+ export declare enum TransferStatusEnum {
2
+ PENDING = "PENDING",
3
+ APPROVED = "APPROVED",
4
+ IN_PROGRESS = "IN_PROGRESS",
5
+ COMPLETED = "COMPLETED",
6
+ FAILED = "FAILED",
7
+ REJECTED = "REJECTED"
8
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TransferStatusEnum = void 0;
4
+ var TransferStatusEnum;
5
+ (function (TransferStatusEnum) {
6
+ TransferStatusEnum["PENDING"] = "PENDING";
7
+ TransferStatusEnum["APPROVED"] = "APPROVED";
8
+ TransferStatusEnum["IN_PROGRESS"] = "IN_PROGRESS";
9
+ TransferStatusEnum["COMPLETED"] = "COMPLETED";
10
+ TransferStatusEnum["FAILED"] = "FAILED";
11
+ TransferStatusEnum["REJECTED"] = "REJECTED";
12
+ })(TransferStatusEnum || (exports.TransferStatusEnum = TransferStatusEnum = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.8.1",
3
+ "version": "3.11.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -0,0 +1,101 @@
1
+ import {
2
+ IsLatitude,
3
+ IsLongitude,
4
+ IsNotEmpty,
5
+ IsNumber,
6
+ IsObject,
7
+ IsOptional,
8
+ IsPositive,
9
+ IsString,
10
+ Length,
11
+ MaxLength,
12
+ } from "class-validator";
13
+
14
+ /**
15
+ * Request del endpoint nuevo `POST /authorizeBenefitsMarketplaceTransaction`
16
+ * en `transaction-processor-business` (PublicController). Lo invoca la app
17
+ * para todos los flujos del Centro de Beneficios.
18
+ *
19
+ * NO se reusa `AuthorizePaymentTransactionRequest` ni similares: este DTO
20
+ * es dedicado, sin sub-objetos opcionales, con los campos del Centro como
21
+ * ciudadanos de primera clase.
22
+ *
23
+ * Los endpoints `authorize*Transaction` actuales del procesador no se tocan
24
+ * y siguen recibiendo su tráfico legacy. Ver doc Fase 2 §5.1.
25
+ */
26
+ export class AuthorizeBenefitsMarketplaceTransactionRequest {
27
+ /**
28
+ * Reusa entradas existentes en `ProductCatalog_GT` del procesador
29
+ * (`MEX_TOPUP`, `MEX_SERVICE_PAYMENT`, …). No se agregan entradas nuevas
30
+ * en Fase 2 (ver doc §10).
31
+ */
32
+ @IsString()
33
+ @IsNotEmpty()
34
+ @MaxLength(64)
35
+ productCatalogId!: string;
36
+
37
+ /**
38
+ * Idempotency key generada por la **app** (UUID por intento).
39
+ * Lo consume el decorador `@IdempotencyController` del procesador para
40
+ * deduplicar reintentos del cliente.
41
+ *
42
+ * Distinto de `BenefitPaymentRequest.transactionNumber` que el procesador
43
+ * genera internamente al crear la transacción y envía al marketplace y
44
+ * al conector como idempotency key del lado del proveedor. La app NO
45
+ * debe generar `transactionNumber` — por eso este DTO no lo expone.
46
+ */
47
+ @IsString()
48
+ @IsNotEmpty()
49
+ @MaxLength(64)
50
+ idempotencyKey!: string;
51
+
52
+ @IsNumber()
53
+ @IsPositive()
54
+ amount!: number;
55
+
56
+ /** ISO numeric (3 chars). Ej: "484" (MXN), "840" (USD). */
57
+ @IsString()
58
+ @Length(3, 3)
59
+ currencyId!: string;
60
+
61
+ // Campos del Centro de Beneficios — first-class, no opcionales
62
+
63
+ @IsString()
64
+ @IsNotEmpty()
65
+ @MaxLength(64)
66
+ benefitId!: string;
67
+
68
+ @IsString()
69
+ @IsNotEmpty()
70
+ @MaxLength(256)
71
+ leafId!: string;
72
+
73
+ @IsString()
74
+ @IsNotEmpty()
75
+ @MaxLength(64)
76
+ productId!: string;
77
+
78
+ @IsString()
79
+ @IsNotEmpty()
80
+ @MaxLength(128)
81
+ reference!: string;
82
+
83
+ /** Decide a qué conector apuntar dentro del marketplace. */
84
+ @IsString()
85
+ @IsNotEmpty()
86
+ @MaxLength(128)
87
+ moduleName!: string;
88
+
89
+ /** Inputs dinámicos del leaf — opcionales según el servicio. */
90
+ @IsOptional()
91
+ @IsObject()
92
+ inputs?: Record<string, string | number | boolean>;
93
+
94
+ @IsOptional()
95
+ @IsLatitude()
96
+ latitude?: number;
97
+
98
+ @IsOptional()
99
+ @IsLongitude()
100
+ longitude?: number;
101
+ }
@@ -0,0 +1,78 @@
1
+ import {
2
+ IsLatitude,
3
+ IsLongitude,
4
+ IsNotEmpty,
5
+ IsNumber,
6
+ IsObject,
7
+ IsOptional,
8
+ IsPositive,
9
+ IsString,
10
+ MaxLength,
11
+ } from "class-validator";
12
+
13
+ /**
14
+ * Request del endpoint privado `POST /pay/{moduleName}` del marketplace
15
+ * (`benefits-marketplace-business`). Lo invoca el procesador desde
16
+ * `IBenefitsMarketplaceApi.pay(...)` cuando entra una transacción por el
17
+ * endpoint `authorizeBenefitsMarketplaceTransaction`.
18
+ *
19
+ * Es el MISMO contrato que reciben los conectores en su `POST /pay/standard`
20
+ * — el marketplace lo reenvía sin transformar (sin mappers legacy).
21
+ *
22
+ * Ver doc Fase 2 §4.1 y §8.1.
23
+ */
24
+ export class BenefitPaymentRequest {
25
+ @IsString()
26
+ @IsNotEmpty()
27
+ @MaxLength(64)
28
+ directoryId!: string;
29
+
30
+ @IsString()
31
+ @IsNotEmpty()
32
+ @MaxLength(64)
33
+ benefitId!: string;
34
+
35
+ @IsString()
36
+ @IsNotEmpty()
37
+ @MaxLength(256)
38
+ leafId!: string;
39
+
40
+ @IsString()
41
+ @IsNotEmpty()
42
+ @MaxLength(64)
43
+ productId!: string;
44
+
45
+ @IsString()
46
+ @IsNotEmpty()
47
+ @MaxLength(128)
48
+ reference!: string;
49
+
50
+ @IsNumber()
51
+ @IsPositive()
52
+ amount!: number;
53
+
54
+ /**
55
+ * Idempotency key del pago (la genera el procesador y la usa el conector
56
+ * para no re-cobrar si el request se repite).
57
+ */
58
+ @IsString()
59
+ @IsNotEmpty()
60
+ @MaxLength(64)
61
+ transactionNumber!: string;
62
+
63
+ /**
64
+ * Inputs dinámicos del leaf (definidos por su `inputSchema`). Opcionales
65
+ * según el servicio.
66
+ */
67
+ @IsOptional()
68
+ @IsObject()
69
+ inputs?: Record<string, string | number | boolean>;
70
+
71
+ @IsOptional()
72
+ @IsLatitude()
73
+ latitude?: number;
74
+
75
+ @IsOptional()
76
+ @IsLongitude()
77
+ longitude?: number;
78
+ }
@@ -0,0 +1,28 @@
1
+ import { BenefitPaymentErrorCodeEnum } from "../enums/BenefitPaymentErrorCodeEnum";
2
+ import { BenefitPaymentStatusEnum } from "../enums/BenefitPaymentStatusEnum";
3
+
4
+ /**
5
+ * Respuesta uniforme del marketplace al procesador, devuelta por el endpoint
6
+ * `POST /pay/{moduleName}`. La emite el marketplace tras invocar al conector
7
+ * — su shape NO depende del conector (el mapping interno → estándar lo hace
8
+ * el propio conector en `/pay/standard`).
9
+ *
10
+ * Sin decoradores `class-validator`: el procesador la consume tal cual viene
11
+ * por la red, no la valida. Ver doc Fase 2 §8.2.
12
+ */
13
+ export class BenefitPaymentResponse {
14
+ /** Estado final del pago. APPROVED dispara el upsert del favorito in-process. */
15
+ status: BenefitPaymentStatusEnum;
16
+
17
+ /** Tracking del proveedor externo (ej. STP authNum). Útil para auditoría. */
18
+ providerReference?: string;
19
+
20
+ /** Código en bruto del proveedor — sirve solo para debug. */
21
+ rawCode?: string;
22
+
23
+ /** Código canónico mapeado (cuando `status !== APPROVED`). */
24
+ errorCode?: BenefitPaymentErrorCodeEnum;
25
+
26
+ /** Mensaje legible asociado al error o al status. */
27
+ message?: string;
28
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Contexto que el `PaymentManager` del marketplace pasa a
3
+ * `FavoriteManager.upsertFromPayment(...)` para crear/actualizar el favorito
4
+ * tras un pago APPROVED.
5
+ *
6
+ * NO ES UN DTO DE REQUEST HTTP: vive solo dentro del proceso del lambda
7
+ * `benefits-marketplace-business`. Por eso no lleva decoradores de
8
+ * `class-validator` — nunca se deserializa desde un body HTTP.
9
+ *
10
+ * El procesador NO conoce este tipo (no participa en la lógica de favoritos).
11
+ * Ver doc Fase 2 §4.3 y §8.4.
12
+ */
13
+ export class FavoriteUpsertContext {
14
+ directoryId: string;
15
+ benefitId: string;
16
+ leafId: string;
17
+ productId: string;
18
+ reference: string;
19
+ amount: number;
20
+
21
+ /** Idempotency key del pago — alimenta el GSI `transactionNumber-index`. */
22
+ transactionNumber: string;
23
+
24
+ /** Epoch ms — cuándo cerró la transacción exitosa en el conector. */
25
+ occurredAt: number;
26
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Códigos canónicos de error del pago. Cada conector mapea sus errores internos
3
+ * a esta lista antes de devolverle al marketplace. Solo se popula cuando
4
+ * `status === REJECTED` (o `PENDING` si el conector quiere comunicar la causa
5
+ * de la espera).
6
+ *
7
+ * Lista canónica documentada en doc Fase 2 §6.5.
8
+ */
9
+ export enum BenefitPaymentErrorCodeEnum {
10
+ LEAF_NOT_FOUND = "LEAF_NOT_FOUND",
11
+ LEAF_DISABLED = "LEAF_DISABLED",
12
+ LEAF_NOT_VISIBLE = "LEAF_NOT_VISIBLE",
13
+ PRODUCT_NOT_FOUND = "PRODUCT_NOT_FOUND",
14
+ PROVIDER_REJECTED = "PROVIDER_REJECTED",
15
+ PROVIDER_TIMEOUT = "PROVIDER_TIMEOUT",
16
+ INSUFFICIENT_FUNDS = "INSUFFICIENT_FUNDS",
17
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Estado del pago devuelto por el marketplace al procesador.
3
+ *
4
+ * Lo decide el conector (STP, Multicomm, donaciones, etc.) en su `/pay/standard`;
5
+ * el marketplace lo reenvía sin transformar. APPROVED dispara el upsert in-process
6
+ * del favorito (ver doc Fase 2 §4.3); REJECTED y PENDING no.
7
+ */
8
+ export enum BenefitPaymentStatusEnum {
9
+ APPROVED = "APPROVED",
10
+ REJECTED = "REJECTED",
11
+ PENDING = "PENDING",
12
+ }
@@ -9,6 +9,8 @@ export * from "./enums/BannerLocaleEnum";
9
9
  export * from "./enums/BannerScreenEnum";
10
10
  export * from "./enums/BannerTemplateVariantEnum";
11
11
  export * from "./enums/FavoriteDisabledReasonEnum";
12
+ export * from "./enums/BenefitPaymentStatusEnum";
13
+ export * from "./enums/BenefitPaymentErrorCodeEnum";
12
14
 
13
15
  //DTOs
14
16
  export * from "./dtos/BenefitItem";
@@ -51,3 +53,8 @@ export * from "./dtos/FavoriteValidationResult";
51
53
  export * from "./dtos/FavoriteDetailResponse";
52
54
  export * from "./dtos/FavoriteUpdateRequest";
53
55
  export * from "./dtos/FavoriteReorderRequest";
56
+ //Phase 2 — Payments + favorite upsert context (v3.9.0)
57
+ export * from "./dtos/BenefitPaymentRequest";
58
+ export * from "./dtos/BenefitPaymentResponse";
59
+ export * from "./dtos/AuthorizeBenefitsMarketplaceTransactionRequest";
60
+ export * from "./dtos/FavoriteUpsertContext";