@fiado/type-kit 3.471.0 → 3.473.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 (278) hide show
  1. package/_test_/unit/common/IsStringValueRecord.test.ts +25 -0
  2. package/_test_/unit/platformRbac/dtos/tenantUserCustomFields.test.ts +55 -0
  3. package/_test_/unit/retailCatalog/catalogDebt.test.ts +123 -0
  4. package/_test_/unit/retailCatalog/catalogEnums.test.ts +2 -2
  5. package/_test_/unit/retailCatalog/ventaSaga.test.ts +152 -0
  6. package/_test_/unit/retailPromotions/computeBudgetUsedBps.test.ts +30 -0
  7. package/_test_/unit/retailPromotions/constants.test.ts +71 -0
  8. package/_test_/unit/retailPromotions/discountCodeAndWizardRequests.test.ts +84 -0
  9. package/_test_/unit/retailPromotions/salePromotionRequests.test.ts +151 -0
  10. package/_test_/unit/retailWizard/promotionM2mRequests.test.ts +189 -0
  11. package/_test_/unit/retailWizard/ventaSagaMessages.test.ts +163 -0
  12. package/_test_/unit/retailWizard/ventaSagaRequests.test.ts +59 -0
  13. package/_test_/unit/retailWizard/ventaSagaShapes.test.ts +99 -0
  14. package/bin/common/index.d.ts +1 -0
  15. package/bin/common/index.js +2 -0
  16. package/bin/common/validators/IsStringValueRecord.d.ts +5 -0
  17. package/bin/common/validators/IsStringValueRecord.js +25 -0
  18. package/bin/index.d.ts +1 -0
  19. package/bin/index.js +5 -2
  20. package/bin/messagesConnector/validators/IsStringValueRecord.d.ts +1 -5
  21. package/bin/messagesConnector/validators/IsStringValueRecord.js +3 -21
  22. package/bin/platformRbac/dtos/CreateTenantUserRequest.d.ts +4 -0
  23. package/bin/platformRbac/dtos/CreateTenantUserRequest.js +9 -0
  24. package/bin/platformRbac/dtos/UpdateTenantUserRequest.d.ts +5 -2
  25. package/bin/platformRbac/dtos/UpdateTenantUserRequest.js +10 -2
  26. package/bin/retailCatalog/dtos/Product.d.ts +6 -0
  27. package/bin/retailCatalog/dtos/requests/BackofficeCreateProductRequest.d.ts +9 -0
  28. package/bin/retailCatalog/dtos/requests/BackofficeCreateProductRequest.js +30 -0
  29. package/bin/retailCatalog/dtos/requests/BackofficeRegisterAdjustmentRequest.d.ts +2 -0
  30. package/bin/retailCatalog/dtos/requests/BackofficeRegisterAdjustmentRequest.js +6 -0
  31. package/bin/retailCatalog/dtos/requests/BackofficeUpdateProductRequest.d.ts +9 -0
  32. package/bin/retailCatalog/dtos/requests/BackofficeUpdateProductRequest.js +30 -0
  33. package/bin/retailCatalog/dtos/requests/HoldStockRequest.d.ts +12 -0
  34. package/bin/retailCatalog/dtos/requests/HoldStockRequest.js +47 -0
  35. package/bin/retailCatalog/dtos/requests/ReserveStockRequest.d.ts +3 -0
  36. package/bin/retailCatalog/dtos/requests/ReserveStockRequest.js +6 -0
  37. package/bin/retailCatalog/dtos/requests/SuggestPiecesQuery.d.ts +2 -0
  38. package/bin/retailCatalog/dtos/requests/SuggestPiecesQuery.js +6 -0
  39. package/bin/retailCatalog/dtos/responses/GetInventorySkuResponse.d.ts +3 -0
  40. package/bin/retailCatalog/dtos/responses/HoldStockResponse.d.ts +8 -0
  41. package/bin/retailCatalog/dtos/responses/HoldStockResponse.js +2 -0
  42. package/bin/retailCatalog/dtos/responses/StoreCatalogItem.d.ts +5 -1
  43. package/bin/retailCatalog/enums/InventoryInboundMessageTypeEnum.d.ts +5 -0
  44. package/bin/retailCatalog/enums/InventoryInboundMessageTypeEnum.js +9 -0
  45. package/bin/retailCatalog/enums/InventoryItemStatusEnum.d.ts +4 -2
  46. package/bin/retailCatalog/enums/InventoryItemStatusEnum.js +3 -1
  47. package/bin/retailCatalog/enums/ReservePurposeEnum.d.ts +4 -0
  48. package/bin/retailCatalog/enums/ReservePurposeEnum.js +8 -0
  49. package/bin/retailCatalog/events/InventoryInboundMessage.d.ts +4 -0
  50. package/bin/retailCatalog/events/InventoryInboundMessage.js +2 -0
  51. package/bin/retailCatalog/events/InventoryReturnMessage.d.ts +12 -0
  52. package/bin/retailCatalog/events/InventoryReturnMessage.js +42 -0
  53. package/bin/retailCatalog/events/InventorySaleAppliedMessage.d.ts +12 -0
  54. package/bin/retailCatalog/events/InventorySaleAppliedMessage.js +42 -0
  55. package/bin/retailCatalog/index.d.ts +7 -0
  56. package/bin/retailCatalog/index.js +8 -0
  57. package/bin/retailPromotions/constants/bonusPreMoney.d.ts +7 -0
  58. package/bin/retailPromotions/constants/bonusPreMoney.js +21 -0
  59. package/bin/retailPromotions/constants/retailPromotionsErrorHttpStatus.d.ts +3 -0
  60. package/bin/retailPromotions/constants/retailPromotionsErrorHttpStatus.js +23 -0
  61. package/bin/retailPromotions/constants/salePromotionTransitions.d.ts +7 -0
  62. package/bin/retailPromotions/constants/salePromotionTransitions.js +13 -0
  63. package/bin/retailPromotions/dtos/DiscountCode.d.ts +35 -0
  64. package/bin/retailPromotions/dtos/DiscountCode.js +2 -0
  65. package/bin/retailPromotions/dtos/DiscountValue.d.ts +7 -0
  66. package/bin/retailPromotions/dtos/DiscountValue.js +2 -0
  67. package/bin/retailPromotions/dtos/LinePromotionDiscount.d.ts +10 -0
  68. package/bin/retailPromotions/dtos/LinePromotionDiscount.js +2 -0
  69. package/bin/retailPromotions/dtos/SalePromotion.d.ts +35 -0
  70. package/bin/retailPromotions/dtos/SalePromotion.js +2 -0
  71. package/bin/retailPromotions/dtos/SalePromotionLevers.d.ts +58 -0
  72. package/bin/retailPromotions/dtos/SalePromotionLevers.js +2 -0
  73. package/bin/retailPromotions/dtos/SalePromotionLogEntry.d.ts +18 -0
  74. package/bin/retailPromotions/dtos/SalePromotionLogEntry.js +2 -0
  75. package/bin/retailPromotions/dtos/requests/ChangeDiscountCodeStatusRequest.d.ts +6 -0
  76. package/bin/retailPromotions/dtos/requests/ChangeDiscountCodeStatusRequest.js +30 -0
  77. package/bin/retailPromotions/dtos/requests/ChangeSalePromotionStatusRequest.d.ts +6 -0
  78. package/bin/retailPromotions/dtos/requests/ChangeSalePromotionStatusRequest.js +30 -0
  79. package/bin/retailPromotions/dtos/requests/CreateDiscountCodeRequest.d.ts +17 -0
  80. package/bin/retailPromotions/dtos/requests/CreateDiscountCodeRequest.js +78 -0
  81. package/bin/retailPromotions/dtos/requests/CreateSalePromotionRequest.d.ts +19 -0
  82. package/bin/retailPromotions/dtos/requests/CreateSalePromotionRequest.js +83 -0
  83. package/bin/retailPromotions/dtos/requests/DiscountValueInput.d.ts +8 -0
  84. package/bin/retailPromotions/dtos/requests/DiscountValueInput.js +36 -0
  85. package/bin/retailPromotions/dtos/requests/EvaluateSalePromotionsRequest.d.ts +5 -0
  86. package/bin/retailPromotions/dtos/requests/EvaluateSalePromotionsRequest.js +31 -0
  87. package/bin/retailPromotions/dtos/requests/HoldSalePromotionRequest.d.ts +11 -0
  88. package/bin/retailPromotions/dtos/requests/HoldSalePromotionRequest.js +48 -0
  89. package/bin/retailPromotions/dtos/requests/ListDiscountCodesQuery.d.ts +10 -0
  90. package/bin/retailPromotions/dtos/requests/ListDiscountCodesQuery.js +49 -0
  91. package/bin/retailPromotions/dtos/requests/ListSalePromotionLogQuery.d.ts +8 -0
  92. package/bin/retailPromotions/dtos/requests/ListSalePromotionLogQuery.js +46 -0
  93. package/bin/retailPromotions/dtos/requests/ListSalePromotionsQuery.d.ts +7 -0
  94. package/bin/retailPromotions/dtos/requests/ListSalePromotionsQuery.js +40 -0
  95. package/bin/retailPromotions/dtos/requests/ListStoreSalePromotionsQuery.d.ts +4 -0
  96. package/bin/retailPromotions/dtos/requests/ListStoreSalePromotionsQuery.js +24 -0
  97. package/bin/retailPromotions/dtos/requests/SalePromotionLeversInput.d.ts +40 -0
  98. package/bin/retailPromotions/dtos/requests/SalePromotionLeversInput.js +166 -0
  99. package/bin/retailPromotions/dtos/requests/SalePromotionScopeInput.d.ts +14 -0
  100. package/bin/retailPromotions/dtos/requests/SalePromotionScopeInput.js +65 -0
  101. package/bin/retailPromotions/dtos/requests/UpdateSalePromotionRequest.d.ts +19 -0
  102. package/bin/retailPromotions/dtos/requests/UpdateSalePromotionRequest.js +85 -0
  103. package/bin/retailPromotions/dtos/responses/DiscountCodeResponses.d.ts +7 -0
  104. package/bin/retailPromotions/dtos/responses/DiscountCodeResponses.js +2 -0
  105. package/bin/retailPromotions/dtos/responses/SalePromotionCrudResponses.d.ts +30 -0
  106. package/bin/retailPromotions/dtos/responses/SalePromotionCrudResponses.js +2 -0
  107. package/bin/retailPromotions/dtos/responses/WizardSalePromotionResponses.d.ts +102 -0
  108. package/bin/retailPromotions/dtos/responses/WizardSalePromotionResponses.js +2 -0
  109. package/bin/retailPromotions/enums/CouponScopeEnum.d.ts +11 -0
  110. package/bin/retailPromotions/enums/CouponScopeEnum.js +15 -0
  111. package/bin/retailPromotions/enums/CouponStatusEnum.d.ts +11 -0
  112. package/bin/retailPromotions/enums/CouponStatusEnum.js +15 -0
  113. package/bin/retailPromotions/enums/DiscountCodeOriginEnum.d.ts +8 -0
  114. package/bin/retailPromotions/enums/DiscountCodeOriginEnum.js +12 -0
  115. package/bin/retailPromotions/enums/DiscountCodeStatusEnum.d.ts +11 -0
  116. package/bin/retailPromotions/enums/DiscountCodeStatusEnum.js +15 -0
  117. package/bin/retailPromotions/enums/DiscountCodeTransitionEnum.d.ts +7 -0
  118. package/bin/retailPromotions/enums/DiscountCodeTransitionEnum.js +11 -0
  119. package/bin/retailPromotions/enums/DiscountTypeEnum.d.ts +8 -0
  120. package/bin/retailPromotions/enums/DiscountTypeEnum.js +12 -0
  121. package/bin/retailPromotions/enums/EntitlementKindEnum.d.ts +9 -0
  122. package/bin/retailPromotions/enums/EntitlementKindEnum.js +13 -0
  123. package/bin/retailPromotions/enums/EntitlementStateEnum.d.ts +13 -0
  124. package/bin/retailPromotions/enums/EntitlementStateEnum.js +17 -0
  125. package/bin/retailPromotions/enums/GiftModeEnum.d.ts +8 -0
  126. package/bin/retailPromotions/enums/GiftModeEnum.js +12 -0
  127. package/bin/retailPromotions/enums/PromotionAppliesToEnum.d.ts +9 -0
  128. package/bin/retailPromotions/enums/PromotionAppliesToEnum.js +13 -0
  129. package/bin/retailPromotions/enums/RetailPromotionsErrorCodeEnum.d.ts +23 -0
  130. package/bin/retailPromotions/enums/RetailPromotionsErrorCodeEnum.js +27 -0
  131. package/bin/retailPromotions/enums/SaleCouponAvailabilityEnum.d.ts +10 -0
  132. package/bin/retailPromotions/enums/SaleCouponAvailabilityEnum.js +14 -0
  133. package/bin/retailPromotions/enums/SalePromotionLeverEnum.d.ts +13 -0
  134. package/bin/retailPromotions/enums/SalePromotionLeverEnum.js +17 -0
  135. package/bin/retailPromotions/enums/SalePromotionLogEventEnum.d.ts +14 -0
  136. package/bin/retailPromotions/enums/SalePromotionLogEventEnum.js +18 -0
  137. package/bin/retailPromotions/enums/SalePromotionLogFormatEnum.d.ts +5 -0
  138. package/bin/retailPromotions/enums/SalePromotionLogFormatEnum.js +9 -0
  139. package/bin/retailPromotions/enums/SalePromotionPhaseEnum.d.ts +11 -0
  140. package/bin/retailPromotions/enums/SalePromotionPhaseEnum.js +15 -0
  141. package/bin/retailPromotions/enums/SalePromotionStatusEnum.d.ts +12 -0
  142. package/bin/retailPromotions/enums/SalePromotionStatusEnum.js +16 -0
  143. package/bin/retailPromotions/enums/SalePromotionTransitionEnum.d.ts +13 -0
  144. package/bin/retailPromotions/enums/SalePromotionTransitionEnum.js +17 -0
  145. package/bin/retailPromotions/helpers/computeBudgetUsedBps.d.ts +3 -0
  146. package/bin/retailPromotions/helpers/computeBudgetUsedBps.js +15 -0
  147. package/bin/retailPromotions/helpers/resolveSalePromotionTransition.d.ts +4 -0
  148. package/bin/retailPromotions/helpers/resolveSalePromotionTransition.js +9 -0
  149. package/bin/retailPromotions/index.d.ts +46 -0
  150. package/bin/retailPromotions/index.js +67 -0
  151. package/bin/retailWizard/dtos/Sale.d.ts +8 -8
  152. package/bin/retailWizard/dtos/SaleLine.d.ts +4 -1
  153. package/bin/retailWizard/dtos/WizardFinancingPreview.d.ts +11 -0
  154. package/bin/retailWizard/dtos/WizardFinancingPreview.js +2 -0
  155. package/bin/retailWizard/dtos/WizardGiftLine.d.ts +8 -0
  156. package/bin/retailWizard/dtos/WizardGiftLine.js +2 -0
  157. package/bin/retailWizard/dtos/WizardLinePromotionFields.d.ts +15 -0
  158. package/bin/retailWizard/dtos/WizardLinePromotionFields.js +2 -0
  159. package/bin/retailWizard/dtos/WizardReservedLine.d.ts +4 -1
  160. package/bin/retailWizard/dtos/WizardSession.d.ts +10 -0
  161. package/bin/retailWizard/dtos/requests/AddProductRequest.d.ts +2 -0
  162. package/bin/retailWizard/dtos/requests/AddProductRequest.js +7 -0
  163. package/bin/retailWizard/dtos/requests/ApplyLinePromotionRequest.d.ts +15 -0
  164. package/bin/retailWizard/dtos/requests/ApplyLinePromotionRequest.js +58 -0
  165. package/bin/retailWizard/dtos/requests/ApplySalePromotionRequest.d.ts +9 -0
  166. package/bin/retailWizard/dtos/requests/ApplySalePromotionRequest.js +36 -0
  167. package/bin/retailWizard/dtos/requests/PinSessionPiecesRequest.d.ts +14 -0
  168. package/bin/retailWizard/dtos/requests/PinSessionPiecesRequest.js +60 -0
  169. package/bin/retailWizard/dtos/requests/QuoteRequest.d.ts +1 -1
  170. package/bin/retailWizard/dtos/requests/SetAnchorGiftsRequest.d.ts +14 -0
  171. package/bin/retailWizard/dtos/requests/SetAnchorGiftsRequest.js +56 -0
  172. package/bin/retailWizard/dtos/responses/PrivateWizardSessionResponse.d.ts +29 -0
  173. package/bin/retailWizard/dtos/responses/PrivateWizardSessionResponse.js +2 -0
  174. package/bin/retailWizard/dtos/responses/SetAnchorGiftsResponse.d.ts +5 -0
  175. package/bin/retailWizard/dtos/responses/SetAnchorGiftsResponse.js +2 -0
  176. package/bin/retailWizard/enums/RetailPromotionInboundMessageTypeEnum.d.ts +5 -0
  177. package/bin/retailWizard/enums/RetailPromotionInboundMessageTypeEnum.js +9 -0
  178. package/bin/retailWizard/enums/WizardLineRoleEnum.d.ts +4 -0
  179. package/bin/retailWizard/enums/WizardLineRoleEnum.js +8 -0
  180. package/bin/retailWizard/events/RetailCommissionInboundMessage.d.ts +19 -0
  181. package/bin/retailWizard/events/RetailCommissionInboundMessage.js +78 -0
  182. package/bin/retailWizard/events/RetailPromotionInboundMessage.d.ts +40 -0
  183. package/bin/retailWizard/events/RetailPromotionInboundMessage.js +160 -0
  184. package/bin/retailWizard/events/SaleCompletedV1.d.ts +2 -3
  185. package/bin/retailWizard/index.d.ts +13 -0
  186. package/bin/retailWizard/index.js +14 -0
  187. package/package.json +1 -1
  188. package/src/common/index.ts +3 -0
  189. package/src/common/validators/IsStringValueRecord.ts +13 -0
  190. package/src/index.ts +3 -0
  191. package/src/messagesConnector/validators/IsStringValueRecord.ts +2 -12
  192. package/src/platformRbac/dtos/CreateTenantUserRequest.ts +8 -1
  193. package/src/platformRbac/dtos/UpdateTenantUserRequest.ts +9 -3
  194. package/src/retailCatalog/dtos/Product.ts +6 -0
  195. package/src/retailCatalog/dtos/requests/BackofficeCreateProductRequest.ts +30 -1
  196. package/src/retailCatalog/dtos/requests/BackofficeRegisterAdjustmentRequest.ts +6 -0
  197. package/src/retailCatalog/dtos/requests/BackofficeUpdateProductRequest.ts +30 -1
  198. package/src/retailCatalog/dtos/requests/HoldStockRequest.ts +28 -0
  199. package/src/retailCatalog/dtos/requests/ReserveStockRequest.ts +7 -1
  200. package/src/retailCatalog/dtos/requests/SuggestPiecesQuery.ts +7 -1
  201. package/src/retailCatalog/dtos/responses/GetInventorySkuResponse.ts +3 -0
  202. package/src/retailCatalog/dtos/responses/HoldStockResponse.ts +9 -0
  203. package/src/retailCatalog/dtos/responses/StoreCatalogItem.ts +6 -1
  204. package/src/retailCatalog/enums/InventoryInboundMessageTypeEnum.ts +5 -0
  205. package/src/retailCatalog/enums/InventoryItemStatusEnum.ts +3 -1
  206. package/src/retailCatalog/enums/ReservePurposeEnum.ts +4 -0
  207. package/src/retailCatalog/events/InventoryInboundMessage.ts +5 -0
  208. package/src/retailCatalog/events/InventoryReturnMessage.ts +26 -0
  209. package/src/retailCatalog/events/InventorySaleAppliedMessage.ts +26 -0
  210. package/src/retailCatalog/index.ts +9 -0
  211. package/src/retailPromotions/constants/bonusPreMoney.ts +19 -0
  212. package/src/retailPromotions/constants/retailPromotionsErrorHttpStatus.ts +21 -0
  213. package/src/retailPromotions/constants/salePromotionTransitions.ts +11 -0
  214. package/src/retailPromotions/dtos/DiscountCode.ts +36 -0
  215. package/src/retailPromotions/dtos/DiscountValue.ts +8 -0
  216. package/src/retailPromotions/dtos/LinePromotionDiscount.ts +10 -0
  217. package/src/retailPromotions/dtos/SalePromotion.ts +36 -0
  218. package/src/retailPromotions/dtos/SalePromotionLevers.ts +67 -0
  219. package/src/retailPromotions/dtos/SalePromotionLogEntry.ts +19 -0
  220. package/src/retailPromotions/dtos/requests/ChangeDiscountCodeStatusRequest.ts +15 -0
  221. package/src/retailPromotions/dtos/requests/ChangeSalePromotionStatusRequest.ts +15 -0
  222. package/src/retailPromotions/dtos/requests/CreateDiscountCodeRequest.ts +71 -0
  223. package/src/retailPromotions/dtos/requests/CreateSalePromotionRequest.ts +73 -0
  224. package/src/retailPromotions/dtos/requests/DiscountValueInput.ts +21 -0
  225. package/src/retailPromotions/dtos/requests/EvaluateSalePromotionsRequest.ts +16 -0
  226. package/src/retailPromotions/dtos/requests/HoldSalePromotionRequest.ts +32 -0
  227. package/src/retailPromotions/dtos/requests/ListDiscountCodesQuery.ts +33 -0
  228. package/src/retailPromotions/dtos/requests/ListSalePromotionLogQuery.ts +29 -0
  229. package/src/retailPromotions/dtos/requests/ListSalePromotionsQuery.ts +24 -0
  230. package/src/retailPromotions/dtos/requests/ListStoreSalePromotionsQuery.ts +10 -0
  231. package/src/retailPromotions/dtos/requests/SalePromotionLeversInput.ts +136 -0
  232. package/src/retailPromotions/dtos/requests/SalePromotionScopeInput.ts +45 -0
  233. package/src/retailPromotions/dtos/requests/UpdateSalePromotionRequest.ts +74 -0
  234. package/src/retailPromotions/dtos/responses/DiscountCodeResponses.ts +9 -0
  235. package/src/retailPromotions/dtos/responses/SalePromotionCrudResponses.ts +35 -0
  236. package/src/retailPromotions/dtos/responses/WizardSalePromotionResponses.ts +115 -0
  237. package/src/retailPromotions/enums/CouponScopeEnum.ts +11 -0
  238. package/src/retailPromotions/enums/CouponStatusEnum.ts +11 -0
  239. package/src/retailPromotions/enums/DiscountCodeOriginEnum.ts +8 -0
  240. package/src/retailPromotions/enums/DiscountCodeStatusEnum.ts +11 -0
  241. package/src/retailPromotions/enums/DiscountCodeTransitionEnum.ts +7 -0
  242. package/src/retailPromotions/enums/DiscountTypeEnum.ts +8 -0
  243. package/src/retailPromotions/enums/EntitlementKindEnum.ts +9 -0
  244. package/src/retailPromotions/enums/EntitlementStateEnum.ts +13 -0
  245. package/src/retailPromotions/enums/GiftModeEnum.ts +8 -0
  246. package/src/retailPromotions/enums/PromotionAppliesToEnum.ts +9 -0
  247. package/src/retailPromotions/enums/RetailPromotionsErrorCodeEnum.ts +23 -0
  248. package/src/retailPromotions/enums/SaleCouponAvailabilityEnum.ts +10 -0
  249. package/src/retailPromotions/enums/SalePromotionLeverEnum.ts +13 -0
  250. package/src/retailPromotions/enums/SalePromotionLogEventEnum.ts +14 -0
  251. package/src/retailPromotions/enums/SalePromotionLogFormatEnum.ts +5 -0
  252. package/src/retailPromotions/enums/SalePromotionPhaseEnum.ts +11 -0
  253. package/src/retailPromotions/enums/SalePromotionStatusEnum.ts +12 -0
  254. package/src/retailPromotions/enums/SalePromotionTransitionEnum.ts +13 -0
  255. package/src/retailPromotions/helpers/computeBudgetUsedBps.ts +15 -0
  256. package/src/retailPromotions/helpers/resolveSalePromotionTransition.ts +12 -0
  257. package/src/retailPromotions/index.ts +55 -0
  258. package/src/retailWizard/dtos/Sale.ts +8 -8
  259. package/src/retailWizard/dtos/SaleLine.ts +4 -1
  260. package/src/retailWizard/dtos/WizardFinancingPreview.ts +12 -0
  261. package/src/retailWizard/dtos/WizardGiftLine.ts +9 -0
  262. package/src/retailWizard/dtos/WizardLinePromotionFields.ts +16 -0
  263. package/src/retailWizard/dtos/WizardReservedLine.ts +4 -1
  264. package/src/retailWizard/dtos/WizardSession.ts +10 -0
  265. package/src/retailWizard/dtos/requests/AddProductRequest.ts +8 -1
  266. package/src/retailWizard/dtos/requests/ApplyLinePromotionRequest.ts +45 -0
  267. package/src/retailWizard/dtos/requests/ApplySalePromotionRequest.ts +24 -0
  268. package/src/retailWizard/dtos/requests/PinSessionPiecesRequest.ts +40 -0
  269. package/src/retailWizard/dtos/requests/QuoteRequest.ts +1 -1
  270. package/src/retailWizard/dtos/requests/SetAnchorGiftsRequest.ts +40 -0
  271. package/src/retailWizard/dtos/responses/PrivateWizardSessionResponse.ts +30 -0
  272. package/src/retailWizard/dtos/responses/SetAnchorGiftsResponse.ts +6 -0
  273. package/src/retailWizard/enums/RetailPromotionInboundMessageTypeEnum.ts +5 -0
  274. package/src/retailWizard/enums/WizardLineRoleEnum.ts +4 -0
  275. package/src/retailWizard/events/RetailCommissionInboundMessage.ts +54 -0
  276. package/src/retailWizard/events/RetailPromotionInboundMessage.ts +138 -0
  277. package/src/retailWizard/events/SaleCompletedV1.ts +2 -3
  278. package/src/retailWizard/index.ts +15 -0
