@fiado/type-kit 3.460.0 → 3.462.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 (199) hide show
  1. package/_test_/unit/loanCredit/customerPaymentDtos.test.ts +87 -0
  2. package/_test_/unit/loanCredit/dtos/createCustomerPaymentRequest.test.ts +78 -0
  3. package/_test_/unit/retailCatalog/catalogEnums.test.ts +34 -0
  4. package/_test_/unit/retailCatalog/stockRequests.test.ts +156 -0
  5. package/_test_/unit/retailLoan/paymentContract.test.ts +128 -0
  6. package/_test_/unit/retailWizard/multiItemRequests.test.ts +114 -0
  7. package/_test_/unit/retailWizard/multiItemShapes.test.ts +126 -0
  8. package/bin/loanCredit/dtos/requests/CreateCustomerPaymentRequest.d.ts +9 -0
  9. package/bin/loanCredit/dtos/requests/CreateCustomerPaymentRequest.js +35 -0
  10. package/bin/loanCredit/dtos/responses/LoanAdHocChargeRequested.d.ts +6 -0
  11. package/bin/loanCredit/dtos/responses/LoanCustomerPaymentOptions.d.ts +33 -0
  12. package/bin/loanCredit/dtos/responses/LoanCustomerPaymentOptions.js +2 -0
  13. package/bin/loanCredit/dtos/responses/LoanCustomerPaymentResult.d.ts +14 -0
  14. package/bin/loanCredit/dtos/responses/LoanCustomerPaymentResult.js +2 -0
  15. package/bin/loanCredit/enums/LoanCustomerPaymentTypeEnum.d.ts +5 -0
  16. package/bin/loanCredit/enums/LoanCustomerPaymentTypeEnum.js +9 -0
  17. package/bin/loanCredit/enums/LoanNextInstallmentModeEnum.d.ts +7 -0
  18. package/bin/loanCredit/enums/LoanNextInstallmentModeEnum.js +11 -0
  19. package/bin/loanCredit/enums/LoanPaymentOptionUnavailableReasonEnum.d.ts +13 -0
  20. package/bin/loanCredit/enums/LoanPaymentOptionUnavailableReasonEnum.js +17 -0
  21. package/bin/loanCredit/index.d.ts +6 -0
  22. package/bin/loanCredit/index.js +7 -0
  23. package/bin/retailCatalog/dtos/Product.d.ts +15 -1
  24. package/bin/retailCatalog/dtos/ProductComponent.d.ts +5 -0
  25. package/bin/retailCatalog/dtos/ProductComponent.js +29 -0
  26. package/bin/retailCatalog/dtos/requests/GetInventorySkuQuery.d.ts +10 -0
  27. package/bin/retailCatalog/dtos/requests/GetInventorySkuQuery.js +42 -0
  28. package/bin/retailCatalog/dtos/requests/InventoryLensQuery.d.ts +5 -0
  29. package/bin/retailCatalog/dtos/requests/InventoryLensQuery.js +11 -0
  30. package/bin/retailCatalog/dtos/requests/ReleaseStockRequest.d.ts +8 -0
  31. package/bin/retailCatalog/dtos/requests/ReleaseStockRequest.js +34 -0
  32. package/bin/retailCatalog/dtos/requests/RenewReservationsRequest.d.ts +6 -0
  33. package/bin/retailCatalog/dtos/requests/RenewReservationsRequest.js +30 -0
  34. package/bin/retailCatalog/dtos/requests/ReservationLineRef.d.ts +5 -0
  35. package/bin/retailCatalog/dtos/requests/ReservationLineRef.js +25 -0
  36. package/bin/retailCatalog/dtos/requests/ReserveStockRequest.d.ts +10 -0
  37. package/bin/retailCatalog/dtos/requests/ReserveStockRequest.js +42 -0
  38. package/bin/retailCatalog/dtos/requests/ReturnStockRequest.d.ts +9 -0
  39. package/bin/retailCatalog/dtos/requests/ReturnStockRequest.js +38 -0
  40. package/bin/retailCatalog/dtos/requests/SellStockRequest.d.ts +7 -0
  41. package/bin/retailCatalog/dtos/requests/SellStockRequest.js +34 -0
  42. package/bin/retailCatalog/dtos/requests/StockLine.d.ts +14 -0
  43. package/bin/retailCatalog/dtos/requests/StockLine.js +56 -0
  44. package/bin/retailCatalog/dtos/requests/SuggestPiecesQuery.d.ts +5 -0
  45. package/bin/retailCatalog/dtos/requests/SuggestPiecesQuery.js +26 -0
  46. package/bin/retailCatalog/dtos/requests/SyncInventoryRequest.d.ts +47 -0
  47. package/bin/retailCatalog/dtos/requests/SyncInventoryRequest.js +173 -0
  48. package/bin/retailCatalog/dtos/responses/GetInventorySkuResponse.d.ts +34 -0
  49. package/bin/retailCatalog/dtos/responses/GetInventorySkuResponse.js +2 -0
  50. package/bin/retailCatalog/dtos/responses/InventoryLensResponse.d.ts +43 -2
  51. package/bin/retailCatalog/dtos/responses/ListSkuPricesResponse.d.ts +6 -0
  52. package/bin/retailCatalog/dtos/responses/ListSkuPricesResponse.js +2 -0
  53. package/bin/retailCatalog/dtos/responses/ReleaseStockResponse.d.ts +10 -0
  54. package/bin/retailCatalog/dtos/responses/ReleaseStockResponse.js +2 -0
  55. package/bin/retailCatalog/dtos/responses/RenewReservationsResponse.d.ts +10 -0
  56. package/bin/retailCatalog/dtos/responses/RenewReservationsResponse.js +2 -0
  57. package/bin/retailCatalog/dtos/responses/ReserveStockResponse.d.ts +25 -0
  58. package/bin/retailCatalog/dtos/responses/ReserveStockResponse.js +2 -0
  59. package/bin/retailCatalog/dtos/responses/ReturnStockResponse.d.ts +4 -0
  60. package/bin/retailCatalog/dtos/responses/ReturnStockResponse.js +2 -0
  61. package/bin/retailCatalog/dtos/responses/SellStockResponse.d.ts +18 -0
  62. package/bin/retailCatalog/dtos/responses/SellStockResponse.js +2 -0
  63. package/bin/retailCatalog/dtos/responses/SkuPriceEntry.d.ts +9 -0
  64. package/bin/retailCatalog/dtos/responses/SkuPriceEntry.js +2 -0
  65. package/bin/retailCatalog/dtos/responses/StoreCatalogItem.d.ts +29 -0
  66. package/bin/retailCatalog/dtos/responses/StoreCatalogItem.js +2 -0
  67. package/bin/retailCatalog/dtos/responses/SuggestPiecesResponse.d.ts +6 -0
  68. package/bin/retailCatalog/dtos/responses/SuggestPiecesResponse.js +2 -0
  69. package/bin/retailCatalog/dtos/responses/SyncInventoryResponse.d.ts +13 -0
  70. package/bin/retailCatalog/dtos/responses/SyncInventoryResponse.js +2 -0
  71. package/bin/retailCatalog/dtos/validation/ValidateProductResponse.d.ts +6 -1
  72. package/bin/retailCatalog/enums/InventoryLensFilterEnum.d.ts +3 -1
  73. package/bin/retailCatalog/enums/InventoryLensFilterEnum.js +2 -0
  74. package/bin/retailCatalog/enums/InventoryLensPeriodEnum.d.ts +7 -0
  75. package/bin/retailCatalog/enums/InventoryLensPeriodEnum.js +11 -0
  76. package/bin/retailCatalog/enums/InventoryMovementTypeEnum.d.ts +9 -0
  77. package/bin/retailCatalog/enums/InventoryMovementTypeEnum.js +13 -0
  78. package/bin/retailCatalog/enums/InventorySyncRejectionCodeEnum.d.ts +9 -0
  79. package/bin/retailCatalog/enums/InventorySyncRejectionCodeEnum.js +13 -0
  80. package/bin/retailCatalog/enums/InventorySyncResultStatusEnum.d.ts +6 -0
  81. package/bin/retailCatalog/enums/InventorySyncResultStatusEnum.js +10 -0
  82. package/bin/retailCatalog/enums/PriceSourceEnum.d.ts +4 -0
  83. package/bin/retailCatalog/enums/PriceSourceEnum.js +8 -0
  84. package/bin/retailCatalog/enums/ProductCategoryEnum.d.ts +9 -0
  85. package/bin/retailCatalog/enums/ProductCategoryEnum.js +13 -0
  86. package/bin/retailCatalog/enums/TrackingModeEnum.d.ts +6 -0
  87. package/bin/retailCatalog/enums/TrackingModeEnum.js +10 -0
  88. package/bin/retailCatalog/index.d.ts +29 -0
  89. package/bin/retailCatalog/index.js +30 -0
  90. package/bin/retailLoan/dtos/CreateMyPaymentRequest.d.ts +7 -0
  91. package/bin/retailLoan/dtos/CreateMyPaymentRequest.js +30 -0
  92. package/bin/retailLoan/dtos/CreateMyPaymentResponse.d.ts +9 -0
  93. package/bin/retailLoan/dtos/CreateMyPaymentResponse.js +2 -0
  94. package/bin/retailLoan/dtos/MyPaymentOptions.d.ts +34 -0
  95. package/bin/retailLoan/dtos/MyPaymentOptions.js +2 -0
  96. package/bin/retailLoan/enums/MyCollectionOutcomeEnum.d.ts +11 -0
  97. package/bin/retailLoan/enums/MyCollectionOutcomeEnum.js +15 -0
  98. package/bin/retailLoan/enums/MyNextInstallmentModeEnum.d.ts +5 -0
  99. package/bin/retailLoan/enums/MyNextInstallmentModeEnum.js +9 -0
  100. package/bin/retailLoan/enums/MyPaymentTypeEnum.d.ts +6 -0
  101. package/bin/retailLoan/enums/MyPaymentTypeEnum.js +10 -0
  102. package/bin/retailLoan/enums/MyPaymentUnavailableReasonEnum.d.ts +8 -0
  103. package/bin/retailLoan/enums/MyPaymentUnavailableReasonEnum.js +12 -0
  104. package/bin/retailLoan/index.d.ts +7 -0
  105. package/bin/retailLoan/index.js +8 -0
  106. package/bin/retailWizard/dtos/Sale.d.ts +7 -0
  107. package/bin/retailWizard/dtos/SaleLine.d.ts +16 -0
  108. package/bin/retailWizard/dtos/SaleLine.js +2 -0
  109. package/bin/retailWizard/dtos/WizardLineIdentifiers.d.ts +5 -0
  110. package/bin/retailWizard/dtos/WizardLineIdentifiers.js +2 -0
  111. package/bin/retailWizard/dtos/WizardLineProduct.d.ts +15 -0
  112. package/bin/retailWizard/dtos/WizardLineProduct.js +2 -0
  113. package/bin/retailWizard/dtos/WizardProduct.d.ts +6 -0
  114. package/bin/retailWizard/dtos/WizardReservedLine.d.ts +35 -0
  115. package/bin/retailWizard/dtos/WizardReservedLine.js +2 -0
  116. package/bin/retailWizard/dtos/WizardSession.d.ts +5 -0
  117. package/bin/retailWizard/dtos/requests/AddProductRequest.d.ts +4 -8
  118. package/bin/retailWizard/dtos/requests/AddProductRequest.js +9 -8
  119. package/bin/retailWizard/dtos/requests/CompleteSaleRequest.d.ts +16 -0
  120. package/bin/retailWizard/dtos/requests/CompleteSaleRequest.js +59 -0
  121. package/bin/retailWizard/dtos/requests/DeleteProductRequest.d.ts +3 -1
  122. package/bin/retailWizard/dtos/requests/DeleteProductRequest.js +7 -1
  123. package/bin/retailWizard/dtos/requests/QuoteRequest.d.ts +2 -0
  124. package/bin/retailWizard/dtos/requests/QuoteRequest.js +7 -0
  125. package/bin/retailWizard/dtos/requests/SuggestIdentifiersQuery.d.ts +5 -0
  126. package/bin/retailWizard/dtos/requests/SuggestIdentifiersQuery.js +30 -0
  127. package/bin/retailWizard/enums/LinePaymentTypeEnum.d.ts +7 -0
  128. package/bin/retailWizard/enums/LinePaymentTypeEnum.js +11 -0
  129. package/bin/retailWizard/enums/WizardLineStatusEnum.d.ts +9 -0
  130. package/bin/retailWizard/enums/WizardLineStatusEnum.js +13 -0
  131. package/bin/retailWizard/index.d.ts +8 -0
  132. package/bin/retailWizard/index.js +8 -0
  133. package/package.json +1 -1
  134. package/src/loanCredit/dtos/requests/CreateCustomerPaymentRequest.ts +21 -0
  135. package/src/loanCredit/dtos/responses/LoanAdHocChargeRequested.ts +3 -0
  136. package/src/loanCredit/dtos/responses/LoanCustomerPaymentOptions.ts +32 -0
  137. package/src/loanCredit/dtos/responses/LoanCustomerPaymentResult.ts +12 -0
  138. package/src/loanCredit/enums/LoanCustomerPaymentTypeEnum.ts +5 -0
  139. package/src/loanCredit/enums/LoanNextInstallmentModeEnum.ts +7 -0
  140. package/src/loanCredit/enums/LoanPaymentOptionUnavailableReasonEnum.ts +13 -0
  141. package/src/loanCredit/index.ts +8 -0
  142. package/src/retailCatalog/dtos/Product.ts +17 -1
  143. package/src/retailCatalog/dtos/ProductComponent.ts +14 -0
  144. package/src/retailCatalog/dtos/requests/GetInventorySkuQuery.ts +27 -0
  145. package/src/retailCatalog/dtos/requests/InventoryLensQuery.ts +12 -1
  146. package/src/retailCatalog/dtos/requests/ReleaseStockRequest.ts +19 -0
  147. package/src/retailCatalog/dtos/requests/RenewReservationsRequest.ts +15 -0
  148. package/src/retailCatalog/dtos/requests/ReservationLineRef.ts +10 -0
  149. package/src/retailCatalog/dtos/requests/ReserveStockRequest.ts +24 -0
  150. package/src/retailCatalog/dtos/requests/ReturnStockRequest.ts +22 -0
  151. package/src/retailCatalog/dtos/requests/SellStockRequest.ts +18 -0
  152. package/src/retailCatalog/dtos/requests/StockLine.ts +36 -0
  153. package/src/retailCatalog/dtos/requests/SuggestPiecesQuery.ts +11 -0
  154. package/src/retailCatalog/dtos/requests/SyncInventoryRequest.ts +145 -0
  155. package/src/retailCatalog/dtos/responses/GetInventorySkuResponse.ts +38 -0
  156. package/src/retailCatalog/dtos/responses/InventoryLensResponse.ts +48 -2
  157. package/src/retailCatalog/dtos/responses/ListSkuPricesResponse.ts +7 -0
  158. package/src/retailCatalog/dtos/responses/ReleaseStockResponse.ts +11 -0
  159. package/src/retailCatalog/dtos/responses/RenewReservationsResponse.ts +11 -0
  160. package/src/retailCatalog/dtos/responses/ReserveStockResponse.ts +27 -0
  161. package/src/retailCatalog/dtos/responses/ReturnStockResponse.ts +4 -0
  162. package/src/retailCatalog/dtos/responses/SellStockResponse.ts +20 -0
  163. package/src/retailCatalog/dtos/responses/SkuPriceEntry.ts +10 -0
  164. package/src/retailCatalog/dtos/responses/StoreCatalogItem.ts +31 -0
  165. package/src/retailCatalog/dtos/responses/SuggestPiecesResponse.ts +7 -0
  166. package/src/retailCatalog/dtos/responses/SyncInventoryResponse.ts +15 -0
  167. package/src/retailCatalog/dtos/validation/ValidateProductResponse.ts +6 -1
  168. package/src/retailCatalog/enums/InventoryLensFilterEnum.ts +2 -0
  169. package/src/retailCatalog/enums/InventoryLensPeriodEnum.ts +7 -0
  170. package/src/retailCatalog/enums/InventoryMovementTypeEnum.ts +9 -0
  171. package/src/retailCatalog/enums/InventorySyncRejectionCodeEnum.ts +9 -0
  172. package/src/retailCatalog/enums/InventorySyncResultStatusEnum.ts +6 -0
  173. package/src/retailCatalog/enums/PriceSourceEnum.ts +4 -0
  174. package/src/retailCatalog/enums/ProductCategoryEnum.ts +9 -0
  175. package/src/retailCatalog/enums/TrackingModeEnum.ts +6 -0
  176. package/src/retailCatalog/index.ts +31 -0
  177. package/src/retailLoan/dtos/CreateMyPaymentRequest.ts +16 -0
  178. package/src/retailLoan/dtos/CreateMyPaymentResponse.ts +10 -0
  179. package/src/retailLoan/dtos/MyPaymentOptions.ts +28 -0
  180. package/src/retailLoan/enums/MyCollectionOutcomeEnum.ts +11 -0
  181. package/src/retailLoan/enums/MyNextInstallmentModeEnum.ts +5 -0
  182. package/src/retailLoan/enums/MyPaymentTypeEnum.ts +6 -0
  183. package/src/retailLoan/enums/MyPaymentUnavailableReasonEnum.ts +8 -0
  184. package/src/retailLoan/index.ts +9 -0
  185. package/src/retailWizard/dtos/Sale.ts +7 -0
  186. package/src/retailWizard/dtos/SaleLine.ts +17 -0
  187. package/src/retailWizard/dtos/WizardLineIdentifiers.ts +5 -0
  188. package/src/retailWizard/dtos/WizardLineProduct.ts +16 -0
  189. package/src/retailWizard/dtos/WizardProduct.ts +7 -0
  190. package/src/retailWizard/dtos/WizardReservedLine.ts +36 -0
  191. package/src/retailWizard/dtos/WizardSession.ts +5 -0
  192. package/src/retailWizard/dtos/requests/AddProductRequest.ts +9 -8
  193. package/src/retailWizard/dtos/requests/CompleteSaleRequest.ts +41 -0
  194. package/src/retailWizard/dtos/requests/DeleteProductRequest.ts +7 -1
  195. package/src/retailWizard/dtos/requests/QuoteRequest.ts +8 -1
  196. package/src/retailWizard/dtos/requests/SuggestIdentifiersQuery.ts +15 -0
  197. package/src/retailWizard/enums/LinePaymentTypeEnum.ts +7 -0
  198. package/src/retailWizard/enums/WizardLineStatusEnum.ts +9 -0
  199. package/src/retailWizard/index.ts +8 -0
