@fiado/type-kit 3.571.0 → 3.572.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.
@@ -6,8 +6,8 @@ import { BonusTypeEnum, UpsertPromotionBonusRequest } from '../../../src/retailC
6
6
  import type { PromotionBonusEntryResponse } from '../../../src/retailCustomer/index';
7
7
 
8
8
  describe('BonusTypeEnum', () => {
9
- it('distingue la bienvenida de las dos promociones', () => {
10
- expect(Object.values(BonusTypeEnum)).toEqual(['WELCOME', 'CREDIT_PROMOTION', 'SALE_PROMOTION']);
9
+ it('distingue la bienvenida, las dos promociones y el premio de referido', () => {
10
+ expect(Object.values(BonusTypeEnum)).toEqual(['WELCOME', 'CREDIT_PROMOTION', 'SALE_PROMOTION', 'REFERRAL']);
11
11
  });
12
12
 
13
13
  it('sale por el index raíz', () => {
@@ -51,6 +51,10 @@ describe('UpsertPromotionBonusRequest', () => {
51
51
  expect(errorsOf({ ...PENDING_SALE, bonusType: 'WELCOME' })).toContain('bonusType');
52
52
  });
53
53
 
54
+ it('acepta el premio de referido con su rol y referido', () => {
55
+ expect(errorsOf({ ...PENDING_SALE, bonusType: 'REFERRAL', role: 'REFERRER', referralId: 'ref-1' })).toEqual([]);
56
+ });
57
+
54
58
  it.each(['promotionId', 'sourceId', 'storeId', 'currency', 'idempotencyKey'])('rechaza %s vacío', (field) => {
55
59
  expect(errorsOf({ ...PENDING_SALE, [field]: ' ' })).toContain(field);
56
60
  });
@@ -18,7 +18,7 @@ const ReferralRoleEnum_1 = require("../../enums/ReferralRoleEnum");
18
18
  const WelcomeBonusStatusEnum_1 = require("../../enums/WelcomeBonusStatusEnum");
19
19
  /** Tope del motivo libre que el caller escribe en el asiento. */
20
20
  const FREE_TEXT_MAX_LENGTH = 256;
21
- const PROMOTION_BONUS_TYPES = [BonusTypeEnum_1.BonusTypeEnum.CREDIT_PROMOTION, BonusTypeEnum_1.BonusTypeEnum.SALE_PROMOTION];
21
+ const PROMOTION_BONUS_TYPES = [BonusTypeEnum_1.BonusTypeEnum.CREDIT_PROMOTION, BonusTypeEnum_1.BonusTypeEnum.SALE_PROMOTION, BonusTypeEnum_1.BonusTypeEnum.REFERRAL];
22
22
  const STATUSES_REQUIRING_REASON = [
23
23
  WelcomeBonusStatusEnum_1.WelcomeBonusStatusEnum.FAILED,
24
24
  WelcomeBonusStatusEnum_1.WelcomeBonusStatusEnum.UNVERIFIED,
@@ -2,5 +2,6 @@
2
2
  export declare enum BonusTypeEnum {
3
3
  WELCOME = "WELCOME",
4
4
  CREDIT_PROMOTION = "CREDIT_PROMOTION",
5
- SALE_PROMOTION = "SALE_PROMOTION"
5
+ SALE_PROMOTION = "SALE_PROMOTION",
6
+ REFERRAL = "REFERRAL"
6
7
  }
@@ -7,4 +7,5 @@ var BonusTypeEnum;
7
7
  BonusTypeEnum["WELCOME"] = "WELCOME";
8
8
  BonusTypeEnum["CREDIT_PROMOTION"] = "CREDIT_PROMOTION";
9
9
  BonusTypeEnum["SALE_PROMOTION"] = "SALE_PROMOTION";
10
+ BonusTypeEnum["REFERRAL"] = "REFERRAL";
10
11
  })(BonusTypeEnum || (exports.BonusTypeEnum = BonusTypeEnum = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.571.0",
3
+ "version": "3.572.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -8,7 +8,7 @@ import { WelcomeBonusStatusEnum } from '../../enums/WelcomeBonusStatusEnum';
8
8
  /** Tope del motivo libre que el caller escribe en el asiento. */
9
9
  const FREE_TEXT_MAX_LENGTH = 256;
10
10
 
11
- const PROMOTION_BONUS_TYPES = [BonusTypeEnum.CREDIT_PROMOTION, BonusTypeEnum.SALE_PROMOTION];
11
+ const PROMOTION_BONUS_TYPES = [BonusTypeEnum.CREDIT_PROMOTION, BonusTypeEnum.SALE_PROMOTION, BonusTypeEnum.REFERRAL];
12
12
 
13
13
  const STATUSES_REQUIRING_REASON: WelcomeBonusStatusEnum[] = [
14
14
  WelcomeBonusStatusEnum.FAILED,
@@ -3,4 +3,5 @@ export enum BonusTypeEnum {
3
3
  WELCOME = 'WELCOME',
4
4
  CREDIT_PROMOTION = 'CREDIT_PROMOTION',
5
5
  SALE_PROMOTION = 'SALE_PROMOTION',
6
+ REFERRAL = 'REFERRAL',
6
7
  }