@@ -41,6 +41,7 @@ __exportStar(require("./enums/BlockedReasonEnum"), exports);
41
41
  __exportStar(require("./enums/BlockedCategoryEnum"), exports);
42
42
  __exportStar(require("./enums/WizardLineStatusEnum"), exports);
43
43
  __exportStar(require("./enums/LinePaymentTypeEnum"), exports);
44
+ __exportStar(require("./enums/WizardLineRoleEnum"), exports);
44
45
  // DTOs anidados
45
46
  __exportStar(require("./dtos/WizardConsents"), exports);
46
47
  __exportStar(require("./dtos/WizardPayment"), exports);
@@ -57,7 +58,10 @@ __exportStar(require("./dtos/WizardResumeTarget"), exports);
57
58
  __exportStar(require("./dtos/WizardBlocked"), exports);
58
59
  __exportStar(require("./dtos/WizardLineProduct"), exports);
59
60
  __exportStar(require("./dtos/WizardLineIdentifiers"), exports);
61
+ __exportStar(require("./dtos/WizardLinePromotionFields"), exports);
62
+ __exportStar(require("./dtos/WizardFinancingPreview"), exports);
60
63
  __exportStar(require("./dtos/WizardReservedLine"), exports);
64
+ __exportStar(require("./dtos/WizardGiftLine"), exports);
61
65
  __exportStar(require("./dtos/SaleLine"), exports);
