@fiado/type-kit 3.472.0 → 3.474.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 (268) hide show
  1. package/_test_/unit/retailCatalog/accessorySubcategory.test.ts +65 -0
  2. package/_test_/unit/retailCatalog/catalogDebt.test.ts +123 -0
  3. package/_test_/unit/retailCatalog/catalogEnums.test.ts +2 -2
  4. package/_test_/unit/retailCatalog/ventaSaga.test.ts +156 -0
  5. package/_test_/unit/retailPromotions/computeBudgetUsedBps.test.ts +30 -0
  6. package/_test_/unit/retailPromotions/constants.test.ts +78 -0
  7. package/_test_/unit/retailPromotions/discountCodeAndWizardRequests.test.ts +97 -0
  8. package/_test_/unit/retailPromotions/salePromotionRequests.test.ts +159 -0
  9. package/_test_/unit/retailWizard/promotionM2mRequests.test.ts +197 -0
  10. package/_test_/unit/retailWizard/ventaSagaMessages.test.ts +186 -0
  11. package/_test_/unit/retailWizard/ventaSagaRequests.test.ts +59 -0
  12. package/_test_/unit/retailWizard/ventaSagaShapes.test.ts +99 -0
  13. package/bin/index.d.ts +1 -0
  14. package/bin/index.js +5 -2
  15. package/bin/retailCatalog/dtos/Product.d.ts +9 -0
  16. package/bin/retailCatalog/dtos/requests/BackofficeCreateProductRequest.d.ts +12 -0
  17. package/bin/retailCatalog/dtos/requests/BackofficeCreateProductRequest.js +36 -0
  18. package/bin/retailCatalog/dtos/requests/BackofficeRegisterAdjustmentRequest.d.ts +2 -0
  19. package/bin/retailCatalog/dtos/requests/BackofficeRegisterAdjustmentRequest.js +6 -0
  20. package/bin/retailCatalog/dtos/requests/BackofficeUpdateProductRequest.d.ts +12 -0
  21. package/bin/retailCatalog/dtos/requests/BackofficeUpdateProductRequest.js +36 -0
  22. package/bin/retailCatalog/dtos/requests/HoldStockRequest.d.ts +12 -0
  23. package/bin/retailCatalog/dtos/requests/HoldStockRequest.js +50 -0
  24. package/bin/retailCatalog/dtos/requests/ReserveStockRequest.d.ts +3 -0
  25. package/bin/retailCatalog/dtos/requests/ReserveStockRequest.js +6 -0
  26. package/bin/retailCatalog/dtos/requests/SuggestPiecesQuery.d.ts +2 -0
  27. package/bin/retailCatalog/dtos/requests/SuggestPiecesQuery.js +6 -0
  28. package/bin/retailCatalog/dtos/responses/GetInventorySkuResponse.d.ts +3 -0
  29. package/bin/retailCatalog/dtos/responses/HoldStockResponse.d.ts +8 -0
  30. package/bin/retailCatalog/dtos/responses/HoldStockResponse.js +2 -0
  31. package/bin/retailCatalog/dtos/responses/StoreCatalogItem.d.ts +8 -1
  32. package/bin/retailCatalog/enums/AccessorySubcategoryEnum.d.ts +9 -0
  33. package/bin/retailCatalog/enums/AccessorySubcategoryEnum.js +13 -0
  34. package/bin/retailCatalog/enums/InventoryInboundMessageTypeEnum.d.ts +5 -0
  35. package/bin/retailCatalog/enums/InventoryInboundMessageTypeEnum.js +9 -0
  36. package/bin/retailCatalog/enums/InventoryItemStatusEnum.d.ts +4 -2
  37. package/bin/retailCatalog/enums/InventoryItemStatusEnum.js +3 -1
  38. package/bin/retailCatalog/enums/ReservePurposeEnum.d.ts +4 -0
  39. package/bin/retailCatalog/enums/ReservePurposeEnum.js +8 -0
  40. package/bin/retailCatalog/events/InventoryInboundMessage.d.ts +4 -0
  41. package/bin/retailCatalog/events/InventoryInboundMessage.js +2 -0
  42. package/bin/retailCatalog/events/InventoryReturnMessage.d.ts +12 -0
  43. package/bin/retailCatalog/events/InventoryReturnMessage.js +42 -0
  44. package/bin/retailCatalog/events/InventorySaleAppliedMessage.d.ts +12 -0
  45. package/bin/retailCatalog/events/InventorySaleAppliedMessage.js +42 -0
  46. package/bin/retailCatalog/index.d.ts +8 -0
  47. package/bin/retailCatalog/index.js +9 -0
  48. package/bin/retailPromotions/constants/bonusPreMoney.d.ts +7 -0
  49. package/bin/retailPromotions/constants/bonusPreMoney.js +21 -0
  50. package/bin/retailPromotions/constants/retailPromotionsErrorHttpStatus.d.ts +3 -0
  51. package/bin/retailPromotions/constants/retailPromotionsErrorHttpStatus.js +27 -0
  52. package/bin/retailPromotions/constants/salePromotionTransitions.d.ts +7 -0
  53. package/bin/retailPromotions/constants/salePromotionTransitions.js +13 -0
  54. package/bin/retailPromotions/dtos/DiscountCode.d.ts +35 -0
  55. package/bin/retailPromotions/dtos/DiscountCode.js +2 -0
  56. package/bin/retailPromotions/dtos/DiscountValue.d.ts +7 -0
  57. package/bin/retailPromotions/dtos/DiscountValue.js +2 -0
  58. package/bin/retailPromotions/dtos/LinePromotionDiscount.d.ts +10 -0
  59. package/bin/retailPromotions/dtos/LinePromotionDiscount.js +2 -0
  60. package/bin/retailPromotions/dtos/SalePromotion.d.ts +35 -0
  61. package/bin/retailPromotions/dtos/SalePromotion.js +2 -0
  62. package/bin/retailPromotions/dtos/SalePromotionLevers.d.ts +59 -0
  63. package/bin/retailPromotions/dtos/SalePromotionLevers.js +2 -0
  64. package/bin/retailPromotions/dtos/SalePromotionLogEntry.d.ts +18 -0
  65. package/bin/retailPromotions/dtos/SalePromotionLogEntry.js +2 -0
  66. package/bin/retailPromotions/dtos/requests/ChangeDiscountCodeStatusRequest.d.ts +6 -0
  67. package/bin/retailPromotions/dtos/requests/ChangeDiscountCodeStatusRequest.js +30 -0
  68. package/bin/retailPromotions/dtos/requests/ChangeSalePromotionStatusRequest.d.ts +6 -0
  69. package/bin/retailPromotions/dtos/requests/ChangeSalePromotionStatusRequest.js +30 -0
  70. package/bin/retailPromotions/dtos/requests/CreateDiscountCodeRequest.d.ts +17 -0
  71. package/bin/retailPromotions/dtos/requests/CreateDiscountCodeRequest.js +78 -0
  72. package/bin/retailPromotions/dtos/requests/CreateSalePromotionRequest.d.ts +19 -0
  73. package/bin/retailPromotions/dtos/requests/CreateSalePromotionRequest.js +83 -0
  74. package/bin/retailPromotions/dtos/requests/DiscountValueInput.d.ts +8 -0
  75. package/bin/retailPromotions/dtos/requests/DiscountValueInput.js +36 -0
  76. package/bin/retailPromotions/dtos/requests/EvaluateSalePromotionsRequest.d.ts +5 -0
  77. package/bin/retailPromotions/dtos/requests/EvaluateSalePromotionsRequest.js +31 -0
  78. package/bin/retailPromotions/dtos/requests/GetSaleCouponQuery.d.ts +4 -0
  79. package/bin/retailPromotions/dtos/requests/GetSaleCouponQuery.js +25 -0
  80. package/bin/retailPromotions/dtos/requests/HoldSalePromotionRequest.d.ts +11 -0
  81. package/bin/retailPromotions/dtos/requests/HoldSalePromotionRequest.js +48 -0
  82. package/bin/retailPromotions/dtos/requests/ListDiscountCodesQuery.d.ts +10 -0
  83. package/bin/retailPromotions/dtos/requests/ListDiscountCodesQuery.js +49 -0
  84. package/bin/retailPromotions/dtos/requests/ListSalePromotionLogQuery.d.ts +8 -0
  85. package/bin/retailPromotions/dtos/requests/ListSalePromotionLogQuery.js +46 -0
  86. package/bin/retailPromotions/dtos/requests/ListSalePromotionsQuery.d.ts +7 -0
  87. package/bin/retailPromotions/dtos/requests/ListSalePromotionsQuery.js +40 -0
  88. package/bin/retailPromotions/dtos/requests/ListStoreSalePromotionsQuery.d.ts +4 -0
  89. package/bin/retailPromotions/dtos/requests/ListStoreSalePromotionsQuery.js +24 -0
  90. package/bin/retailPromotions/dtos/requests/SalePromotionLeversInput.d.ts +41 -0
  91. package/bin/retailPromotions/dtos/requests/SalePromotionLeversInput.js +166 -0
  92. package/bin/retailPromotions/dtos/requests/SalePromotionScopeInput.d.ts +14 -0
  93. package/bin/retailPromotions/dtos/requests/SalePromotionScopeInput.js +65 -0
  94. package/bin/retailPromotions/dtos/requests/UpdateSalePromotionRequest.d.ts +19 -0
  95. package/bin/retailPromotions/dtos/requests/UpdateSalePromotionRequest.js +85 -0
  96. package/bin/retailPromotions/dtos/responses/DiscountCodeResponses.d.ts +7 -0
  97. package/bin/retailPromotions/dtos/responses/DiscountCodeResponses.js +2 -0
  98. package/bin/retailPromotions/dtos/responses/SalePromotionCrudResponses.d.ts +30 -0
  99. package/bin/retailPromotions/dtos/responses/SalePromotionCrudResponses.js +2 -0
  100. package/bin/retailPromotions/dtos/responses/WizardSalePromotionResponses.d.ts +102 -0
  101. package/bin/retailPromotions/dtos/responses/WizardSalePromotionResponses.js +2 -0
  102. package/bin/retailPromotions/enums/CouponScopeEnum.d.ts +11 -0
  103. package/bin/retailPromotions/enums/CouponScopeEnum.js +15 -0
  104. package/bin/retailPromotions/enums/CouponStatusEnum.d.ts +11 -0
  105. package/bin/retailPromotions/enums/CouponStatusEnum.js +15 -0
  106. package/bin/retailPromotions/enums/DiscountCodeOriginEnum.d.ts +8 -0
  107. package/bin/retailPromotions/enums/DiscountCodeOriginEnum.js +12 -0
  108. package/bin/retailPromotions/enums/DiscountCodeStatusEnum.d.ts +11 -0
  109. package/bin/retailPromotions/enums/DiscountCodeStatusEnum.js +15 -0
  110. package/bin/retailPromotions/enums/DiscountCodeTransitionEnum.d.ts +7 -0
  111. package/bin/retailPromotions/enums/DiscountCodeTransitionEnum.js +11 -0
  112. package/bin/retailPromotions/enums/DiscountTypeEnum.d.ts +8 -0
  113. package/bin/retailPromotions/enums/DiscountTypeEnum.js +12 -0
  114. package/bin/retailPromotions/enums/EntitlementKindEnum.d.ts +9 -0
  115. package/bin/retailPromotions/enums/EntitlementKindEnum.js +13 -0
  116. package/bin/retailPromotions/enums/EntitlementStateEnum.d.ts +13 -0
  117. package/bin/retailPromotions/enums/EntitlementStateEnum.js +17 -0
  118. package/bin/retailPromotions/enums/GiftModeEnum.d.ts +8 -0
  119. package/bin/retailPromotions/enums/GiftModeEnum.js +12 -0
  120. package/bin/retailPromotions/enums/PromotionAppliesToEnum.d.ts +9 -0
  121. package/bin/retailPromotions/enums/PromotionAppliesToEnum.js +13 -0
  122. package/bin/retailPromotions/enums/RetailPromotionsErrorCodeEnum.d.ts +29 -0
  123. package/bin/retailPromotions/enums/RetailPromotionsErrorCodeEnum.js +33 -0
  124. package/bin/retailPromotions/enums/SaleCouponAvailabilityEnum.d.ts +10 -0
  125. package/bin/retailPromotions/enums/SaleCouponAvailabilityEnum.js +14 -0
  126. package/bin/retailPromotions/enums/SalePromotionLeverEnum.d.ts +13 -0
  127. package/bin/retailPromotions/enums/SalePromotionLeverEnum.js +17 -0
  128. package/bin/retailPromotions/enums/SalePromotionLogEventEnum.d.ts +14 -0
  129. package/bin/retailPromotions/enums/SalePromotionLogEventEnum.js +18 -0
  130. package/bin/retailPromotions/enums/SalePromotionLogFormatEnum.d.ts +5 -0
  131. package/bin/retailPromotions/enums/SalePromotionLogFormatEnum.js +9 -0
  132. package/bin/retailPromotions/enums/SalePromotionPhaseEnum.d.ts +11 -0
  133. package/bin/retailPromotions/enums/SalePromotionPhaseEnum.js +15 -0
  134. package/bin/retailPromotions/enums/SalePromotionStatusEnum.d.ts +12 -0
  135. package/bin/retailPromotions/enums/SalePromotionStatusEnum.js +16 -0
  136. package/bin/retailPromotions/enums/SalePromotionTransitionEnum.d.ts +13 -0
  137. package/bin/retailPromotions/enums/SalePromotionTransitionEnum.js +17 -0
  138. package/bin/retailPromotions/helpers/computeBudgetUsedBps.d.ts +3 -0
  139. package/bin/retailPromotions/helpers/computeBudgetUsedBps.js +15 -0
  140. package/bin/retailPromotions/helpers/resolveSalePromotionTransition.d.ts +4 -0
  141. package/bin/retailPromotions/helpers/resolveSalePromotionTransition.js +9 -0
  142. package/bin/retailPromotions/index.d.ts +47 -0
  143. package/bin/retailPromotions/index.js +68 -0
  144. package/bin/retailWizard/dtos/Sale.d.ts +8 -8
  145. package/bin/retailWizard/dtos/SaleLine.d.ts +4 -1
  146. package/bin/retailWizard/dtos/WizardFinancingPreview.d.ts +11 -0
  147. package/bin/retailWizard/dtos/WizardFinancingPreview.js +2 -0
  148. package/bin/retailWizard/dtos/WizardGiftLine.d.ts +10 -0
  149. package/bin/retailWizard/dtos/WizardGiftLine.js +2 -0
  150. package/bin/retailWizard/dtos/WizardLinePromotionFields.d.ts +15 -0
  151. package/bin/retailWizard/dtos/WizardLinePromotionFields.js +2 -0
  152. package/bin/retailWizard/dtos/WizardReservedLine.d.ts +4 -1
  153. package/bin/retailWizard/dtos/WizardSession.d.ts +10 -0
  154. package/bin/retailWizard/dtos/requests/AddProductRequest.d.ts +2 -0
  155. package/bin/retailWizard/dtos/requests/AddProductRequest.js +7 -0
  156. package/bin/retailWizard/dtos/requests/ApplyLinePromotionRequest.d.ts +14 -0
  157. package/bin/retailWizard/dtos/requests/ApplyLinePromotionRequest.js +57 -0
  158. package/bin/retailWizard/dtos/requests/ApplySalePromotionRequest.d.ts +9 -0
  159. package/bin/retailWizard/dtos/requests/ApplySalePromotionRequest.js +36 -0
  160. package/bin/retailWizard/dtos/requests/PinSessionPiecesRequest.d.ts +14 -0
  161. package/bin/retailWizard/dtos/requests/PinSessionPiecesRequest.js +60 -0
  162. package/bin/retailWizard/dtos/requests/QuoteRequest.d.ts +1 -1
  163. package/bin/retailWizard/dtos/requests/SetAnchorGiftsRequest.d.ts +14 -0
  164. package/bin/retailWizard/dtos/requests/SetAnchorGiftsRequest.js +56 -0
  165. package/bin/retailWizard/dtos/responses/PrivateWizardSessionResponse.d.ts +29 -0
  166. package/bin/retailWizard/dtos/responses/PrivateWizardSessionResponse.js +2 -0
  167. package/bin/retailWizard/dtos/responses/SetAnchorGiftsResponse.d.ts +5 -0
  168. package/bin/retailWizard/dtos/responses/SetAnchorGiftsResponse.js +2 -0
  169. package/bin/retailWizard/enums/RetailPromotionInboundMessageTypeEnum.d.ts +5 -0
  170. package/bin/retailWizard/enums/RetailPromotionInboundMessageTypeEnum.js +9 -0
  171. package/bin/retailWizard/enums/WizardLineRoleEnum.d.ts +4 -0
  172. package/bin/retailWizard/enums/WizardLineRoleEnum.js +8 -0
  173. package/bin/retailWizard/events/RetailCommissionInboundMessage.d.ts +19 -0
  174. package/bin/retailWizard/events/RetailCommissionInboundMessage.js +78 -0
  175. package/bin/retailWizard/events/RetailPromotionInboundMessage.d.ts +40 -0
  176. package/bin/retailWizard/events/RetailPromotionInboundMessage.js +162 -0
  177. package/bin/retailWizard/events/SaleCompletedV1.d.ts +2 -3
  178. package/bin/retailWizard/index.d.ts +13 -0
  179. package/bin/retailWizard/index.js +14 -0
  180. package/package.json +1 -1
  181. package/src/index.ts +3 -0
  182. package/src/retailCatalog/dtos/Product.ts +9 -0
  183. package/src/retailCatalog/dtos/requests/BackofficeCreateProductRequest.ts +36 -1
  184. package/src/retailCatalog/dtos/requests/BackofficeRegisterAdjustmentRequest.ts +6 -0
  185. package/src/retailCatalog/dtos/requests/BackofficeUpdateProductRequest.ts +36 -1
  186. package/src/retailCatalog/dtos/requests/HoldStockRequest.ts +31 -0
  187. package/src/retailCatalog/dtos/requests/ReserveStockRequest.ts +7 -1
  188. package/src/retailCatalog/dtos/requests/SuggestPiecesQuery.ts +7 -1
  189. package/src/retailCatalog/dtos/responses/GetInventorySkuResponse.ts +3 -0
  190. package/src/retailCatalog/dtos/responses/HoldStockResponse.ts +9 -0
  191. package/src/retailCatalog/dtos/responses/StoreCatalogItem.ts +9 -1
  192. package/src/retailCatalog/enums/AccessorySubcategoryEnum.ts +9 -0
  193. package/src/retailCatalog/enums/InventoryInboundMessageTypeEnum.ts +5 -0
  194. package/src/retailCatalog/enums/InventoryItemStatusEnum.ts +3 -1
  195. package/src/retailCatalog/enums/ReservePurposeEnum.ts +4 -0
  196. package/src/retailCatalog/events/InventoryInboundMessage.ts +5 -0
  197. package/src/retailCatalog/events/InventoryReturnMessage.ts +26 -0
  198. package/src/retailCatalog/events/InventorySaleAppliedMessage.ts +26 -0
  199. package/src/retailCatalog/index.ts +10 -0
  200. package/src/retailPromotions/constants/bonusPreMoney.ts +19 -0
  201. package/src/retailPromotions/constants/retailPromotionsErrorHttpStatus.ts +25 -0
  202. package/src/retailPromotions/constants/salePromotionTransitions.ts +11 -0
  203. package/src/retailPromotions/dtos/DiscountCode.ts +36 -0
  204. package/src/retailPromotions/dtos/DiscountValue.ts +8 -0
  205. package/src/retailPromotions/dtos/LinePromotionDiscount.ts +10 -0
  206. package/src/retailPromotions/dtos/SalePromotion.ts +36 -0
  207. package/src/retailPromotions/dtos/SalePromotionLevers.ts +68 -0
  208. package/src/retailPromotions/dtos/SalePromotionLogEntry.ts +19 -0
  209. package/src/retailPromotions/dtos/requests/ChangeDiscountCodeStatusRequest.ts +15 -0
  210. package/src/retailPromotions/dtos/requests/ChangeSalePromotionStatusRequest.ts +15 -0
  211. package/src/retailPromotions/dtos/requests/CreateDiscountCodeRequest.ts +71 -0
  212. package/src/retailPromotions/dtos/requests/CreateSalePromotionRequest.ts +73 -0
  213. package/src/retailPromotions/dtos/requests/DiscountValueInput.ts +21 -0
  214. package/src/retailPromotions/dtos/requests/EvaluateSalePromotionsRequest.ts +16 -0
  215. package/src/retailPromotions/dtos/requests/GetSaleCouponQuery.ts +11 -0
  216. package/src/retailPromotions/dtos/requests/HoldSalePromotionRequest.ts +32 -0
  217. package/src/retailPromotions/dtos/requests/ListDiscountCodesQuery.ts +33 -0
  218. package/src/retailPromotions/dtos/requests/ListSalePromotionLogQuery.ts +29 -0
  219. package/src/retailPromotions/dtos/requests/ListSalePromotionsQuery.ts +24 -0
  220. package/src/retailPromotions/dtos/requests/ListStoreSalePromotionsQuery.ts +10 -0
  221. package/src/retailPromotions/dtos/requests/SalePromotionLeversInput.ts +135 -0
  222. package/src/retailPromotions/dtos/requests/SalePromotionScopeInput.ts +45 -0
  223. package/src/retailPromotions/dtos/requests/UpdateSalePromotionRequest.ts +74 -0
  224. package/src/retailPromotions/dtos/responses/DiscountCodeResponses.ts +9 -0
  225. package/src/retailPromotions/dtos/responses/SalePromotionCrudResponses.ts +35 -0
  226. package/src/retailPromotions/dtos/responses/WizardSalePromotionResponses.ts +115 -0
  227. package/src/retailPromotions/enums/CouponScopeEnum.ts +11 -0
  228. package/src/retailPromotions/enums/CouponStatusEnum.ts +11 -0
  229. package/src/retailPromotions/enums/DiscountCodeOriginEnum.ts +8 -0
  230. package/src/retailPromotions/enums/DiscountCodeStatusEnum.ts +11 -0
  231. package/src/retailPromotions/enums/DiscountCodeTransitionEnum.ts +7 -0
  232. package/src/retailPromotions/enums/DiscountTypeEnum.ts +8 -0
  233. package/src/retailPromotions/enums/EntitlementKindEnum.ts +9 -0
  234. package/src/retailPromotions/enums/EntitlementStateEnum.ts +13 -0
  235. package/src/retailPromotions/enums/GiftModeEnum.ts +8 -0
  236. package/src/retailPromotions/enums/PromotionAppliesToEnum.ts +9 -0
  237. package/src/retailPromotions/enums/RetailPromotionsErrorCodeEnum.ts +29 -0
  238. package/src/retailPromotions/enums/SaleCouponAvailabilityEnum.ts +10 -0
  239. package/src/retailPromotions/enums/SalePromotionLeverEnum.ts +13 -0
  240. package/src/retailPromotions/enums/SalePromotionLogEventEnum.ts +14 -0
  241. package/src/retailPromotions/enums/SalePromotionLogFormatEnum.ts +5 -0
  242. package/src/retailPromotions/enums/SalePromotionPhaseEnum.ts +11 -0
  243. package/src/retailPromotions/enums/SalePromotionStatusEnum.ts +12 -0
  244. package/src/retailPromotions/enums/SalePromotionTransitionEnum.ts +13 -0
  245. package/src/retailPromotions/helpers/computeBudgetUsedBps.ts +15 -0
  246. package/src/retailPromotions/helpers/resolveSalePromotionTransition.ts +12 -0
  247. package/src/retailPromotions/index.ts +56 -0
  248. package/src/retailWizard/dtos/Sale.ts +8 -8
  249. package/src/retailWizard/dtos/SaleLine.ts +4 -1
  250. package/src/retailWizard/dtos/WizardFinancingPreview.ts +12 -0
  251. package/src/retailWizard/dtos/WizardGiftLine.ts +11 -0
  252. package/src/retailWizard/dtos/WizardLinePromotionFields.ts +16 -0
  253. package/src/retailWizard/dtos/WizardReservedLine.ts +4 -1
  254. package/src/retailWizard/dtos/WizardSession.ts +10 -0
  255. package/src/retailWizard/dtos/requests/AddProductRequest.ts +8 -1
  256. package/src/retailWizard/dtos/requests/ApplyLinePromotionRequest.ts +44 -0
  257. package/src/retailWizard/dtos/requests/ApplySalePromotionRequest.ts +24 -0
  258. package/src/retailWizard/dtos/requests/PinSessionPiecesRequest.ts +40 -0
  259. package/src/retailWizard/dtos/requests/QuoteRequest.ts +1 -1
  260. package/src/retailWizard/dtos/requests/SetAnchorGiftsRequest.ts +40 -0
  261. package/src/retailWizard/dtos/responses/PrivateWizardSessionResponse.ts +30 -0
  262. package/src/retailWizard/dtos/responses/SetAnchorGiftsResponse.ts +6 -0
  263. package/src/retailWizard/enums/RetailPromotionInboundMessageTypeEnum.ts +5 -0
  264. package/src/retailWizard/enums/WizardLineRoleEnum.ts +4 -0
  265. package/src/retailWizard/events/RetailCommissionInboundMessage.ts +54 -0
  266. package/src/retailWizard/events/RetailPromotionInboundMessage.ts +140 -0
  267. package/src/retailWizard/events/SaleCompletedV1.ts +2 -3
  268. package/src/retailWizard/index.ts +15 -0
