@fiado/type-kit 3.577.0 → 3.578.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.
@@ -12,9 +12,12 @@ describe('BackofficeCustomerTableResponse', () => {
12
12
  to: '2026-10-07T18:00:00.000Z',
13
13
  nextToken: 'abc',
14
14
  sources: { sales: SellerTableSourceStatusEnum.OK, credit: SellerTableSourceStatusEnum.UNAVAILABLE },
15
+ counts: { withSales: 1, accountOnly: 1 },
15
16
  items: [
16
17
  {
17
18
  retailCustomerId: 'RC-1',
19
+ accountOnly: false,
20
+ originStoreId: 'ST-1',
18
21
  name: 'Ana',
19
22
  phone: null,
20
23
  purchaseCount: 2,
@@ -28,9 +31,28 @@ describe('BackofficeCustomerTableResponse', () => {
28
31
  skLevel: ClientLevelEnum.GOLD,
29
32
  activeCreditsCount: null,
30
33
  },
34
+ {
35
+ retailCustomerId: 'RC-2',
36
+ accountOnly: true,
37
+ originStoreId: 'ST-1',
38
+ name: 'Luz',
39
+ phone: null,
40
+ purchaseCount: 0,
41
+ totalSpentCents: 0,
42
+ averageTicketCents: null,
43
+ firstPurchaseAt: null,
44
+ lastPurchaseAt: null,
45
+ lastStoreName: null,
46
+ favoriteStoreId: null,
47
+ favoriteStoreName: null,
48
+ skLevel: null,
49
+ activeCreditsCount: null,
50
+ },
31
51
  ],
32
52
  };
33
53
  expect(response.items[0].skLevel).toBe('GOLD');
34
54
  expect(response.sources.credit).toBe('UNAVAILABLE');
55
+ expect(response.items[1].accountOnly).toBe(true);
56
+ expect(response.counts.accountOnly).toBe(1);
35
57
  });
36
58
  });