62
66
  // Entidades principales (shapes de estado/persistencia — planas)
63
67
  __exportStar(require("./dtos/WizardSession"), exports);
@@ -79,6 +83,10 @@ __exportStar(require("./dtos/requests/KycManualRequest"), exports);
79
83
  __exportStar(require("./dtos/requests/ProofOfAddressPrepareRequest"), exports);
80
84
  __exportStar(require("./dtos/requests/OccupationRequest"), exports);
81
85
  __exportStar(require("./dtos/requests/AddProductRequest"), exports);
86
+ __exportStar(require("./dtos/requests/PinSessionPiecesRequest"), exports);
87
+ __exportStar(require("./dtos/requests/ApplyLinePromotionRequest"), exports);
88
+ __exportStar(require("./dtos/requests/SetAnchorGiftsRequest"), exports);
89
+ __exportStar(require("./dtos/requests/ApplySalePromotionRequest"), exports);
82
90
  __exportStar(require("./dtos/requests/DeleteProductRequest"), exports);
83
91
  __exportStar(require("./dtos/requests/SetPaymentMethodRequest"), exports);
84
92
  __exportStar(require("./dtos/requests/ExternalReferralRequest"), exports);
@@ -160,7 +168,13 @@ __exportStar(require("./events/SaleCancelledV1"), exports);
160
168
  __exportStar(require("./events/SaleCompletedV2"), exports);
