@fiado/type-kit 3.560.0 → 3.562.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 (59) hide show
  1. package/_test_/unit/directDeposit/directDepositDtos.test.ts +38 -0
  2. package/_test_/unit/pdfGenerator/pdfGeneratorDtos.test.ts +29 -0
  3. package/_test_/unit/retailPromotions/constants.test.ts +6 -1
  4. package/_test_/unit/retailPromotions/salePromotionRequests.test.ts +21 -0
  5. package/_test_/unit/retailWizard/accessorySaleRequests.test.ts +6 -8
  6. package/bin/directDeposit/dtos/DirectDepositFormatResponse.d.ts +4 -0
  7. package/bin/directDeposit/dtos/DirectDepositFormatResponse.js +7 -0
  8. package/bin/directDeposit/dtos/GetDirectDepositFormatByDirectoryRequest.d.ts +6 -0
  9. package/bin/directDeposit/dtos/GetDirectDepositFormatByDirectoryRequest.js +31 -0
  10. package/bin/directDeposit/dtos/GetDirectDepositFormatRequest.d.ts +5 -0
  11. package/bin/directDeposit/dtos/GetDirectDepositFormatRequest.js +26 -0
  12. package/bin/directDeposit/index.d.ts +3 -0
  13. package/bin/directDeposit/index.js +20 -0
  14. package/bin/pdfGenerator/dtos/PdfGeneratorPageConfig.d.ts +28 -0
  15. package/bin/pdfGenerator/dtos/PdfGeneratorPageConfig.js +14 -0
  16. package/bin/pdfGenerator/dtos/PdfGeneratorRequest.d.ts +9 -0
  17. package/bin/pdfGenerator/dtos/PdfGeneratorRequest.js +33 -0
  18. package/bin/pdfGenerator/dtos/PdfGeneratorResponse.d.ts +4 -0
  19. package/bin/pdfGenerator/dtos/PdfGeneratorResponse.js +7 -0
  20. package/bin/pdfGenerator/index.d.ts +3 -0
  21. package/bin/pdfGenerator/index.js +20 -0
  22. package/bin/retailPromotions/constants/retailPromotionsErrorHttpStatus.js +1 -0
  23. package/bin/retailPromotions/dtos/SalePromotion.d.ts +4 -0
  24. package/bin/retailPromotions/dtos/requests/CreateSalePromotionRequest.d.ts +4 -1
  25. package/bin/retailPromotions/dtos/requests/CreateSalePromotionRequest.js +8 -0
  26. package/bin/retailPromotions/dtos/requests/UpdateSalePromotionRequest.d.ts +4 -1
  27. package/bin/retailPromotions/dtos/requests/UpdateSalePromotionRequest.js +8 -0
  28. package/bin/retailPromotions/dtos/responses/WizardSalePromotionResponses.d.ts +7 -2
  29. package/bin/retailPromotions/enums/PromotionAppliesToEnum.d.ts +1 -0
  30. package/bin/retailPromotions/enums/PromotionAppliesToEnum.js +1 -0
  31. package/bin/retailPromotions/enums/PromotionPaymentOptionEnum.d.ts +15 -0
  32. package/bin/retailPromotions/enums/PromotionPaymentOptionEnum.js +19 -0
  33. package/bin/retailPromotions/enums/RetailPromotionsErrorCodeEnum.d.ts +3 -1
  34. package/bin/retailPromotions/enums/RetailPromotionsErrorCodeEnum.js +2 -0
  35. package/bin/retailPromotions/index.d.ts +1 -0
  36. package/bin/retailPromotions/index.js +1 -0
  37. package/bin/retailWizard/dtos/requests/CreateAccessorySaleRequest.d.ts +0 -4
  38. package/bin/retailWizard/dtos/requests/CreateAccessorySaleRequest.js +0 -12
  39. package/bin/retailWizard/dtos/responses/PrivateWizardSessionResponse.d.ts +3 -0
  40. package/package.json +1 -1
  41. package/src/directDeposit/dtos/DirectDepositFormatResponse.ts +4 -0
  42. package/src/directDeposit/dtos/GetDirectDepositFormatByDirectoryRequest.ts +12 -0
  43. package/src/directDeposit/dtos/GetDirectDepositFormatRequest.ts +9 -0
  44. package/src/directDeposit/index.ts +4 -0
  45. package/src/pdfGenerator/dtos/PdfGeneratorPageConfig.ts +22 -0
  46. package/src/pdfGenerator/dtos/PdfGeneratorRequest.ts +16 -0
  47. package/src/pdfGenerator/dtos/PdfGeneratorResponse.ts +4 -0
  48. package/src/pdfGenerator/index.ts +4 -0
  49. package/src/retailPromotions/constants/retailPromotionsErrorHttpStatus.ts +1 -0
  50. package/src/retailPromotions/dtos/SalePromotion.ts +4 -0
  51. package/src/retailPromotions/dtos/requests/CreateSalePromotionRequest.ts +10 -1
  52. package/src/retailPromotions/dtos/requests/UpdateSalePromotionRequest.ts +10 -1
  53. package/src/retailPromotions/dtos/responses/WizardSalePromotionResponses.ts +7 -2
  54. package/src/retailPromotions/enums/PromotionAppliesToEnum.ts +1 -0
  55. package/src/retailPromotions/enums/PromotionPaymentOptionEnum.ts +15 -0
  56. package/src/retailPromotions/enums/RetailPromotionsErrorCodeEnum.ts +2 -0
  57. package/src/retailPromotions/index.ts +1 -0
  58. package/src/retailWizard/dtos/requests/CreateAccessorySaleRequest.ts +0 -16
  59. package/src/retailWizard/dtos/responses/PrivateWizardSessionResponse.ts +3 -0
