@fiado/type-kit 3.507.0 → 3.508.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.
- package/_test_/unit/retailWizard/storeTableShapes.test.ts +47 -0
- package/bin/retailWizard/dtos/responses/BackofficeStoreDetailResponse.d.ts +27 -0
- package/bin/retailWizard/dtos/responses/BackofficeStoreDetailResponse.js +2 -0
- package/bin/retailWizard/dtos/responses/BackofficeStoreTableResponse.d.ts +55 -0
- package/bin/retailWizard/dtos/responses/BackofficeStoreTableResponse.js +2 -0
- package/bin/retailWizard/enums/StoreKindEnum.d.ts +5 -0
- package/bin/retailWizard/enums/StoreKindEnum.js +9 -0
- package/bin/retailWizard/index.d.ts +3 -0
- package/bin/retailWizard/index.js +3 -0
- package/package.json +1 -1
- package/src/retailWizard/dtos/responses/BackofficeStoreDetailResponse.ts +30 -0
- package/src/retailWizard/dtos/responses/BackofficeStoreTableResponse.ts +58 -0
- package/src/retailWizard/enums/StoreKindEnum.ts +5 -0
- package/src/retailWizard/index.ts +3 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { ProductCategoryEnum } from '../../../src/retailCatalog/enums/ProductCategoryEnum';
|
|
3
|
+
import { StoreStatusEnum } from '../../../src/retailOrg/enums/StoreStatusEnum';
|
|
4
|
+
import {
|
|
5
|
+
SellerTableSourceStatusEnum,
|
|
6
|
+
StoreKindEnum,
|
|
7
|
+
type BackofficeStoreDetailResponse,
|
|
8
|
+
type BackofficeStoreTableResponse,
|
|
9
|
+
} from '../../../src/retailWizard';
|
|
10
|
+
|
|
11
|
+
describe('BackofficeStoreTableResponse', () => {
|
|
12
|
+
it('declara las fuentes y una fila completa', () => {
|
|
13
|
+
const response: BackofficeStoreTableResponse = {
|
|
14
|
+
from: '2026-09-30T06:00:00.000Z',
|
|
15
|
+
to: '2026-10-07T05:59:59.999Z',
|
|
16
|
+
truncated: false,
|
|
17
|
+
sources: { roster: SellerTableSourceStatusEnum.OK, team: SellerTableSourceStatusEnum.OK, goals: SellerTableSourceStatusEnum.UNAVAILABLE },
|
|
18
|
+
items: [
|
|
19
|
+
{
|
|
20
|
+
storeId: 'ST-1', code: 'CEN', name: 'Centro', zoneId: 'Z-1', zoneName: 'Norte',
|
|
21
|
+
status: StoreStatusEnum.ACTIVE, kind: null,
|
|
22
|
+
managerRetailUserId: 'V-1', managerName: 'Karla',
|
|
23
|
+
teamActiveCount: 3, teamTotalCount: 4,
|
|
24
|
+
salesCount: 2, placedCents: 200_000, averageTicketCents: 100_000, customersServed: 2,
|
|
25
|
+
lastSaleAt: '2026-10-05T18:00:00.000Z', weekOverWeekChangePct: 12.5,
|
|
26
|
+
goalCents: null, networkSharePct: 40, npiM30Pct: null,
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
};
|
|
30
|
+
expect(response.items[0].status).toBe('ACTIVE');
|
|
31
|
+
expect(StoreKindEnum.SUBDISTRIBUTOR).toBe('SUBDISTRIBUTOR');
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
describe('BackofficeStoreDetailResponse', () => {
|
|
36
|
+
it('declara la serie semanal y el mix por categoría', () => {
|
|
37
|
+
const response: BackofficeStoreDetailResponse = {
|
|
38
|
+
storeId: 'ST-1',
|
|
39
|
+
from: '2026-09-30T06:00:00.000Z',
|
|
40
|
+
to: '2026-10-07T05:59:59.999Z',
|
|
41
|
+
truncated: false,
|
|
42
|
+
weeklyPlacement: [{ from: '2026-09-30T06:00:00.000Z', to: '2026-10-07T05:59:59.999Z', salesCount: 1, placedCents: 100_000 }],
|
|
43
|
+
categoryMix: [{ category: ProductCategoryEnum.PHONE, units: 1, placedCents: 100_000 }, { category: null, units: 1, placedCents: 5_000 }],
|
|
44
|
+
};
|
|
45
|
+
expect(response.categoryMix[1].category).toBeNull();
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ProductCategoryEnum } from '../../../retailCatalog/enums/ProductCategoryEnum';
|
|
2
|
+
/** Colocación de una semana de 7 días; ISO, ambos extremos incluidos. */
|
|
3
|
+
export interface StoreWeeklyPlacement {
|
|
4
|
+
from: string;
|
|
5
|
+
to: string;
|
|
6
|
+
salesCount: number;
|
|
7
|
+
placedCents: number;
|
|
8
|
+
}
|
|
9
|
+
/** Lo vendido de una categoría en la ventana. `category: null` = venta sin líneas de producto. */
|
|
10
|
+
export interface StoreCategoryMixEntry {
|
|
11
|
+
category: ProductCategoryEnum | null;
|
|
12
|
+
units: number;
|
|
13
|
+
placedCents: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* `GET /backoffice/stores/{storeId}/detail?from&to` — el cajón de una tienda: colocación de las 8
|
|
17
|
+
* semanas que terminan en `to` (de la más vieja a la más nueva) y mix por categoría de `[from, to]`.
|
|
18
|
+
*/
|
|
19
|
+
export interface BackofficeStoreDetailResponse {
|
|
20
|
+
storeId: string;
|
|
21
|
+
from: string;
|
|
22
|
+
to: string;
|
|
23
|
+
truncated: boolean;
|
|
24
|
+
weeklyPlacement: StoreWeeklyPlacement[];
|
|
25
|
+
/** De mayor a menor colocación. */
|
|
26
|
+
categoryMix: StoreCategoryMixEntry[];
|
|
27
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { StoreStatusEnum } from '../../../retailOrg/enums/StoreStatusEnum';
|
|
2
|
+
import type { SellerTableSourceStatusEnum } from '../../enums/SellerTableSourceStatusEnum';
|
|
3
|
+
import type { StoreKindEnum } from '../../enums/StoreKindEnum';
|
|
4
|
+
/** Una fila de la tabla de Tiendas: padrón + equipo + ventas de la ventana + meta. */
|
|
5
|
+
export interface StoreTableRow {
|
|
6
|
+
storeId: string;
|
|
7
|
+
/** `null` si la tienda vendió pero ya no está en el padrón. */
|
|
8
|
+
code: string | null;
|
|
9
|
+
name: string | null;
|
|
10
|
+
zoneId: string | null;
|
|
11
|
+
zoneName: string | null;
|
|
12
|
+
status: StoreStatusEnum | null;
|
|
13
|
+
/** Propia o subdistribuidor; `null` mientras ninguna fuente lo sepa. */
|
|
14
|
+
kind: StoreKindEnum | null;
|
|
15
|
+
managerRetailUserId: string | null;
|
|
16
|
+
/** `null` sin encargado o con el equipo sin leer. */
|
|
17
|
+
managerName: string | null;
|
|
18
|
+
/** Vendedores activos con esa tienda de casa; `null` con el equipo sin leer. */
|
|
19
|
+
teamActiveCount: number | null;
|
|
20
|
+
teamTotalCount: number | null;
|
|
21
|
+
/** Sin ventas en la ventana viaja `0`: el barrido es exhaustivo. */
|
|
22
|
+
salesCount: number;
|
|
23
|
+
placedCents: number;
|
|
24
|
+
averageTicketCents: number | null;
|
|
25
|
+
/** Clientes distintos que compraron en la ventana. */
|
|
26
|
+
customersServed: number | null;
|
|
27
|
+
lastSaleAt: string | null;
|
|
28
|
+
/** Δ % contra la misma ventana 7 días antes; `null` si la ventana pasa de 7 días o no hubo base. */
|
|
29
|
+
weekOverWeekChangePct: number | null;
|
|
30
|
+
/** Meta mensual de la tienda escalada a los días de la ventana; `null` sin meta, con metas caídas o ventana > 90 días. */
|
|
31
|
+
goalCents: number | null;
|
|
32
|
+
/** % de la colocación de la cadena en la ventana, a un decimal; `null` si la cadena no colocó. */
|
|
33
|
+
networkSharePct: number | null;
|
|
34
|
+
/** NPI M30: no lo calcula ningún lambda todavía. Siempre `null`. */
|
|
35
|
+
npiM30Pct: null;
|
|
36
|
+
}
|
|
37
|
+
/** Estado de cada fuente. Una fuente `UNAVAILABLE` deja sus campos en `null`, nunca en `0`. */
|
|
38
|
+
export interface StoreTableSources {
|
|
39
|
+
roster: SellerTableSourceStatusEnum;
|
|
40
|
+
/** Vendedores de la cadena: equipo y nombre del encargado. */
|
|
41
|
+
team: SellerTableSourceStatusEnum;
|
|
42
|
+
goals: SellerTableSourceStatusEnum;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* `GET /backoffice/stores/table?from&to&value` — la tabla completa de Tiendas del Portal Admin VL,
|
|
46
|
+
* sin paginación. Incluye las tiendas del padrón sin ventas y las inactivas.
|
|
47
|
+
*/
|
|
48
|
+
export interface BackofficeStoreTableResponse {
|
|
49
|
+
from: string;
|
|
50
|
+
to: string;
|
|
51
|
+
/** Las ventas de la ventana pasaron el tope de lectura: los números están recortados. */
|
|
52
|
+
truncated: boolean;
|
|
53
|
+
sources: StoreTableSources;
|
|
54
|
+
items: StoreTableRow[];
|
|
55
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StoreKindEnum = void 0;
|
|
4
|
+
/** Si la tienda es propia de la cadena o de un subdistribuidor. */
|
|
5
|
+
var StoreKindEnum;
|
|
6
|
+
(function (StoreKindEnum) {
|
|
7
|
+
StoreKindEnum["OWN"] = "OWN";
|
|
8
|
+
StoreKindEnum["SUBDISTRIBUTOR"] = "SUBDISTRIBUTOR";
|
|
9
|
+
})(StoreKindEnum || (exports.StoreKindEnum = StoreKindEnum = {}));
|
|
@@ -138,6 +138,9 @@ export * from './dtos/responses/BackofficeSellerKpisResponse';
|
|
|
138
138
|
export * from './enums/SellerTableSourceStatusEnum';
|
|
139
139
|
export * from './dtos/responses/BackofficeSellerTableResponse';
|
|
140
140
|
export * from './dtos/responses/BackofficeCustomerTableResponse';
|
|
141
|
+
export * from './enums/StoreKindEnum';
|
|
142
|
+
export * from './dtos/responses/BackofficeStoreTableResponse';
|
|
143
|
+
export * from './dtos/responses/BackofficeStoreDetailResponse';
|
|
141
144
|
export * from './events/SaleCompletedV1';
|
|
142
145
|
export * from './events/SaleCancelledV1';
|
|
143
146
|
export * from './events/SaleCompletedV2';
|
|
@@ -171,6 +171,9 @@ __exportStar(require("./dtos/responses/BackofficeSellerKpisResponse"), exports);
|
|
|
171
171
|
__exportStar(require("./enums/SellerTableSourceStatusEnum"), exports);
|
|
172
172
|
__exportStar(require("./dtos/responses/BackofficeSellerTableResponse"), exports);
|
|
173
173
|
__exportStar(require("./dtos/responses/BackofficeCustomerTableResponse"), exports);
|
|
174
|
+
__exportStar(require("./enums/StoreKindEnum"), exports);
|
|
175
|
+
__exportStar(require("./dtos/responses/BackofficeStoreTableResponse"), exports);
|
|
176
|
+
__exportStar(require("./dtos/responses/BackofficeStoreDetailResponse"), exports);
|
|
174
177
|
// Contratos de eventos (PascalCase + sufijo V1)
|
|
175
178
|
__exportStar(require("./events/SaleCompletedV1"), exports);
|
|
176
179
|
__exportStar(require("./events/SaleCancelledV1"), exports);
|
package/package.json
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ProductCategoryEnum } from '../../../retailCatalog/enums/ProductCategoryEnum';
|
|
2
|
+
|
|
3
|
+
/** Colocación de una semana de 7 días; ISO, ambos extremos incluidos. */
|
|
4
|
+
export interface StoreWeeklyPlacement {
|
|
5
|
+
from: string;
|
|
6
|
+
to: string;
|
|
7
|
+
salesCount: number;
|
|
8
|
+
placedCents: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Lo vendido de una categoría en la ventana. `category: null` = venta sin líneas de producto. */
|
|
12
|
+
export interface StoreCategoryMixEntry {
|
|
13
|
+
category: ProductCategoryEnum | null;
|
|
14
|
+
units: number;
|
|
15
|
+
placedCents: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* `GET /backoffice/stores/{storeId}/detail?from&to` — el cajón de una tienda: colocación de las 8
|
|
20
|
+
* semanas que terminan en `to` (de la más vieja a la más nueva) y mix por categoría de `[from, to]`.
|
|
21
|
+
*/
|
|
22
|
+
export interface BackofficeStoreDetailResponse {
|
|
23
|
+
storeId: string;
|
|
24
|
+
from: string;
|
|
25
|
+
to: string;
|
|
26
|
+
truncated: boolean;
|
|
27
|
+
weeklyPlacement: StoreWeeklyPlacement[];
|
|
28
|
+
/** De mayor a menor colocación. */
|
|
29
|
+
categoryMix: StoreCategoryMixEntry[];
|
|
30
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { StoreStatusEnum } from '../../../retailOrg/enums/StoreStatusEnum';
|
|
2
|
+
import type { SellerTableSourceStatusEnum } from '../../enums/SellerTableSourceStatusEnum';
|
|
3
|
+
import type { StoreKindEnum } from '../../enums/StoreKindEnum';
|
|
4
|
+
|
|
5
|
+
/** Una fila de la tabla de Tiendas: padrón + equipo + ventas de la ventana + meta. */
|
|
6
|
+
export interface StoreTableRow {
|
|
7
|
+
storeId: string;
|
|
8
|
+
/** `null` si la tienda vendió pero ya no está en el padrón. */
|
|
9
|
+
code: string | null;
|
|
10
|
+
name: string | null;
|
|
11
|
+
zoneId: string | null;
|
|
12
|
+
zoneName: string | null;
|
|
13
|
+
status: StoreStatusEnum | null;
|
|
14
|
+
/** Propia o subdistribuidor; `null` mientras ninguna fuente lo sepa. */
|
|
15
|
+
kind: StoreKindEnum | null;
|
|
16
|
+
managerRetailUserId: string | null;
|
|
17
|
+
/** `null` sin encargado o con el equipo sin leer. */
|
|
18
|
+
managerName: string | null;
|
|
19
|
+
/** Vendedores activos con esa tienda de casa; `null` con el equipo sin leer. */
|
|
20
|
+
teamActiveCount: number | null;
|
|
21
|
+
teamTotalCount: number | null;
|
|
22
|
+
/** Sin ventas en la ventana viaja `0`: el barrido es exhaustivo. */
|
|
23
|
+
salesCount: number;
|
|
24
|
+
placedCents: number;
|
|
25
|
+
averageTicketCents: number | null;
|
|
26
|
+
/** Clientes distintos que compraron en la ventana. */
|
|
27
|
+
customersServed: number | null;
|
|
28
|
+
lastSaleAt: string | null;
|
|
29
|
+
/** Δ % contra la misma ventana 7 días antes; `null` si la ventana pasa de 7 días o no hubo base. */
|
|
30
|
+
weekOverWeekChangePct: number | null;
|
|
31
|
+
/** Meta mensual de la tienda escalada a los días de la ventana; `null` sin meta, con metas caídas o ventana > 90 días. */
|
|
32
|
+
goalCents: number | null;
|
|
33
|
+
/** % de la colocación de la cadena en la ventana, a un decimal; `null` si la cadena no colocó. */
|
|
34
|
+
networkSharePct: number | null;
|
|
35
|
+
/** NPI M30: no lo calcula ningún lambda todavía. Siempre `null`. */
|
|
36
|
+
npiM30Pct: null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Estado de cada fuente. Una fuente `UNAVAILABLE` deja sus campos en `null`, nunca en `0`. */
|
|
40
|
+
export interface StoreTableSources {
|
|
41
|
+
roster: SellerTableSourceStatusEnum;
|
|
42
|
+
/** Vendedores de la cadena: equipo y nombre del encargado. */
|
|
43
|
+
team: SellerTableSourceStatusEnum;
|
|
44
|
+
goals: SellerTableSourceStatusEnum;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* `GET /backoffice/stores/table?from&to&value` — la tabla completa de Tiendas del Portal Admin VL,
|
|
49
|
+
* sin paginación. Incluye las tiendas del padrón sin ventas y las inactivas.
|
|
50
|
+
*/
|
|
51
|
+
export interface BackofficeStoreTableResponse {
|
|
52
|
+
from: string;
|
|
53
|
+
to: string;
|
|
54
|
+
/** Las ventas de la ventana pasaron el tope de lectura: los números están recortados. */
|
|
55
|
+
truncated: boolean;
|
|
56
|
+
sources: StoreTableSources;
|
|
57
|
+
items: StoreTableRow[];
|
|
58
|
+
}
|
|
@@ -163,6 +163,9 @@ export * from './dtos/responses/BackofficeSellerKpisResponse';
|
|
|
163
163
|
export * from './enums/SellerTableSourceStatusEnum';
|
|
164
164
|
export * from './dtos/responses/BackofficeSellerTableResponse';
|
|
165
165
|
export * from './dtos/responses/BackofficeCustomerTableResponse';
|
|
166
|
+
export * from './enums/StoreKindEnum';
|
|
167
|
+
export * from './dtos/responses/BackofficeStoreTableResponse';
|
|
168
|
+
export * from './dtos/responses/BackofficeStoreDetailResponse';
|
|
166
169
|
|
|
167
170
|
// Contratos de eventos (PascalCase + sufijo V1)
|
|
168
171
|
export * from './events/SaleCompletedV1';
|