@fiado/type-kit 3.460.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.
Files changed (149) hide show
  1. package/_test_/unit/retailCatalog/catalogEnums.test.ts +34 -0
  2. package/_test_/unit/retailCatalog/stockRequests.test.ts +156 -0
  3. package/_test_/unit/retailWizard/multiItemRequests.test.ts +114 -0
  4. package/_test_/unit/retailWizard/multiItemShapes.test.ts +126 -0
  5. package/bin/retailCatalog/dtos/Product.d.ts +15 -1
  6. package/bin/retailCatalog/dtos/ProductComponent.d.ts +5 -0
  7. package/bin/retailCatalog/dtos/ProductComponent.js +29 -0
  8. package/bin/retailCatalog/dtos/requests/GetInventorySkuQuery.d.ts +10 -0
  9. package/bin/retailCatalog/dtos/requests/GetInventorySkuQuery.js +42 -0
  10. package/bin/retailCatalog/dtos/requests/InventoryLensQuery.d.ts +5 -0
  11. package/bin/retailCatalog/dtos/requests/InventoryLensQuery.js +11 -0
  12. package/bin/retailCatalog/dtos/requests/ReleaseStockRequest.d.ts +8 -0
  13. package/bin/retailCatalog/dtos/requests/ReleaseStockRequest.js +34 -0
  14. package/bin/retailCatalog/dtos/requests/RenewReservationsRequest.d.ts +6 -0
  15. package/bin/retailCatalog/dtos/requests/RenewReservationsRequest.js +30 -0
  16. package/bin/retailCatalog/dtos/requests/ReservationLineRef.d.ts +5 -0
  17. package/bin/retailCatalog/dtos/requests/ReservationLineRef.js +25 -0
  18. package/bin/retailCatalog/dtos/requests/ReserveStockRequest.d.ts +10 -0
  19. package/bin/retailCatalog/dtos/requests/ReserveStockRequest.js +42 -0
  20. package/bin/retailCatalog/dtos/requests/ReturnStockRequest.d.ts +9 -0
  21. package/bin/retailCatalog/dtos/requests/ReturnStockRequest.js +38 -0
  22. package/bin/retailCatalog/dtos/requests/SellStockRequest.d.ts +7 -0
  23. package/bin/retailCatalog/dtos/requests/SellStockRequest.js +34 -0
  24. package/bin/retailCatalog/dtos/requests/StockLine.d.ts +14 -0
  25. package/bin/retailCatalog/dtos/requests/StockLine.js +56 -0
  26. package/bin/retailCatalog/dtos/requests/SuggestPiecesQuery.d.ts +5 -0
  27. package/bin/retailCatalog/dtos/requests/SuggestPiecesQuery.js +26 -0
  28. package/bin/retailCatalog/dtos/requests/SyncInventoryRequest.d.ts +47 -0
  29. package/bin/retailCatalog/dtos/requests/SyncInventoryRequest.js +173 -0
  30. package/bin/retailCatalog/dtos/responses/GetInventorySkuResponse.d.ts +34 -0
  31. package/bin/retailCatalog/dtos/responses/GetInventorySkuResponse.js +2 -0
  32. package/bin/retailCatalog/dtos/responses/InventoryLensResponse.d.ts +43 -2
  33. package/bin/retailCatalog/dtos/responses/ListSkuPricesResponse.d.ts +6 -0
  34. package/bin/retailCatalog/dtos/responses/ListSkuPricesResponse.js +2 -0
  35. package/bin/retailCatalog/dtos/responses/ReleaseStockResponse.d.ts +10 -0
  36. package/bin/retailCatalog/dtos/responses/ReleaseStockResponse.js +2 -0
  37. package/bin/retailCatalog/dtos/responses/RenewReservationsResponse.d.ts +10 -0
  38. package/bin/retailCatalog/dtos/responses/RenewReservationsResponse.js +2 -0
  39. package/bin/retailCatalog/dtos/responses/ReserveStockResponse.d.ts +25 -0
  40. package/bin/retailCatalog/dtos/responses/ReserveStockResponse.js +2 -0
  41. package/bin/retailCatalog/dtos/responses/ReturnStockResponse.d.ts +4 -0
  42. package/bin/retailCatalog/dtos/responses/ReturnStockResponse.js +2 -0
  43. package/bin/retailCatalog/dtos/responses/SellStockResponse.d.ts +18 -0
  44. package/bin/retailCatalog/dtos/responses/SellStockResponse.js +2 -0
  45. package/bin/retailCatalog/dtos/responses/SkuPriceEntry.d.ts +9 -0
  46. package/bin/retailCatalog/dtos/responses/SkuPriceEntry.js +2 -0
  47. package/bin/retailCatalog/dtos/responses/StoreCatalogItem.d.ts +29 -0
  48. package/bin/retailCatalog/dtos/responses/StoreCatalogItem.js +2 -0
  49. package/bin/retailCatalog/dtos/responses/SuggestPiecesResponse.d.ts +6 -0
  50. package/bin/retailCatalog/dtos/responses/SuggestPiecesResponse.js +2 -0
  51. package/bin/retailCatalog/dtos/responses/SyncInventoryResponse.d.ts +13 -0
  52. package/bin/retailCatalog/dtos/responses/SyncInventoryResponse.js +2 -0
  53. package/bin/retailCatalog/dtos/validation/ValidateProductResponse.d.ts +6 -1
  54. package/bin/retailCatalog/enums/InventoryLensFilterEnum.d.ts +3 -1
  55. package/bin/retailCatalog/enums/InventoryLensFilterEnum.js +2 -0
  56. package/bin/retailCatalog/enums/InventoryLensPeriodEnum.d.ts +7 -0
  57. package/bin/retailCatalog/enums/InventoryLensPeriodEnum.js +11 -0
  58. package/bin/retailCatalog/enums/InventoryMovementTypeEnum.d.ts +9 -0
  59. package/bin/retailCatalog/enums/InventoryMovementTypeEnum.js +13 -0
  60. package/bin/retailCatalog/enums/InventorySyncRejectionCodeEnum.d.ts +9 -0
  61. package/bin/retailCatalog/enums/InventorySyncRejectionCodeEnum.js +13 -0
  62. package/bin/retailCatalog/enums/InventorySyncResultStatusEnum.d.ts +6 -0
  63. package/bin/retailCatalog/enums/InventorySyncResultStatusEnum.js +10 -0
  64. package/bin/retailCatalog/enums/PriceSourceEnum.d.ts +4 -0
  65. package/bin/retailCatalog/enums/PriceSourceEnum.js +8 -0
  66. package/bin/retailCatalog/enums/ProductCategoryEnum.d.ts +9 -0
  67. package/bin/retailCatalog/enums/ProductCategoryEnum.js +13 -0
  68. package/bin/retailCatalog/enums/TrackingModeEnum.d.ts +6 -0
  69. package/bin/retailCatalog/enums/TrackingModeEnum.js +10 -0
  70. package/bin/retailCatalog/index.d.ts +29 -0
  71. package/bin/retailCatalog/index.js +30 -0
  72. package/bin/retailWizard/dtos/Sale.d.ts +7 -0
  73. package/bin/retailWizard/dtos/SaleLine.d.ts +16 -0
  74. package/bin/retailWizard/dtos/SaleLine.js +2 -0
  75. package/bin/retailWizard/dtos/WizardLineIdentifiers.d.ts +5 -0
  76. package/bin/retailWizard/dtos/WizardLineIdentifiers.js +2 -0
  77. package/bin/retailWizard/dtos/WizardLineProduct.d.ts +15 -0
  78. package/bin/retailWizard/dtos/WizardLineProduct.js +2 -0
  79. package/bin/retailWizard/dtos/WizardProduct.d.ts +6 -0
  80. package/bin/retailWizard/dtos/WizardReservedLine.d.ts +35 -0
  81. package/bin/retailWizard/dtos/WizardReservedLine.js +2 -0
  82. package/bin/retailWizard/dtos/WizardSession.d.ts +5 -0
  83. package/bin/retailWizard/dtos/requests/AddProductRequest.d.ts +4 -8
  84. package/bin/retailWizard/dtos/requests/AddProductRequest.js +9 -8
  85. package/bin/retailWizard/dtos/requests/CompleteSaleRequest.d.ts +16 -0
  86. package/bin/retailWizard/dtos/requests/CompleteSaleRequest.js +59 -0
  87. package/bin/retailWizard/dtos/requests/DeleteProductRequest.d.ts +3 -1
  88. package/bin/retailWizard/dtos/requests/DeleteProductRequest.js +7 -1
  89. package/bin/retailWizard/dtos/requests/QuoteRequest.d.ts +2 -0
  90. package/bin/retailWizard/dtos/requests/QuoteRequest.js +7 -0
  91. package/bin/retailWizard/dtos/requests/SuggestIdentifiersQuery.d.ts +5 -0
  92. package/bin/retailWizard/dtos/requests/SuggestIdentifiersQuery.js +30 -0
  93. package/bin/retailWizard/enums/LinePaymentTypeEnum.d.ts +7 -0
  94. package/bin/retailWizard/enums/LinePaymentTypeEnum.js +11 -0
  95. package/bin/retailWizard/enums/WizardLineStatusEnum.d.ts +9 -0
  96. package/bin/retailWizard/enums/WizardLineStatusEnum.js +13 -0
  97. package/bin/retailWizard/index.d.ts +8 -0
  98. package/bin/retailWizard/index.js +8 -0
  99. package/package.json +1 -1
  100. package/src/retailCatalog/dtos/Product.ts +17 -1
  101. package/src/retailCatalog/dtos/ProductComponent.ts +14 -0
  102. package/src/retailCatalog/dtos/requests/GetInventorySkuQuery.ts +27 -0
  103. package/src/retailCatalog/dtos/requests/InventoryLensQuery.ts +12 -1
  104. package/src/retailCatalog/dtos/requests/ReleaseStockRequest.ts +19 -0
  105. package/src/retailCatalog/dtos/requests/RenewReservationsRequest.ts +15 -0
  106. package/src/retailCatalog/dtos/requests/ReservationLineRef.ts +10 -0
  107. package/src/retailCatalog/dtos/requests/ReserveStockRequest.ts +24 -0
  108. package/src/retailCatalog/dtos/requests/ReturnStockRequest.ts +22 -0
  109. package/src/retailCatalog/dtos/requests/SellStockRequest.ts +18 -0
  110. package/src/retailCatalog/dtos/requests/StockLine.ts +36 -0
  111. package/src/retailCatalog/dtos/requests/SuggestPiecesQuery.ts +11 -0
  112. package/src/retailCatalog/dtos/requests/SyncInventoryRequest.ts +145 -0
  113. package/src/retailCatalog/dtos/responses/GetInventorySkuResponse.ts +38 -0
  114. package/src/retailCatalog/dtos/responses/InventoryLensResponse.ts +48 -2
  115. package/src/retailCatalog/dtos/responses/ListSkuPricesResponse.ts +7 -0
  116. package/src/retailCatalog/dtos/responses/ReleaseStockResponse.ts +11 -0
  117. package/src/retailCatalog/dtos/responses/RenewReservationsResponse.ts +11 -0
  118. package/src/retailCatalog/dtos/responses/ReserveStockResponse.ts +27 -0
  119. package/src/retailCatalog/dtos/responses/ReturnStockResponse.ts +4 -0
  120. package/src/retailCatalog/dtos/responses/SellStockResponse.ts +20 -0
  121. package/src/retailCatalog/dtos/responses/SkuPriceEntry.ts +10 -0
  122. package/src/retailCatalog/dtos/responses/StoreCatalogItem.ts +31 -0
  123. package/src/retailCatalog/dtos/responses/SuggestPiecesResponse.ts +7 -0
  124. package/src/retailCatalog/dtos/responses/SyncInventoryResponse.ts +15 -0
  125. package/src/retailCatalog/dtos/validation/ValidateProductResponse.ts +6 -1
  126. package/src/retailCatalog/enums/InventoryLensFilterEnum.ts +2 -0
  127. package/src/retailCatalog/enums/InventoryLensPeriodEnum.ts +7 -0
  128. package/src/retailCatalog/enums/InventoryMovementTypeEnum.ts +9 -0
  129. package/src/retailCatalog/enums/InventorySyncRejectionCodeEnum.ts +9 -0
  130. package/src/retailCatalog/enums/InventorySyncResultStatusEnum.ts +6 -0
  131. package/src/retailCatalog/enums/PriceSourceEnum.ts +4 -0
  132. package/src/retailCatalog/enums/ProductCategoryEnum.ts +9 -0
  133. package/src/retailCatalog/enums/TrackingModeEnum.ts +6 -0
  134. package/src/retailCatalog/index.ts +31 -0
  135. package/src/retailWizard/dtos/Sale.ts +7 -0
  136. package/src/retailWizard/dtos/SaleLine.ts +17 -0
  137. package/src/retailWizard/dtos/WizardLineIdentifiers.ts +5 -0
  138. package/src/retailWizard/dtos/WizardLineProduct.ts +16 -0
  139. package/src/retailWizard/dtos/WizardProduct.ts +7 -0
  140. package/src/retailWizard/dtos/WizardReservedLine.ts +36 -0
  141. package/src/retailWizard/dtos/WizardSession.ts +5 -0
  142. package/src/retailWizard/dtos/requests/AddProductRequest.ts +9 -8
  143. package/src/retailWizard/dtos/requests/CompleteSaleRequest.ts +41 -0
  144. package/src/retailWizard/dtos/requests/DeleteProductRequest.ts +7 -1
  145. package/src/retailWizard/dtos/requests/QuoteRequest.ts +8 -1
  146. package/src/retailWizard/dtos/requests/SuggestIdentifiersQuery.ts +15 -0
  147. package/src/retailWizard/enums/LinePaymentTypeEnum.ts +7 -0
  148. package/src/retailWizard/enums/WizardLineStatusEnum.ts +9 -0
  149. 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
