@fiado/type-kit 3.8.0 → 3.9.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 (43) hide show
  1. package/bin/benefitCenter/dtos/AuthorizeBenefitsMarketplaceTransactionRequest.d.ts +35 -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/FavoriteDetailResponse.d.ts +40 -0
  8. package/bin/benefitCenter/dtos/FavoriteDetailResponse.js +27 -0
  9. package/bin/benefitCenter/dtos/FavoriteItem.d.ts +21 -0
  10. package/bin/benefitCenter/dtos/FavoriteItem.js +10 -0
  11. package/bin/benefitCenter/dtos/FavoriteListResponse.d.ts +4 -0
  12. package/bin/benefitCenter/dtos/FavoriteListResponse.js +6 -0
  13. package/bin/benefitCenter/dtos/FavoriteReorderRequest.d.ts +13 -0
  14. package/bin/benefitCenter/dtos/FavoriteReorderRequest.js +42 -0
  15. package/bin/benefitCenter/dtos/FavoriteUpdateRequest.d.ts +15 -0
  16. package/bin/benefitCenter/dtos/FavoriteUpdateRequest.js +42 -0
  17. package/bin/benefitCenter/dtos/FavoriteUpsertContext.d.ts +24 -0
  18. package/bin/benefitCenter/dtos/FavoriteUpsertContext.js +18 -0
  19. package/bin/benefitCenter/dtos/FavoriteValidationResult.d.ts +34 -0
  20. package/bin/benefitCenter/dtos/FavoriteValidationResult.js +25 -0
  21. package/bin/benefitCenter/enums/BenefitPaymentErrorCodeEnum.d.ts +17 -0
  22. package/bin/benefitCenter/enums/BenefitPaymentErrorCodeEnum.js +21 -0
  23. package/bin/benefitCenter/enums/BenefitPaymentStatusEnum.d.ts +12 -0
  24. package/bin/benefitCenter/enums/BenefitPaymentStatusEnum.js +16 -0
  25. package/bin/benefitCenter/enums/FavoriteDisabledReasonEnum.d.ts +15 -0
  26. package/bin/benefitCenter/enums/FavoriteDisabledReasonEnum.js +19 -0
  27. package/bin/benefitCenter/index.d.ts +13 -0
  28. package/bin/benefitCenter/index.js +15 -0
  29. package/package.json +1 -1
  30. package/src/benefitCenter/dtos/AuthorizeBenefitsMarketplaceTransactionRequest.ts +92 -0
  31. package/src/benefitCenter/dtos/BenefitPaymentRequest.ts +78 -0
  32. package/src/benefitCenter/dtos/BenefitPaymentResponse.ts +28 -0
  33. package/src/benefitCenter/dtos/FavoriteDetailResponse.ts +43 -0
  34. package/src/benefitCenter/dtos/FavoriteItem.ts +25 -0
  35. package/src/benefitCenter/dtos/FavoriteListResponse.ts +5 -0
  36. package/src/benefitCenter/dtos/FavoriteReorderRequest.ts +32 -0
  37. package/src/benefitCenter/dtos/FavoriteUpdateRequest.ts +35 -0
  38. package/src/benefitCenter/dtos/FavoriteUpsertContext.ts +26 -0
  39. package/src/benefitCenter/dtos/FavoriteValidationResult.ts +37 -0
  40. package/src/benefitCenter/enums/BenefitPaymentErrorCodeEnum.ts +17 -0
  41. package/src/benefitCenter/enums/BenefitPaymentStatusEnum.ts +12 -0
  42. package/src/benefitCenter/enums/FavoriteDisabledReasonEnum.ts +15 -0
  43. package/src/benefitCenter/index.ts +15 -0
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Request del endpoint nuevo `POST /authorizeBenefitsMarketplaceTransaction`
3
+ * en `transaction-processor-business` (PublicController). Lo invoca la app
4
+ * para todos los flujos del Centro de Beneficios.
5
+ *
6
+ * NO se reusa `AuthorizePaymentTransactionRequest` ni similares: este DTO
7
+ * es dedicado, sin sub-objetos opcionales, con los campos del Centro como
8
+ * ciudadanos de primera clase.
9
+ *
10
+ * Los endpoints `authorize*Transaction` actuales del procesador no se tocan
11
+ * y siguen recibiendo su tráfico legacy. Ver doc Fase 2 §5.1.
12
+ */
13
+ export declare class AuthorizeBenefitsMarketplaceTransactionRequest {
14
+ /**
15
+ * Reusa entradas existentes en `ProductCatalog_GT` del procesador
16
+ * (`MEX_TOPUP`, `MEX_SERVICE_PAYMENT`, …). No se agregan entradas nuevas
17
+ * en Fase 2 (ver doc §10).
18
+ */
19
+ productCatalogId: string;
20
+ /** Idempotency key — viaja end-to-end (procesador → marketplace → conector). */
21
+ transactionNumber: string;
22
+ amount: number;
23
+ /** ISO numeric (3 chars). Ej: "484" (MXN), "840" (USD). */
24
+ currencyId: string;
25
+ benefitId: string;
26
+ leafId: string;
27
+ productId: string;
28
+ reference: string;
29
+ /** Decide a qué conector apuntar dentro del marketplace. */
30
+ moduleName: string;
31
+ /** Inputs dinámicos del leaf — opcionales según el servicio. */
32
+ inputs?: Record<string, string | number | boolean>;
33
+ latitude?: number;
34
+ longitude?: number;
35
+ }
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.AuthorizeBenefitsMarketplaceTransactionRequest = void 0;
13
+ const class_validator_1 = require("class-validator");
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
+ class AuthorizeBenefitsMarketplaceTransactionRequest {
27
+ }
28
+ exports.AuthorizeBenefitsMarketplaceTransactionRequest = AuthorizeBenefitsMarketplaceTransactionRequest;
29
+ __decorate([
30
+ (0, class_validator_1.IsString)(),
31
+ (0, class_validator_1.IsNotEmpty)(),
32
+ (0, class_validator_1.MaxLength)(64),
33
+ __metadata("design:type", String)
34
+ ], AuthorizeBenefitsMarketplaceTransactionRequest.prototype, "productCatalogId", void 0);
35
+ __decorate([
36
+ (0, class_validator_1.IsString)(),
37
+ (0, class_validator_1.IsNotEmpty)(),
38
+ (0, class_validator_1.MaxLength)(64),
39
+ __metadata("design:type", String)
40
+ ], AuthorizeBenefitsMarketplaceTransactionRequest.prototype, "transactionNumber", void 0);
41
+ __decorate([
42
+ (0, class_validator_1.IsNumber)(),
43
+ (0, class_validator_1.IsPositive)(),
44
+ __metadata("design:type", Number)
45
+ ], AuthorizeBenefitsMarketplaceTransactionRequest.prototype, "amount", void 0);
46
+ __decorate([
47
+ (0, class_validator_1.IsString)(),
48
+ (0, class_validator_1.Length)(3, 3),
49
+ __metadata("design:type", String)
50
+ ], AuthorizeBenefitsMarketplaceTransactionRequest.prototype, "currencyId", void 0);
51
+ __decorate([
52
+ (0, class_validator_1.IsString)(),
53
+ (0, class_validator_1.IsNotEmpty)(),
54
+ (0, class_validator_1.MaxLength)(64),
55
+ __metadata("design:type", String)
56
+ ], AuthorizeBenefitsMarketplaceTransactionRequest.prototype, "benefitId", void 0);
57
+ __decorate([
58
+ (0, class_validator_1.IsString)(),
59
+ (0, class_validator_1.IsNotEmpty)(),
60
+ (0, class_validator_1.MaxLength)(256),
61
+ __metadata("design:type", String)
62
+ ], AuthorizeBenefitsMarketplaceTransactionRequest.prototype, "leafId", void 0);
63
+ __decorate([
64
+ (0, class_validator_1.IsString)(),
65
+ (0, class_validator_1.IsNotEmpty)(),
66
+ (0, class_validator_1.MaxLength)(64),
67
+ __metadata("design:type", String)
68
+ ], AuthorizeBenefitsMarketplaceTransactionRequest.prototype, "productId", void 0);
69
+ __decorate([
70
+ (0, class_validator_1.IsString)(),
71
+ (0, class_validator_1.IsNotEmpty)(),
72
+ (0, class_validator_1.MaxLength)(128),
73
+ __metadata("design:type", String)
74
+ ], AuthorizeBenefitsMarketplaceTransactionRequest.prototype, "reference", void 0);
75
+ __decorate([
76
+ (0, class_validator_1.IsString)(),
77
+ (0, class_validator_1.IsNotEmpty)(),
78
+ (0, class_validator_1.MaxLength)(128),
79
+ __metadata("design:type", String)
80
+ ], AuthorizeBenefitsMarketplaceTransactionRequest.prototype, "moduleName", void 0);
81
+ __decorate([
82
+ (0, class_validator_1.IsOptional)(),
83
+ (0, class_validator_1.IsObject)(),
84
+ __metadata("design:type", Object)
85
+ ], AuthorizeBenefitsMarketplaceTransactionRequest.prototype, "inputs", void 0);
86
+ __decorate([
87
+ (0, class_validator_1.IsOptional)(),
88
+ (0, class_validator_1.IsLatitude)(),
89
+ __metadata("design:type", Number)
90
+ ], AuthorizeBenefitsMarketplaceTransactionRequest.prototype, "latitude", void 0);
91
+ __decorate([
92
+ (0, class_validator_1.IsOptional)(),
93
+ (0, class_validator_1.IsLongitude)(),
94
+ __metadata("design:type", Number)
95
+ ], AuthorizeBenefitsMarketplaceTransactionRequest.prototype, "longitude", void 0);
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Request del endpoint privado `POST /pay/{moduleName}` del marketplace
3
+ * (`benefits-marketplace-business`). Lo invoca el procesador desde
4
+ * `IBenefitsMarketplaceApi.pay(...)` cuando entra una transacción por el
5
+ * endpoint `authorizeBenefitsMarketplaceTransaction`.
6
+ *
7
+ * Es el MISMO contrato que reciben los conectores en su `POST /pay/standard`
8
+ * — el marketplace lo reenvía sin transformar (sin mappers legacy).
9
+ *
10
+ * Ver doc Fase 2 §4.1 y §8.1.
11
+ */
12
+ export declare class BenefitPaymentRequest {
13
+ directoryId: string;
14
+ benefitId: string;
15
+ leafId: string;
16
+ productId: string;
17
+ reference: string;
18
+ amount: number;
19
+ /**
20
+ * Idempotency key del pago (la genera el procesador y la usa el conector
21
+ * para no re-cobrar si el request se repite).
22
+ */
23
+ transactionNumber: string;
24
+ /**
25
+ * Inputs dinámicos del leaf (definidos por su `inputSchema`). Opcionales
26
+ * según el servicio.
27
+ */
28
+ inputs?: Record<string, string | number | boolean>;
29
+ latitude?: number;
30
+ longitude?: number;
31
+ }
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.BenefitPaymentRequest = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ /**
15
+ * Request del endpoint privado `POST /pay/{moduleName}` del marketplace
16
+ * (`benefits-marketplace-business`). Lo invoca el procesador desde
17
+ * `IBenefitsMarketplaceApi.pay(...)` cuando entra una transacción por el
18
+ * endpoint `authorizeBenefitsMarketplaceTransaction`.
19
+ *
20
+ * Es el MISMO contrato que reciben los conectores en su `POST /pay/standard`
21
+ * — el marketplace lo reenvía sin transformar (sin mappers legacy).
22
+ *
23
+ * Ver doc Fase 2 §4.1 y §8.1.
24
+ */
25
+ class BenefitPaymentRequest {
26
+ }
27
+ exports.BenefitPaymentRequest = BenefitPaymentRequest;
28
+ __decorate([
29
+ (0, class_validator_1.IsString)(),
30
+ (0, class_validator_1.IsNotEmpty)(),
31
+ (0, class_validator_1.MaxLength)(64),
32
+ __metadata("design:type", String)
33
+ ], BenefitPaymentRequest.prototype, "directoryId", void 0);
34
+ __decorate([
35
+ (0, class_validator_1.IsString)(),
36
+ (0, class_validator_1.IsNotEmpty)(),
37
+ (0, class_validator_1.MaxLength)(64),
38
+ __metadata("design:type", String)
39
+ ], BenefitPaymentRequest.prototype, "benefitId", void 0);
40
+ __decorate([
41
+ (0, class_validator_1.IsString)(),
42
+ (0, class_validator_1.IsNotEmpty)(),
43
+ (0, class_validator_1.MaxLength)(256),
44
+ __metadata("design:type", String)
45
+ ], BenefitPaymentRequest.prototype, "leafId", void 0);
46
+ __decorate([
47
+ (0, class_validator_1.IsString)(),
48
+ (0, class_validator_1.IsNotEmpty)(),
49
+ (0, class_validator_1.MaxLength)(64),
50
+ __metadata("design:type", String)
51
+ ], BenefitPaymentRequest.prototype, "productId", void 0);
52
+ __decorate([
53
+ (0, class_validator_1.IsString)(),
54
+ (0, class_validator_1.IsNotEmpty)(),
55
+ (0, class_validator_1.MaxLength)(128),
56
+ __metadata("design:type", String)
57
+ ], BenefitPaymentRequest.prototype, "reference", void 0);
58
+ __decorate([
59
+ (0, class_validator_1.IsNumber)(),
60
+ (0, class_validator_1.IsPositive)(),
61
+ __metadata("design:type", Number)
62
+ ], BenefitPaymentRequest.prototype, "amount", void 0);
63
+ __decorate([
64
+ (0, class_validator_1.IsString)(),
65
+ (0, class_validator_1.IsNotEmpty)(),
66
+ (0, class_validator_1.MaxLength)(64),
67
+ __metadata("design:type", String)
68
+ ], BenefitPaymentRequest.prototype, "transactionNumber", void 0);
69
+ __decorate([
70
+ (0, class_validator_1.IsOptional)(),
71
+ (0, class_validator_1.IsObject)(),
72
+ __metadata("design:type", Object)
73
+ ], BenefitPaymentRequest.prototype, "inputs", void 0);
74
+ __decorate([
75
+ (0, class_validator_1.IsOptional)(),
76
+ (0, class_validator_1.IsLatitude)(),
77
+ __metadata("design:type", Number)
78
+ ], BenefitPaymentRequest.prototype, "latitude", void 0);
79
+ __decorate([
80
+ (0, class_validator_1.IsOptional)(),
81
+ (0, class_validator_1.IsLongitude)(),
82
+ __metadata("design:type", Number)
83
+ ], BenefitPaymentRequest.prototype, "longitude", void 0);
@@ -0,0 +1,23 @@
1
+ import { BenefitPaymentErrorCodeEnum } from "../enums/BenefitPaymentErrorCodeEnum";
2
+ import { BenefitPaymentStatusEnum } from "../enums/BenefitPaymentStatusEnum";
3
+ /**
4
+ * Respuesta uniforme del marketplace al procesador, devuelta por el endpoint
5
+ * `POST /pay/{moduleName}`. La emite el marketplace tras invocar al conector
6
+ * — su shape NO depende del conector (el mapping interno → estándar lo hace
7
+ * el propio conector en `/pay/standard`).
8
+ *
9
+ * Sin decoradores `class-validator`: el procesador la consume tal cual viene
10
+ * por la red, no la valida. Ver doc Fase 2 §8.2.
11
+ */
12
+ export declare class BenefitPaymentResponse {
13
+ /** Estado final del pago. APPROVED dispara el upsert del favorito in-process. */
14
+ status: BenefitPaymentStatusEnum;
15
+ /** Tracking del proveedor externo (ej. STP authNum). Útil para auditoría. */
16
+ providerReference?: string;
17
+ /** Código en bruto del proveedor — sirve solo para debug. */
18
+ rawCode?: string;
19
+ /** Código canónico mapeado (cuando `status !== APPROVED`). */
20
+ errorCode?: BenefitPaymentErrorCodeEnum;
21
+ /** Mensaje legible asociado al error o al status. */
22
+ message?: string;
23
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BenefitPaymentResponse = void 0;
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
+ class BenefitPaymentResponse {
14
+ }
15
+ exports.BenefitPaymentResponse = BenefitPaymentResponse;
@@ -0,0 +1,40 @@
1
+ import { BenefitSummary } from "./BenefitSummary";
2
+ import { CatalogNode } from "./CatalogNode";
3
+ /**
4
+ * Selección previa del usuario que el frontend usa para pre-llenar el form
5
+ * de pago. La `reference` viaja en claro (es data del propio usuario,
6
+ * autenticado).
7
+ */
8
+ export declare class FavoriteSelection {
9
+ leafId: string;
10
+ productId: string;
11
+ amount: number | null;
12
+ reference: string;
13
+ }
14
+ /**
15
+ * Metadata del favorito en sí (para menús contextuales, ordenamiento, etc.).
16
+ */
17
+ export declare class FavoriteDetailMeta {
18
+ id: string;
19
+ alias: string | null;
20
+ photo: string | null;
21
+ position: number;
22
+ disabled: boolean;
23
+ usageCount: number;
24
+ lastUsedAt: number;
25
+ createdAt: number;
26
+ updatedAt: number;
27
+ }
28
+ /**
29
+ * Response de `GET /favorites/{id}`. Devuelve el shape del árbol del catálogo
30
+ * (BRANCH padre con los LEAFs hermanos del favorito; el LEAF del favorito
31
+ * trae `leaf` populado inline) más la selección previa y la metadata editable.
32
+ *
33
+ * El frontend reusa `renderCatalog(catalog)` sin caso especial.
34
+ */
35
+ export declare class FavoriteDetailResponse {
36
+ benefit: BenefitSummary;
37
+ catalog: CatalogNode;
38
+ selection: FavoriteSelection;
39
+ favorite: FavoriteDetailMeta;
40
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FavoriteDetailResponse = exports.FavoriteDetailMeta = exports.FavoriteSelection = void 0;
4
+ /**
5
+ * Selección previa del usuario que el frontend usa para pre-llenar el form
6
+ * de pago. La `reference` viaja en claro (es data del propio usuario,
7
+ * autenticado).
8
+ */
9
+ class FavoriteSelection {
10
+ }
11
+ exports.FavoriteSelection = FavoriteSelection;
12
+ /**
13
+ * Metadata del favorito en sí (para menús contextuales, ordenamiento, etc.).
14
+ */
15
+ class FavoriteDetailMeta {
16
+ }
17
+ exports.FavoriteDetailMeta = FavoriteDetailMeta;
18
+ /**
19
+ * Response de `GET /favorites/{id}`. Devuelve el shape del árbol del catálogo
20
+ * (BRANCH padre con los LEAFs hermanos del favorito; el LEAF del favorito
21
+ * trae `leaf` populado inline) más la selección previa y la metadata editable.
22
+ *
23
+ * El frontend reusa `renderCatalog(catalog)` sin caso especial.
24
+ */
25
+ class FavoriteDetailResponse {
26
+ }
27
+ exports.FavoriteDetailResponse = FavoriteDetailResponse;
@@ -0,0 +1,21 @@
1
+ import { FavoriteDisabledReasonEnum } from "../enums/FavoriteDisabledReasonEnum";
2
+ /**
3
+ * Ítem que viaja en `GET /favorites`. Representa un favorito ACTIVO
4
+ * (la lista filtra `disabled=true` por default).
5
+ */
6
+ export declare class FavoriteItem {
7
+ id: string;
8
+ benefitId: string;
9
+ leafId: string;
10
+ productId: string;
11
+ referenceMasked: string;
12
+ alias: string | null;
13
+ photo: string | null;
14
+ position: number;
15
+ disabled: boolean;
16
+ disabledReason: FavoriteDisabledReasonEnum | null;
17
+ lastProductId: string | null;
18
+ lastAmount: number | null;
19
+ usageCount: number;
20
+ lastUsedAt: number;
21
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FavoriteItem = void 0;
4
+ /**
5
+ * Ítem que viaja en `GET /favorites`. Representa un favorito ACTIVO
6
+ * (la lista filtra `disabled=true` por default).
7
+ */
8
+ class FavoriteItem {
9
+ }
10
+ exports.FavoriteItem = FavoriteItem;
@@ -0,0 +1,4 @@
1
+ import { FavoriteItem } from "./FavoriteItem";
2
+ export declare class FavoriteListResponse {
3
+ items: FavoriteItem[];
4
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FavoriteListResponse = void 0;
4
+ class FavoriteListResponse {
5
+ }
6
+ exports.FavoriteListResponse = FavoriteListResponse;
@@ -0,0 +1,13 @@
1
+ export declare class FavoriteReorderItem {
2
+ id: string;
3
+ position: number;
4
+ }
5
+ /**
6
+ * Body de `PATCH /favorites/reorder`. El frontend manda la lista completa con
7
+ * las posiciones finales (1, 2, 3, …); el backend confía y persiste.
8
+ *
9
+ * `items: []` es válido: equivale a no-op (drag sin cambios netos) y devuelve 204.
10
+ */
11
+ export declare class FavoriteReorderRequest {
12
+ items: FavoriteReorderItem[];
13
+ }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.FavoriteReorderRequest = exports.FavoriteReorderItem = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const class_transformer_1 = require("class-transformer");
15
+ class FavoriteReorderItem {
16
+ }
17
+ exports.FavoriteReorderItem = FavoriteReorderItem;
18
+ __decorate([
19
+ (0, class_validator_1.IsString)(),
20
+ (0, class_validator_1.IsNotEmpty)(),
21
+ __metadata("design:type", String)
22
+ ], FavoriteReorderItem.prototype, "id", void 0);
23
+ __decorate([
24
+ (0, class_validator_1.IsInt)(),
25
+ (0, class_validator_1.Min)(0),
26
+ __metadata("design:type", Number)
27
+ ], FavoriteReorderItem.prototype, "position", void 0);
28
+ /**
29
+ * Body de `PATCH /favorites/reorder`. El frontend manda la lista completa con
30
+ * las posiciones finales (1, 2, 3, …); el backend confía y persiste.
31
+ *
32
+ * `items: []` es válido: equivale a no-op (drag sin cambios netos) y devuelve 204.
33
+ */
34
+ class FavoriteReorderRequest {
35
+ }
36
+ exports.FavoriteReorderRequest = FavoriteReorderRequest;
37
+ __decorate([
38
+ (0, class_validator_1.IsArray)(),
39
+ (0, class_validator_1.ValidateNested)({ each: true }),
40
+ (0, class_transformer_1.Type)(() => FavoriteReorderItem),
41
+ __metadata("design:type", Array)
42
+ ], FavoriteReorderRequest.prototype, "items", void 0);
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Body de `PATCH /favorites/{id}`. Solo `alias` y `photo` son editables por
3
+ * el usuario.
4
+ *
5
+ * - `undefined` (campo ausente) → no se toca.
6
+ * - `null` → borra el valor actual.
7
+ * - `string` → setea el nuevo valor (validado).
8
+ *
9
+ * Si AMBOS llegan `undefined`, el manager devuelve `INVALID_PATCH_PAYLOAD`
10
+ * (PATCH vacío no aporta).
11
+ */
12
+ export declare class FavoriteUpdateRequest {
13
+ alias?: string | null;
14
+ photo?: string | null;
15
+ }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.FavoriteUpdateRequest = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ /**
15
+ * Body de `PATCH /favorites/{id}`. Solo `alias` y `photo` son editables por
16
+ * el usuario.
17
+ *
18
+ * - `undefined` (campo ausente) → no se toca.
19
+ * - `null` → borra el valor actual.
20
+ * - `string` → setea el nuevo valor (validado).
21
+ *
22
+ * Si AMBOS llegan `undefined`, el manager devuelve `INVALID_PATCH_PAYLOAD`
23
+ * (PATCH vacío no aporta).
24
+ */
25
+ class FavoriteUpdateRequest {
26
+ }
27
+ exports.FavoriteUpdateRequest = FavoriteUpdateRequest;
28
+ __decorate([
29
+ (0, class_validator_1.IsOptional)(),
30
+ (0, class_validator_1.ValidateIf)((_, value) => value !== null),
31
+ (0, class_validator_1.IsString)(),
32
+ (0, class_validator_1.Length)(1, 60),
33
+ (0, class_validator_1.Matches)(/^[^\u0000-\u001f<>]+$/, { message: "alias contiene caracteres no permitidos" }),
34
+ __metadata("design:type", String)
35
+ ], FavoriteUpdateRequest.prototype, "alias", void 0);
36
+ __decorate([
37
+ (0, class_validator_1.IsOptional)(),
38
+ (0, class_validator_1.ValidateIf)((_, value) => value !== null),
39
+ (0, class_validator_1.IsUrl)({ protocols: ["https"], require_protocol: true }),
40
+ (0, class_validator_1.MaxLength)(500),
41
+ __metadata("design:type", String)
42
+ ], FavoriteUpdateRequest.prototype, "photo", void 0);
@@ -0,0 +1,24 @@
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 declare class FavoriteUpsertContext {
14
+ directoryId: string;
15
+ benefitId: string;
16
+ leafId: string;
17
+ productId: string;
18
+ reference: string;
19
+ amount: number;
20
+ /** Idempotency key del pago — alimenta el GSI `transactionNumber-index`. */
21
+ transactionNumber: string;
22
+ /** Epoch ms — cuándo cerró la transacción exitosa en el conector. */
23
+ occurredAt: number;
24
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FavoriteUpsertContext = void 0;
4
+ /**
5
+ * Contexto que el `PaymentManager` del marketplace pasa a
6
+ * `FavoriteManager.upsertFromPayment(...)` para crear/actualizar el favorito
7
+ * tras un pago APPROVED.
8
+ *
9
+ * NO ES UN DTO DE REQUEST HTTP: vive solo dentro del proceso del lambda
10
+ * `benefits-marketplace-business`. Por eso no lleva decoradores de
11
+ * `class-validator` — nunca se deserializa desde un body HTTP.
12
+ *
13
+ * El procesador NO conoce este tipo (no participa en la lógica de favoritos).
14
+ * Ver doc Fase 2 §4.3 y §8.4.
15
+ */
16
+ class FavoriteUpsertContext {
17
+ }
18
+ exports.FavoriteUpsertContext = FavoriteUpsertContext;
@@ -0,0 +1,34 @@
1
+ import { AmountTypeEnum } from "../../servicePayment/enums/AmountTypeEnum";
2
+ import { FavoriteDisabledReasonEnum } from "../enums/FavoriteDisabledReasonEnum";
3
+ /**
4
+ * Información del leaf incluida en el response del validate cuando se pudo
5
+ * resolver. Si el leaf no existe (`reason === LEAF_NOT_FOUND`), no viaja.
6
+ */
7
+ export declare class FavoriteValidationLeaf {
8
+ name: string;
9
+ logo: string;
10
+ enabled: boolean;
11
+ }
12
+ /**
13
+ * Información del producto. `price` es `null` cuando `amountType === VARIABLE`
14
+ * (productos de monto abierto donde el usuario decide cuánto pagar).
15
+ */
16
+ export declare class FavoriteValidationProduct {
17
+ productId: string;
18
+ productName: string;
19
+ amountType: AmountTypeEnum;
20
+ price: number | null;
21
+ currency: string;
22
+ }
23
+ /**
24
+ * Resultado del endpoint `POST /favorites/{id}/validate`. Si `valid === false`,
25
+ * el backend ya marcó `disabled: true` con `disabledReason: <reason>` en la
26
+ * misma operación (excepto `USER`, que solo se setea por soft-delete del usuario).
27
+ */
28
+ export declare class FavoriteValidationResult {
29
+ id: string;
30
+ valid: boolean;
31
+ reason?: FavoriteDisabledReasonEnum;
32
+ leaf?: FavoriteValidationLeaf;
33
+ product?: FavoriteValidationProduct;
34
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FavoriteValidationResult = exports.FavoriteValidationProduct = exports.FavoriteValidationLeaf = void 0;
4
+ /**
5
+ * Información del leaf incluida en el response del validate cuando se pudo
6
+ * resolver. Si el leaf no existe (`reason === LEAF_NOT_FOUND`), no viaja.
7
+ */
8
+ class FavoriteValidationLeaf {
9
+ }
10
+ exports.FavoriteValidationLeaf = FavoriteValidationLeaf;
11
+ /**
12
+ * Información del producto. `price` es `null` cuando `amountType === VARIABLE`
13
+ * (productos de monto abierto donde el usuario decide cuánto pagar).
14
+ */
15
+ class FavoriteValidationProduct {
16
+ }
17
+ exports.FavoriteValidationProduct = FavoriteValidationProduct;
18
+ /**
19
+ * Resultado del endpoint `POST /favorites/{id}/validate`. Si `valid === false`,
20
+ * el backend ya marcó `disabled: true` con `disabledReason: <reason>` en la
21
+ * misma operación (excepto `USER`, que solo se setea por soft-delete del usuario).
22
+ */
23
+ class FavoriteValidationResult {
24
+ }
25
+ exports.FavoriteValidationResult = FavoriteValidationResult;
@@ -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 declare 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
+ }