@fiado/type-kit 3.658.0 → 3.659.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.
@@ -107,6 +107,7 @@ describe('RetailUser — wallet PCF', () => {
107
107
  pcfAccountId: null,
108
108
  walletLinkMethod: null,
109
109
  walletClabeLast4: null,
110
+ walletPhoneLast4: null,
110
111
  walletLinkedAt: null,
111
112
  walletLinkedBy: null,
112
113
  };
@@ -124,6 +125,17 @@ describe('RetailUser — wallet PCF', () => {
124
125
  expect(errors.some(e => e.property === 'walletClabeLast4')).toBe(true);
125
126
  });
126
127
 
128
+ it('valida la wallet vinculada por teléfono con sus últimos 4', async () => {
129
+ const byPhone = { ...linked, walletLinkMethod: RetailUserWalletLinkMethodEnum.PHONE, walletClabeLast4: null, walletPhoneLast4: '9900' };
130
+ const errors = await validate(plainToInstance(RetailUser, byPhone));
131
+ expect(errors).toEqual([]);
132
+ });
133
+
134
+ it('falla si walletPhoneLast4 trae el teléfono completo', async () => {
135
+ const errors = await validate(plainToInstance(RetailUser, { ...linked, walletPhoneLast4: '5512345678' }));
136
+ expect(errors.some(e => e.property === 'walletPhoneLast4')).toBe(true);
137
+ });
138
+
127
139
  it('falla si walletLinkedAt no es ISO 8601', async () => {
128
140
  const errors = await validate(plainToInstance(RetailUser, { ...linked, walletLinkedAt: '20/10/2026' }));
129
141
  expect(errors.some(e => e.property === 'walletLinkedAt')).toBe(true);
@@ -37,6 +37,8 @@ export declare class RetailUser {
37
37
  walletLinkMethod?: RetailUserWalletLinkMethodEnum | null;
38
38
  /** Últimos 4 dígitos de la CLABE; la CLABE completa no se guarda. */
39
39
  walletClabeLast4?: string | null;
40
+ /** Últimos 4 dígitos del teléfono con que se buscó la wallet; el teléfono completo no se guarda. */
41
+ walletPhoneLast4?: string | null;
40
42
  /** Cuándo se vinculó (ISO). */
41
43
  walletLinkedAt?: string | null;
42
44
  /** Quién la vinculó: el actorId del usuario del back office. */
@@ -115,6 +115,13 @@ __decorate([
115
115
  (0, class_validator_1.Matches)(/^\d{4}$/, { message: 'walletClabeLast4 debe tener 4 dígitos' }),
116
116
  __metadata("design:type", String)
117
117
  ], RetailUser.prototype, "walletClabeLast4", void 0);
118
+ __decorate([
119
+ (0, class_transformer_1.Expose)(),
120
+ (0, class_validator_1.IsOptional)(),
121
+ (0, class_validator_1.IsString)(),
122
+ (0, class_validator_1.Matches)(/^\d{4}$/, { message: 'walletPhoneLast4 debe tener 4 dígitos' }),
123
+ __metadata("design:type", String)
124
+ ], RetailUser.prototype, "walletPhoneLast4", void 0);
118
125
  __decorate([
119
126
  (0, class_transformer_1.Expose)(),
120
127
  (0, class_validator_1.IsOptional)(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.658.0",
3
+ "version": "3.659.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -100,6 +100,13 @@ export class RetailUser {
100
100
  @Matches(/^\d{4}$/, { message: 'walletClabeLast4 debe tener 4 dígitos' })
101
101
  walletClabeLast4?: string | null;
102
102
 
103
+ /** Últimos 4 dígitos del teléfono con que se buscó la wallet; el teléfono completo no se guarda. */
104
+ @Expose()
105
+ @IsOptional()
106
+ @IsString()
107
+ @Matches(/^\d{4}$/, { message: 'walletPhoneLast4 debe tener 4 dígitos' })
108
+ walletPhoneLast4?: string | null;
109
+
103
110
  /** Cuándo se vinculó (ISO). */
104
111
  @Expose()
105
112
  @IsOptional()