- counters: InventoryLensCounters;
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,7 @@
1
+ import type { SkuPriceEntry } from './SkuPriceEntry';
2
+
3
+ /** Response de GET /backoffice/inventory/skus/{sku}/prices; más reciente primero. */
4
+ export interface ListSkuPricesResponse {
5
+ sku: string;
6
+ items: SkuPriceEntry[];
7
+ }
@@ -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,4 @@
1
+ /** Response de privateReturnStock; una repetición también responde 200. */
2
+ export interface ReturnStockResponse {
3
+ saleId: string;
4
+ }
@@ -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,7 @@
1
+ /** Pieza AVAILABLE sugerida por prefijo. */
2
+ export interface SuggestedPiece {
3
+ identifier: string;
4
+ }
5
+
6
+ /** Response de privateSuggestPieces, con tope de resultados. */
7
+ export type SuggestPiecesResponse = SuggestedPiece[];
@@ -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
- tier!: ProductTierEnum;
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
  }
@@ -18,4 +18,6 @@ export enum InventoryLensFilterEnum {
18
18
  GAP = 'gap',
19
19
  /** Desbalance de stock del mismo SKU entre tiendas. */
20
20
  TRANSFERS = 'transfers',
21
+ /** Lista por SKU del Inventario v3, con stock, ventas del periodo, cobertura y alertas. */
22
+ LIST = 'list',
21
23
  }
