@fiado/type-kit 3.559.0 → 3.561.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 (36) hide show
  1. package/_test_/unit/retailPromotions/constants.test.ts +6 -1
  2. package/_test_/unit/retailPromotions/salePromotionRequests.test.ts +21 -0
  3. package/_test_/unit/retailWizard/accessorySaleRequests.test.ts +6 -8
  4. package/bin/notificationMessages/dtos/DisputeNotificationData.d.ts +10 -0
  5. package/bin/notificationMessages/dtos/DisputeNotificationData.js +5 -0
  6. package/bin/retailPromotions/constants/retailPromotionsErrorHttpStatus.js +1 -0
  7. package/bin/retailPromotions/dtos/SalePromotion.d.ts +4 -0
  8. package/bin/retailPromotions/dtos/requests/CreateSalePromotionRequest.d.ts +4 -1
  9. package/bin/retailPromotions/dtos/requests/CreateSalePromotionRequest.js +8 -0
  10. package/bin/retailPromotions/dtos/requests/UpdateSalePromotionRequest.d.ts +4 -1
  11. package/bin/retailPromotions/dtos/requests/UpdateSalePromotionRequest.js +8 -0
  12. package/bin/retailPromotions/dtos/responses/WizardSalePromotionResponses.d.ts +7 -2
  13. package/bin/retailPromotions/enums/PromotionAppliesToEnum.d.ts +1 -0
  14. package/bin/retailPromotions/enums/PromotionAppliesToEnum.js +1 -0
  15. package/bin/retailPromotions/enums/PromotionPaymentOptionEnum.d.ts +15 -0
  16. package/bin/retailPromotions/enums/PromotionPaymentOptionEnum.js +19 -0
  17. package/bin/retailPromotions/enums/RetailPromotionsErrorCodeEnum.d.ts +3 -1
  18. package/bin/retailPromotions/enums/RetailPromotionsErrorCodeEnum.js +2 -0
  19. package/bin/retailPromotions/index.d.ts +1 -0
  20. package/bin/retailPromotions/index.js +1 -0
  21. package/bin/retailWizard/dtos/requests/CreateAccessorySaleRequest.d.ts +0 -4
  22. package/bin/retailWizard/dtos/requests/CreateAccessorySaleRequest.js +0 -12
  23. package/bin/retailWizard/dtos/responses/PrivateWizardSessionResponse.d.ts +3 -0
  24. package/package.json +1 -1
  25. package/src/notificationMessages/dtos/DisputeNotificationData.ts +11 -0
  26. package/src/retailPromotions/constants/retailPromotionsErrorHttpStatus.ts +1 -0
  27. package/src/retailPromotions/dtos/SalePromotion.ts +4 -0
  28. package/src/retailPromotions/dtos/requests/CreateSalePromotionRequest.ts +10 -1
  29. package/src/retailPromotions/dtos/requests/UpdateSalePromotionRequest.ts +10 -1
  30. package/src/retailPromotions/dtos/responses/WizardSalePromotionResponses.ts +7 -2
  31. package/src/retailPromotions/enums/PromotionAppliesToEnum.ts +1 -0
  32. package/src/retailPromotions/enums/PromotionPaymentOptionEnum.ts +15 -0
  33. package/src/retailPromotions/enums/RetailPromotionsErrorCodeEnum.ts +2 -0
  34. package/src/retailPromotions/index.ts +1 -0
  35. package/src/retailWizard/dtos/requests/CreateAccessorySaleRequest.ts +0 -16
  36. package/src/retailWizard/dtos/responses/PrivateWizardSessionResponse.ts +3 -0
@@ -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', () => {
@@ -1,9 +1,19 @@
1
+ import { ProviderCode } from '../../provider/enums/ProviderCode';
1
2
  /**
2
3
  * `destinations[].data` de los pushes DISPUTE_* (dictamen, reapertura, 2° dictamen).
3
4
  * La app lo usa para saber de qué folio es el push: recargar el detalle o abrir la ficha.
5
+ *
6
+ * Para abrir la ficha al tocar el push, la app navega al detalle del movimiento con
7
+ * `transactionNumber` + `providerCode` (mismo par que usan
8
+ * `/trx/transactions/code/{providerCode}/id/{transactionNumber}` y
9
+ * `/disputes/transaction/{providerCode}/{transactionNumber}`).
4
10
  */
5
11
  export declare class DisputeNotificationData {
6
12
  id: string;
7
13
  folio: string;
8
14
  folioId?: string;
15
+ /** Número de la transacción reclamada. Ausente si el folio no tiene transacción real (alta desde el Dashboard). */
16
+ transactionNumber?: string;
17
+ /** Código del proveedor de esa transacción (Pago ConFiado = P9429). */
18
+ providerCode?: ProviderCode;
9
19
  }
@@ -4,6 +4,11 @@ exports.DisputeNotificationData = void 0;
4
4
  /**
5
5
  * `destinations[].data` de los pushes DISPUTE_* (dictamen, reapertura, 2° dictamen).
6
6
  * La app lo usa para saber de qué folio es el push: recargar el detalle o abrir la ficha.
7
+ *
8
+ * Para abrir la ficha al tocar el push, la app navega al detalle del movimiento con
9
+ * `transactionNumber` + `providerCode` (mismo par que usan
10
+ * `/trx/transactions/code/{providerCode}/id/{transactionNumber}` y
11
+ * `/disputes/transaction/{providerCode}/{transactionNumber}`).
7
12
  */
8
13
  class DisputeNotificationData {
9
14
  }
@@ -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.559.0",
3
+ "version": "3.561.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -1,9 +1,20 @@
1
+ import { ProviderCode } from '../../provider/enums/ProviderCode';
2
+
1
3
  /**
2
4
  * `destinations[].data` de los pushes DISPUTE_* (dictamen, reapertura, 2° dictamen).
3
5
  * La app lo usa para saber de qué folio es el push: recargar el detalle o abrir la ficha.
6
+ *
7
+ * Para abrir la ficha al tocar el push, la app navega al detalle del movimiento con
8
+ * `transactionNumber` + `providerCode` (mismo par que usan
9
+ * `/trx/transactions/code/{providerCode}/id/{transactionNumber}` y
10
+ * `/disputes/transaction/{providerCode}/{transactionNumber}`).
4
11
  */
5
12
  export class DisputeNotificationData {
6
13
  id: string; // templateId (DISPUTE_DICTAMEN_PROCEDENTE, DISPUTE_REOPEN_CONFIRMED, ...)
7
14
  folio: string; // disputeOrFraudFolio
8
15
  folioId?: string; // id del folio en DisputeOrFraudLog
16
+ /** Número de la transacción reclamada. Ausente si el folio no tiene transacción real (alta desde el Dashboard). */
17
+ transactionNumber?: string;
18
+ /** Código del proveedor de esa transacción (Pago ConFiado = P9429). */
19
+ providerCode?: ProviderCode;
9
20
  }
@@ -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. */