161
169
  __exportStar(require("./events/SaleCancelledV2"), exports);
162
170
  __exportStar(require("./events/SessionExpiredV1"), exports);
171
+ __exportStar(require("./enums/RetailPromotionInboundMessageTypeEnum"), exports);
172
+ __exportStar(require("./events/RetailPromotionInboundMessage"), exports);
173
+ __exportStar(require("./events/RetailCommissionInboundMessage"), exports);
163
174
  // Lookup privado por lote (GET /private/wizard-sessions/batch)
164
175
  __exportStar(require("./enums/WizardSessionLookupStatusEnum"), exports);
165
176
  __exportStar(require("./dtos/WizardSessionLookupEntry"), exports);
166
177
  __exportStar(require("./dtos/responses/WizardSessionLookupResponse"), exports);
178
+ // M2M de Promociones (lectura privada de la sesión y regalo)
179
+ __exportStar(require("./dtos/responses/PrivateWizardSessionResponse"), exports);
180
+ __exportStar(require("./dtos/responses/SetAnchorGiftsResponse"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.471.0",
3
+ "version": "3.473.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -1,6 +1,9 @@
1
1
  //decorators
2
2
  export * from './decorators/Trim';
3
3
 
4
+ //validators
5
+ export * from './validators/IsStringValueRecord';
6
+
4
7
  //dtos
5
8
  export * from './dtos/ProcessValidationResultDto';
6
9
 
@@ -0,0 +1,13 @@
1
+ import { ValidatorConstraint, ValidatorConstraintInterface, ValidationArguments } from 'class-validator';
2
+
3
+ // Valida que un objeto sea un mapa clave → string.
4
+ @ValidatorConstraint({ name: 'IsStringValueRecord', async: false })
5
+ export class IsStringValueRecord implements ValidatorConstraintInterface {
6
+ validate(value: unknown, _args: ValidationArguments): boolean {
7
+ if (!value || typeof value !== 'object') return false;
8
+ return Object.values(value as Record<string, unknown>).every(v => typeof v === 'string');
9
+ }
10
+ defaultMessage(_args: ValidationArguments): string {
11
+ return 'All values in variables must be strings';
12
+ }
13
+ }
package/src/index.ts CHANGED
@@ -122,6 +122,9 @@ export * as RetailCustomer from './retailCustomer';
122
122
  // RetailWizard: DTOs/enums del lambda retail-wizard-business (comp 04 — wizard de venta de contado:
123
123
  // saga de sesión, OTP, KYC, venta y prospectos; SureKeep Fase 2 — pista Retail).
124
124
  export * as RetailWizard from './retailWizard';
125
+ // RetailPromotions: DTOs/enums de retail-promotions-business (promos de venta, códigos de descuento y
126
+ // cupones de VentasLuga). Porcentajes en puntos base, dinero en centavos.
127
+ export * as RetailPromotions from './retailPromotions';
125
128
  export * as DatalakeQuery from './datalakeQuery';
126
129
  // LoanConfig: DTOs/enums del lambda loan-config-business (comp 09 — parámetros operativos del SOFOM).
127
130
  export * as LoanConfig from './loanConfig';
@@ -1,12 +1,2 @@
1
- import { ValidatorConstraint, ValidatorConstraintInterface, ValidationArguments } from 'class-validator';
2
-
3
- @ValidatorConstraint({ name: 'IsStringValueRecord', async: false })
4
- export class IsStringValueRecord implements ValidatorConstraintInterface {
5
- validate(value: unknown, _args: ValidationArguments): boolean {
6
- if (!value || typeof value !== 'object') return false;
7
- return Object.values(value as Record<string, unknown>).every(v => typeof v === 'string');
8
- }
9
- defaultMessage(_args: ValidationArguments): string {
10
- return 'All values in variables must be strings';
11
- }
12
- }
1
+ // Movido a common: se reexporta para no romper a quien importa desde messagesConnector.
2
+ export { IsStringValueRecord } from '../../common/validators/IsStringValueRecord';
@@ -1,6 +1,7 @@
1
1
  import { Expose } from 'class-transformer';
2
- import { IsEmail, IsEnum, IsNotEmpty, IsOptional, IsString } from 'class-validator';
2
+ import { IsEmail, IsEnum, IsNotEmpty, IsObject, IsOptional, IsString, Validate } from 'class-validator';
3
3
  import { PermissionScope } from '../enums/PermissionScope';
4
+ import { IsStringValueRecord } from '../../common/validators/IsStringValueRecord';
4
5
 
5
6
  /**
6
7
  * Body del POST /internal/tenants/{tenantId}/users (endpoint privado, VPC/ANONIMUS). `tenantId` viaja en el path.
@@ -11,6 +12,7 @@ import { PermissionScope } from '../enums/PermissionScope';
11
12
  * - Idempotente por identidad Cognito.
12
13
  * - `scope`/`scopeRef` = grant del rol (ej. LEVEL_3 + storeId para un vendedor de tienda).
13
14
  * - `createdBy` = cognitoSub del admin real (audit + grantedBy del assignment).
15
+ * - `customFields` = valores de los campos personalizados del tenant; si el correo ya tiene usuario, se fusionan.
14
16
  */
15
17
  export class CreateTenantUserRequest {
16
18
  @Expose() @IsEmail() email!: string;
@@ -19,4 +21,9 @@ export class CreateTenantUserRequest {
19
21
  @Expose() @IsEnum(PermissionScope) scope!: PermissionScope;
20
22
  @Expose() @IsString() @IsNotEmpty() scopeRef!: string;
21
23
  @Expose() @IsString() @IsNotEmpty() createdBy!: string;
24
+ @Expose()
25
+ @IsOptional()
26
+ @IsObject()
27
+ @Validate(IsStringValueRecord, { message: 'customFields: todos los valores deben ser string' })
28
+ customFields?: { [key: string]: string };
22
29
  }
@@ -1,11 +1,17 @@
1
1
  import { Expose } from 'class-transformer';
2
- import { IsNotEmpty, IsOptional, IsString, MaxLength } from 'class-validator';
2
+ import { IsNotEmpty, IsObject, IsOptional, IsString, MaxLength, Validate } from 'class-validator';
3
+ import { IsStringValueRecord } from '../../common/validators/IsStringValueRecord';
3
4
 
4
5
  /**
5
- * Body del PUT que renombra a un usuario. El correo es inmutable en el rbac y el grupo se mueve
6
- * reasignando el rol, así que aquí no viaja ninguno de los dos.
6
+ * Body del PUT que edita a un usuario: nombre y campos personalizados. `customFields` se fusiona con los
7
+ * actuales (solo cambian las claves enviadas; "" borra una). Correo y grupo no viajan aquí.
7
8
  */
8
9
  export class UpdateTenantUserRequest {
9
10
  @Expose() @IsOptional() @IsString() @IsNotEmpty() @MaxLength(120) displayName?: string;
11
+ @Expose()
12
+ @IsOptional()
13
+ @IsObject()
14
+ @Validate(IsStringValueRecord, { message: 'customFields: todos los valores deben ser string' })
15
+ customFields?: { [key: string]: string };
10
16
  @Expose() @IsString() @IsNotEmpty() actedBy!: string;
11
17
  }
@@ -51,4 +51,10 @@ export class Product {
51
51
  currentPriceSk?: string | null;
52
52
  /** Producto físico o servicio; inmutable tras el alta. Ausente = PRODUCT. */
53
53
  itemType?: ItemTypeEnum;
54
+ /** Prioridad de venta 0–100; «Recomendados» ordena por ella. */
55
+ salePriority?: number;
56
+ highlights?: string[];
57
+ warrantyMonths?: number;
58
+ /** Fecha ISO 8601. */
59
+ launchDate?: string;
54
60
  }
@@ -1,4 +1,4 @@
1
- import { IsArray, IsBoolean, IsEnum, IsIn, IsOptional, IsString, Length, Matches, Validate, ValidateIf } from 'class-validator';
1
+ import { IsArray, IsBoolean, IsEnum, IsIn, IsInt, IsISO8601, IsObject, IsOptional, IsString, Length, Matches, Max, Min, Validate, ValidateIf } from 'class-validator';
2
2
  import { SKU_PATTERN } from '../../constants/SkuPattern';
3
3
  import { NON_BUNDLE_CATEGORIES } from '../../constants/NonBundleCategories';
4
4
  import { ProductCategoryEnum } from '../../enums/ProductCategoryEnum';
@@ -89,4 +89,33 @@ export class BackofficeCreateProductRequest {
89
89
  @IsOptional()
90
90
  @IsEnum(MdmLockModeEnum)
91
91
  mdmLockMode?: MdmLockModeEnum | null;
92
+
93
+ /** Prioridad de venta: 100 sale primero en «Recomendados». */
94
+ @IsOptional()
95
+ @IsInt()
96
+ @Min(0)
97
+ @Max(100)
98
+ salePriority?: number;
99
+
100
+ @IsOptional()
101
+ @IsArray()
102
+ @Matches(/\S/, { each: true })
103
+ @IsString({ each: true })
104
+ highlights?: string[];
105
+
106
+ /** 0 = sin garantía. */
107
+ @IsOptional()
108
+ @IsInt()
109
+ @Min(0)
110
+ warrantyMonths?: number;
111
+
112
+ /** Fecha ISO 8601. */
113
+ @IsOptional()
114
+ @IsISO8601()
115
+ launchDate?: string;
116
+
117
+ /** Ficha técnica como mapa clave/valor, igual que Product.specs. */
118
+ @IsOptional()
119
+ @IsObject()
120
+ specs?: Record<string, unknown>;
92
121
  }
@@ -31,4 +31,10 @@ export class BackofficeRegisterAdjustmentRequest {
31
31
  @Matches(/^\S+$/, { each: true })
32
32
  @IsString({ each: true })
33
33
  identifiers?: string[];
34
+
35
+ /** movementId del MOV# que este ajuste corrige; el catálogo responde 404 si no existe. */
36
+ @IsOptional()
37
+ @Matches(/^\S+$/)
38
+ @IsString()
39
+ reversesMovementId?: string;
34
40
  }
@@ -1,5 +1,5 @@
1
1
  import { Type } from 'class-transformer';
2
- import { ArrayMinSize, IsArray, IsBoolean, IsEnum, IsIn, IsOptional, IsString, Matches, Validate, ValidateNested } from 'class-validator';
2
+ import { ArrayMinSize, IsArray, IsBoolean, IsEnum, IsIn, IsInt, IsISO8601, IsObject, IsOptional, IsString, Matches, Max, Min, Validate, ValidateNested } from 'class-validator';
3
3
  import { NON_BUNDLE_CATEGORIES } from '../../constants/NonBundleCategories';
4
4
  import { ProductCategoryEnum } from '../../enums/ProductCategoryEnum';
5
5
  import { ProductTierEnum } from '../../enums/ProductTierEnum';
@@ -90,4 +90,33 @@ export class BackofficeUpdateProductRequest {
90
90
  @IsOptional()
91
91
  @IsEnum(MdmLockModeEnum)
92
92
  mdmLockMode?: MdmLockModeEnum | null;
93
+
94
+ /** Prioridad de venta: 100 sale primero en «Recomendados». */
95
+ @IsOptional()
96
+ @IsInt()
97
+ @Min(0)
98
+ @Max(100)
99
+ salePriority?: number;
100
+
101
+ @IsOptional()
102
+ @IsArray()
103
+ @Matches(/\S/, { each: true })
104
+ @IsString({ each: true })
105
+ highlights?: string[];
106
+
107
+ /** 0 = sin garantía. */
108
+ @IsOptional()
109
+ @IsInt()
110
+ @Min(0)
111
+ warrantyMonths?: number;
112
+
113
+ /** Fecha ISO 8601. */
114
+ @IsOptional()
115
+ @IsISO8601()
116
+ launchDate?: string;
117
+
118
+ /** Ficha técnica como mapa clave/valor, igual que Product.specs. */
119
+ @IsOptional()
120
+ @IsObject()
121
+ specs?: Record<string, unknown>;
93
122
  }
@@ -0,0 +1,28 @@
1
+ import { Type } from 'class-transformer';
2
+ import { ArrayMinSize, IsArray, IsString, ValidateNested } from 'class-validator';
3
+ import { ReservationLineRef } from './ReservationLineRef';
4
+
5
+ /** Componente de la línea con las piezas que quedan HELD de la sesión. */
6
+ export class HoldStockComponent {
7
+ @IsString()
8
+ sku!: string;
9
+
10
+ @IsArray()
11
+ @IsString({ each: true })
12
+ identifiers!: string[];
13
+ }
14
+
15
+ /** Body de PUT /private/stores/{storeId}/holds (privateHoldStock); fija las piezas de una línea. */
16
+ export class HoldStockRequest extends ReservationLineRef {
17
+ @IsString()
18
+ sessionId!: string;
19
+
20
+ @IsString()
21
+ retailerId!: string;
22
+
23
+ @IsArray()
24
+ @ArrayMinSize(1)
25
+ @ValidateNested({ each: true })
26
+ @Type(() => HoldStockComponent)
27
+ components!: HoldStockComponent[];
28
+ }
@@ -1,4 +1,5 @@
1
- import { IsInt, IsString, Min } from 'class-validator';
1
+ import { IsEnum, IsInt, IsOptional, IsString, Min } from 'class-validator';
2
+ import { ReservePurposeEnum } from '../../enums/ReservePurposeEnum';
2
3
 
3
4
  /** Body de PUT /private/stores/{storeId}/reservations (privateReserveStock); reserva una línea, kit completo. */
4
5
  export class ReserveStockRequest {
@@ -21,4 +22,9 @@ export class ReserveStockRequest {
21
22
  @IsInt()
22
23
  @Min(1)
23
24
  qty!: number;
25
+
26
+ /** GIFT aparta un regalo de Promociones; ausente = apartado normal de venta. */
27
+ @IsOptional()
28
+ @IsEnum(ReservePurposeEnum)
29
+ purpose?: ReservePurposeEnum;
24
30
  }
@@ -1,4 +1,4 @@
1
- import { IsString, MinLength } from 'class-validator';
1
+ import { IsNotEmpty, IsOptional, IsString, MinLength } from 'class-validator';
2
2
 
3
3
  /** Query de GET /private/stores/{storeId}/pieces (privateSuggestPieces); sku es el componente si es kit. */
4
4
  export class SuggestPiecesQuery {
@@ -8,4 +8,10 @@ export class SuggestPiecesQuery {
8
8
  @IsString()
9
9
  @MinLength(4)
10
10
  prefix!: string;
11
+
12
+ /** Sesión que pide; incluye sus propias piezas HELD en las sugerencias. */
13
+ @IsOptional()
14
+ @IsString()
15
+ @IsNotEmpty()
16
+ sessionId?: string;
11
17
  }
@@ -1,5 +1,6 @@
1
1
  import type { InventoryItemStatusEnum } from '../../enums/InventoryItemStatusEnum';
2
2
  import type { InventoryMovementTypeEnum } from '../../enums/InventoryMovementTypeEnum';
3
+ import type { InventoryMovementReasonEnum } from '../../enums/InventoryMovementReasonEnum';
3
4
  import type { SkuPriceEntry } from './SkuPriceEntry';
4
5
 
5
6
  /** Un movimiento del libro de inventario. */
@@ -12,6 +13,8 @@ export interface InventoryMovementEntry {
12
13
  identifier: string | null;
13
14
  occurredAt: string;
14
15
  createdBy: string;
16
+ /** Motivo guardado en el MOV#; ausente en los tipos que no llevan motivo. */
17
+ reason?: InventoryMovementReasonEnum;
15
18
  }
16
19
 
17
20
  /** Pieza de una tienda; status AVAILABLE, SOLD o DAMAGED. */
@@ -0,0 +1,9 @@
1
+ import type { HoldStockComponent } from '../requests/HoldStockRequest';
2
+
3
+ /** Response de privateHoldStock: la línea con las piezas que quedaron HELD. */
4
+ export interface HoldStockResponse {
5
+ lineId: string;
6
+ reservationId: string;
7
+ sessionId: string;
8
+ components: HoldStockComponent[];
9
+ }
@@ -6,6 +6,11 @@ import type { TrackingModeEnum } from '../../enums/TrackingModeEnum';
6
6
  import type { ItemTypeEnum } from '../../enums/ItemTypeEnum';
7
7
  import type { ProductComponent } from '../ProductComponent';
8
8
 
9
+ /** Componente de un kit en el catálogo de venta, con la categoría de su SKU. */
10
+ export interface StoreCatalogComponent extends ProductComponent {
11
+ category?: ProductCategoryEnum;
12
+ }
13
+
9
14
  /** Fila por SKU del catálogo de venta de una tienda (privateGetStoreStockCatalog). */
10
15
  export interface StoreCatalogItem {
11
16
  sku: string;
@@ -25,7 +30,7 @@ export interface StoreCatalogItem {
25
30
  mdmProvider: MdmProviderEnum | null;
26
31
  mdmLockMode: MdmLockModeEnum | null;
27
32
  /** Solo si es kit. */
28
- components?: ProductComponent[];
33
+ components?: StoreCatalogComponent[];
29
34
  /** Producto físico o servicio. Ausente = PRODUCT. */
30
35
  itemType?: ItemTypeEnum;
31
36
  /** Nombre visible para kits y servicios, que no tienen marca/modelo. */
@@ -0,0 +1,5 @@
1
+ /** Tipo de aviso que el wizard publica en la cola de inventario del catálogo. */
2
+ export enum InventoryInboundMessageTypeEnum {
3
+ SALE_APPLIED = 'SALE_APPLIED',
4
+ RETURN = 'RETURN',
5
+ }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Estado de una unidad física (IMEI) en inventario.
3
- * Transiciones: AVAILABLE → RESERVED → SOLD/AVAILABLE (release); RETURNED desde SOLD; DAMAGED.
3
+ * Transiciones: AVAILABLE → RESERVED → SOLD/AVAILABLE (release); AVAILABLE → HELD → SOLD/AVAILABLE; RETURNED desde SOLD; DAMAGED.
4
4
  * @enum {string}
5
5
  *
6
6
  * @property {string} AVAILABLE - Disponible en stock.
@@ -9,6 +9,7 @@
9
9
  * @property {string} RETURNED - Devuelta por el cliente.
10
10
  * @property {string} DAMAGED - Dañada, fuera de stock vendible.
11
11
  * @property {string} IN_TRANSIT - En traspaso entre tiendas, fuera de stock vendible.
12
+ * @property {string} HELD - Capturada por una sesión de venta; no vence hasta venderse o soltarse.
12
13
  */
13
14
  export enum InventoryItemStatusEnum {
14
15
  AVAILABLE = 'AVAILABLE',
@@ -17,4 +18,5 @@ export enum InventoryItemStatusEnum {
17
18
  RETURNED = 'RETURNED',
18
19
  DAMAGED = 'DAMAGED',
19
20
  IN_TRANSIT = 'IN_TRANSIT',
21
+ HELD = 'HELD',
20
22
  }
@@ -0,0 +1,4 @@
1
+ /** Motivo de un apartado; sin valor es un apartado normal de venta. */
2
+ export enum ReservePurposeEnum {
3
+ GIFT = 'GIFT',
4
+ }
@@ -0,0 +1,5 @@
1
+ import type { InventoryReturnMessage } from './InventoryReturnMessage';
2
+ import type { InventorySaleAppliedMessage } from './InventorySaleAppliedMessage';
3
+
4
+ /** Cualquier aviso de la cola de inventario; se discrimina por `type`. */
5
+ export type InventoryInboundMessage = InventorySaleAppliedMessage | InventoryReturnMessage;
@@ -0,0 +1,26 @@
1
+ import { Equals, IsISO8601, IsNotEmpty, IsString } from 'class-validator';
2
+ import { InventoryInboundMessageTypeEnum } from '../enums/InventoryInboundMessageTypeEnum';
3
+ import { ReturnStockRequest } from '../dtos/requests/ReturnStockRequest';
4
+
5
+ /** Aviso de devolución de una venta de la saga en la cola de inventario. */
6
+ export class InventoryReturnMessage extends ReturnStockRequest {
7
+ @Equals(InventoryInboundMessageTypeEnum.RETURN)
8
+ type!: InventoryInboundMessageTypeEnum.RETURN;
9
+
10
+ @IsString()
11
+ @IsNotEmpty()
12
+ tenantId!: string;
13
+
14
+ @IsString()
15
+ @IsNotEmpty()
16
+ storeId!: string;
17
+
18
+ /** Sesión de la venta; ubica su marcador IDEMP#SELL. */
19
+ @IsString()
20
+ @IsNotEmpty()
21
+ sessionId!: string;
22
+
23
+ /** Fecha de la devolución; es el occurredAt del MOV#. */
24
+ @IsISO8601()
25
+ returnedAt!: string;
26
+ }
@@ -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
+ }
@@ -92,3 +92,12 @@ export * from './dtos/requests/BackofficeCreateTransferRequest';
92
92
  export * from './dtos/requests/BackofficeListTransfersQuery';
93
93
  export * from './dtos/responses/TransferResponse';
94
94
  export * from './dtos/responses/ListTransfersResponse';
95
+
96
+ // Venta saga (ciclo 3)
97
+ export * from './enums/ReservePurposeEnum';
98
+ export * from './enums/InventoryInboundMessageTypeEnum';
99
+ export * from './dtos/requests/HoldStockRequest';
100
+ export * from './dtos/responses/HoldStockResponse';
101
+ export * from './events/InventorySaleAppliedMessage';
102
+ export * from './events/InventoryReturnMessage';
103
+ 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,21 @@
1
+ import { RetailPromotionsErrorCodeEnum as C } from '../enums/RetailPromotionsErrorCodeEnum';
2
+
3
+ /** Status HTTP de cada code: 404 no existe · 409 conflicto de estado · 422 regla de negocio. */
4
+ export const RETAIL_PROMOTIONS_ERROR_HTTP_STATUS: Readonly<Record<C, 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
+ };
@@ -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
+ }