@@ -0,0 +1,26 @@
1
+ import { Equals, IsISO8601, IsNotEmpty, IsString } from 'class-validator';
2
+ import { InventoryInboundMessageTypeEnum } from '../enums/InventoryInboundMessageTypeEnum';
3
+ import { SellStockRequest } from '../dtos/requests/SellStockRequest';
4
+
5
+ /** Aviso de venta de la saga en la cola de inventario; el catálogo pasa las piezas HELD a SOLD. */
6
+ export class InventorySaleAppliedMessage extends SellStockRequest {
7
+ @Equals(InventoryInboundMessageTypeEnum.SALE_APPLIED)
8
+ type!: InventoryInboundMessageTypeEnum.SALE_APPLIED;
9
+
10
+ /** La cola es compartida entre silos; el tenant elige las tablas. */
11
+ @IsString()
12
+ @IsNotEmpty()
13
+ tenantId!: string;
14
+
15
+ @IsString()
16
+ @IsNotEmpty()
17
+ storeId!: string;
18
+
19
+ @IsString()
20
+ @IsNotEmpty()
21
+ saleId!: string;
22
+
23
+ /** Fecha de la venta; fecha el DAY# y el MOV#. */
24
+ @IsISO8601()
25
+ soldAt!: string;
26
+ }
@@ -45,6 +45,7 @@ export * from './dtos/validation/ValidateInventoryResponse';
45
45
 