@@ -0,0 +1,7 @@
1
+ /** Periodo de ventas y cobertura del Inventario v3; viaja en query string. `all` cuenta como 90 días. */
2
+ export enum InventoryLensPeriodEnum {
3
+ DAYS_7 = '7d',
4
+ DAYS_30 = '30d',
5
+ DAYS_90 = '90d',
6
+ ALL = 'all',
7
+ }
@@ -0,0 +1,9 @@
1
+ /** Tipo de movimiento del libro de inventario (MOV#) de una tienda. */
2
+ export enum InventoryMovementTypeEnum {
3
+ ENTRY = 'ENTRY',
4
+ RESERVATION = 'RESERVATION',
5
+ RELEASE = 'RELEASE',
6
+ SALE = 'SALE',
7
+ RETURN = 'RETURN',
8
+ ADJUSTMENT = 'ADJUSTMENT',
9
+ }
@@ -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,6 @@
1
+ /** Resultado por ítem de la puerta de entrada (sync): aplicado, sin cambios o rechazado. */
2
+ export enum InventorySyncResultStatusEnum {
3
+ APPLIED = 'APPLIED',
4
+ NOOP = 'NOOP',
5
+ REJECTED = 'REJECTED',
6
+ }
@@ -0,0 +1,4 @@
1
+ /** Origen de un registro del historial de precios (PRICE#). */
2
+ export enum PriceSourceEnum {
3
+ ZENTRAL_SYNC = 'ZENTRAL_SYNC',
4
+ }
@@ -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
+ }
@@ -0,0 +1,6 @@
1
+ /** Cómo se rastrea el stock de un producto: por pieza (IMEI o serie) o solo por cantidad. */
2
+ export enum TrackingModeEnum {
3
+ IMEI = 'IMEI',
4
+ SERIAL = 'SERIAL',
5
+ QUANTITY = 'QUANTITY',
6
+ }
@@ -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,5 @@
1
+ /** Identificadores (IMEI o serie) capturados para un SKU de la línea; un producto suelto es un solo SKU. */
2
+ export interface WizardLineIdentifiers {
3
+ sku: string;
4
+ identifiers: string[];
5
+ }
@@ -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
+ }