@@ -0,0 +1,38 @@
1
+ import 'reflect-metadata';
2
+ import { plainToInstance } from 'class-transformer';
3
+ import { validate } from 'class-validator';
4
+ import { GetDirectDepositFormatByDirectoryRequest, GetDirectDepositFormatRequest } from '../../../src/directDeposit';
5
+
6
+ const parse = async <T extends object>(cls: new () => T, query: unknown) => {
7
+ const instance = plainToInstance(cls, query);
8
+ const errors = (await validate(instance as object, { whitelist: true })).map(e => e.property);
9
+ return { instance, errors };
10
+ };
11
+
12
+ describe('GetDirectDepositFormatRequest (app: el directoryId sale del token)', () => {
13
+ it('convierte percentage de string (query) a número', async () => {
14
+ const { instance, errors } = await parse(GetDirectDepositFormatRequest, { percentage: '50' });
15
+ expect(errors).toEqual([]);
16
+ expect(instance.percentage).toBe(50);
17
+ });
18
+
19
+ it('percentage es opcional', async () => {
20
+ expect((await parse(GetDirectDepositFormatRequest, {})).errors).toEqual([]);
21
+ });
22
+
23
+ it.each(['0', '101', '12.5', 'abc'])('rechaza percentage=%s', async (percentage) => {
24
+ expect((await parse(GetDirectDepositFormatRequest, { percentage })).errors).toEqual(['percentage']);
25
+ });
26
+ });
27
+
28
+ describe('GetDirectDepositFormatByDirectoryRequest (agentes y backoffice)', () => {
29
+ it('acepta directoryId con percentage', async () => {
30
+ const { instance, errors } = await parse(GetDirectDepositFormatByDirectoryRequest, { directoryId: 'dir-1', percentage: '30' });
31
+ expect(errors).toEqual([]);
32
+ expect(instance.percentage).toBe(30);
33
+ });
34
+
35
+ it.each([[{}], [{ directoryId: '' }]])('directoryId es obligatorio (%j)', async (query) => {
36
+ expect((await parse(GetDirectDepositFormatByDirectoryRequest, query)).errors).toEqual(['directoryId']);
37
+ });
38
+ });
@@ -0,0 +1,29 @@
1
+ import 'reflect-metadata';
2
+ import { plainToInstance } from 'class-transformer';
3
+ import { validate } from 'class-validator';
4
+ import { PdfGeneratorRequest } from '../../../src/pdfGenerator';
5
+
6
+ const errorsOf = async (body: unknown) =>
7
+ (await validate(plainToInstance(PdfGeneratorRequest, body) as object, { whitelist: true })).map(e => e.property);
8
+
9
+ describe('pdfGenerator DTOs', () => {
10
+ it('acepta html con page y provider', async () => {
11
+ expect(await errorsOf({
12
+ html: '<p>x</p>',
13
+ page: { size: 'A4', margin: { top: '45pt', right: '45pt', bottom: '45pt', left: '45pt' } },
14
+ provider: 'pdflib',
15
+ })).toEqual([]);
16
+ });
17
+
18
+ it('acepta solo html', async () => {
19
+ expect(await errorsOf({ html: '<p>x</p>' })).toEqual([]);
20
+ });
21
+
22
+ it('rechaza html vacío y provider desconocido', async () => {
23
+ expect((await errorsOf({ html: '', provider: 'chrome' })).sort()).toEqual(['html', 'provider']);
24
+ });
25
+
26
+ it('rechaza page que no es objeto', async () => {
27
+ expect(await errorsOf({ html: '<p>x</p>', page: 'A4' })).toEqual(['page']);
28
+ });
29
+ });
@@ -43,10 +43,15 @@ describe('catálogo de errores', () => {
43
43
  expect(RETAIL_PROMOTIONS_ERROR_HTTP_STATUS.CODE_NOT_FOUND).toBe(404);
44
44
  expect(RETAIL_PROMOTIONS_ERROR_HTTP_STATUS.DISCOUNT_AFTER_QUOTE).toBe(409);
45
45
  expect(RETAIL_PROMOTIONS_ERROR_HTTP_STATUS.CODE_NOT_OWNED).toBe(422);
46
- expect(Object.keys(RetailPromotionsErrorCodeEnum)).toHaveLength(31);
46
+ expect(Object.keys(RetailPromotionsErrorCodeEnum)).toHaveLength(32);
47
47
  expect(RETAIL_PROMOTIONS_ERROR_HTTP_STATUS.SPLIT_FINANCING_DISABLED).toBe(409);
48
48
  });
49
49
 
50
+ it('la forma de pago que la promo no acepta es 422', () => {
51
+ expect(RetailPromotionsErrorCodeEnum.PROMOTION_PAYMENT_NOT_ELIGIBLE).toBe('PROMOTION_PAYMENT_NOT_ELIGIBLE');
52
+ expect(RETAIL_PROMOTIONS_ERROR_HTTP_STATUS.PROMOTION_PAYMENT_NOT_ELIGIBLE).toBe(422);
53
+ });
54
+
50
55
  it('promo de regalo y de venta mandadas en el campo equivocado son 422', () => {
51
56
  expect(RetailPromotionsErrorCodeEnum.PROMOTION_KIND_MISMATCH).toBe('PROMOTION_KIND_MISMATCH');
52
57
  expect(RETAIL_PROMOTIONS_ERROR_HTTP_STATUS.PROMOTION_KIND_MISMATCH).toBe(422);
@@ -8,6 +8,7 @@ import {
8
8
  ListSalePromotionLogQuery,
9
9
  ListSalePromotionsQuery,
10
10
  PromotionAppliesToEnum,
11
+ PromotionPaymentOptionEnum,
11
12
  SalePromotionTransitionEnum,
12
13
  UpdateSalePromotionRequest,
13
14
  } from '../../../src/retailPromotions/index';
@@ -157,3 +158,23 @@ describe('queries paginadas', () => {
157
158
  expect(await errorPaths(ListSalePromotionLogQuery, { format: 'XLSX' })).toContain('format');
158
159
  });
159
160
  });
161
+
162
+ describe('paymentOptions en alta y edición', () => {
163
+ it.each([CreateSalePromotionRequest, UpdateSalePromotionRequest])('%p acepta lista del enum, null o ausente', async (dto) => {
164
+ const full = dto === CreateSalePromotionRequest ? base : {};
165
+ const all = Object.values(PromotionPaymentOptionEnum);
166
+ expect(await errorPaths(dto, { ...full, paymentOptions: all })).toEqual([]);
167
+ expect(await errorPaths(dto, { ...full, paymentOptions: null })).toEqual([]);
168
+ expect(await errorPaths(dto, full)).toEqual([]);
169
+ });
170
+
171
+ it.each([CreateSalePromotionRequest, UpdateSalePromotionRequest])('%p rechaza un valor fuera del enum', async (dto) => {
172
+ const full = dto === CreateSalePromotionRequest ? base : {};
173
+ expect(await errorPaths(dto, { ...full, paymentOptions: ['SUREKEEP', 'BITCOIN'] })).toEqual(['paymentOptions']);
174
+ expect(await errorPaths(dto, { ...full, paymentOptions: 'CASH' })).toEqual(['paymentOptions']);
175
+ });
176
+
177
+ it('el enum trae las 8 formas de pago', () => {
178
+ expect(Object.values(PromotionPaymentOptionEnum)).toEqual(['SUREKEEP', 'PAYJOY', 'CREDIYA', 'LESPAGO', 'INNOVA', 'CASH', 'CARD', 'WIRE']);
179
+ });
180
+ });
@@ -16,8 +16,6 @@ const validSale = {
16
16
  paymentMethod: SalePaymentMethodEnum.CASH,
17
17
  amountCents: 39800,
18
18
  paymentDetail: { cashConfirmedInRegister: true },
19
- privacyNoticeAccepted: true,
20
- privacyNoticeVersion: 'AVISO-2026-10',
21
19
  };
22
20
 