@@ -0,0 +1,27 @@
1
+ import { Type } from 'class-transformer';
2
+ import { IsEnum, IsInt, IsOptional, IsString, Max, Min } from 'class-validator';
3
+ import { InventoryLensPeriodEnum } from '../../enums/InventoryLensPeriodEnum';
4
+
5
+ /** Query de GET /backoffice/inventory/skus/{sku} (backofficeGetInventorySku); el retailer sale del token. */
6
+ export class GetInventorySkuQuery {
7
+ @IsOptional()
8
+ @IsEnum(InventoryLensPeriodEnum)
9
+ period?: InventoryLensPeriodEnum;
10
+
11
+ /** Debe pertenecer al retailer del token. */
12
+ @IsOptional()
13
+ @IsString()
14
+ storeId?: string;
15
+
16
+ /** Tamaño de página del libro de movimientos. */
17
+ @IsOptional()
18
+ @Type(() => Number)
19
+ @IsInt()
20
+ @Min(1)
21
+ @Max(100)
22
+ limit?: number;
23
+
24
+ @IsOptional()
25
+ @IsString()
26
+ nextToken?: string;
27
+ }
@@ -1,5 +1,6 @@
1
- import { IsEnum } from 'class-validator';
1
+ import { IsEnum, IsOptional, IsString } from 'class-validator';
2
2
  import { InventoryLensFilterEnum } from '../../enums/InventoryLensFilterEnum';