46
46
  // Inventario multi-item (ciclo 1)
47
47
  export * from './enums/ProductCategoryEnum';
48
+ export * from './enums/AccessorySubcategoryEnum';
48
49
  export * from './enums/TrackingModeEnum';
49
50
  export * from './enums/InventoryMovementTypeEnum';
50
51
  export * from './enums/InventorySyncResultStatusEnum';
@@ -92,3 +93,12 @@ export * from './dtos/requests/BackofficeCreateTransferRequest';
92
93
  export * from './dtos/requests/BackofficeListTransfersQuery';
93
94
  export * from './dtos/responses/TransferResponse';
94
95
  export * from './dtos/responses/ListTransfersResponse';
96
+
97
+ // Saga de venta: hold y avisos de la cola
98
+ export * from './enums/ReservePurposeEnum';
99
+ export * from './enums/InventoryInboundMessageTypeEnum';
100
+ export * from './dtos/requests/HoldStockRequest';
101
+ export * from './dtos/responses/HoldStockResponse';
102
+ export * from './events/InventorySaleAppliedMessage';
103
+ export * from './events/InventoryReturnMessage';
104
+ export * from './events/InventoryInboundMessage';
@@ -0,0 +1,19 @@
1
+ /** HTTP con los que el request no llegó al handler del processor: los contesta la infraestructura. */
2
+ export const PRE_HANDLER_HTTP_STATUSES: ReadonlySet<number> = new Set([401, 403, 404, 405]);
3
+
4
+ /**
5
+ * Codes de transaction-processor que prueban que el bono NO movió saldo.
6
+ * Es whitelist: cualquier otro code se trata como ambiguo (`UNVERIFIED`).
7
+ */
8
+ export const BONUS_PRE_MONEY_CODES: ReadonlySet<string> = new Set<string>([
9
+ 'USER_NOT_ACTIVE',
10
+ 'ACCOUNT_NOT_FOUND',
11
+ 'ACCOUNT_BLOCKED',
12
+ 'DOCUMENT_ID_NOT_FOUND',
13
+ 'PRODUCT_NOT_FOUND',
14
+ 'ACCOUNT_LEVEL_MAX_MONTHLY_AMOUNT_EXCEEDED',
15
+ 'ACCOUNT_LEVEL_MAX_AVAILABLE_BALANCE_EXCEEDED',
16
+ 'INVALID_REQUEST',
17
+ // Literal del decorador de idempotencia, no del enum del processor: por eso el Set es de string.
18
+ 'IDEMPOTENCY_KEY_REQUIRED',
19
+ ]);
@@ -0,0 +1,25 @@
1
+ import { RetailPromotionsErrorCodeEnum as C } from '../enums/RetailPromotionsErrorCodeEnum';
2
+
3
+ /** Status HTTP de cada code: 403 sesión sin alcance · 404 no existe · 409 conflicto de estado · 422 regla de negocio. */
4
+ export const RETAIL_PROMOTIONS_ERROR_HTTP_STATUS: Readonly<Record<C, 403 | 404 | 409 | 422>> = {
5
+ [C.INVALID_PROMOTION_TRANSITION]: 409,
6
+ [C.CODE_TEXT_TAKEN]: 409,
7
+ [C.PROMOTION_NOT_ACTIVE]: 409,
8
+ [C.PROMOTION_NOT_APPLICABLE]: 422,
9
+ [C.CUSTOMER_NOT_IDENTIFIED]: 422,
10
+ [C.GIFT_NOT_ALLOWED]: 422,
11
+ [C.INSUFFICIENT_STOCK]: 409,
12
+ [C.CODE_NOT_FOUND]: 404,
13
+ [C.CODE_NOT_APPLICABLE]: 422,
14
+ [C.CODE_NOT_OWNED]: 422,
15
+ [C.CODE_NOT_ACTIVE]: 409,
16
+ [C.CODE_EXHAUSTED]: 409,
17
+ [C.CODE_ALREADY_APPLIED]: 409,
18
+ [C.DISCOUNT_AFTER_QUOTE]: 409,
19
+ [C.INVALID_SALE_PROMOTION]: 422,
20
+ [C.INVALID_DISCOUNT_CODE]: 422,
21
+ [C.SALE_PROMOTION_NOT_FOUND]: 404,
22
+ [C.SALE_COUPON_NOT_FOUND]: 404,
23
+ [C.MISSING_RETAILER_SCOPE]: 403,
24
+ [C.MISSING_STORE_SCOPE]: 403,
25
+ };
@@ -0,0 +1,11 @@
1
+ import { SalePromotionStatusEnum as S } from '../enums/SalePromotionStatusEnum';
2
+ import { SalePromotionTransitionEnum as T } from '../enums/SalePromotionTransitionEnum';
3
+
4
+ /** Por cada transición: desde qué estados se permite y a cuál lleva. */
5
+ export const SALE_PROMOTION_TRANSITIONS: Readonly<Record<T, { from: readonly S[]; to: S }>> = {
6
+ [T.PUBLISH]: { from: [S.DRAFT], to: S.ACTIVE },
7
+ [T.PAUSE]: { from: [S.ACTIVE], to: S.PAUSED },
8
+ [T.RESUME]: { from: [S.PAUSED], to: S.ACTIVE },
9
+ [T.EXPIRE]: { from: [S.ACTIVE, S.PAUSED], to: S.EXPIRED },
10
+ [T.ARCHIVE]: { from: [S.DRAFT, S.ACTIVE, S.PAUSED, S.EXPIRED], to: S.ARCHIVED },
11
+ };
@@ -0,0 +1,36 @@
1
+ import { CouponScopeEnum } from '../enums/CouponScopeEnum';
2
+ import { CouponStatusEnum } from '../enums/CouponStatusEnum';
3
+ import { DiscountCodeOriginEnum } from '../enums/DiscountCodeOriginEnum';
4
+ import { DiscountCodeStatusEnum } from '../enums/DiscountCodeStatusEnum';
5
+ import { PromotionAppliesToEnum } from '../enums/PromotionAppliesToEnum';
6
+ import { DiscountValue } from './DiscountValue';
7
+
8
+ /**
9
+ * Código de descuento de Admin VL o cupón emitido por una venta (según `origin`).
10
+ * Los campos de cupón (`ownerCustomerId`, `issuedBySaleId`, `couponScope`) son `null` en los de Admin.
11
+ */
12
+ export interface DiscountCode {
13
+ codeId: string;
14
+ codeText: string;
15
+ origin: DiscountCodeOriginEnum;
16
+ status: DiscountCodeStatusEnum | CouponStatusEnum;
17
+ discount: DiscountValue;
18
+ validFrom: string | null;
19
+ validUntil: string | null;
20
+ /** `null` = sin tope de usos. */
21
+ maxUses: number | null;
22
+ uses: number;
23
+ skus: string[] | null;
24
+ storeIds: string[] | null;
25
+ announceInStore: boolean;
26
+ appliesTo: PromotionAppliesToEnum;
27
+ ownerCustomerId: string | null;
28
+ issuedBySaleId: string | null;
29
+ issuingStoreId: string | null;
30
+ couponScope: CouponScopeEnum | null;
31
+ redeemedBySaleId: string | null;
32
+ createdBy: string;
33
+ updatedBy: string;
34
+ createdAt: string;
35
+ updatedAt: string;
36
+ }
@@ -0,0 +1,8 @@
1
+ import { DiscountTypeEnum } from '../enums/DiscountTypeEnum';
2
+
3
+ /** Descuento en $ o %: `amountCents` si es `AMOUNT`, `percentBps` (1000 = 10%) si es `PERCENTAGE`. */
4
+ export interface DiscountValue {
5
+ type: DiscountTypeEnum;
6
+ amountCents: number | null;
7
+ percentBps: number | null;
8
+ }
@@ -0,0 +1,10 @@
1
+ /** Desglose por línea de la sesión: qué promo o código la tocó y cuánto bajó. */
2
+ export interface LinePromotionDiscount {
3
+ lineId: string;
4
+ promotionId: string | null;
5
+ promotionVersion: number | null;
6
+ discountCode: string | null;
7
+ originalPriceCents: number;
8
+ discountCents: number;
9
+ finalPriceCents: number;
10
+ }
@@ -0,0 +1,36 @@
1
+ import { PromotionAppliesToEnum } from '../enums/PromotionAppliesToEnum';
2
+ import { SalePromotionPhaseEnum } from '../enums/SalePromotionPhaseEnum';
3
+ import { SalePromotionStatusEnum } from '../enums/SalePromotionStatusEnum';
4
+ import { SalePromotionLevers, SalePromotionScope, SalePromotionSegmentation } from './SalePromotionLevers';
5
+
6
+ /** Promo de venta tal como la devuelve el CRUD. Dinero en centavos, fechas ISO. */
7
+ export interface SalePromotion {
8
+ promotionId: string;
9
+ retailerId: string;
10
+ name: string;
11
+ /** Texto que ve el cliente en el wizard. */
12
+ customerText: string;
13
+ levers: SalePromotionLevers;
14
+ scope: SalePromotionScope;
15
+ segmentation: SalePromotionSegmentation;
16
+ appliesTo: PromotionAppliesToEnum;
17
+ /** `null` = sin tope. */
18
+ budgetMaxCents: number | null;
19
+ budgetConsumedCents: number;
20
+ redemptionCount: number;
21
+ validFrom: string | null;
22
+ /** `null` = permanente. */
23
+ validUntil: string | null;
24
+ oncePerCustomer: boolean;
25
+ status: SalePromotionStatusEnum;
26
+ /** Derivada; `null` cuando el estado no es `ACTIVE`. */
27
+ phase: SalePromotionPhaseEnum | null;
28
+ version: number;
29
+ pausedAt: string | null;
30
+ pauseReason: string | null;
31
+ publishedAt: string | null;
32
+ createdBy: string;
33
+ updatedBy: string;
34
+ createdAt: string;
35
+ updatedAt: string;
36
+ }
@@ -0,0 +1,68 @@
1
+ import { AccessorySubcategoryEnum } from '../../retailCatalog/enums/AccessorySubcategoryEnum';
2
+ import { ProductCategoryEnum } from '../../retailCatalog/enums/ProductCategoryEnum';
3
+ import { ProductTierEnum } from '../../retailCatalog/enums/ProductTierEnum';
4
+ import { CouponScopeEnum } from '../enums/CouponScopeEnum';
5
+ import { GiftModeEnum } from '../enums/GiftModeEnum';
6
+ import { DiscountValue } from './DiscountValue';
7
+
8
+ /** Descuento en accesorios: % sobre los accesorios de la venta, con tope opcional en centavos. */
9
+ export interface AccessoryDiscountLever {
10
+ percentBps: number;
11
+ maxAmountCents: number | null;
12
+ }
13
+
14
+ /** Regalo por lista (`skus`) o por gama (`accessorySubcategory` + `maxPriceCents`); el cliente elige `chooseCount`. */
15
+ export interface GiftLever {
16
+ mode: GiftModeEnum;
17
+ skus: string[] | null;
18
+ accessorySubcategory: AccessorySubcategoryEnum | null;
19
+ maxPriceCents: number | null;
20
+ chooseCount: number;
21
+ }
22
+
23
+ /** Cupón que emite la venta: su descuento, días de vida y dónde vale. */
24
+ export interface CouponLever extends DiscountValue {
25
+ validityDays: number;
26
+ scope: CouponScopeEnum;
27
+ }
28
+
29
+ /** Tiempo aire: `rechargeCount` recargas de `rechargeAmountCents`. */
30
+ export interface AirtimeLever {
31
+ rechargeCount: number;
32
+ rechargeAmountCents: number;
33
+ }
34
+
35
+ /** Garantía extendida: meses extra sobre la de fábrica y su costo para el presupuesto. */
36
+ export interface ExtendedWarrantyLever {
37
+ extraMonths: number;
38
+ costCents: number;
39
+ }
40
+
41
+ export interface WalletBonusLever {
42
+ amountCents: number;
43
+ }
44
+
45
+ /** Las 7 palancas; una palanca ausente o `null` no se usa. */
46
+ export interface SalePromotionLevers {
47
+ deviceDiscount: DiscountValue | null;
48
+ accessoryDiscount: AccessoryDiscountLever | null;
49
+ gift: GiftLever | null;
50
+ coupon: CouponLever | null;
51
+ airtime: AirtimeLever | null;
52
+ extendedWarranty: ExtendedWarrantyLever | null;
53
+ walletBonus: WalletBonusLever | null;
54
+ }
55
+
56
+ /** Qué compra dispara la promo; cada lista `null` = sin restricción en esa dimensión. */
57
+ export interface SalePromotionScope {
58
+ productCategories: ProductCategoryEnum[] | null;
59
+ tiers: ProductTierEnum[] | null;
60
+ skus: string[] | null;
61
+ storeIds: string[] | null;
62
+ }
63
+
64
+ /** A quién va la promo: segmentos de loan-offerings y, aparte, si exige crédito SK activo. */
65
+ export interface SalePromotionSegmentation {
66
+ segmentIds: string[] | null;
67
+ requiresActiveSurekeepCredit: boolean;
68
+ }
@@ -0,0 +1,19 @@
1
+ import { SalePromotionLogEventEnum } from '../enums/SalePromotionLogEventEnum';
2
+ import { SalePromotionStatusEnum } from '../enums/SalePromotionStatusEnum';
3
+
4
+ /** Evento del historial de una promo. */
5
+ export interface SalePromotionLogEntry {
6
+ logId: string;
7
+ promotionId: string;
8
+ promotionName: string;
9
+ version: number;
10
+ event: SalePromotionLogEventEnum;
11
+ fromStatus: SalePromotionStatusEnum | null;
12
+ toStatus: SalePromotionStatusEnum | null;
13
+ /** `null` = evento automático del sistema. */
14
+ performedByUserId: string | null;
15
+ /** Nombre visible del actor; «Sistema» en los automáticos. */
16
+ performedByName: string;
17
+ occurredAt: string;
18
+ reason: string | null;
19
+ }
@@ -0,0 +1,15 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsEnum, IsOptional, IsString } from 'class-validator';
3
+ import { DiscountCodeTransitionEnum } from '../../enums/DiscountCodeTransitionEnum';
4
+
5
+ /** Body de publicChangeDiscountCodeStatus (anular un código o cupón). */
6
+ export class ChangeDiscountCodeStatusRequest {
7
+ @Expose()
8
+ @IsEnum(DiscountCodeTransitionEnum)
9
+ transition!: DiscountCodeTransitionEnum;
10
+
11
+ @Expose()
12
+ @IsOptional()
13
+ @IsString()
14
+ reason?: string | null;
15
+ }
@@ -0,0 +1,15 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsEnum, IsOptional, IsString } from 'class-validator';
3
+ import { SalePromotionTransitionEnum } from '../../enums/SalePromotionTransitionEnum';
4
+
5
+ /** Body de publicChangeSalePromotionStatus; `reason` queda en el historial. */
6
+ export class ChangeSalePromotionStatusRequest {
7
+ @Expose()
8
+ @IsEnum(SalePromotionTransitionEnum)
9
+ transition!: SalePromotionTransitionEnum;
10
+
11
+ @Expose()
12
+ @IsOptional()
13
+ @IsString()
14
+ reason?: string | null;
15
+ }
@@ -0,0 +1,71 @@
1
+ import { Expose, Type } from 'class-transformer';
2
+ import {
3
+ IsArray,
4
+ IsBoolean,
5
+ IsDefined,
6
+ IsEnum,
7
+ IsInt,
8
+ IsISO8601,
9
+ IsNotEmpty,
10
+ IsOptional,
11
+ IsString,
12
+ MaxLength,
13
+ ValidateNested,
14
+ } from 'class-validator';
15
+ import { PromotionAppliesToEnum } from '../../enums/PromotionAppliesToEnum';
16
+ import { DiscountValueInput } from './DiscountValueInput';
17
+
18
+ /** Body de publicCreateDiscountCode. Que el texto sea único entre los vigentes es `CODE_TEXT_TAKEN`. */
19
+ export class CreateDiscountCodeRequest {
20
+ @Expose()
21
+ @IsString()
22
+ @IsNotEmpty()
23
+ @MaxLength(32)
24
+ codeText!: string;
25
+
26
+ @Expose()
27
+ @IsDefined()
28
+ @ValidateNested()
29
+ @Type(() => DiscountValueInput)
30
+ discount!: DiscountValueInput;
31
+
32
+ @Expose()
33
+ @IsOptional()
34
+ @IsISO8601()
35
+ validFrom?: string | null;
36
+
37
+ @Expose()
38
+ @IsOptional()
39
+ @IsISO8601()
40
+ validUntil?: string | null;
41
+
42
+ /** `null` = sin tope de usos. */
43
+ @Expose()
44
+ @IsOptional()
45
+ @IsInt()
46
+ maxUses?: number | null;
47
+
48
+ /** Equipos donde vale; `null` = todos. */
49
+ @Expose()
50
+ @IsOptional()
51
+ @IsArray()
52
+ @IsString({ each: true })
53
+ skus?: string[] | null;
54
+
55
+ @Expose()
56
+ @IsOptional()
57
+ @IsArray()
58
+ @IsString({ each: true })
59
+ storeIds?: string[] | null;
60
+
61
+ @Expose()
62
+ @IsOptional()
63
+ @IsBoolean()
64
+ announceInStore?: boolean;
65
+
66
+ /** Ausente = `SUREKEEP_ONLY`. */
67
+ @Expose()
68
+ @IsOptional()
69
+ @IsEnum(PromotionAppliesToEnum)
70
+ appliesTo?: PromotionAppliesToEnum;
71
+ }
@@ -0,0 +1,73 @@
1
+ import { Expose, Type } from 'class-transformer';
2
+ import {
3
+ IsBoolean,
4
+ IsDefined,
5
+ IsEnum,
6
+ IsInt,
7
+ IsISO8601,
8
+ IsNotEmpty,
9
+ IsOptional,
10
+ IsString,
11
+ ValidateNested,
12
+ } from 'class-validator';
13
+ import { PromotionAppliesToEnum } from '../../enums/PromotionAppliesToEnum';
14
+ import { SalePromotionLeversInput } from './SalePromotionLeversInput';
15
+ import { SalePromotionScopeInput, SalePromotionSegmentationInput } from './SalePromotionScopeInput';
16
+
17
+ /** Body de publicCreateSalePromotion. Nace en `DRAFT`; el retailer sale del token. */
18
+ export class CreateSalePromotionRequest {
19
+ @Expose()
20
+ @IsString()
21
+ @IsNotEmpty()
22
+ name!: string;
23
+
24
+ @Expose()
25
+ @IsString()
26
+ customerText!: string;
27
+
28
+ @Expose()
29
+ @IsDefined()
30
+ @ValidateNested()
31
+ @Type(() => SalePromotionLeversInput)
32
+ levers!: SalePromotionLeversInput;
33
+
34
+ @Expose()
35
+ @IsOptional()
36
+ @ValidateNested()
37
+ @Type(() => SalePromotionScopeInput)
38
+ scope?: SalePromotionScopeInput | null;
39
+
40
+ @Expose()
41
+ @IsOptional()
42
+ @ValidateNested()
43
+ @Type(() => SalePromotionSegmentationInput)
44
+ segmentation?: SalePromotionSegmentationInput | null;
45
+
46
+ /** Ausente = `SUREKEEP_ONLY`. */
47
+ @Expose()
48
+ @IsOptional()
49
+ @IsEnum(PromotionAppliesToEnum)
50
+ appliesTo?: PromotionAppliesToEnum;
51
+
52
+ /** `null` = sin tope. */
53
+ @Expose()
54
+ @IsOptional()
55
+ @IsInt()
56
+ budgetMaxCents?: number | null;
57
+
58
+ @Expose()
59
+ @IsOptional()
60
+ @IsISO8601()
61
+ validFrom?: string | null;
62
+
63
+ /** `null` = permanente. */
64
+ @Expose()
65
+ @IsOptional()
66
+ @IsISO8601()
67
+ validUntil?: string | null;
68
+
69
+ @Expose()
70
+ @IsOptional()
71
+ @IsBoolean()
72
+ oncePerCustomer?: boolean;
73
+ }
@@ -0,0 +1,21 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsEnum, IsInt, ValidateIf } from 'class-validator';
3
+ import { DiscountTypeEnum } from '../../enums/DiscountTypeEnum';
4
+
5
+ /** Descuento en el body: exige el campo que corresponde al tipo. Rangos y signo los valida el lambda (422). */
6
+ export class DiscountValueInput {
7
+ @Expose()
8
+ @IsEnum(DiscountTypeEnum)
9
+ type!: DiscountTypeEnum;
10
+
11
+ @Expose()
12
+ @ValidateIf((o: DiscountValueInput) => o.type === DiscountTypeEnum.AMOUNT)
13
+ @IsInt()
14
+ amountCents?: number | null;
15
+
16
+ /** Puntos base: 1000 = 10%. */
17
+ @Expose()
18
+ @ValidateIf((o: DiscountValueInput) => o.type === DiscountTypeEnum.PERCENTAGE)
19
+ @IsInt()
20
+ percentBps?: number | null;
21
+ }
@@ -0,0 +1,16 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsNotEmpty, IsOptional, IsString } from 'class-validator';
3
+
4
+ /** Body de publicEvaluateSalePromotions; precios, líneas y cliente salen de la sesión. */
5
+ export class EvaluateSalePromotionsRequest {
6
+ @Expose()
7
+ @IsString()
8
+ @IsNotEmpty()
9
+ sessionId!: string;
10
+
11
+ @Expose()
12
+ @IsOptional()
13
+ @IsString()
14
+ @IsNotEmpty()
15
+ discountCode?: string | null;
16
+ }
@@ -0,0 +1,11 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsNotEmpty, IsOptional, IsString } from 'class-validator';
3
+
4
+ /** Query de publicGetSaleCoupon (`GET /public/sales/{saleId}/coupon`). */
5
+ export class GetSaleCouponQuery {
6
+ @Expose()
7
+ @IsOptional()
8
+ @IsString()
9
+ @IsNotEmpty()
10
+ sessionId?: string;
11
+ }
@@ -0,0 +1,32 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsArray, IsInt, IsNotEmpty, IsOptional, IsString, ValidateIf } from 'class-validator';
3
+
4
+ /**
5
+ * Body de publicHoldSalePromotion (PUT, `sessionId` en el path). `promotionId: null` = «Ninguna»;
6
+ * un PUT distinto reemplaza el apartado anterior.
7
+ */
8
+ export class HoldSalePromotionRequest {
9
+ @Expose()
10
+ @IsOptional()
11
+ @IsString()
12
+ @IsNotEmpty()
13
+ promotionId?: string | null;
14
+
15
+ @Expose()
16
+ @ValidateIf((o: HoldSalePromotionRequest) => o.promotionId !== undefined && o.promotionId !== null)
17
+ @IsInt()
18
+ promotionVersion?: number | null;
19
+
20
+ /** Regalos elegidos por el cliente, si la promo trae regalo. */
21
+ @Expose()
22
+ @IsOptional()
23
+ @IsArray()
24
+ @IsString({ each: true })
25
+ giftSkus?: string[] | null;
26
+
27
+ @Expose()
28
+ @IsOptional()
29
+ @IsString()
30
+ @IsNotEmpty()
31
+ discountCode?: string | null;
32
+ }
@@ -0,0 +1,33 @@
1
+ import { Expose, Type } from 'class-transformer';
2
+ import { IsEnum, IsIn, IsInt, IsOptional, IsString, Max, Min } from 'class-validator';
3
+ import { CouponStatusEnum } from '../../enums/CouponStatusEnum';
4
+ import { DiscountCodeOriginEnum } from '../../enums/DiscountCodeOriginEnum';
5
+ import { DiscountCodeStatusEnum } from '../../enums/DiscountCodeStatusEnum';
6
+
7
+ const LISTABLE_STATUSES = [...new Set<string>([...Object.values(DiscountCodeStatusEnum), ...Object.values(CouponStatusEnum)])];
8
+
9
+ /** Query de publicListDiscountCodes: códigos y cupones, filtrables por origen y estado. */
10
+ export class ListDiscountCodesQuery {
11
+ @Expose()
12
+ @IsOptional()
13
+ @IsEnum(DiscountCodeOriginEnum)
14
+ origin?: DiscountCodeOriginEnum;
15
+
16
+ @Expose()
17
+ @IsOptional()
18
+ @IsIn(LISTABLE_STATUSES)
19
+ status?: DiscountCodeStatusEnum | CouponStatusEnum;
20
+
21
+ @Expose()
22
+ @IsOptional()
23
+ @Type(() => Number)
24
+ @IsInt()
25
+ @Min(1)
26
+ @Max(100)
27
+ limit?: number;
28
+
29
+ @Expose()
30
+ @IsOptional()
31
+ @IsString()
32
+ nextToken?: string;
33
+ }
@@ -0,0 +1,29 @@
1
+ import { Expose, Type } from 'class-transformer';
2
+ import { IsEnum, IsInt, IsOptional, IsString, Max, Min } from 'class-validator';
3
+ import { SalePromotionLogFormatEnum } from '../../enums/SalePromotionLogFormatEnum';
4
+
5
+ /** Query de publicListSalePromotionLog: global o de una promo; `CSV` exporta en vez de paginar. */
6
+ export class ListSalePromotionLogQuery {
7
+ @Expose()
8
+ @IsOptional()
9
+ @IsString()
10
+ promotionId?: string;
11
+
12
+ @Expose()
13
+ @IsOptional()
14
+ @IsEnum(SalePromotionLogFormatEnum)
15
+ format?: SalePromotionLogFormatEnum;
16
+
17
+ @Expose()
18
+ @IsOptional()
19
+ @Type(() => Number)
20
+ @IsInt()
21
+ @Min(1)
22
+ @Max(100)
23
+ limit?: number;
24
+
25
+ @Expose()
26
+ @IsOptional()
27
+ @IsString()
28
+ nextToken?: string;
29
+ }
@@ -0,0 +1,24 @@
1
+ import { Expose, Type } from 'class-transformer';
2
+ import { IsEnum, IsInt, IsOptional, IsString, Max, Min } from 'class-validator';
3
+ import { SalePromotionStatusEnum } from '../../enums/SalePromotionStatusEnum';
4
+
5
+ /** Query de publicListSalePromotions; sin `status` excluye las archivadas. */
6
+ export class ListSalePromotionsQuery {
7
+ @Expose()
8
+ @IsOptional()
9
+ @IsEnum(SalePromotionStatusEnum)
10
+ status?: SalePromotionStatusEnum;
11
+
12
+ @Expose()
13
+ @IsOptional()
14
+ @Type(() => Number)
15
+ @IsInt()
16
+ @Min(1)
17
+ @Max(100)
18
+ limit?: number;
19
+
20
+ @Expose()
21
+ @IsOptional()
22
+ @IsString()
23
+ nextToken?: string;
24
+ }
@@ -0,0 +1,10 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsNotEmpty, IsString } from 'class-validator';
3
+
4
+ /** Query de publicListStoreSalePromotions; la tienda sale de la sesión, no del request. */
5
+ export class ListStoreSalePromotionsQuery {
6
+ @Expose()
7
+ @IsString()
8
+ @IsNotEmpty()
9
+ sessionId!: string;
10
+ }