@@ -10,6 +10,8 @@ import { RetailKycStatusEnum } from '../../enums/RetailKycStatusEnum';
10
10
  export declare class UpsertCustomerFromKycRequest {
11
11
  /** Tienda de alta/origen — del JWT del vendedor dueño de la sesión del wizard (F1 §3.5). */
12
12
  originStoreId: string;
13
+ /** Cadena de la tienda de alta; el wizard la manda desde la sesión. */
14
+ retailerId?: string;
13
15
  /** Nombre partido por convención Fiado (F1 §3.5) — lo entrega el OCR del INE, NO se deriva de un string. */
14
16
  names: string;
15
17
  paternalLastName: string;
@@ -30,6 +30,12 @@ __decorate([
30
30
  (0, class_validator_1.IsString)(),
31
31
  __metadata("design:type", String)
32
32
  ], UpsertCustomerFromKycRequest.prototype, "originStoreId", void 0);
33
+ __decorate([
34
+ (0, class_transformer_1.Expose)(),
35
+ (0, class_validator_1.IsOptional)(),
36
+ (0, class_validator_1.IsString)(),
37
+ __metadata("design:type", String)
38
+ ], UpsertCustomerFromKycRequest.prototype, "retailerId", void 0);
33
39
  __decorate([
34
40
  (0, class_transformer_1.Expose)(),
35
41
  (0, class_validator_1.IsString)(),
@@ -1,16 +1,23 @@
1
1
  import type { ClientLevelEnum } from '../../../loanScoring/enums/ClientLevelEnum';
2
2
  import type { SellerTableSourceStatusEnum } from '../../enums/SellerTableSourceStatusEnum';
3
- /** Una fila de la tabla de Clientes: compras en la cadena dentro de la ventana, sin canceladas, más su crédito SK. */
3
+ /**
4
+ * Una fila de la tabla de Clientes: un cliente del padrón de la cadena con sus compras en la ventana
5
+ * (sin canceladas) y su crédito SK. `accountOnly` = abrió cuenta y no tiene ninguna compra en la cadena.
6
+ */
4
7
  export interface CustomerTableRow {
5
8
  retailCustomerId: string;
9
+ accountOnly: boolean;
10
+ /** Tienda donde se dio de alta; `null` si el padrón no la tiene. */
11
+ originStoreId: string | null;
6
12
  name: string | null;
7
13
  phone: string | null;
8
14
  purchaseCount: number;
9
15
  /** Precio de lo comprado (en crédito, el precio del equipo, no el enganche). */
10
16
  totalSpentCents: number;
11
17
  averageTicketCents: number | null;
12
- firstPurchaseAt: string;
13
- lastPurchaseAt: string;
18
+ /** `null` en un cliente «solo cuenta». */
19
+ firstPurchaseAt: string | null;
20
+ lastPurchaseAt: string | null;
14
21
  lastStoreName: string | null;
15
22
  /** Tienda con más compras; en empate, la de la compra más reciente. */
16
23
  favoriteStoreId: string | null;
@@ -25,14 +32,20 @@ export interface CustomerTableSources {
25
32
  sales: SellerTableSourceStatusEnum.OK;
26
33
  credit: SellerTableSourceStatusEnum;
27
34
  }
35
+ /** Clientes del padrón leídos en la página, antes del filtro `customerType`; el front los suma por página. */
36
+ export interface CustomerTableCounts {
37
+ withSales: number;
38
+ accountOnly: number;
39
+ }
28
40
  /**
29
- * `GET /backoffice/customers/table?from&to&limit&nextToken&storeId&sellerId&value` — tabla de Clientes
30
- * del Portal Admin VL, paginada por última compra descendente. `from` en `null` es «Todo».
41
+ * `GET /backoffice/customers/table?from&to&limit&nextToken&storeId&sellerId&customerType&value` — tabla
42
+ * de Clientes del Portal Admin VL, paginada sobre el padrón por alta descendente. `from` en `null` es «Todo».
31
43
  */
32
44
  export interface BackofficeCustomerTableResponse {
33
45
  from: string | null;
34
46
  to: string;
35
47
  nextToken: string | null;
36
48
  sources: CustomerTableSources;
49
+ counts: CustomerTableCounts;
37
50
  items: CustomerTableRow[];
38
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.577.0",
3
+ "version": "3.578.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -27,6 +27,12 @@ export class UpsertCustomerFromKycRequest {
27
27
  @IsString()
28
28
  originStoreId!: string;
29
29
 
30
+ /** Cadena de la tienda de alta; el wizard la manda desde la sesión. */
31
+ @Expose()
32
+ @IsOptional()
33
+ @IsString()
34
+ retailerId?: string;
35
+
30
36
  /** Nombre partido por convención Fiado (F1 §3.5) — lo entrega el OCR del INE, NO se deriva de un string. */
31
37
  @Expose()
32
38
  @IsString()
@@ -1,17 +1,24 @@
1
1
  import type { ClientLevelEnum } from '../../../loanScoring/enums/ClientLevelEnum';
2
2
  import type { SellerTableSourceStatusEnum } from '../../enums/SellerTableSourceStatusEnum';
3
3
 
4
- /** Una fila de la tabla de Clientes: compras en la cadena dentro de la ventana, sin canceladas, más su crédito SK. */
4
+ /**
5
+ * Una fila de la tabla de Clientes: un cliente del padrón de la cadena con sus compras en la ventana
6
+ * (sin canceladas) y su crédito SK. `accountOnly` = abrió cuenta y no tiene ninguna compra en la cadena.
7
+ */
5
8
  export interface CustomerTableRow {
6
9
  retailCustomerId: string;
10
+ accountOnly: boolean;
11
+ /** Tienda donde se dio de alta; `null` si el padrón no la tiene. */
12
+ originStoreId: string | null;
7
13
  name: string | null;
8
14
  phone: string | null;
9
15
  purchaseCount: number;
10
16
  /** Precio de lo comprado (en crédito, el precio del equipo, no el enganche). */
11
17
  totalSpentCents: number;
12
18
  averageTicketCents: number | null;
13
- firstPurchaseAt: string;
14
- lastPurchaseAt: string;
19
+ /** `null` en un cliente «solo cuenta». */
20
+ firstPurchaseAt: string | null;
21
+ lastPurchaseAt: string | null;
15
22
  lastStoreName: string | null;
16
23
  /** Tienda con más compras; en empate, la de la compra más reciente. */
17
24
  favoriteStoreId: string | null;
@@ -28,14 +35,21 @@ export interface CustomerTableSources {
28
35
  credit: SellerTableSourceStatusEnum;
29
36
  }
30
37
 
38
+ /** Clientes del padrón leídos en la página, antes del filtro `customerType`; el front los suma por página. */
39
+ export interface CustomerTableCounts {
40
+ withSales: number;
41
+ accountOnly: number;
42
+ }
43
+
31
44
  /**
32
- * `GET /backoffice/customers/table?from&to&limit&nextToken&storeId&sellerId&value` — tabla de Clientes
33
- * del Portal Admin VL, paginada por última compra descendente. `from` en `null` es «Todo».
45
+ * `GET /backoffice/customers/table?from&to&limit&nextToken&storeId&sellerId&customerType&value` — tabla
46
+ * de Clientes del Portal Admin VL, paginada sobre el padrón por alta descendente. `from` en `null` es «Todo».
34
47
  */
35
48
  export interface BackofficeCustomerTableResponse {
36
49
  from: string | null;
37
50
  to: string;
38
51
  nextToken: string | null;
39
52
  sources: CustomerTableSources;
53
+ counts: CustomerTableCounts;
40
54
  items: CustomerTableRow[];
41
55
  }