23
21
  describe('CreateAccessorySaleRequest', () => {
@@ -52,12 +50,12 @@ describe('CreateAccessorySaleRequest', () => {
52
50
  expect(errorsOf(CreateAccessorySaleRequest, rest)).toContain('paymentDetail');
53
51
  });
54
52
 
55
- it('exige la versión del aviso de privacidad', () => {
56
- expect(errorsOf(CreateAccessorySaleRequest, { ...validSale, privacyNoticeVersion: '' })).toContain('privacyNoticeVersion');
57
- });
58
-
59
- it('privacyNoticeAccepted no booleano → error de formato', () => {
60
- expect(errorsOf(CreateAccessorySaleRequest, { ...validSale, privacyNoticeAccepted: 'si' })).toContain('privacyNoticeAccepted');
53
+ it('no lleva aviso de privacidad: privacyNoticeAccepted y privacyNoticeVersion se descartan', () => {
54
+ const payload = { ...validSale, privacyNoticeAccepted: true, privacyNoticeVersion: 'AVISO-2026-10' };
55
+ const dto = plainToInstance(CreateAccessorySaleRequest, payload, { excludeExtraneousValues: true });
56
+ expect(dto).not.toHaveProperty('privacyNoticeAccepted');
57
+ expect(dto).not.toHaveProperty('privacyNoticeVersion');
58
+ expect(validateSync(dto)).toEqual([]);
61
59
  });
62
60
 
63
61
  it('el medio WIRE (SPEI) es válido', () => {
@@ -0,0 +1,4 @@
1
+ /** `data` de la respuesta: el PDF del formato Direct Deposit en base64. */
2
+ export declare class DirectDepositFormatResponse {
3
+ format: string;
4
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DirectDepositFormatResponse = void 0;
4
+ /** `data` de la respuesta: el PDF del formato Direct Deposit en base64. */
5
+ class DirectDepositFormatResponse {
6
+ }
7
+ exports.DirectDepositFormatResponse = DirectDepositFormatResponse;
@@ -0,0 +1,6 @@
1
+ /** Query de GET /agents/direct-deposit y /backoffice/direct-deposit (+ /v2): formato de un tercero. */
2
+ export declare class GetDirectDepositFormatByDirectoryRequest {
3
+ directoryId: string;
4
+ /** Porcentaje del cheque a depositar (1–100). Default 100. */
5
+ percentage?: number;
6
+ }
@@ -0,0 +1,31 @@
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.GetDirectDepositFormatByDirectoryRequest = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ /** Query de GET /agents/direct-deposit y /backoffice/direct-deposit (+ /v2): formato de un tercero. */
16
+ class GetDirectDepositFormatByDirectoryRequest {
17
+ }
18
+ exports.GetDirectDepositFormatByDirectoryRequest = GetDirectDepositFormatByDirectoryRequest;
19
+ __decorate([
20
+ (0, class_validator_1.IsString)(),
21
+ (0, class_validator_1.IsNotEmpty)(),
22
+ __metadata("design:type", String)
23
+ ], GetDirectDepositFormatByDirectoryRequest.prototype, "directoryId", void 0);
24
+ __decorate([
25
+ (0, class_validator_1.IsOptional)(),
26
+ (0, class_transformer_1.Type)(() => Number),
27
+ (0, class_validator_1.IsInt)(),
28
+ (0, class_validator_1.Min)(1),
29
+ (0, class_validator_1.Max)(100),
30
+ __metadata("design:type", Number)
31
+ ], GetDirectDepositFormatByDirectoryRequest.prototype, "percentage", void 0);
@@ -0,0 +1,5 @@
1
+ /** Query de GET /direct-deposit (app) de direct-deposit-export-business. El directoryId sale del token. */
2
+ export declare class GetDirectDepositFormatRequest {
3
+ /** Porcentaje del cheque a depositar (1–100). Default 100. */
4
+ percentage?: number;
5
+ }
@@ -0,0 +1,26 @@
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.GetDirectDepositFormatRequest = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ /** Query de GET /direct-deposit (app) de direct-deposit-export-business. El directoryId sale del token. */
16
+ class GetDirectDepositFormatRequest {
17
+ }
18
+ exports.GetDirectDepositFormatRequest = GetDirectDepositFormatRequest;
19
+ __decorate([
20
+ (0, class_validator_1.IsOptional)(),
21
+ (0, class_transformer_1.Type)(() => Number),
22
+ (0, class_validator_1.IsInt)(),
23
+ (0, class_validator_1.Min)(1),
24
+ (0, class_validator_1.Max)(100),
25
+ __metadata("design:type", Number)
26
+ ], GetDirectDepositFormatRequest.prototype, "percentage", void 0);
@@ -0,0 +1,3 @@
1
+ export * from './dtos/GetDirectDepositFormatRequest';
2
+ export * from './dtos/GetDirectDepositFormatByDirectoryRequest';
3
+ export * from './dtos/DirectDepositFormatResponse';
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ //dtos
18
+ __exportStar(require("./dtos/GetDirectDepositFormatRequest"), exports);
19
+ __exportStar(require("./dtos/GetDirectDepositFormatByDirectoryRequest"), exports);
20
+ __exportStar(require("./dtos/DirectDepositFormatResponse"), exports);
@@ -0,0 +1,28 @@
1
+ /** Tamaño nombrado o personalizado en puntos PDF (1pt = 1/72in). */
2
+ export type PdfGeneratorPageSize = 'LETTER' | 'A4' | 'LEGAL' | {
3
+ width: number;
4
+ height: number;
5
+ };
6
+ /** Texto por página en el margen; acepta los tokens {page} y {pages}. */
7
+ export declare class PdfGeneratorPageBoxText {
8
+ left?: string;
9
+ center?: string;
10
+ right?: string;
11
+ fontSize?: number;
12
+ }
13
+ /**
14
+ * Configuración de hoja de pdf-generator-business. Las longitudes de margen llevan unidad
15
+ * (mm, cm, in, pt, px). Sin `page`, el lambda usa el @page de la plantilla o A4 con 2 mm.
16
+ */
17
+ export declare class PdfGeneratorPageConfig {
18
+ size?: PdfGeneratorPageSize;
19
+ orientation?: 'portrait' | 'landscape';
20
+ margin?: {
21
+ top?: string;
22
+ right?: string;
23
+ bottom?: string;
24
+ left?: string;
25
+ };
26
+ header?: PdfGeneratorPageBoxText;
27
+ footer?: PdfGeneratorPageBoxText;
28
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PdfGeneratorPageConfig = exports.PdfGeneratorPageBoxText = void 0;
4
+ /** Texto por página en el margen; acepta los tokens {page} y {pages}. */
5
+ class PdfGeneratorPageBoxText {
6
+ }
7
+ exports.PdfGeneratorPageBoxText = PdfGeneratorPageBoxText;
8
+ /**
9
+ * Configuración de hoja de pdf-generator-business. Las longitudes de margen llevan unidad
10
+ * (mm, cm, in, pt, px). Sin `page`, el lambda usa el @page de la plantilla o A4 con 2 mm.
11
+ */
12
+ class PdfGeneratorPageConfig {
13
+ }
14
+ exports.PdfGeneratorPageConfig = PdfGeneratorPageConfig;
@@ -0,0 +1,9 @@
1
+ import { PdfGeneratorPageConfig } from './PdfGeneratorPageConfig';
2
+ /** POST /generate-pdf de pdf-generator-business: HTML ya armado → PDF en base64. */
3
+ export declare class PdfGeneratorRequest {
4
+ html: string;
5
+ /** La valida a fondo el propio lambda (400 con el campo que falla). */
6
+ page?: PdfGeneratorPageConfig;
7
+ /** Override del motor para este request (default del lambda: pdflib). */
8
+ provider?: 'pdflib' | 'puppeteer';
9
+ }
@@ -0,0 +1,33 @@
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.PdfGeneratorRequest = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const PdfGeneratorPageConfig_1 = require("./PdfGeneratorPageConfig");
15
+ /** POST /generate-pdf de pdf-generator-business: HTML ya armado → PDF en base64. */
16
+ class PdfGeneratorRequest {
17
+ }
18
+ exports.PdfGeneratorRequest = PdfGeneratorRequest;
19
+ __decorate([
20
+ (0, class_validator_1.IsString)(),
21
+ (0, class_validator_1.IsNotEmpty)(),
22
+ __metadata("design:type", String)
23
+ ], PdfGeneratorRequest.prototype, "html", void 0);
24
+ __decorate([
25
+ (0, class_validator_1.IsOptional)(),
26
+ (0, class_validator_1.IsObject)(),
27
+ __metadata("design:type", PdfGeneratorPageConfig_1.PdfGeneratorPageConfig)
28
+ ], PdfGeneratorRequest.prototype, "page", void 0);
29
+ __decorate([
30
+ (0, class_validator_1.IsOptional)(),
31
+ (0, class_validator_1.IsIn)(['pdflib', 'puppeteer']),
32
+ __metadata("design:type", String)
33
+ ], PdfGeneratorRequest.prototype, "provider", void 0);
@@ -0,0 +1,4 @@
1
+ /** Respuesta de POST /generate-pdf. El header X-Pdf-Provider indica el motor usado. */
2
+ export declare class PdfGeneratorResponse {
3
+ base64: string;
4
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PdfGeneratorResponse = void 0;
4
+ /** Respuesta de POST /generate-pdf. El header X-Pdf-Provider indica el motor usado. */
5
+ class PdfGeneratorResponse {
6
+ }
7
+ exports.PdfGeneratorResponse = PdfGeneratorResponse;
@@ -0,0 +1,3 @@
1
+ export * from './dtos/PdfGeneratorPageConfig';
2
+ export * from './dtos/PdfGeneratorRequest';
3
+ export * from './dtos/PdfGeneratorResponse';
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ //dtos
18
+ __exportStar(require("./dtos/PdfGeneratorPageConfig"), exports);
19
+ __exportStar(require("./dtos/PdfGeneratorRequest"), exports);
20
+ __exportStar(require("./dtos/PdfGeneratorResponse"), exports);
@@ -35,4 +35,5 @@ exports.RETAIL_PROMOTIONS_ERROR_HTTP_STATUS = {
35
35
  [RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.CATALOG_SKU_NOT_FOUND]: 404,
36
36
  [RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.SPLIT_FINANCING_DISABLED]: 409,
37
37
  [RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.PROMOTION_NOT_STACKABLE]: 422,
38
+ [RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.PROMOTION_PAYMENT_NOT_ELIGIBLE]: 422,
38
39
  };
@@ -1,4 +1,5 @@
1
1
  import { PromotionAppliesToEnum } from '../enums/PromotionAppliesToEnum';
2
+ import { PromotionPaymentOptionEnum } from '../enums/PromotionPaymentOptionEnum';
2
3
  import { SalePromotionPhaseEnum } from '../enums/SalePromotionPhaseEnum';
3
4
  import { SalePromotionStatusEnum } from '../enums/SalePromotionStatusEnum';
4
5
  import { SalePromotionLevers, SalePromotionScope, SalePromotionSegmentation } from './SalePromotionLevers';
@@ -12,7 +13,10 @@ export interface SalePromotion {
12
13
  levers: SalePromotionLevers;
13
14
  scope: SalePromotionScope;
14
15
  segmentation: SalePromotionSegmentation;
16
+ /** @deprecated Usa `paymentOptions`; se deriva de ella. */
15
17
  appliesTo: PromotionAppliesToEnum;
18
+ /** Formas de pago con las que aplica; `null` = cualquiera. */
19
+ paymentOptions: PromotionPaymentOptionEnum[] | null;
16
20
  /** `null` = sin tope. */
17
21
  budgetMaxCents: number | null;
18
22
  budgetConsumedCents: number;
@@ -1,4 +1,5 @@
1
1
  import { PromotionAppliesToEnum } from '../../enums/PromotionAppliesToEnum';
2
+ import { PromotionPaymentOptionEnum } from '../../enums/PromotionPaymentOptionEnum';
2
3
  import { SalePromotionLeversInput } from './SalePromotionLeversInput';
3
4
  import { SalePromotionScopeInput, SalePromotionSegmentationInput } from './SalePromotionScopeInput';
4
5
  /** Body de publicCreateSalePromotion. Nace en `DRAFT`; el retailer sale del token. */
@@ -8,8 +9,10 @@ export declare class CreateSalePromotionRequest {
8
9
  levers: SalePromotionLeversInput;
9
10
  scope?: SalePromotionScopeInput | null;
10
11
  segmentation?: SalePromotionSegmentationInput | null;
11
- /** Ausente = `SUREKEEP_ONLY`. */
12
+ /** @deprecated Usa `paymentOptions`; solo se lee si `paymentOptions` no viene. Ausente = `SUREKEEP_ONLY`. */
12
13
  appliesTo?: PromotionAppliesToEnum;
14
+ /** Formas de pago con las que aplica; `null` = cualquiera. Ausente = `[SUREKEEP]`. */
15
+ paymentOptions?: PromotionPaymentOptionEnum[] | null;
13
16
  /** `null` = sin tope. */
14
17
  budgetMaxCents?: number | null;
15
18
  validFrom?: string | null;
@@ -13,6 +13,7 @@ exports.CreateSalePromotionRequest = void 0;
13
13
  const class_transformer_1 = require("class-transformer");
14
14
  const class_validator_1 = require("class-validator");
15
15
  const PromotionAppliesToEnum_1 = require("../../enums/PromotionAppliesToEnum");
16
+ const PromotionPaymentOptionEnum_1 = require("../../enums/PromotionPaymentOptionEnum");
16
17
  const SalePromotionLeversInput_1 = require("./SalePromotionLeversInput");
17
18
  const SalePromotionScopeInput_1 = require("./SalePromotionScopeInput");
18
19
  /** Body de publicCreateSalePromotion. Nace en `DRAFT`; el retailer sale del token. */
@@ -57,6 +58,13 @@ __decorate([
57
58
  (0, class_validator_1.IsEnum)(PromotionAppliesToEnum_1.PromotionAppliesToEnum),
58
59
  __metadata("design:type", String)
59
60
  ], CreateSalePromotionRequest.prototype, "appliesTo", void 0);
61
+ __decorate([
62
+ (0, class_transformer_1.Expose)(),
63
+ (0, class_validator_1.IsOptional)(),
64
+ (0, class_validator_1.IsArray)(),
65
+ (0, class_validator_1.IsEnum)(PromotionPaymentOptionEnum_1.PromotionPaymentOptionEnum, { each: true }),
66
+ __metadata("design:type", Array)
67
+ ], CreateSalePromotionRequest.prototype, "paymentOptions", void 0);
60
68
  __decorate([
61
69
  (0, class_transformer_1.Expose)(),
62
70
  (0, class_validator_1.IsOptional)(),
@@ -1,4 +1,5 @@
1
1
  import { PromotionAppliesToEnum } from '../../enums/PromotionAppliesToEnum';
2
+ import { PromotionPaymentOptionEnum } from '../../enums/PromotionPaymentOptionEnum';
2
3
  import { SalePromotionLeversInput } from './SalePromotionLeversInput';
3
4
  import { SalePromotionScopeInput, SalePromotionSegmentationInput } from './SalePromotionScopeInput';
4
5
  /** Body de publicUpdateSalePromotion: parche; el lambda crea una versión nueva para ventas futuras. */
@@ -8,8 +9,10 @@ export declare class UpdateSalePromotionRequest {
8
9
  levers?: SalePromotionLeversInput;
9
10
  scope?: SalePromotionScopeInput | null;
10
11
  segmentation?: SalePromotionSegmentationInput | null;
11
- /** Ausente = conserva el valor actual. */
12
+ /** @deprecated Usa `paymentOptions`; solo se lee si `paymentOptions` no viene. Ausente = conserva el valor actual. */
12
13
  appliesTo?: PromotionAppliesToEnum;
14
+ /** Formas de pago con las que aplica; `null` = cualquiera. Ausente = conserva el valor actual. */
15
+ paymentOptions?: PromotionPaymentOptionEnum[] | null;
13
16
  /** `null` = sin tope. */
14
17
  budgetMaxCents?: number | null;
15
18
  validFrom?: string | null;
@@ -13,6 +13,7 @@ exports.UpdateSalePromotionRequest = void 0;
13
13
  const class_transformer_1 = require("class-transformer");
14
14
  const class_validator_1 = require("class-validator");
15
15
  const PromotionAppliesToEnum_1 = require("../../enums/PromotionAppliesToEnum");
16
+ const PromotionPaymentOptionEnum_1 = require("../../enums/PromotionPaymentOptionEnum");
16
17
  const SalePromotionLeversInput_1 = require("./SalePromotionLeversInput");
17
18
  const SalePromotionScopeInput_1 = require("./SalePromotionScopeInput");
18
19
  /** Body de publicUpdateSalePromotion: parche; el lambda crea una versión nueva para ventas futuras. */
@@ -59,6 +60,13 @@ __decorate([
59
60
  (0, class_validator_1.IsEnum)(PromotionAppliesToEnum_1.PromotionAppliesToEnum),
60
61
  __metadata("design:type", String)
61
62
  ], UpdateSalePromotionRequest.prototype, "appliesTo", void 0);
63
+ __decorate([
64
+ (0, class_transformer_1.Expose)(),
65
+ (0, class_validator_1.IsOptional)(),
66
+ (0, class_validator_1.IsArray)(),
67
+ (0, class_validator_1.IsEnum)(PromotionPaymentOptionEnum_1.PromotionPaymentOptionEnum, { each: true }),
68
+ __metadata("design:type", Array)
69
+ ], UpdateSalePromotionRequest.prototype, "paymentOptions", void 0);
62
70
  __decorate([
63
71
  (0, class_transformer_1.Expose)(),
64
72
  (0, class_validator_1.IsOptional)(),
@@ -3,6 +3,7 @@ import { CouponStatusEnum } from '../../enums/CouponStatusEnum';
3
3
  import { EntitlementKindEnum } from '../../enums/EntitlementKindEnum';
4
4
  import { EntitlementStateEnum } from '../../enums/EntitlementStateEnum';
5
5
  import { PromotionAppliesToEnum } from '../../enums/PromotionAppliesToEnum';
6
+ import { PromotionPaymentOptionEnum } from '../../enums/PromotionPaymentOptionEnum';
6
7
  import { RetailPromotionsErrorCodeEnum } from '../../enums/RetailPromotionsErrorCodeEnum';
7
8
  import { SaleCouponAvailabilityEnum } from '../../enums/SaleCouponAvailabilityEnum';
8
9
  import { SalePromotionKindEnum } from '../../enums/SalePromotionKindEnum';
@@ -25,8 +26,10 @@ export interface StoreSalePromotionItem {
25
26
  levers: SalePromotionLevers;
26
27
  /** Para cruzar con cada equipo; todo `null` = fila «Toda la tienda». */
27
28
  scope: SalePromotionScope;
28
- /** SUREKEEP_ONLY = solo con crédito SureKeep; ANY_FINANCIER = también contado o derivada. */
29
+ /** @deprecated Usa `paymentOptions`. SUREKEEP_ONLY = solo con crédito SureKeep; ANY_FINANCIER = cualquier otra lista. */
29
30
  appliesTo: PromotionAppliesToEnum;
31
+ /** Formas de pago con las que aplica; `null` = cualquiera. */
32
+ paymentOptions?: PromotionPaymentOptionEnum[] | null;
30
33
  /** Si se puede sumar con otras promos en la misma línea. */
31
34
  stackable: boolean;
32
35
  /** Ocupa el lugar de la línea ancla (teléfono o kit), aunque no la toque directo. */
@@ -68,8 +71,10 @@ export interface EvaluatedSalePromotion {
68
71
  giftOptions: GiftOption[];
69
72
  giftChooseCount: number | null;
70
73
  afterSale: AfterSaleBenefit[];
71
- /** SUREKEEP_ONLY = solo con crédito SureKeep; ANY_FINANCIER = también contado o derivada. */
74
+ /** @deprecated Usa `paymentOptions`. SUREKEEP_ONLY = solo con crédito SureKeep; ANY_FINANCIER = cualquier otra lista. */
72
75
  appliesTo: PromotionAppliesToEnum;
76
+ /** Formas de pago con las que aplica; `null` = cualquiera. */
77
+ paymentOptions?: PromotionPaymentOptionEnum[] | null;
73
78
  /** Si se puede sumar con otras promos en la misma línea. */
74
79
  stackable: boolean;
75
80
  /** Ocupa el lugar de la línea ancla (teléfono o kit), aunque no la toque directo. */
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * Con qué financiera aplica una promo o un código. Sin valor, el lambda asume `SUREKEEP_ONLY`.
3
+ * En promos de venta lo reemplaza `paymentOptions` (`PromotionPaymentOptionEnum`).
3
4
  * @enum {string}
4
5
  */
5
6
  export declare enum PromotionAppliesToEnum {
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PromotionAppliesToEnum = void 0;
4
4
  /**
5
5
  * Con qué financiera aplica una promo o un código. Sin valor, el lambda asume `SUREKEEP_ONLY`.
6
+ * En promos de venta lo reemplaza `paymentOptions` (`PromotionPaymentOptionEnum`).
6
7
  * @enum {string}
7
8
  */
8
9
  var PromotionAppliesToEnum;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Forma de pago con la que aplica una promo de venta. SUREKEEP = crédito SureKeep; PAYJOY…INNOVA = derivada
3
+ * a esa financiera; CASH, CARD y WIRE = contado con ese medio de cobro.
4
+ * @enum {string}
5
+ */
6
+ export declare enum PromotionPaymentOptionEnum {
7
+ SUREKEEP = "SUREKEEP",
8
+ PAYJOY = "PAYJOY",
9
+ CREDIYA = "CREDIYA",
10
+ LESPAGO = "LESPAGO",
11
+ INNOVA = "INNOVA",
12
+ CASH = "CASH",
13
+ CARD = "CARD",
14
+ WIRE = "WIRE"
15
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PromotionPaymentOptionEnum = void 0;
4
+ /**
5
+ * Forma de pago con la que aplica una promo de venta. SUREKEEP = crédito SureKeep; PAYJOY…INNOVA = derivada
6
+ * a esa financiera; CASH, CARD y WIRE = contado con ese medio de cobro.
7
+ * @enum {string}
8
+ */
9
+ var PromotionPaymentOptionEnum;
10
+ (function (PromotionPaymentOptionEnum) {
11
+ PromotionPaymentOptionEnum["SUREKEEP"] = "SUREKEEP";
12
+ PromotionPaymentOptionEnum["PAYJOY"] = "PAYJOY";
13
+ PromotionPaymentOptionEnum["CREDIYA"] = "CREDIYA";
14
+ PromotionPaymentOptionEnum["LESPAGO"] = "LESPAGO";
15
+ PromotionPaymentOptionEnum["INNOVA"] = "INNOVA";
16
+ PromotionPaymentOptionEnum["CASH"] = "CASH";
17
+ PromotionPaymentOptionEnum["CARD"] = "CARD";
18
+ PromotionPaymentOptionEnum["WIRE"] = "WIRE";
19
+ })(PromotionPaymentOptionEnum || (exports.PromotionPaymentOptionEnum = PromotionPaymentOptionEnum = {}));
@@ -46,5 +46,7 @@ export declare enum RetailPromotionsErrorCodeEnum {
46
46
  /** Con el reparto apagado no se aplican palancas de precio ni código; los regalos sí. */
47
47
  SPLIT_FINANCING_DISABLED = "SPLIT_FINANCING_DISABLED",
48
48
  /** La promo no acumulable choca con otra en la misma línea. */
49
- PROMOTION_NOT_STACKABLE = "PROMOTION_NOT_STACKABLE"
49
+ PROMOTION_NOT_STACKABLE = "PROMOTION_NOT_STACKABLE",
50
+ /** La promo no acepta la forma de pago o el medio de cobro de la venta. */
51
+ PROMOTION_PAYMENT_NOT_ELIGIBLE = "PROMOTION_PAYMENT_NOT_ELIGIBLE"
50
52
  }
@@ -51,4 +51,6 @@ var RetailPromotionsErrorCodeEnum;
51
51
  RetailPromotionsErrorCodeEnum["SPLIT_FINANCING_DISABLED"] = "SPLIT_FINANCING_DISABLED";
52
52
  /** La promo no acumulable choca con otra en la misma línea. */
53
53
  RetailPromotionsErrorCodeEnum["PROMOTION_NOT_STACKABLE"] = "PROMOTION_NOT_STACKABLE";
54
+ /** La promo no acepta la forma de pago o el medio de cobro de la venta. */
55
+ RetailPromotionsErrorCodeEnum["PROMOTION_PAYMENT_NOT_ELIGIBLE"] = "PROMOTION_PAYMENT_NOT_ELIGIBLE";
54
56
  })(RetailPromotionsErrorCodeEnum || (exports.RetailPromotionsErrorCodeEnum = RetailPromotionsErrorCodeEnum = {}));
@@ -7,6 +7,7 @@ export * from './enums/SalePromotionLogFormatEnum';
7
7
  export * from './enums/DiscountTypeEnum';
8
8
  export * from './enums/GiftModeEnum';
9
9
  export * from './enums/PromotionAppliesToEnum';
10
+ export * from './enums/PromotionPaymentOptionEnum';
10
11
  export * from './enums/CouponScopeEnum';
11
12
  export * from './enums/CouponStatusEnum';
12
13
  export * from './enums/DiscountCodeStatusEnum';
@@ -24,6 +24,7 @@ __exportStar(require("./enums/SalePromotionLogFormatEnum"), exports);
24
24
  __exportStar(require("./enums/DiscountTypeEnum"), exports);
25
25
  __exportStar(require("./enums/GiftModeEnum"), exports);
26
26
  __exportStar(require("./enums/PromotionAppliesToEnum"), exports);
27
+ __exportStar(require("./enums/PromotionPaymentOptionEnum"), exports);
27
28
  __exportStar(require("./enums/CouponScopeEnum"), exports);
28
29
  __exportStar(require("./enums/CouponStatusEnum"), exports);
29
30
  __exportStar(require("./enums/DiscountCodeStatusEnum"), exports);
@@ -10,8 +10,4 @@ export declare class CreateAccessorySaleRequest {
10
10
  paymentMethod: SalePaymentMethodEnum;
11
11
  amountCents: number;
12
12
  paymentDetail: SalePaymentDetail;
13
- /** El cliente aceptó el aviso de privacidad; sin `true` el back responde 400 PRIVACY_NOTICE_REQUIRED. */
14
- privacyNoticeAccepted?: boolean;
15
- /** Versión del aviso de privacidad que se mostró. */
16
- privacyNoticeVersion: string;
17
13
  }
@@ -49,15 +49,3 @@ __decorate([
49
49
  (0, class_transformer_1.Type)(() => SalePaymentDetail_1.SalePaymentDetail),
50
50
  __metadata("design:type", SalePaymentDetail_1.SalePaymentDetail)
51
51
  ], CreateAccessorySaleRequest.prototype, "paymentDetail", void 0);
52
- __decorate([
53
- (0, class_transformer_1.Expose)(),
54
- (0, class_validator_1.IsOptional)(),
55
- (0, class_validator_1.IsBoolean)(),
56
- __metadata("design:type", Boolean)
57
- ], CreateAccessorySaleRequest.prototype, "privacyNoticeAccepted", void 0);
58
- __decorate([
59
- (0, class_transformer_1.Expose)(),
60
- (0, class_validator_1.IsString)(),
61
- (0, class_validator_1.MinLength)(1),
62
- __metadata("design:type", String)
63
- ], CreateAccessorySaleRequest.prototype, "privacyNoticeVersion", void 0);
@@ -1,3 +1,4 @@
1
+ import type { ExternalProviderEnum } from '../../enums/ExternalProviderEnum';
1
2
  import type { PaymentMethodEnum } from '../../enums/PaymentMethodEnum';
2
3
  import type { WizardStateEnum } from '../../enums/WizardStateEnum';
3
4
  import type { WizardStepEnum } from '../../enums/WizardStepEnum';
@@ -27,6 +28,8 @@ export interface PrivateWizardSessionResponse {
27
28
  folio?: string | null;
28
29
  /** Forma de pago que eligió el vendedor; existe antes que `creditId`. */
29
30
  paymentMethod?: PaymentMethodEnum | null;
31
+ /** Financiera de la venta derivada (`paymentMethod = EXTERNAL`); `null` en las demás. */
32
+ externalProvider?: ExternalProviderEnum | null;
30
33
  /** Cobro de contado; `null` mientras no se cobra. */
31
34
  payment?: WizardPayment | null;
32
35
  /** Valor efectivo del flag SPLIT_FINANCING_ENABLED del wizard. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.560.0",
3
+ "version": "3.562.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -0,0 +1,4 @@
1
+ /** `data` de la respuesta: el PDF del formato Direct Deposit en base64. */
2
+ export class DirectDepositFormatResponse {
3
+ format!: string;
4
+ }
@@ -0,0 +1,12 @@
1
+ import { Type } from 'class-transformer';
2
+ import { IsInt, IsNotEmpty, IsOptional, IsString, Max, Min } from 'class-validator';
3
+
4
+ /** Query de GET /agents/direct-deposit y /backoffice/direct-deposit (+ /v2): formato de un tercero. */
5
+ export class GetDirectDepositFormatByDirectoryRequest {
6
+ @IsString() @IsNotEmpty()
7
+ directoryId!: string;
8
+
9
+ /** Porcentaje del cheque a depositar (1–100). Default 100. */
10
+ @IsOptional() @Type(() => Number) @IsInt() @Min(1) @Max(100)
11
+ percentage?: number;
12
+ }
@@ -0,0 +1,9 @@
1
+ import { Type } from 'class-transformer';
2
+ import { IsInt, IsOptional, Max, Min } from 'class-validator';
3
+
4
+ /** Query de GET /direct-deposit (app) de direct-deposit-export-business. El directoryId sale del token. */
5
+ export class GetDirectDepositFormatRequest {
6
+ /** Porcentaje del cheque a depositar (1–100). Default 100. */
7
+ @IsOptional() @Type(() => Number) @IsInt() @Min(1) @Max(100)
8
+ percentage?: number;
9
+ }
@@ -0,0 +1,4 @@
1
+ //dtos
2
+ export * from './dtos/GetDirectDepositFormatRequest';
3
+ export * from './dtos/GetDirectDepositFormatByDirectoryRequest';
4
+ export * from './dtos/DirectDepositFormatResponse';
@@ -0,0 +1,22 @@
1
+ /** Tamaño nombrado o personalizado en puntos PDF (1pt = 1/72in). */
2
+ export type PdfGeneratorPageSize = 'LETTER' | 'A4' | 'LEGAL' | { width: number; height: number };
3
+
4
+ /** Texto por página en el margen; acepta los tokens {page} y {pages}. */
5
+ export class PdfGeneratorPageBoxText {
6
+ left?: string;
7
+ center?: string;
8
+ right?: string;
9
+ fontSize?: number;
10
+ }
11
+
12
+ /**
13
+ * Configuración de hoja de pdf-generator-business. Las longitudes de margen llevan unidad
14
+ * (mm, cm, in, pt, px). Sin `page`, el lambda usa el @page de la plantilla o A4 con 2 mm.
15
+ */
16
+ export class PdfGeneratorPageConfig {
17
+ size?: PdfGeneratorPageSize;
18
+ orientation?: 'portrait' | 'landscape';
19
+ margin?: { top?: string; right?: string; bottom?: string; left?: string };
20
+ header?: PdfGeneratorPageBoxText;
21
+ footer?: PdfGeneratorPageBoxText;
22
+ }
@@ -0,0 +1,16 @@
1
+ import { IsIn, IsNotEmpty, IsObject, IsOptional, IsString } from 'class-validator';
2
+ import { PdfGeneratorPageConfig } from './PdfGeneratorPageConfig';
3
+
4
+ /** POST /generate-pdf de pdf-generator-business: HTML ya armado → PDF en base64. */
5
+ export class PdfGeneratorRequest {
6
+ @IsString() @IsNotEmpty()
7
+ html!: string;
8
+
9
+ /** La valida a fondo el propio lambda (400 con el campo que falla). */
10
+ @IsOptional() @IsObject()
11
+ page?: PdfGeneratorPageConfig;
12
+
13
+ /** Override del motor para este request (default del lambda: pdflib). */
14
+ @IsOptional() @IsIn(['pdflib', 'puppeteer'])
15
+ provider?: 'pdflib' | 'puppeteer';
16
+ }
@@ -0,0 +1,4 @@
1
+ /** Respuesta de POST /generate-pdf. El header X-Pdf-Provider indica el motor usado. */
2
+ export class PdfGeneratorResponse {
3
+ base64!: string;
4
+ }
@@ -0,0 +1,4 @@
1
+ //dtos
2
+ export * from './dtos/PdfGeneratorPageConfig';
3
+ export * from './dtos/PdfGeneratorRequest';
4
+ export * from './dtos/PdfGeneratorResponse';
@@ -33,4 +33,5 @@ export const RETAIL_PROMOTIONS_ERROR_HTTP_STATUS: Readonly<Record<C, 400 | 403 |
33
33
  [C.CATALOG_SKU_NOT_FOUND]: 404,
34
34
  [C.SPLIT_FINANCING_DISABLED]: 409,
35
35
  [C.PROMOTION_NOT_STACKABLE]: 422,
36
+ [C.PROMOTION_PAYMENT_NOT_ELIGIBLE]: 422,
36
37
  };
@@ -1,4 +1,5 @@
1
1
  import { PromotionAppliesToEnum } from '../enums/PromotionAppliesToEnum';
2
+ import { PromotionPaymentOptionEnum } from '../enums/PromotionPaymentOptionEnum';
2
3
  import { SalePromotionPhaseEnum } from '../enums/SalePromotionPhaseEnum';
3
4
  import { SalePromotionStatusEnum } from '../enums/SalePromotionStatusEnum';
4
5
  import { SalePromotionLevers, SalePromotionScope, SalePromotionSegmentation } from './SalePromotionLevers';
@@ -13,7 +14,10 @@ export interface SalePromotion {
13
14
  levers: SalePromotionLevers;
14
15
  scope: SalePromotionScope;
15
16
  segmentation: SalePromotionSegmentation;
17
+ /** @deprecated Usa `paymentOptions`; se deriva de ella. */
16
18
  appliesTo: PromotionAppliesToEnum;
19
+ /** Formas de pago con las que aplica; `null` = cualquiera. */
20
+ paymentOptions: PromotionPaymentOptionEnum[] | null;
17
21
  /** `null` = sin tope. */
18
22
  budgetMaxCents: number | null;
19
23
  budgetConsumedCents: number;
@@ -1,5 +1,6 @@
1
1
  import { Expose, Type } from 'class-transformer';
2
2
  import {
3
+ IsArray,
3
4
  IsBoolean,
4
5
  IsDefined,
5
6
  IsEnum,
@@ -11,6 +12,7 @@ import {
11
12
  ValidateNested,
12
13
  } from 'class-validator';
13
14
  import { PromotionAppliesToEnum } from '../../enums/PromotionAppliesToEnum';
15
+ import { PromotionPaymentOptionEnum } from '../../enums/PromotionPaymentOptionEnum';
14
16
  import { SalePromotionLeversInput } from './SalePromotionLeversInput';
15
17
  import { SalePromotionScopeInput, SalePromotionSegmentationInput } from './SalePromotionScopeInput';
16
18
 
@@ -43,12 +45,19 @@ export class CreateSalePromotionRequest {
43
45
  @Type(() => SalePromotionSegmentationInput)
44
46
  segmentation?: SalePromotionSegmentationInput | null;
45
47
 
46
- /** Ausente = `SUREKEEP_ONLY`. */
48
+ /** @deprecated Usa `paymentOptions`; solo se lee si `paymentOptions` no viene. Ausente = `SUREKEEP_ONLY`. */
47
49
  @Expose()
48
50
  @IsOptional()
49
51
  @IsEnum(PromotionAppliesToEnum)
50
52
  appliesTo?: PromotionAppliesToEnum;
51
53
 
54
+ /** Formas de pago con las que aplica; `null` = cualquiera. Ausente = `[SUREKEEP]`. */
55
+ @Expose()
56
+ @IsOptional()
57
+ @IsArray()
58
+ @IsEnum(PromotionPaymentOptionEnum, { each: true })
59
+ paymentOptions?: PromotionPaymentOptionEnum[] | null;
60
+
52
61
  /** `null` = sin tope. */
53
62
  @Expose()
54
63
  @IsOptional()
@@ -1,5 +1,6 @@
1
1
  import { Expose, Type } from 'class-transformer';
2
2
  import {
3
+ IsArray,
3
4
  IsBoolean,
4
5
  IsEnum,
5
6
  IsInt,
@@ -10,6 +11,7 @@ import {
10
11
  ValidateNested,
11
12
  } from 'class-validator';
12
13
  import { PromotionAppliesToEnum } from '../../enums/PromotionAppliesToEnum';
14
+ import { PromotionPaymentOptionEnum } from '../../enums/PromotionPaymentOptionEnum';
13
15
  import { SalePromotionLeversInput } from './SalePromotionLeversInput';
14
16
  import { SalePromotionScopeInput, SalePromotionSegmentationInput } from './SalePromotionScopeInput';
15
17
 
@@ -44,12 +46,19 @@ export class UpdateSalePromotionRequest {
44
46
  @Type(() => SalePromotionSegmentationInput)
45
47
  segmentation?: SalePromotionSegmentationInput | null;
46
48
 
47
- /** Ausente = conserva el valor actual. */
49
+ /** @deprecated Usa `paymentOptions`; solo se lee si `paymentOptions` no viene. Ausente = conserva el valor actual. */
48
50
  @Expose()
49
51
  @IsOptional()
50
52
  @IsEnum(PromotionAppliesToEnum)
51
53
  appliesTo?: PromotionAppliesToEnum;
52
54
 
55
+ /** Formas de pago con las que aplica; `null` = cualquiera. Ausente = conserva el valor actual. */
56
+ @Expose()
57
+ @IsOptional()
58
+ @IsArray()
59
+ @IsEnum(PromotionPaymentOptionEnum, { each: true })
60
+ paymentOptions?: PromotionPaymentOptionEnum[] | null;
61
+
53
62
  /** `null` = sin tope. */
54
63
  @Expose()
55
64
  @IsOptional()
@@ -3,6 +3,7 @@ import { CouponStatusEnum } from '../../enums/CouponStatusEnum';
3
3
  import { EntitlementKindEnum } from '../../enums/EntitlementKindEnum';
4
4
  import { EntitlementStateEnum } from '../../enums/EntitlementStateEnum';
5
5
  import { PromotionAppliesToEnum } from '../../enums/PromotionAppliesToEnum';
6
+ import { PromotionPaymentOptionEnum } from '../../enums/PromotionPaymentOptionEnum';
6
7
  import { RetailPromotionsErrorCodeEnum } from '../../enums/RetailPromotionsErrorCodeEnum';
7
8
  import { SaleCouponAvailabilityEnum } from '../../enums/SaleCouponAvailabilityEnum';
8
9
  import { SalePromotionKindEnum } from '../../enums/SalePromotionKindEnum';
@@ -27,8 +28,10 @@ export interface StoreSalePromotionItem {
27
28
  levers: SalePromotionLevers;
28
29
  /** Para cruzar con cada equipo; todo `null` = fila «Toda la tienda». */
29
30
  scope: SalePromotionScope;
30
- /** SUREKEEP_ONLY = solo con crédito SureKeep; ANY_FINANCIER = también contado o derivada. */
31
+ /** @deprecated Usa `paymentOptions`. SUREKEEP_ONLY = solo con crédito SureKeep; ANY_FINANCIER = cualquier otra lista. */
31
32
  appliesTo: PromotionAppliesToEnum;
33
+ /** Formas de pago con las que aplica; `null` = cualquiera. */
34
+ paymentOptions?: PromotionPaymentOptionEnum[] | null;
32
35
  /** Si se puede sumar con otras promos en la misma línea. */
33
36
  stackable: boolean;
34
37
  /** Ocupa el lugar de la línea ancla (teléfono o kit), aunque no la toque directo. */
@@ -74,8 +77,10 @@ export interface EvaluatedSalePromotion {
74
77
  giftOptions: GiftOption[];
75
78
  giftChooseCount: number | null;
76
79
  afterSale: AfterSaleBenefit[];
77
- /** SUREKEEP_ONLY = solo con crédito SureKeep; ANY_FINANCIER = también contado o derivada. */
80
+ /** @deprecated Usa `paymentOptions`. SUREKEEP_ONLY = solo con crédito SureKeep; ANY_FINANCIER = cualquier otra lista. */
78
81
  appliesTo: PromotionAppliesToEnum;
82
+ /** Formas de pago con las que aplica; `null` = cualquiera. */
83
+ paymentOptions?: PromotionPaymentOptionEnum[] | null;
79
84
  /** Si se puede sumar con otras promos en la misma línea. */
80
85
  stackable: boolean;
81
86
  /** Ocupa el lugar de la línea ancla (teléfono o kit), aunque no la toque directo. */
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * Con qué financiera aplica una promo o un código. Sin valor, el lambda asume `SUREKEEP_ONLY`.
3
+ * En promos de venta lo reemplaza `paymentOptions` (`PromotionPaymentOptionEnum`).
3
4
  * @enum {string}
4
5
  */
5
6
  export enum PromotionAppliesToEnum {
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Forma de pago con la que aplica una promo de venta. SUREKEEP = crédito SureKeep; PAYJOY…INNOVA = derivada
3
+ * a esa financiera; CASH, CARD y WIRE = contado con ese medio de cobro.
4
+ * @enum {string}
5
+ */
6
+ export enum PromotionPaymentOptionEnum {
7
+ SUREKEEP = 'SUREKEEP',
8
+ PAYJOY = 'PAYJOY',
9
+ CREDIYA = 'CREDIYA',
10
+ LESPAGO = 'LESPAGO',
11
+ INNOVA = 'INNOVA',
12
+ CASH = 'CASH',
13
+ CARD = 'CARD',
14
+ WIRE = 'WIRE',
15
+ }
@@ -47,4 +47,6 @@ export enum RetailPromotionsErrorCodeEnum {
47
47
  SPLIT_FINANCING_DISABLED = 'SPLIT_FINANCING_DISABLED',
48
48
  /** La promo no acumulable choca con otra en la misma línea. */
49
49
  PROMOTION_NOT_STACKABLE = 'PROMOTION_NOT_STACKABLE',
50
+ /** La promo no acepta la forma de pago o el medio de cobro de la venta. */
51
+ PROMOTION_PAYMENT_NOT_ELIGIBLE = 'PROMOTION_PAYMENT_NOT_ELIGIBLE',
50
52
  }
@@ -8,6 +8,7 @@ export * from './enums/SalePromotionLogFormatEnum';
8
8
  export * from './enums/DiscountTypeEnum';
9
9
  export * from './enums/GiftModeEnum';
10
10
  export * from './enums/PromotionAppliesToEnum';
11
+ export * from './enums/PromotionPaymentOptionEnum';
11
12
  export * from './enums/CouponScopeEnum';
12
13
  export * from './enums/CouponStatusEnum';
13
14
  export * from './enums/DiscountCodeStatusEnum';
@@ -3,14 +3,10 @@ import {
3
3
  ArrayMaxSize,
4
4
  ArrayMinSize,
5
5
  IsArray,
6
- IsBoolean,
7
6
  IsDefined,
8
7
  IsEnum,
9
8
  IsInt,
10
- IsOptional,
11
- IsString,
12
9
  Min,
13
- MinLength,
14
10
  ValidateNested,
15
11
  } from 'class-validator';
16
12
  import { SalePaymentMethodEnum } from '../../enums/SalePaymentMethodEnum';
@@ -44,16 +40,4 @@ export class CreateAccessorySaleRequest {
44
40
  @ValidateNested()
45
41
  @Type(() => SalePaymentDetail)
46
42
  paymentDetail!: SalePaymentDetail;
47
-
48
- /** El cliente aceptó el aviso de privacidad; sin `true` el back responde 400 PRIVACY_NOTICE_REQUIRED. */
49
- @Expose()
50
- @IsOptional()
51
- @IsBoolean()
52
- privacyNoticeAccepted?: boolean;
53
-
54
- /** Versión del aviso de privacidad que se mostró. */
55
- @Expose()
56
- @IsString()
57
- @MinLength(1)
58
- privacyNoticeVersion!: string;
59
43
  }
@@ -1,3 +1,4 @@
1
+ import type { ExternalProviderEnum } from '../../enums/ExternalProviderEnum';
1
2
  import type { PaymentMethodEnum } from '../../enums/PaymentMethodEnum';
2
3
  import type { WizardStateEnum } from '../../enums/WizardStateEnum';
3
4
  import type { WizardStepEnum } from '../../enums/WizardStepEnum';
@@ -28,6 +29,8 @@ export interface PrivateWizardSessionResponse {
28
29
  folio?: string | null;
29
30
  /** Forma de pago que eligió el vendedor; existe antes que `creditId`. */
30
31
  paymentMethod?: PaymentMethodEnum | null;
32
+ /** Financiera de la venta derivada (`paymentMethod = EXTERNAL`); `null` en las demás. */
33
+ externalProvider?: ExternalProviderEnum | null;
31
34
  /** Cobro de contado; `null` mientras no se cobra. */
32
35
  payment?: WizardPayment | null;
33
36
  /** Valor efectivo del flag SPLIT_FINANCING_ENABLED del wizard. */