@fiado/type-kit 3.459.0 → 3.461.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/retailCatalog/catalogEnums.test.ts +34 -0
- package/_test_/unit/retailCatalog/stockRequests.test.ts +156 -0
- package/_test_/unit/retailWizard/multiItemRequests.test.ts +114 -0
- package/_test_/unit/retailWizard/multiItemShapes.test.ts +126 -0
- package/bin/card/enums/Status.d.ts +6 -1
- package/bin/card/enums/Status.js +5 -0
- package/bin/retailCatalog/dtos/Product.d.ts +15 -1
- package/bin/retailCatalog/dtos/ProductComponent.d.ts +5 -0
- package/bin/retailCatalog/dtos/ProductComponent.js +29 -0
- package/bin/retailCatalog/dtos/requests/GetInventorySkuQuery.d.ts +10 -0
- package/bin/retailCatalog/dtos/requests/GetInventorySkuQuery.js +42 -0
- package/bin/retailCatalog/dtos/requests/InventoryLensQuery.d.ts +5 -0
- package/bin/retailCatalog/dtos/requests/InventoryLensQuery.js +11 -0
- package/bin/retailCatalog/dtos/requests/ReleaseStockRequest.d.ts +8 -0
- package/bin/retailCatalog/dtos/requests/ReleaseStockRequest.js +34 -0
- package/bin/retailCatalog/dtos/requests/RenewReservationsRequest.d.ts +6 -0
- package/bin/retailCatalog/dtos/requests/RenewReservationsRequest.js +30 -0
- package/bin/retailCatalog/dtos/requests/ReservationLineRef.d.ts +5 -0
- package/bin/retailCatalog/dtos/requests/ReservationLineRef.js +25 -0
- package/bin/retailCatalog/dtos/requests/ReserveStockRequest.d.ts +10 -0
- package/bin/retailCatalog/dtos/requests/ReserveStockRequest.js +42 -0
- package/bin/retailCatalog/dtos/requests/ReturnStockRequest.d.ts +9 -0
- package/bin/retailCatalog/dtos/requests/ReturnStockRequest.js +38 -0
- package/bin/retailCatalog/dtos/requests/SellStockRequest.d.ts +7 -0
- package/bin/retailCatalog/dtos/requests/SellStockRequest.js +34 -0
- package/bin/retailCatalog/dtos/requests/StockLine.d.ts +14 -0
- package/bin/retailCatalog/dtos/requests/StockLine.js +56 -0
- package/bin/retailCatalog/dtos/requests/SuggestPiecesQuery.d.ts +5 -0
- package/bin/retailCatalog/dtos/requests/SuggestPiecesQuery.js +26 -0
- package/bin/retailCatalog/dtos/requests/SyncInventoryRequest.d.ts +47 -0
- package/bin/retailCatalog/dtos/requests/SyncInventoryRequest.js +173 -0
- package/bin/retailCatalog/dtos/responses/GetInventorySkuResponse.d.ts +34 -0
- package/bin/retailCatalog/dtos/responses/GetInventorySkuResponse.js +2 -0
- package/bin/retailCatalog/dtos/responses/InventoryLensResponse.d.ts +43 -2
- package/bin/retailCatalog/dtos/responses/ListSkuPricesResponse.d.ts +6 -0
- package/bin/retailCatalog/dtos/responses/ListSkuPricesResponse.js +2 -0
- package/bin/retailCatalog/dtos/responses/ReleaseStockResponse.d.ts +10 -0
- package/bin/retailCatalog/dtos/responses/ReleaseStockResponse.js +2 -0
- package/bin/retailCatalog/dtos/responses/RenewReservationsResponse.d.ts +10 -0
- package/bin/retailCatalog/dtos/responses/RenewReservationsResponse.js +2 -0
- package/bin/retailCatalog/dtos/responses/ReserveStockResponse.d.ts +25 -0
- package/bin/retailCatalog/dtos/responses/ReserveStockResponse.js +2 -0
- package/bin/retailCatalog/dtos/responses/ReturnStockResponse.d.ts +4 -0
- package/bin/retailCatalog/dtos/responses/ReturnStockResponse.js +2 -0
- package/bin/retailCatalog/dtos/responses/SellStockResponse.d.ts +18 -0
- package/bin/retailCatalog/dtos/responses/SellStockResponse.js +2 -0
- package/bin/retailCatalog/dtos/responses/SkuPriceEntry.d.ts +9 -0
- package/bin/retailCatalog/dtos/responses/SkuPriceEntry.js +2 -0
- package/bin/retailCatalog/dtos/responses/StoreCatalogItem.d.ts +29 -0
- package/bin/retailCatalog/dtos/responses/StoreCatalogItem.js +2 -0
- package/bin/retailCatalog/dtos/responses/SuggestPiecesResponse.d.ts +6 -0
- package/bin/retailCatalog/dtos/responses/SuggestPiecesResponse.js +2 -0
- package/bin/retailCatalog/dtos/responses/SyncInventoryResponse.d.ts +13 -0
- package/bin/retailCatalog/dtos/responses/SyncInventoryResponse.js +2 -0
- package/bin/retailCatalog/dtos/validation/ValidateProductResponse.d.ts +6 -1
- package/bin/retailCatalog/enums/InventoryLensFilterEnum.d.ts +3 -1
- package/bin/retailCatalog/enums/InventoryLensFilterEnum.js +2 -0
- package/bin/retailCatalog/enums/InventoryLensPeriodEnum.d.ts +7 -0
- package/bin/retailCatalog/enums/InventoryLensPeriodEnum.js +11 -0
- package/bin/retailCatalog/enums/InventoryMovementTypeEnum.d.ts +9 -0
- package/bin/retailCatalog/enums/InventoryMovementTypeEnum.js +13 -0
- package/bin/retailCatalog/enums/InventorySyncRejectionCodeEnum.d.ts +9 -0
- package/bin/retailCatalog/enums/InventorySyncRejectionCodeEnum.js +13 -0
- package/bin/retailCatalog/enums/InventorySyncResultStatusEnum.d.ts +6 -0
- package/bin/retailCatalog/enums/InventorySyncResultStatusEnum.js +10 -0
- package/bin/retailCatalog/enums/PriceSourceEnum.d.ts +4 -0
- package/bin/retailCatalog/enums/PriceSourceEnum.js +8 -0
- package/bin/retailCatalog/enums/ProductCategoryEnum.d.ts +9 -0
- package/bin/retailCatalog/enums/ProductCategoryEnum.js +13 -0
- package/bin/retailCatalog/enums/TrackingModeEnum.d.ts +6 -0
- package/bin/retailCatalog/enums/TrackingModeEnum.js +10 -0
- package/bin/retailCatalog/index.d.ts +29 -0
- package/bin/retailCatalog/index.js +30 -0
- package/bin/retailWizard/dtos/Sale.d.ts +7 -0
- package/bin/retailWizard/dtos/SaleLine.d.ts +16 -0
- package/bin/retailWizard/dtos/SaleLine.js +2 -0
- package/bin/retailWizard/dtos/WizardLineIdentifiers.d.ts +5 -0
- package/bin/retailWizard/dtos/WizardLineIdentifiers.js +2 -0
- package/bin/retailWizard/dtos/WizardLineProduct.d.ts +15 -0
- package/bin/retailWizard/dtos/WizardLineProduct.js +2 -0
- package/bin/retailWizard/dtos/WizardProduct.d.ts +6 -0
- package/bin/retailWizard/dtos/WizardReservedLine.d.ts +35 -0
- package/bin/retailWizard/dtos/WizardReservedLine.js +2 -0
- package/bin/retailWizard/dtos/WizardSession.d.ts +5 -0
- package/bin/retailWizard/dtos/requests/AddProductRequest.d.ts +4 -8
- package/bin/retailWizard/dtos/requests/AddProductRequest.js +9 -8
- package/bin/retailWizard/dtos/requests/CompleteSaleRequest.d.ts +16 -0
- package/bin/retailWizard/dtos/requests/CompleteSaleRequest.js +59 -0
- package/bin/retailWizard/dtos/requests/DeleteProductRequest.d.ts +3 -1
- package/bin/retailWizard/dtos/requests/DeleteProductRequest.js +7 -1
- package/bin/retailWizard/dtos/requests/QuoteRequest.d.ts +2 -0
- package/bin/retailWizard/dtos/requests/QuoteRequest.js +7 -0
- package/bin/retailWizard/dtos/requests/SuggestIdentifiersQuery.d.ts +5 -0
- package/bin/retailWizard/dtos/requests/SuggestIdentifiersQuery.js +30 -0
- package/bin/retailWizard/enums/LinePaymentTypeEnum.d.ts +7 -0
- package/bin/retailWizard/enums/LinePaymentTypeEnum.js +11 -0
- package/bin/retailWizard/enums/WizardLineStatusEnum.d.ts +9 -0
- package/bin/retailWizard/enums/WizardLineStatusEnum.js +13 -0
- package/bin/retailWizard/index.d.ts +8 -0
- package/bin/retailWizard/index.js +8 -0
- package/package.json +1 -1
- package/src/card/enums/Status.ts +6 -1
- package/src/retailCatalog/dtos/Product.ts +17 -1
- package/src/retailCatalog/dtos/ProductComponent.ts +14 -0
- package/src/retailCatalog/dtos/requests/GetInventorySkuQuery.ts +27 -0
- package/src/retailCatalog/dtos/requests/InventoryLensQuery.ts +12 -1
- package/src/retailCatalog/dtos/requests/ReleaseStockRequest.ts +19 -0
- package/src/retailCatalog/dtos/requests/RenewReservationsRequest.ts +15 -0
- package/src/retailCatalog/dtos/requests/ReservationLineRef.ts +10 -0
- package/src/retailCatalog/dtos/requests/ReserveStockRequest.ts +24 -0
- package/src/retailCatalog/dtos/requests/ReturnStockRequest.ts +22 -0
- package/src/retailCatalog/dtos/requests/SellStockRequest.ts +18 -0
- package/src/retailCatalog/dtos/requests/StockLine.ts +36 -0
- package/src/retailCatalog/dtos/requests/SuggestPiecesQuery.ts +11 -0
- package/src/retailCatalog/dtos/requests/SyncInventoryRequest.ts +145 -0
- package/src/retailCatalog/dtos/responses/GetInventorySkuResponse.ts +38 -0
- package/src/retailCatalog/dtos/responses/InventoryLensResponse.ts +48 -2
- package/src/retailCatalog/dtos/responses/ListSkuPricesResponse.ts +7 -0
- package/src/retailCatalog/dtos/responses/ReleaseStockResponse.ts +11 -0
- package/src/retailCatalog/dtos/responses/RenewReservationsResponse.ts +11 -0
- package/src/retailCatalog/dtos/responses/ReserveStockResponse.ts +27 -0
- package/src/retailCatalog/dtos/responses/ReturnStockResponse.ts +4 -0
- package/src/retailCatalog/dtos/responses/SellStockResponse.ts +20 -0
- package/src/retailCatalog/dtos/responses/SkuPriceEntry.ts +10 -0
- package/src/retailCatalog/dtos/responses/StoreCatalogItem.ts +31 -0
- package/src/retailCatalog/dtos/responses/SuggestPiecesResponse.ts +7 -0
- package/src/retailCatalog/dtos/responses/SyncInventoryResponse.ts +15 -0
- package/src/retailCatalog/dtos/validation/ValidateProductResponse.ts +6 -1
- package/src/retailCatalog/enums/InventoryLensFilterEnum.ts +2 -0
- package/src/retailCatalog/enums/InventoryLensPeriodEnum.ts +7 -0
- package/src/retailCatalog/enums/InventoryMovementTypeEnum.ts +9 -0
- package/src/retailCatalog/enums/InventorySyncRejectionCodeEnum.ts +9 -0
- package/src/retailCatalog/enums/InventorySyncResultStatusEnum.ts +6 -0
- package/src/retailCatalog/enums/PriceSourceEnum.ts +4 -0
- package/src/retailCatalog/enums/ProductCategoryEnum.ts +9 -0
- package/src/retailCatalog/enums/TrackingModeEnum.ts +6 -0
- package/src/retailCatalog/index.ts +31 -0
- package/src/retailWizard/dtos/Sale.ts +7 -0
- package/src/retailWizard/dtos/SaleLine.ts +17 -0
- package/src/retailWizard/dtos/WizardLineIdentifiers.ts +5 -0
- package/src/retailWizard/dtos/WizardLineProduct.ts +16 -0
- package/src/retailWizard/dtos/WizardProduct.ts +7 -0
- package/src/retailWizard/dtos/WizardReservedLine.ts +36 -0
- package/src/retailWizard/dtos/WizardSession.ts +5 -0
- package/src/retailWizard/dtos/requests/AddProductRequest.ts +9 -8
- package/src/retailWizard/dtos/requests/CompleteSaleRequest.ts +41 -0
- package/src/retailWizard/dtos/requests/DeleteProductRequest.ts +7 -1
- package/src/retailWizard/dtos/requests/QuoteRequest.ts +8 -1
- package/src/retailWizard/dtos/requests/SuggestIdentifiersQuery.ts +15 -0
- package/src/retailWizard/enums/LinePaymentTypeEnum.ts +7 -0
- package/src/retailWizard/enums/WizardLineStatusEnum.ts +9 -0
- package/src/retailWizard/index.ts +8 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { Type } from 'class-transformer';
|
|
2
|
+
import {
|
|
3
|
+
IsArray,
|
|
4
|
+
IsBoolean,
|
|
5
|
+
IsEnum,
|
|
6
|
+
IsInt,
|
|
7
|
+
IsISO8601,
|
|
8
|
+
IsOptional,
|
|
9
|
+
IsString,
|
|
10
|
+
Length,
|
|
11
|
+
Matches,
|
|
12
|
+
Min,
|
|
13
|
+
ValidateNested,
|
|
14
|
+
} from 'class-validator';
|
|
15
|
+
import { SKU_PATTERN } from '../../constants/SkuPattern';
|
|
16
|
+
import { MdmLockModeEnum } from '../../enums/MdmLockModeEnum';
|
|
17
|
+
import { MdmProviderEnum } from '../../enums/MdmProviderEnum';
|
|
18
|
+
import { ProductCategoryEnum } from '../../enums/ProductCategoryEnum';
|
|
19
|
+
import { ProductTierEnum } from '../../enums/ProductTierEnum';
|
|
20
|
+
import { TrackingModeEnum } from '../../enums/TrackingModeEnum';
|
|
21
|
+
import { ProductComponent } from '../ProductComponent';
|
|
22
|
+
|
|
23
|
+
/** Precio de un producto en la puerta de entrada; crea PRICE# solo si cambió el monto. */
|
|
24
|
+
export class SyncPrice {
|
|
25
|
+
@IsOptional()
|
|
26
|
+
@IsInt()
|
|
27
|
+
@Min(0)
|
|
28
|
+
listPriceCents?: number | null;
|
|
29
|
+
|
|
30
|
+
@IsInt()
|
|
31
|
+
@Min(0)
|
|
32
|
+
basePriceCents!: number;
|
|
33
|
+
|
|
34
|
+
@IsISO8601()
|
|
35
|
+
effectiveFrom!: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Producto tal como llega de Zentral. */
|
|
39
|
+
export class SyncProduct {
|
|
40
|
+
@Matches(SKU_PATTERN, { message: 'sku admite solo [A-Za-z0-9-]' })
|
|
41
|
+
@Length(1, 64)
|
|
42
|
+
@IsString()
|
|
43
|
+
sku!: string;
|
|
44
|
+
|
|
45
|
+
@IsEnum(ProductCategoryEnum)
|
|
46
|
+
category!: ProductCategoryEnum;
|
|
47
|
+
|
|
48
|
+
@IsEnum(TrackingModeEnum)
|
|
49
|
+
trackingMode!: TrackingModeEnum;
|
|
50
|
+
|
|
51
|
+
@IsBoolean()
|
|
52
|
+
sellable!: boolean;
|
|
53
|
+
|
|
54
|
+
@IsBoolean()
|
|
55
|
+
showInSalesFlow!: boolean;
|
|
56
|
+
|
|
57
|
+
@IsArray()
|
|
58
|
+
@IsString({ each: true })
|
|
59
|
+
eligibleFinanciers!: string[];
|
|
60
|
+
|
|
61
|
+
/** Solo en BUNDLE. */
|
|
62
|
+
@IsOptional()
|
|
63
|
+
@IsArray()
|
|
64
|
+
@ValidateNested({ each: true })
|
|
65
|
+
@Type(() => ProductComponent)
|
|
66
|
+
components?: ProductComponent[];
|
|
67
|
+
|
|
68
|
+
/** `null` o ausente = Sin gama. */
|
|
69
|
+
@IsOptional()
|
|
70
|
+
@IsEnum(ProductTierEnum)
|
|
71
|
+
tier?: ProductTierEnum | null;
|
|
72
|
+
|
|
73
|
+
@ValidateNested()
|
|
74
|
+
@Type(() => SyncPrice)
|
|
75
|
+
price!: SyncPrice;
|
|
76
|
+
|
|
77
|
+
// Datos descriptivos y MDM: un producto nuevo de Zentral solo entra por esta puerta.
|
|
78
|
+
@IsOptional()
|
|
79
|
+
@IsString()
|
|
80
|
+
brand?: string;
|
|
81
|
+
|
|
82
|
+
@IsOptional()
|
|
83
|
+
@IsString()
|
|
84
|
+
model?: string;
|
|
85
|
+
|
|
86
|
+
@IsOptional()
|
|
87
|
+
@IsString()
|
|
88
|
+
capacity?: string;
|
|
89
|
+
|
|
90
|
+
@IsOptional()
|
|
91
|
+
@IsString()
|
|
92
|
+
color?: string;
|
|
93
|
+
|
|
94
|
+
@IsOptional()
|
|
95
|
+
@IsString()
|
|
96
|
+
description?: string;
|
|
97
|
+
|
|
98
|
+
@IsOptional()
|
|
99
|
+
@IsString()
|
|
100
|
+
imageUrl?: string | null;
|
|
101
|
+
|
|
102
|
+
@IsOptional()
|
|
103
|
+
@IsBoolean()
|
|
104
|
+
mdmEnabled?: boolean;
|
|
105
|
+
|
|
106
|
+
@IsOptional()
|
|
107
|
+
@IsEnum(MdmProviderEnum)
|
|
108
|
+
mdmProvider?: MdmProviderEnum | null;
|
|
109
|
+
|
|
110
|
+
@IsOptional()
|
|
111
|
+
@IsEnum(MdmLockModeEnum)
|
|
112
|
+
mdmLockMode?: MdmLockModeEnum | null;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** Stock de un SKU en una tienda: `qty` para SKUs por cantidad, `identifiers` para IMEI o serie. */
|
|
116
|
+
export class SyncStock {
|
|
117
|
+
@IsString()
|
|
118
|
+
storeId!: string;
|
|
119
|
+
|
|
120
|
+
@IsString()
|
|
121
|
+
sku!: string;
|
|
122
|
+
|
|
123
|
+
@IsOptional()
|
|
124
|
+
@IsInt()
|
|
125
|
+
@Min(0)
|
|
126
|
+
qty?: number;
|
|
127
|
+
|
|
128
|
+
@IsOptional()
|
|
129
|
+
@IsArray()
|
|
130
|
+
@IsString({ each: true })
|
|
131
|
+
identifiers?: string[];
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/** Body de POST /private/retailers/{retailerId}/inventory/sync (privateSyncInventory), la puerta de entrada. */
|
|
135
|
+
export class SyncInventoryRequest {
|
|
136
|
+
@IsArray()
|
|
137
|
+
@ValidateNested({ each: true })
|
|
138
|
+
@Type(() => SyncProduct)
|
|
139
|
+
products!: SyncProduct[];
|
|
140
|
+
|
|
141
|
+
@IsArray()
|
|
142
|
+
@ValidateNested({ each: true })
|
|
143
|
+
@Type(() => SyncStock)
|
|
144
|
+
stock!: SyncStock[];
|
|
145
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { InventoryItemStatusEnum } from '../../enums/InventoryItemStatusEnum';
|
|
2
|
+
import type { InventoryMovementTypeEnum } from '../../enums/InventoryMovementTypeEnum';
|
|
3
|
+
import type { SkuPriceEntry } from './SkuPriceEntry';
|
|
4
|
+
|
|
5
|
+
/** Un movimiento del libro de inventario. */
|
|
6
|
+
export interface InventoryMovementEntry {
|
|
7
|
+
storeId: string;
|
|
8
|
+
sku: string;
|
|
9
|
+
type: InventoryMovementTypeEnum;
|
|
10
|
+
qty: number;
|
|
11
|
+
/** IMEI o serie; `null` en SKUs por cantidad. */
|
|
12
|
+
identifier: string | null;
|
|
13
|
+
occurredAt: string;
|
|
14
|
+
createdBy: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Pieza de una tienda; status AVAILABLE, SOLD o DAMAGED. */
|
|
18
|
+
export interface InventoryPieceEntry {
|
|
19
|
+
identifier: string;
|
|
20
|
+
status: InventoryItemStatusEnum;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Piezas de un SKU con IMEI o serie en una tienda. */
|
|
24
|
+
export interface InventoryStorePieces {
|
|
25
|
+
storeId: string;
|
|
26
|
+
pieces: InventoryPieceEntry[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Response de backofficeGetInventorySku: solo lo que la fila de filter=list no trae. */
|
|
30
|
+
export interface GetInventorySkuResponse {
|
|
31
|
+
sku: string;
|
|
32
|
+
movements: InventoryMovementEntry[];
|
|
33
|
+
/** Página siguiente del libro; `null` si no hay más. */
|
|
34
|
+
nextToken: string | null;
|
|
35
|
+
/** Vacío si el SKU se rastrea por cantidad. */
|
|
36
|
+
piecesByStore: InventoryStorePieces[];
|
|
37
|
+
currentPrice: SkuPriceEntry | null;
|
|
38
|
+
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { InventoryLensFilterEnum } from '../../enums/InventoryLensFilterEnum';
|
|
2
|
+
import type { InventoryLensPeriodEnum } from '../../enums/InventoryLensPeriodEnum';
|
|
3
|
+
import type { ProductCategoryEnum } from '../../enums/ProductCategoryEnum';
|
|
4
|
+
import type { ProductTierEnum } from '../../enums/ProductTierEnum';
|
|
2
5
|
import type { InventoryLensUnavailableReasonEnum } from '../../enums/InventoryLensUnavailableReasonEnum';
|
|
3
6
|
import type { InventoryTransferReasonEnum } from '../../enums/InventoryTransferReasonEnum';
|
|
4
7
|
|
|
@@ -87,8 +90,47 @@ export interface InventoryLensTransferSuggestion {
|
|
|
87
90
|
reason: InventoryTransferReasonEnum;
|
|
88
91
|
}
|
|
89
92
|
|
|
93
|
+
/** Stock y ventas del periodo de un SKU en una tienda. */
|
|
94
|
+
export interface InventoryLensStoreStock {
|
|
95
|
+
storeId: string;
|
|
96
|
+
stock: number;
|
|
97
|
+
sold: number;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Alertas de una fila del modo lista. */
|
|
101
|
+
export interface InventoryLensAlerts {
|
|
102
|
+
/** Cobertura menor a 7 días con stock. */
|
|
103
|
+
lowStock: boolean;
|
|
104
|
+
/** Más de 5 piezas sin ventas en el periodo. */
|
|
105
|
+
slowMover: boolean;
|
|
106
|
+
outOfStock: boolean;
|
|
107
|
+
/** Ventas de 30 días en el percentil 90 del tenant. */
|
|
108
|
+
topRotation: boolean;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** Días de cobertura: número, `INFINITE` con stock sin ventas, `null` sin stock. */
|
|
112
|
+
export type InventoryLensCoverage = number | 'INFINITE' | null;
|
|
113
|
+
|
|
114
|
+
/** Una fila del modo `list` (Inventario v3): un SKU consolidado o de la tienda pedida. */
|
|
115
|
+
export interface InventoryLensListItem {
|
|
116
|
+
sku: string;
|
|
117
|
+
brand: string;
|
|
118
|
+
model: string;
|
|
119
|
+
category: ProductCategoryEnum;
|
|
120
|
+
tier: ProductTierEnum | null;
|
|
121
|
+
basePriceCents: number;
|
|
122
|
+
stockTotal: number;
|
|
123
|
+
storesWithStock: number;
|
|
124
|
+
storesTotal: number;
|
|
125
|
+
byStore: InventoryLensStoreStock[];
|
|
126
|
+
soldPeriod: number;
|
|
127
|
+
coverage: InventoryLensCoverage;
|
|
128
|
+
alerts: InventoryLensAlerts;
|
|
129
|
+
sold30d: number;
|
|
130
|
+
}
|
|
131
|
+
|
|
90
132
|
/** Fila del lente — el tipo depende del tab pedido. */
|
|
91
|
-
export type InventoryLensItem = InventoryLensSkuItem | InventoryLensTransferSuggestion;
|
|
133
|
+
export type InventoryLensItem = InventoryLensSkuItem | InventoryLensTransferSuggestion | InventoryLensListItem;
|
|
92
134
|
|
|
93
135
|
/**
|
|
94
136
|
* `GET /backoffice/inventory/lens?filter=…` — la pantalla «Inventario» del Portal Admin VentasLuga.
|
|
@@ -104,7 +146,11 @@ export interface InventoryLensResponse {
|
|
|
104
146
|
/** El tab que se resolvió — eco del query, para que el front no se confunda de pestaña. */
|
|
105
147
|
filter: InventoryLensFilterEnum;
|
|
106
148
|
|
|
107
|
-
|
|
149
|
+
/** No viaja en el modo `list`. */
|
|
150
|
+
counters?: InventoryLensCounters;
|
|
151
|
+
|
|
152
|
+
/** Eco del periodo resuelto en el modo `list`. */
|
|
153
|
+
period?: InventoryLensPeriodEnum;
|
|
108
154
|
|
|
109
155
|
/** Filas del tab. Vacío cuando `unavailable` es `true`. */
|
|
110
156
|
items: InventoryLensItem[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Resultado de liberar una línea; `released=false` si onlyExpired y aún no vence. */
|
|
2
|
+
export interface ReleasedReservationLine {
|
|
3
|
+
lineId: string;
|
|
4
|
+
reservationId: string;
|
|
5
|
+
released: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/** Response de privateReleaseStock. */
|
|
9
|
+
export interface ReleaseStockResponse {
|
|
10
|
+
lines: ReleasedReservationLine[];
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Vencimiento nuevo de una línea renovada. */
|
|
2
|
+
export interface RenewedReservationLine {
|
|
3
|
+
lineId: string;
|
|
4
|
+
reservationId: string;
|
|
5
|
+
expiresAt: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/** Response de privateRenewReservations. */
|
|
9
|
+
export interface RenewReservationsResponse {
|
|
10
|
+
lines: RenewedReservationLine[];
|
|
11
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { MdmProviderEnum } from '../../enums/MdmProviderEnum';
|
|
2
|
+
import type { ProductCategoryEnum } from '../../enums/ProductCategoryEnum';
|
|
3
|
+
import type { TrackingModeEnum } from '../../enums/TrackingModeEnum';
|
|
4
|
+
|
|
5
|
+
/** Componente reservado de un kit. */
|
|
6
|
+
export interface ReservedComponent {
|
|
7
|
+
sku: string;
|
|
8
|
+
qty: number;
|
|
9
|
+
category: ProductCategoryEnum;
|
|
10
|
+
trackingMode: TrackingModeEnum;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Response de privateReserveStock; el precio de la línea es `basePriceCents`. */
|
|
14
|
+
export interface ReserveStockResponse {
|
|
15
|
+
expiresAt: string;
|
|
16
|
+
basePriceCents: number;
|
|
17
|
+
listPriceCents: number | null;
|
|
18
|
+
/** Llave del registro PRICE# del que salió el precio fijado. */
|
|
19
|
+
priceSk: string;
|
|
20
|
+
eligibleFinanciers: string[];
|
|
21
|
+
/** Ítems que la línea suma al tope de la venta. */
|
|
22
|
+
sellItemCost: number;
|
|
23
|
+
mdmEnabled: boolean;
|
|
24
|
+
mdmProvider: MdmProviderEnum | null;
|
|
25
|
+
/** Solo si la línea es un kit. */
|
|
26
|
+
components?: ReservedComponent[];
|
|
27
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Componente vendido con las piezas que salieron. */
|
|
2
|
+
export interface SoldLineComponent {
|
|
3
|
+
sku: string;
|
|
4
|
+
qty: number;
|
|
5
|
+
identifiers: string[];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/** Línea vendida. */
|
|
9
|
+
export interface SoldLine {
|
|
10
|
+
lineId: string;
|
|
11
|
+
sku: string;
|
|
12
|
+
qty: number;
|
|
13
|
+
components: SoldLineComponent[];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Response de privateSellStock; una repetición devuelve el mismo resultado. */
|
|
17
|
+
export interface SellStockResponse {
|
|
18
|
+
soldAt: string;
|
|
19
|
+
lines: SoldLine[];
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PriceSourceEnum } from '../../enums/PriceSourceEnum';
|
|
2
|
+
|
|
3
|
+
/** Un registro del historial de precios PRICE# de un SKU. */
|
|
4
|
+
export interface SkuPriceEntry {
|
|
5
|
+
effectiveFrom: string;
|
|
6
|
+
listPriceCents: number | null;
|
|
7
|
+
basePriceCents: number;
|
|
8
|
+
source: PriceSourceEnum;
|
|
9
|
+
createdBy: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { MdmLockModeEnum } from '../../enums/MdmLockModeEnum';
|
|
2
|
+
import type { MdmProviderEnum } from '../../enums/MdmProviderEnum';
|
|
3
|
+
import type { ProductCategoryEnum } from '../../enums/ProductCategoryEnum';
|
|
4
|
+
import type { ProductTierEnum } from '../../enums/ProductTierEnum';
|
|
5
|
+
import type { TrackingModeEnum } from '../../enums/TrackingModeEnum';
|
|
6
|
+
import type { ProductComponent } from '../ProductComponent';
|
|
7
|
+
|
|
8
|
+
/** Fila por SKU del catálogo de venta de una tienda (privateGetStoreStockCatalog). */
|
|
9
|
+
export interface StoreCatalogItem {
|
|
10
|
+
sku: string;
|
|
11
|
+
/** Piezas disponibles; en un kit, el mínimo que alcanzan sus componentes. */
|
|
12
|
+
available: number;
|
|
13
|
+
basePriceCents: number;
|
|
14
|
+
category: ProductCategoryEnum;
|
|
15
|
+
trackingMode: TrackingModeEnum;
|
|
16
|
+
brand: string;
|
|
17
|
+
model: string;
|
|
18
|
+
capacity: string;
|
|
19
|
+
color: string;
|
|
20
|
+
imageUrl: string | null;
|
|
21
|
+
tier: ProductTierEnum | null;
|
|
22
|
+
eligibleFinanciers: string[];
|
|
23
|
+
mdmEnabled: boolean;
|
|
24
|
+
mdmProvider: MdmProviderEnum | null;
|
|
25
|
+
mdmLockMode: MdmLockModeEnum | null;
|
|
26
|
+
/** Solo si es kit. */
|
|
27
|
+
components?: ProductComponent[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Response de privateGetStoreStockCatalog. */
|
|
31
|
+
export type GetStoreStockCatalogResponse = StoreCatalogItem[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { InventorySyncRejectionCodeEnum } from '../../enums/InventorySyncRejectionCodeEnum';
|
|
2
|
+
import type { InventorySyncResultStatusEnum } from '../../enums/InventorySyncResultStatusEnum';
|
|
3
|
+
|
|
4
|
+
/** Resultado de un ítem del lote; `code` solo viene con REJECTED. */
|
|
5
|
+
export interface InventorySyncResult {
|
|
6
|
+
/** Identifica el ítem del lote (SKU, o tienda + SKU + identificador). */
|
|
7
|
+
key: string;
|
|
8
|
+
status: InventorySyncResultStatusEnum;
|
|
9
|
+
code?: InventorySyncRejectionCodeEnum;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** Response de privateSyncInventory: siempre 200, con resultado por ítem. */
|
|
13
|
+
export interface SyncInventoryResponse {
|
|
14
|
+
results: InventorySyncResult[];
|
|
15
|
+
}
|
|
@@ -2,6 +2,8 @@ import { MdmLockModeEnum } from '../../enums/MdmLockModeEnum';
|
|
|
2
2
|
import { MdmProviderEnum } from '../../enums/MdmProviderEnum';
|
|
3
3
|
import { ProductStatusEnum } from '../../enums/ProductStatusEnum';
|
|
4
4
|
import { ProductTierEnum } from '../../enums/ProductTierEnum';
|
|
5
|
+
import { ProductCategoryEnum } from '../../enums/ProductCategoryEnum';
|
|
6
|
+
import { TrackingModeEnum } from '../../enums/TrackingModeEnum';
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
9
|
* Response de GET /private/products/:retailerId/:sku — validar que el producto existe + status.
|
|
@@ -13,9 +15,12 @@ export class ValidateProductResponse {
|
|
|
13
15
|
retailerId!: string;
|
|
14
16
|
sku!: string;
|
|
15
17
|
status!: ProductStatusEnum;
|
|
16
|
-
|
|
18
|
+
/** `null` = Sin gama. */
|
|
19
|
+
tier!: ProductTierEnum | null;
|
|
17
20
|
eligibleFinanciers!: string[];
|
|
18
21
|
mdmEnabled!: boolean;
|
|
19
22
|
mdmProvider!: MdmProviderEnum | null;
|
|
20
23
|
mdmLockMode!: MdmLockModeEnum | null;
|
|
24
|
+
category?: ProductCategoryEnum;
|
|
25
|
+
trackingMode?: TrackingModeEnum;
|
|
21
26
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Motivo por el que la puerta de entrada rechaza un ítem; el resto del lote sí se aplica. */
|
|
2
|
+
export enum InventorySyncRejectionCodeEnum {
|
|
3
|
+
/** El identificador ya existe en otra tienda o SKU del tenant. */
|
|
4
|
+
DUPLICATE_IDENTIFIER = 'DUPLICATE_IDENTIFIER',
|
|
5
|
+
/** El ajuste de un SKU por cantidad deja el saldo por debajo de lo reservado. */
|
|
6
|
+
ADJUSTMENT_EXCEEDS_AVAILABLE = 'ADJUSTMENT_EXCEEDS_AVAILABLE',
|
|
7
|
+
/** El precio trae una vigencia futura, que este ciclo no se admite. */
|
|
8
|
+
FUTURE_PRICE_NOT_SUPPORTED = 'FUTURE_PRICE_NOT_SUPPORTED',
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Categoría del producto tal como llega de Zentral; solo PHONE lleva configuración MDM. */
|
|
2
|
+
export enum ProductCategoryEnum {
|
|
3
|
+
PHONE = 'PHONE',
|
|
4
|
+
SIM = 'SIM',
|
|
5
|
+
MODEM = 'MODEM',
|
|
6
|
+
ACCESSORY = 'ACCESSORY',
|
|
7
|
+
/** Kit: se vende como una línea y consume el stock de sus componentes. */
|
|
8
|
+
BUNDLE = 'BUNDLE',
|
|
9
|
+
}
|
|
@@ -39,3 +39,34 @@ export * from './dtos/responses/InventoryLensResponse';
|
|
|
39
39
|
// Validation DTOs (shapes de endpoints privados)
|
|
40
40
|
export * from './dtos/validation/ValidateProductResponse';
|
|
41
41
|
export * from './dtos/validation/ValidateInventoryResponse';
|
|
42
|
+
|
|
43
|
+
// Inventario multi-item (ciclo 1)
|
|
44
|
+
export * from './enums/ProductCategoryEnum';
|
|
45
|
+
export * from './enums/TrackingModeEnum';
|
|
46
|
+
export * from './enums/InventoryMovementTypeEnum';
|
|
47
|
+
export * from './enums/InventorySyncResultStatusEnum';
|
|
48
|
+
export * from './enums/InventorySyncRejectionCodeEnum';
|
|
49
|
+
export * from './enums/PriceSourceEnum';
|
|
50
|
+
export * from './enums/InventoryLensPeriodEnum';
|
|
51
|
+
export * from './dtos/ProductComponent';
|
|
52
|
+
export * from './dtos/requests/ReservationLineRef';
|
|
53
|
+
export * from './dtos/requests/StockLine';
|
|
54
|
+
export * from './dtos/requests/ReserveStockRequest';
|
|
55
|
+
export * from './dtos/requests/RenewReservationsRequest';
|
|
56
|
+
export * from './dtos/requests/SuggestPiecesQuery';
|
|
57
|
+
export * from './dtos/requests/SellStockRequest';
|
|
58
|
+
export * from './dtos/requests/ReleaseStockRequest';
|
|
59
|
+
export * from './dtos/requests/ReturnStockRequest';
|
|
60
|
+
export * from './dtos/requests/SyncInventoryRequest';
|
|
61
|
+
export * from './dtos/requests/GetInventorySkuQuery';
|
|
62
|
+
export * from './dtos/responses/ReserveStockResponse';
|
|
63
|
+
export * from './dtos/responses/RenewReservationsResponse';
|
|
64
|
+
export * from './dtos/responses/SuggestPiecesResponse';
|
|
65
|
+
export * from './dtos/responses/SellStockResponse';
|
|
66
|
+
export * from './dtos/responses/ReleaseStockResponse';
|
|
67
|
+
export * from './dtos/responses/ReturnStockResponse';
|
|
68
|
+
export * from './dtos/responses/SyncInventoryResponse';
|
|
69
|
+
export * from './dtos/responses/StoreCatalogItem';
|
|
70
|
+
export * from './dtos/responses/SkuPriceEntry';
|
|
71
|
+
export * from './dtos/responses/GetInventorySkuResponse';
|
|
72
|
+
export * from './dtos/responses/ListSkuPricesResponse';
|
|
@@ -4,6 +4,7 @@ import type { SalePaymentMethodEnum } from '../enums/SalePaymentMethodEnum';
|
|
|
4
4
|
import type { ExternalProviderEnum } from '../enums/ExternalProviderEnum';
|
|
5
5
|
import type { CentralSyncStatusEnum } from '../enums/CentralSyncStatusEnum';
|
|
6
6
|
import type { SalePaymentDetail } from './SalePaymentDetail';
|
|
7
|
+
import type { SaleLine } from './SaleLine';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Venta (modelo-datos §3). pk `SALE#<saleId>` · sk `META` · 4 GSIs (`retailerId-soldAt-index`,
|
|
@@ -20,6 +21,12 @@ export interface Sale {
|
|
|
20
21
|
type: SaleTypeEnum;
|
|
21
22
|
externalProvider: ExternalProviderEnum | null;
|
|
22
23
|
sku: string;
|
|
24
|
+
/** Líneas vendidas; `sku` e `imei` siguen siendo los del teléfono financiado o de la línea principal. */
|
|
25
|
+
lines?: SaleLine[];
|
|
26
|
+
/** SKUs de líneas y componentes, para filtrar ventas por SKU. */
|
|
27
|
+
skus?: string[];
|
|
28
|
+
/** La cancelación aún no confirma la devolución al inventario. */
|
|
29
|
+
inventoryReturnPending?: boolean;
|
|
23
30
|
/** IMEI consumido del silo también en contado (local-first); null en EXTERNAL_REFERRAL (D15). */
|
|
24
31
|
imei: string | null;
|
|
25
32
|
/**
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SoldLineComponent } from '../../retailCatalog/dtos/responses/SellStockResponse';
|
|
2
|
+
import type { LinePaymentTypeEnum } from '../enums/LinePaymentTypeEnum';
|
|
3
|
+
import type { WizardLineProduct } from './WizardLineProduct';
|
|
4
|
+
|
|
5
|
+
/** Línea de una venta cerrada; un producto suelto es un solo componente. */
|
|
6
|
+
export interface SaleLine {
|
|
7
|
+
lineId: string;
|
|
8
|
+
sku: string;
|
|
9
|
+
qty: number;
|
|
10
|
+
basePriceCents: number;
|
|
11
|
+
listPriceCents: number | null;
|
|
12
|
+
/** Llave del registro PRICE# del que salió el precio. */
|
|
13
|
+
priceSk: string;
|
|
14
|
+
paymentType: LinePaymentTypeEnum;
|
|
15
|
+
components: SoldLineComponent[];
|
|
16
|
+
product?: WizardLineProduct | null;
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ProductCategoryEnum } from '../../retailCatalog/enums/ProductCategoryEnum';
|
|
2
|
+
import type { ProductTierEnum } from '../../retailCatalog/enums/ProductTierEnum';
|
|
3
|
+
import type { TrackingModeEnum } from '../../retailCatalog/enums/TrackingModeEnum';
|
|
4
|
+
|
|
5
|
+
/** Ficha comercial de una línea, congelada al reservar para pintarla sin volver al catálogo. */
|
|
6
|
+
export interface WizardLineProduct {
|
|
7
|
+
brand: string;
|
|
8
|
+
model: string;
|
|
9
|
+
capacity: string | null;
|
|
10
|
+
color: string | null;
|
|
11
|
+
imageUrl: string | null;
|
|
12
|
+
/** `null` = Sin gama. */
|
|
13
|
+
tier: ProductTierEnum | null;
|
|
14
|
+
category: ProductCategoryEnum;
|
|
15
|
+
trackingMode: TrackingModeEnum;
|
|
16
|
+
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import type { ProductCategoryEnum } from '../../retailCatalog/enums/ProductCategoryEnum';
|
|
2
|
+
import type { TrackingModeEnum } from '../../retailCatalog/enums/TrackingModeEnum';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Ficha COMERCIAL del equipo reservado, congelada en la sesión al momento de reservarlo (S03).
|
|
3
6
|
*
|
|
@@ -38,4 +41,8 @@ export interface WizardProduct {
|
|
|
38
41
|
* Mismo nombre que en `retail-catalog`: es su dato, no se renombra al cruzar la frontera.
|
|
39
42
|
*/
|
|
40
43
|
eligibleFinanciers: string[];
|
|
44
|
+
/** Línea de `reservedLines` que espeja esta ficha. */
|
|
45
|
+
lineId?: string;
|
|
46
|
+
category?: ProductCategoryEnum;
|
|
47
|
+
trackingMode?: TrackingModeEnum;
|
|
41
48
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { MdmProviderEnum } from '../../retailCatalog/enums/MdmProviderEnum';
|
|
2
|
+
import type { ReservedComponent } from '../../retailCatalog/dtos/responses/ReserveStockResponse';
|
|
3
|
+
import type { LinePaymentTypeEnum } from '../enums/LinePaymentTypeEnum';
|
|
4
|
+
import type { WizardLineStatusEnum } from '../enums/WizardLineStatusEnum';
|
|
5
|
+
import type { WizardLineIdentifiers } from './WizardLineIdentifiers';
|
|
6
|
+
import type { WizardLineProduct } from './WizardLineProduct';
|
|
7
|
+
|
|
8
|
+
/** Línea de la venta en curso; los campos de precio son `null` mientras la línea está PENDING. */
|
|
9
|
+
export interface WizardReservedLine {
|
|
10
|
+
lineId: string;
|
|
11
|
+
sku: string;
|
|
12
|
+
qty: number;
|
|
13
|
+
status: WizardLineStatusEnum;
|
|
14
|
+
/** Llave de idempotencia de la reserva; una nueva por cada intento. */
|
|
15
|
+
reservationId: string;
|
|
16
|
+
/** Vencimiento de la reserva; una línea PENDING nace con ahora + 30 min. */
|
|
17
|
+
expiresAt: string;
|
|
18
|
+
/** Precio fijado de la línea (el del kit si es kit). */
|
|
19
|
+
basePriceCents: number | null;
|
|
20
|
+
listPriceCents: number | null;
|
|
21
|
+
/** Llave del registro PRICE# del que salió el precio. */
|
|
22
|
+
priceSk: string | null;
|
|
23
|
+
eligibleFinanciers: string[];
|
|
24
|
+
/** SureKeep está en `eligibleFinanciers`. */
|
|
25
|
+
financeable: boolean;
|
|
26
|
+
/** `null` mientras no se decide qué línea se financia. */
|
|
27
|
+
paymentType: LinePaymentTypeEnum | null;
|
|
28
|
+
/** Ítems que la línea suma al tope de 100 de la venta. */
|
|
29
|
+
sellItemCost: number | null;
|
|
30
|
+
mdmEnabled?: boolean;
|
|
31
|
+
mdmProvider?: MdmProviderEnum | null;
|
|
32
|
+
/** Solo si la línea es un kit. */
|
|
33
|
+
components?: ReservedComponent[];
|
|
34
|
+
identifiers?: WizardLineIdentifiers[];
|
|
35
|
+
product?: WizardLineProduct | null;
|
|
36
|
+
}
|