@fiado/type-kit 3.239.0 → 3.241.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.
@@ -27,6 +27,7 @@ describe('ValidationDtos (shapes mínimos de endpoints privados)', () => {
27
27
  storeId: 'store_001',
28
28
  retailerId: 'ret_001',
29
29
  zoneId: null,
30
+ zoneName: null,
30
31
  code: 'MTY-001',
31
32
  name: 'Sucursal Centro',
32
33
  status: StoreStatusEnum.ACTIVE,
@@ -41,6 +42,7 @@ describe('ValidationDtos (shapes mínimos de endpoints privados)', () => {
41
42
  cognitoSub: '5f7c8a90-1234-4abc-9def-0123456789ab',
42
43
  retailerId: 'ret_001',
43
44
  homeStoreId: 'store_001',
45
+ displayName: 'Vendedor Uno',
44
46
  employmentType: EmploymentTypeEnum.EMPLOYEE,
45
47
  commissionTier: 'TIER_A',
46
48
  status: RetailUserStatusEnum.ACTIVE,
@@ -3,9 +3,24 @@ import { BeneficiaryRelationEnum } from '../enums/BeneficiaryRelationEnum';
3
3
  * Beneficiario capturado en el paso 10 (bienvenida N2). Se envía a `IAccountBeneficiaryApi.create`
4
4
  * (expediente wallet Fiado). El cliente puede NO dar beneficiario (opcional en régimen simplificado N1).
5
5
  * SureKeep Fase 2 — pista Retail.
6
+ *
7
+ * 2026-07-28 (aditivo, retrocompatible): el front captura nombre/apellidos POR SEPARADO y el esquema
8
+ * del expediente (`beneficiary-business`) EXIGE `paternalLastName` — con solo `fullName` la
9
+ * información se perdía justo antes de donde se necesita (400 BULK_GROUP_CREATION_FAILED). Los
10
+ * campos separados son opcionales: un caller viejo que mande solo `fullName` sigue validando, y el
11
+ * adapter del wizard degrada con heurística documentada (DEC-BENEF-001).
6
12
  */
7
13
  export declare class WizardBeneficiary {
8
14
  fullName: string;
15
+ /** Nombre(s) de pila, sin apellidos. Preferir SIEMPRE sobre partir `fullName`. */
16
+ firstName?: string;
17
+ /** Apellido paterno — el esquema del expediente wallet lo exige. */
18
+ paternalLastName?: string;
19
+ maternalLastName?: string;
20
+ /** Fecha de nacimiento ISO (YYYY-MM-DD). */
21
+ dateOfBirth?: string;
22
+ /** Teléfono del beneficiario (el front ofrece "mismo teléfono que el titular"). */
23
+ phoneNumber?: string;
9
24
  relation: BeneficiaryRelationEnum;
10
25
  /** Porcentaje de asignación (1-100). Si hay un solo beneficiario, típicamente 100. */
11
26
  percentage?: number;
@@ -17,6 +17,12 @@ const BeneficiaryRelationEnum_1 = require("../enums/BeneficiaryRelationEnum");
17
17
  * Beneficiario capturado en el paso 10 (bienvenida N2). Se envía a `IAccountBeneficiaryApi.create`
18
18
  * (expediente wallet Fiado). El cliente puede NO dar beneficiario (opcional en régimen simplificado N1).
19
19
  * SureKeep Fase 2 — pista Retail.
20
+ *
21
+ * 2026-07-28 (aditivo, retrocompatible): el front captura nombre/apellidos POR SEPARADO y el esquema
22
+ * del expediente (`beneficiary-business`) EXIGE `paternalLastName` — con solo `fullName` la
23
+ * información se perdía justo antes de donde se necesita (400 BULK_GROUP_CREATION_FAILED). Los
24
+ * campos separados son opcionales: un caller viejo que mande solo `fullName` sigue validando, y el
25
+ * adapter del wizard degrada con heurística documentada (DEC-BENEF-001).
20
26
  */
21
27
  class WizardBeneficiary {
22
28
  }
@@ -26,6 +32,36 @@ __decorate([
26
32
  (0, class_validator_1.IsString)(),
27
33
  __metadata("design:type", String)
28
34
  ], WizardBeneficiary.prototype, "fullName", void 0);
35
+ __decorate([
36
+ (0, class_transformer_1.Expose)(),
37
+ (0, class_validator_1.IsOptional)(),
38
+ (0, class_validator_1.IsString)(),
39
+ __metadata("design:type", String)
40
+ ], WizardBeneficiary.prototype, "firstName", void 0);
41
+ __decorate([
42
+ (0, class_transformer_1.Expose)(),
43
+ (0, class_validator_1.IsOptional)(),
44
+ (0, class_validator_1.IsString)(),
45
+ __metadata("design:type", String)
46
+ ], WizardBeneficiary.prototype, "paternalLastName", void 0);
47
+ __decorate([
48
+ (0, class_transformer_1.Expose)(),
49
+ (0, class_validator_1.IsOptional)(),
50
+ (0, class_validator_1.IsString)(),
51
+ __metadata("design:type", String)
52
+ ], WizardBeneficiary.prototype, "maternalLastName", void 0);
53
+ __decorate([
54
+ (0, class_transformer_1.Expose)(),
55
+ (0, class_validator_1.IsOptional)(),
56
+ (0, class_validator_1.IsISO8601)(),
57
+ __metadata("design:type", String)
58
+ ], WizardBeneficiary.prototype, "dateOfBirth", void 0);
59
+ __decorate([
60
+ (0, class_transformer_1.Expose)(),
61
+ (0, class_validator_1.IsOptional)(),
62
+ (0, class_validator_1.IsString)(),
63
+ __metadata("design:type", String)
64
+ ], WizardBeneficiary.prototype, "phoneNumber", void 0);
29
65
  __decorate([
30
66
  (0, class_transformer_1.Expose)(),
31
67
  (0, class_validator_1.IsEnum)(BeneficiaryRelationEnum_1.BeneficiaryRelationEnum),
@@ -1,3 +1,4 @@
1
+ import type { SaleTypeEnum } from '../enums/SaleTypeEnum';
1
2
  /**
2
3
  * Emitido al cerrar una venta (flujo 09). Se escribe al outbox transaccional en la MISMA
3
4
  * `TransactWriteItems` del cierre; drena a la cola Central + datalake. Solo identificadores
@@ -11,7 +12,23 @@ export interface SaleCompletedV1 {
11
12
  retailCustomerId: string;
12
13
  sku: string;
13
14
  imei: string | null;
15
+ /**
16
+ * Lo COBRADO en caja al cerrar (contrato histórico — La Central y comisión F4 lo asumen así).
17
+ * En contado == precio del equipo; en CREDIT es SOLO el enganche: desambiguar con `type` +
18
+ * `equipmentPriceCents`, NUNCA redefinir este campo.
19
+ */
14
20
  amountCents: number;
21
+ /**
22
+ * Eje financiero (aditivos 2026-07-28, opcionales para consumidores/eventos previos):
23
+ * sin `type` un crédito con $1,300 de enganche era indistinguible de un contado de $1,300.
24
+ */
25
+ type?: SaleTypeEnum;
26
+ /** Precio de lista del equipo; en contado coincide con `amountCents`. */
27
+ equipmentPriceCents?: number;
28
+ /** Enganche cobrado (solo `type=CREDIT`). */
29
+ downPaymentCents?: number;
30
+ /** Puntero al crédito SOFOM en loan-credit (solo `type=CREDIT`). */
31
+ creditId?: string;
15
32
  soldAt: string;
16
33
  occurredAt: string;
17
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.239.0",
3
+ "version": "3.241.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -1,17 +1,52 @@
1
1
  import { Expose } from 'class-transformer';
2
- import { IsEnum, IsInt, IsOptional, IsString, Max, Min } from 'class-validator';
2
+ import { IsEnum, IsInt, IsISO8601, IsOptional, IsString, Max, Min } from 'class-validator';
3
3
  import { BeneficiaryRelationEnum } from '../enums/BeneficiaryRelationEnum';
4
4
 
5
5
  /**
6
6
  * Beneficiario capturado en el paso 10 (bienvenida N2). Se envía a `IAccountBeneficiaryApi.create`
7
7
  * (expediente wallet Fiado). El cliente puede NO dar beneficiario (opcional en régimen simplificado N1).
8
8
  * SureKeep Fase 2 — pista Retail.
9
+ *
10
+ * 2026-07-28 (aditivo, retrocompatible): el front captura nombre/apellidos POR SEPARADO y el esquema
11
+ * del expediente (`beneficiary-business`) EXIGE `paternalLastName` — con solo `fullName` la
12
+ * información se perdía justo antes de donde se necesita (400 BULK_GROUP_CREATION_FAILED). Los
13
+ * campos separados son opcionales: un caller viejo que mande solo `fullName` sigue validando, y el
14
+ * adapter del wizard degrada con heurística documentada (DEC-BENEF-001).
9
15
  */
10
16
  export class WizardBeneficiary {
11
17
  @Expose()
12
18
  @IsString()
13
19
  fullName!: string;
14
20
 
21
+ /** Nombre(s) de pila, sin apellidos. Preferir SIEMPRE sobre partir `fullName`. */
22
+ @Expose()
23
+ @IsOptional()
24
+ @IsString()
25
+ firstName?: string;
26
+
27
+ /** Apellido paterno — el esquema del expediente wallet lo exige. */
28
+ @Expose()
29
+ @IsOptional()
30
+ @IsString()
31
+ paternalLastName?: string;
32
+
33
+ @Expose()
34
+ @IsOptional()
35
+ @IsString()
36
+ maternalLastName?: string;
37
+
38
+ /** Fecha de nacimiento ISO (YYYY-MM-DD). */
39
+ @Expose()
40
+ @IsOptional()
41
+ @IsISO8601()
42
+ dateOfBirth?: string;
43
+
44
+ /** Teléfono del beneficiario (el front ofrece "mismo teléfono que el titular"). */
45
+ @Expose()
46
+ @IsOptional()
47
+ @IsString()
48
+ phoneNumber?: string;
49
+
15
50
  @Expose()
16
51
  @IsEnum(BeneficiaryRelationEnum)
17
52
  relation!: BeneficiaryRelationEnum;
@@ -1,3 +1,5 @@
1
+ import type { SaleTypeEnum } from '../enums/SaleTypeEnum';
2
+
1
3
  /**
2
4
  * Emitido al cerrar una venta (flujo 09). Se escribe al outbox transaccional en la MISMA
3
5
  * `TransactWriteItems` del cierre; drena a la cola Central + datalake. Solo identificadores
@@ -11,7 +13,23 @@ export interface SaleCompletedV1 {
11
13
  retailCustomerId: string;
12
14
  sku: string;
13
15
  imei: string | null;
16
+ /**
17
+ * Lo COBRADO en caja al cerrar (contrato histórico — La Central y comisión F4 lo asumen así).
18
+ * En contado == precio del equipo; en CREDIT es SOLO el enganche: desambiguar con `type` +
19
+ * `equipmentPriceCents`, NUNCA redefinir este campo.
20
+ */
14
21
  amountCents: number;
22
+ /**
23
+ * Eje financiero (aditivos 2026-07-28, opcionales para consumidores/eventos previos):
24
+ * sin `type` un crédito con $1,300 de enganche era indistinguible de un contado de $1,300.
25
+ */
26
+ type?: SaleTypeEnum;
27
+ /** Precio de lista del equipo; en contado coincide con `amountCents`. */
28
+ equipmentPriceCents?: number;
29
+ /** Enganche cobrado (solo `type=CREDIT`). */
30
+ downPaymentCents?: number;
31
+ /** Puntero al crédito SOFOM en loan-credit (solo `type=CREDIT`). */
32
+ creditId?: string;
15
33
  soldAt: string;
16
34
  occurredAt: string;
17
35
  }