3
+ import { InventoryLensPeriodEnum } from '../../enums/InventoryLensPeriodEnum';
3
4
 
4
5
  /**
5
6
  * Query string de `GET /backoffice/inventory/lens`. SureKeep Fase 3 — pista Retail.
@@ -13,4 +14,14 @@ import { InventoryLensFilterEnum } from '../../enums/InventoryLensFilterEnum';
13
14
  export class InventoryLensQuery {
14
15
  @IsEnum(InventoryLensFilterEnum)
15
16
  filter!: InventoryLensFilterEnum;
17
+
18
+ /** Solo `filter=list`: periodo de ventas y cobertura. */
19
+ @IsOptional()
20
+ @IsEnum(InventoryLensPeriodEnum)
21
+ period?: InventoryLensPeriodEnum;
22
+
23
+ /** Solo `filter=list`: una tienda del retailer del token; ausente = consolidado. */
24
+ @IsOptional()
25
+ @IsString()
26
+ storeId?: string;
16
27
  }
@@ -0,0 +1,19 @@
1
+ import { Type } from 'class-transformer';
2
+ import { ArrayMinSize, IsArray, IsBoolean, IsString, ValidateNested } from 'class-validator';
3
+ import { ReservationLineRef } from './ReservationLineRef';
4
+
5
+ /** Body de PUT /private/stores/{storeId}/reservations/release (privateReleaseStock). */
6
+ export class ReleaseStockRequest {
7
+ @IsString()
8
+ sessionId!: string;
9
+
10
+ @IsArray()
11
+ @ArrayMinSize(1)
12
+ @ValidateNested({ each: true })
13
+ @Type(() => ReservationLineRef)
14
+ lines!: ReservationLineRef[];
15
+
16
+ /** `true` = solo libera las reservas ya vencidas (barrido). */
17
+ @IsBoolean()
18
+ onlyExpired!: boolean;
19
+ }
@@ -0,0 +1,15 @@
1
+ import { Type } from 'class-transformer';
2
+ import { ArrayMinSize, IsArray, IsString, ValidateNested } from 'class-validator';
3
+ import { ReservationLineRef } from './ReservationLineRef';
4
+
5
+ /** Body de PUT /private/stores/{storeId}/reservations/renew (privateRenewReservations). */
6
+ export class RenewReservationsRequest {
7
+ @IsString()
8
+ sessionId!: string;
9
+
10
+ @IsArray()
11
+ @ArrayMinSize(1)
12
+ @ValidateNested({ each: true })
13
+ @Type(() => ReservationLineRef)
14
+ lines!: ReservationLineRef[];
15
+ }
@@ -0,0 +1,10 @@
1
+ import { IsString } from 'class-validator';
2
+
3
+ /** Una línea de la venta y la reserva que la respalda; la usan renew y release. */
4
+ export class ReservationLineRef {
5
+ @IsString()
6
+ lineId!: string;
7
+
8
+ @IsString()
9
+ reservationId!: string;
10
+ }
@@ -0,0 +1,24 @@
1
+ import { IsInt, IsString, Min } from 'class-validator';
2
+
3
+ /** Body de PUT /private/stores/{storeId}/reservations (privateReserveStock); reserva una línea, kit completo. */
4
+ export class ReserveStockRequest {
5
+ @IsString()
6
+ sessionId!: string;
7
+
8
+ @IsString()
9
+ lineId!: string;
10
+
11
+ /** Llave de idempotencia; un id nuevo por cada intento de reserva. */
12
+ @IsString()
13
+ reservationId!: string;
14
+
15
+ @IsString()
16
+ retailerId!: string;
17
+
18
+ @IsString()
19
+ sku!: string;
20
+
21
+ @IsInt()
22
+ @Min(1)
23
+ qty!: number;
24
+ }
@@ -0,0 +1,22 @@
1
+ import { Type } from 'class-transformer';
2
+ import { ArrayMinSize, IsArray, IsISO8601, IsString, ValidateNested } from 'class-validator';
3
+ import { StockLine } from './StockLine';
4
+
5
+ /** Body de PUT /private/stores/{storeId}/returns (privateReturnStock); componentes guardados en la venta. */
6
+ export class ReturnStockRequest {
7
+ @IsString()
8
+ saleId!: string;
9
+
10
+ @IsString()
11
+ retailerId!: string;
12
+
13
+ /** Fecha de la venta; fija el día de negocio del contador DAY# que se descuenta. */
14
+ @IsISO8601()
15
+ soldAt!: string;
16
+
17
+ @IsArray()
18
+ @ArrayMinSize(1)
19
+ @ValidateNested({ each: true })
20
+ @Type(() => StockLine)
21
+ lines!: StockLine[];
22
+ }
@@ -0,0 +1,18 @@
1
+ import { Type } from 'class-transformer';
2
+ import { ArrayMinSize, IsArray, IsString, ValidateNested } from 'class-validator';
3
+ import { StockLine } from './StockLine';
4
+
5
+ /** Body de PUT /private/stores/{storeId}/sales (privateSellStock); una TX de venta. */
6
+ export class SellStockRequest {
7
+ @IsString()
8
+ sessionId!: string;
9
+
10
+ @IsString()
11
+ retailerId!: string;
12
+
13
+ @IsArray()
14
+ @ArrayMinSize(1)
15
+ @ValidateNested({ each: true })
16
+ @Type(() => StockLine)
17
+ lines!: StockLine[];
18
+ }
@@ -0,0 +1,36 @@
1
+ import { Type } from 'class-transformer';
2
+ import { ArrayMinSize, IsArray, IsInt, IsString, Min, ValidateNested } from 'class-validator';
3
+
4
+ /** Componente de una línea con las piezas que se entregan; un producto suelto es un solo componente. */
5
+ export class StockLineComponent {
6
+ @IsString()
7
+ sku!: string;
8
+
9
+ @IsInt()
10
+ @Min(1)
11
+ qty!: number;
12
+
13
+ /** IMEI o serie de cada pieza; vacío si el SKU se rastrea por cantidad. */
14
+ @IsArray()
15
+ @IsString({ each: true })
16
+ identifiers!: string[];
17
+ }
18
+
19
+ /** Línea de venta o devolución con sus componentes; la usan sell y return. */
20
+ export class StockLine {
21
+ @IsString()
22
+ lineId!: string;
23
+
24
+ @IsString()
25
+ sku!: string;
26
+
27
+ @IsInt()
28
+ @Min(1)
29
+ qty!: number;
30
+
31
+ @IsArray()
32
+ @ArrayMinSize(1)
33
+ @ValidateNested({ each: true })
34
+ @Type(() => StockLineComponent)
35
+ components!: StockLineComponent[];
36
+ }
@@ -0,0 +1,11 @@
1
+ import { IsString, MinLength } from 'class-validator';
2
+
3
+ /** Query de GET /private/stores/{storeId}/pieces (privateSuggestPieces); sku es el componente si es kit. */
4
+ export class SuggestPiecesQuery {
5
+ @IsString()
6
+ sku!: string;
7
+
8
+ @IsString()
9
+ @MinLength(4)
10
+ prefix!: string;
11
+ }
@@ -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
+ }