@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.
- package/_test_/unit/common/IsStringValueRecord.test.ts +25 -0
- package/_test_/unit/platformRbac/dtos/tenantUserCustomFields.test.ts +55 -0
- package/_test_/unit/retailCatalog/catalogDebt.test.ts +123 -0
- package/_test_/unit/retailCatalog/catalogEnums.test.ts +2 -2
- package/_test_/unit/retailCatalog/ventaSaga.test.ts +152 -0
- package/_test_/unit/retailPromotions/computeBudgetUsedBps.test.ts +30 -0
- package/_test_/unit/retailPromotions/constants.test.ts +71 -0
- package/_test_/unit/retailPromotions/discountCodeAndWizardRequests.test.ts +84 -0
- package/_test_/unit/retailPromotions/salePromotionRequests.test.ts +151 -0
- package/_test_/unit/retailWizard/promotionM2mRequests.test.ts +189 -0
- package/_test_/unit/retailWizard/ventaSagaMessages.test.ts +163 -0
- package/_test_/unit/retailWizard/ventaSagaRequests.test.ts +59 -0
- package/_test_/unit/retailWizard/ventaSagaShapes.test.ts +99 -0
- package/bin/common/index.d.ts +1 -0
- package/bin/common/index.js +2 -0
- package/bin/common/validators/IsStringValueRecord.d.ts +5 -0
- package/bin/common/validators/IsStringValueRecord.js +25 -0
- package/bin/index.d.ts +1 -0
- package/bin/index.js +5 -2
- package/bin/messagesConnector/validators/IsStringValueRecord.d.ts +1 -5
- package/bin/messagesConnector/validators/IsStringValueRecord.js +3 -21
- package/bin/platformRbac/dtos/CreateTenantUserRequest.d.ts +4 -0
- package/bin/platformRbac/dtos/CreateTenantUserRequest.js +9 -0
- package/bin/platformRbac/dtos/UpdateTenantUserRequest.d.ts +5 -2
- package/bin/platformRbac/dtos/UpdateTenantUserRequest.js +10 -2
- package/bin/retailCatalog/dtos/Product.d.ts +6 -0
- package/bin/retailCatalog/dtos/requests/BackofficeCreateProductRequest.d.ts +9 -0
- package/bin/retailCatalog/dtos/requests/BackofficeCreateProductRequest.js +30 -0
- package/bin/retailCatalog/dtos/requests/BackofficeRegisterAdjustmentRequest.d.ts +2 -0
- package/bin/retailCatalog/dtos/requests/BackofficeRegisterAdjustmentRequest.js +6 -0
- package/bin/retailCatalog/dtos/requests/BackofficeUpdateProductRequest.d.ts +9 -0
- package/bin/retailCatalog/dtos/requests/BackofficeUpdateProductRequest.js +30 -0
- package/bin/retailCatalog/dtos/requests/HoldStockRequest.d.ts +12 -0
- package/bin/retailCatalog/dtos/requests/HoldStockRequest.js +47 -0
- package/bin/retailCatalog/dtos/requests/ReserveStockRequest.d.ts +3 -0
- package/bin/retailCatalog/dtos/requests/ReserveStockRequest.js +6 -0
- package/bin/retailCatalog/dtos/requests/SuggestPiecesQuery.d.ts +2 -0
- package/bin/retailCatalog/dtos/requests/SuggestPiecesQuery.js +6 -0
- package/bin/retailCatalog/dtos/responses/GetInventorySkuResponse.d.ts +3 -0
- package/bin/retailCatalog/dtos/responses/HoldStockResponse.d.ts +8 -0
- package/bin/retailCatalog/dtos/responses/HoldStockResponse.js +2 -0
- package/bin/retailCatalog/dtos/responses/StoreCatalogItem.d.ts +5 -1
- package/bin/retailCatalog/enums/InventoryInboundMessageTypeEnum.d.ts +5 -0
- package/bin/retailCatalog/enums/InventoryInboundMessageTypeEnum.js +9 -0
- package/bin/retailCatalog/enums/InventoryItemStatusEnum.d.ts +4 -2
- package/bin/retailCatalog/enums/InventoryItemStatusEnum.js +3 -1
- package/bin/retailCatalog/enums/ReservePurposeEnum.d.ts +4 -0
- package/bin/retailCatalog/enums/ReservePurposeEnum.js +8 -0
- package/bin/retailCatalog/events/InventoryInboundMessage.d.ts +4 -0
- package/bin/retailCatalog/events/InventoryInboundMessage.js +2 -0
- package/bin/retailCatalog/events/InventoryReturnMessage.d.ts +12 -0
- package/bin/retailCatalog/events/InventoryReturnMessage.js +42 -0
- package/bin/retailCatalog/events/InventorySaleAppliedMessage.d.ts +12 -0
- package/bin/retailCatalog/events/InventorySaleAppliedMessage.js +42 -0
- package/bin/retailCatalog/index.d.ts +7 -0
- package/bin/retailCatalog/index.js +8 -0
- package/bin/retailPromotions/constants/bonusPreMoney.d.ts +7 -0
- package/bin/retailPromotions/constants/bonusPreMoney.js +21 -0
- package/bin/retailPromotions/constants/retailPromotionsErrorHttpStatus.d.ts +3 -0
- package/bin/retailPromotions/constants/retailPromotionsErrorHttpStatus.js +23 -0
- package/bin/retailPromotions/constants/salePromotionTransitions.d.ts +7 -0
- package/bin/retailPromotions/constants/salePromotionTransitions.js +13 -0
- package/bin/retailPromotions/dtos/DiscountCode.d.ts +35 -0
- package/bin/retailPromotions/dtos/DiscountCode.js +2 -0
- package/bin/retailPromotions/dtos/DiscountValue.d.ts +7 -0
- package/bin/retailPromotions/dtos/DiscountValue.js +2 -0
- package/bin/retailPromotions/dtos/LinePromotionDiscount.d.ts +10 -0
- package/bin/retailPromotions/dtos/LinePromotionDiscount.js +2 -0
- package/bin/retailPromotions/dtos/SalePromotion.d.ts +35 -0
- package/bin/retailPromotions/dtos/SalePromotion.js +2 -0
- package/bin/retailPromotions/dtos/SalePromotionLevers.d.ts +58 -0
- package/bin/retailPromotions/dtos/SalePromotionLevers.js +2 -0
- package/bin/retailPromotions/dtos/SalePromotionLogEntry.d.ts +18 -0
- package/bin/retailPromotions/dtos/SalePromotionLogEntry.js +2 -0
- package/bin/retailPromotions/dtos/requests/ChangeDiscountCodeStatusRequest.d.ts +6 -0
- package/bin/retailPromotions/dtos/requests/ChangeDiscountCodeStatusRequest.js +30 -0
- package/bin/retailPromotions/dtos/requests/ChangeSalePromotionStatusRequest.d.ts +6 -0
- package/bin/retailPromotions/dtos/requests/ChangeSalePromotionStatusRequest.js +30 -0
- package/bin/retailPromotions/dtos/requests/CreateDiscountCodeRequest.d.ts +17 -0
- package/bin/retailPromotions/dtos/requests/CreateDiscountCodeRequest.js +78 -0
- package/bin/retailPromotions/dtos/requests/CreateSalePromotionRequest.d.ts +19 -0
- package/bin/retailPromotions/dtos/requests/CreateSalePromotionRequest.js +83 -0
- package/bin/retailPromotions/dtos/requests/DiscountValueInput.d.ts +8 -0
- package/bin/retailPromotions/dtos/requests/DiscountValueInput.js +36 -0
- package/bin/retailPromotions/dtos/requests/EvaluateSalePromotionsRequest.d.ts +5 -0
- package/bin/retailPromotions/dtos/requests/EvaluateSalePromotionsRequest.js +31 -0
- package/bin/retailPromotions/dtos/requests/HoldSalePromotionRequest.d.ts +11 -0
- package/bin/retailPromotions/dtos/requests/HoldSalePromotionRequest.js +48 -0
- package/bin/retailPromotions/dtos/requests/ListDiscountCodesQuery.d.ts +10 -0
- package/bin/retailPromotions/dtos/requests/ListDiscountCodesQuery.js +49 -0
- package/bin/retailPromotions/dtos/requests/ListSalePromotionLogQuery.d.ts +8 -0
- package/bin/retailPromotions/dtos/requests/ListSalePromotionLogQuery.js +46 -0
- package/bin/retailPromotions/dtos/requests/ListSalePromotionsQuery.d.ts +7 -0
- package/bin/retailPromotions/dtos/requests/ListSalePromotionsQuery.js +40 -0
- package/bin/retailPromotions/dtos/requests/ListStoreSalePromotionsQuery.d.ts +4 -0
- package/bin/retailPromotions/dtos/requests/ListStoreSalePromotionsQuery.js +24 -0
- package/bin/retailPromotions/dtos/requests/SalePromotionLeversInput.d.ts +40 -0
- package/bin/retailPromotions/dtos/requests/SalePromotionLeversInput.js +166 -0
- package/bin/retailPromotions/dtos/requests/SalePromotionScopeInput.d.ts +14 -0
- package/bin/retailPromotions/dtos/requests/SalePromotionScopeInput.js +65 -0
- package/bin/retailPromotions/dtos/requests/UpdateSalePromotionRequest.d.ts +19 -0
- package/bin/retailPromotions/dtos/requests/UpdateSalePromotionRequest.js +85 -0
- package/bin/retailPromotions/dtos/responses/DiscountCodeResponses.d.ts +7 -0
- package/bin/retailPromotions/dtos/responses/DiscountCodeResponses.js +2 -0
- package/bin/retailPromotions/dtos/responses/SalePromotionCrudResponses.d.ts +30 -0
- package/bin/retailPromotions/dtos/responses/SalePromotionCrudResponses.js +2 -0
- package/bin/retailPromotions/dtos/responses/WizardSalePromotionResponses.d.ts +102 -0
- package/bin/retailPromotions/dtos/responses/WizardSalePromotionResponses.js +2 -0
- package/bin/retailPromotions/enums/CouponScopeEnum.d.ts +11 -0
- package/bin/retailPromotions/enums/CouponScopeEnum.js +15 -0
- package/bin/retailPromotions/enums/CouponStatusEnum.d.ts +11 -0
- package/bin/retailPromotions/enums/CouponStatusEnum.js +15 -0
- package/bin/retailPromotions/enums/DiscountCodeOriginEnum.d.ts +8 -0
- package/bin/retailPromotions/enums/DiscountCodeOriginEnum.js +12 -0
- package/bin/retailPromotions/enums/DiscountCodeStatusEnum.d.ts +11 -0
- package/bin/retailPromotions/enums/DiscountCodeStatusEnum.js +15 -0
- package/bin/retailPromotions/enums/DiscountCodeTransitionEnum.d.ts +7 -0
- package/bin/retailPromotions/enums/DiscountCodeTransitionEnum.js +11 -0
- package/bin/retailPromotions/enums/DiscountTypeEnum.d.ts +8 -0
- package/bin/retailPromotions/enums/DiscountTypeEnum.js +12 -0
- package/bin/retailPromotions/enums/EntitlementKindEnum.d.ts +9 -0
- package/bin/retailPromotions/enums/EntitlementKindEnum.js +13 -0
- package/bin/retailPromotions/enums/EntitlementStateEnum.d.ts +13 -0
- package/bin/retailPromotions/enums/EntitlementStateEnum.js +17 -0
- package/bin/retailPromotions/enums/GiftModeEnum.d.ts +8 -0
- package/bin/retailPromotions/enums/GiftModeEnum.js +12 -0
- package/bin/retailPromotions/enums/PromotionAppliesToEnum.d.ts +9 -0
- package/bin/retailPromotions/enums/PromotionAppliesToEnum.js +13 -0
- package/bin/retailPromotions/enums/RetailPromotionsErrorCodeEnum.d.ts +23 -0
- package/bin/retailPromotions/enums/RetailPromotionsErrorCodeEnum.js +27 -0
- package/bin/retailPromotions/enums/SaleCouponAvailabilityEnum.d.ts +10 -0
- package/bin/retailPromotions/enums/SaleCouponAvailabilityEnum.js +14 -0
- package/bin/retailPromotions/enums/SalePromotionLeverEnum.d.ts +13 -0
- package/bin/retailPromotions/enums/SalePromotionLeverEnum.js +17 -0
- package/bin/retailPromotions/enums/SalePromotionLogEventEnum.d.ts +14 -0
- package/bin/retailPromotions/enums/SalePromotionLogEventEnum.js +18 -0
- package/bin/retailPromotions/enums/SalePromotionLogFormatEnum.d.ts +5 -0
- package/bin/retailPromotions/enums/SalePromotionLogFormatEnum.js +9 -0
- package/bin/retailPromotions/enums/SalePromotionPhaseEnum.d.ts +11 -0
- package/bin/retailPromotions/enums/SalePromotionPhaseEnum.js +15 -0
- package/bin/retailPromotions/enums/SalePromotionStatusEnum.d.ts +12 -0
- package/bin/retailPromotions/enums/SalePromotionStatusEnum.js +16 -0
- package/bin/retailPromotions/enums/SalePromotionTransitionEnum.d.ts +13 -0
- package/bin/retailPromotions/enums/SalePromotionTransitionEnum.js +17 -0
- package/bin/retailPromotions/helpers/computeBudgetUsedBps.d.ts +3 -0
- package/bin/retailPromotions/helpers/computeBudgetUsedBps.js +15 -0
- package/bin/retailPromotions/helpers/resolveSalePromotionTransition.d.ts +4 -0
- package/bin/retailPromotions/helpers/resolveSalePromotionTransition.js +9 -0
- package/bin/retailPromotions/index.d.ts +46 -0
- package/bin/retailPromotions/index.js +67 -0
- package/bin/retailWizard/dtos/Sale.d.ts +8 -8
- package/bin/retailWizard/dtos/SaleLine.d.ts +4 -1
- package/bin/retailWizard/dtos/WizardFinancingPreview.d.ts +11 -0
- package/bin/retailWizard/dtos/WizardFinancingPreview.js +2 -0
- package/bin/retailWizard/dtos/WizardGiftLine.d.ts +8 -0
- package/bin/retailWizard/dtos/WizardGiftLine.js +2 -0
- package/bin/retailWizard/dtos/WizardLinePromotionFields.d.ts +15 -0
- package/bin/retailWizard/dtos/WizardLinePromotionFields.js +2 -0
- package/bin/retailWizard/dtos/WizardReservedLine.d.ts +4 -1
- package/bin/retailWizard/dtos/WizardSession.d.ts +10 -0
- package/bin/retailWizard/dtos/requests/AddProductRequest.d.ts +2 -0
- package/bin/retailWizard/dtos/requests/AddProductRequest.js +7 -0
- package/bin/retailWizard/dtos/requests/ApplyLinePromotionRequest.d.ts +15 -0
- package/bin/retailWizard/dtos/requests/ApplyLinePromotionRequest.js +58 -0
- package/bin/retailWizard/dtos/requests/ApplySalePromotionRequest.d.ts +9 -0
- package/bin/retailWizard/dtos/requests/ApplySalePromotionRequest.js +36 -0
- package/bin/retailWizard/dtos/requests/PinSessionPiecesRequest.d.ts +14 -0
- package/bin/retailWizard/dtos/requests/PinSessionPiecesRequest.js +60 -0
- package/bin/retailWizard/dtos/requests/QuoteRequest.d.ts +1 -1
- package/bin/retailWizard/dtos/requests/SetAnchorGiftsRequest.d.ts +14 -0
- package/bin/retailWizard/dtos/requests/SetAnchorGiftsRequest.js +56 -0
- package/bin/retailWizard/dtos/responses/PrivateWizardSessionResponse.d.ts +29 -0
- package/bin/retailWizard/dtos/responses/PrivateWizardSessionResponse.js +2 -0
- package/bin/retailWizard/dtos/responses/SetAnchorGiftsResponse.d.ts +5 -0
- package/bin/retailWizard/dtos/responses/SetAnchorGiftsResponse.js +2 -0
- package/bin/retailWizard/enums/RetailPromotionInboundMessageTypeEnum.d.ts +5 -0
- package/bin/retailWizard/enums/RetailPromotionInboundMessageTypeEnum.js +9 -0
- package/bin/retailWizard/enums/WizardLineRoleEnum.d.ts +4 -0
- package/bin/retailWizard/enums/WizardLineRoleEnum.js +8 -0
- package/bin/retailWizard/events/RetailCommissionInboundMessage.d.ts +19 -0
- package/bin/retailWizard/events/RetailCommissionInboundMessage.js +78 -0
- package/bin/retailWizard/events/RetailPromotionInboundMessage.d.ts +40 -0
- package/bin/retailWizard/events/RetailPromotionInboundMessage.js +160 -0
- package/bin/retailWizard/events/SaleCompletedV1.d.ts +2 -3
- package/bin/retailWizard/index.d.ts +13 -0
- package/bin/retailWizard/index.js +14 -0
- package/package.json +1 -1
- package/src/common/index.ts +3 -0
- package/src/common/validators/IsStringValueRecord.ts +13 -0
- package/src/index.ts +3 -0
- package/src/messagesConnector/validators/IsStringValueRecord.ts +2 -12
- package/src/platformRbac/dtos/CreateTenantUserRequest.ts +8 -1
- package/src/platformRbac/dtos/UpdateTenantUserRequest.ts +9 -3
- package/src/retailCatalog/dtos/Product.ts +6 -0
- package/src/retailCatalog/dtos/requests/BackofficeCreateProductRequest.ts +30 -1
- package/src/retailCatalog/dtos/requests/BackofficeRegisterAdjustmentRequest.ts +6 -0
- package/src/retailCatalog/dtos/requests/BackofficeUpdateProductRequest.ts +30 -1
- package/src/retailCatalog/dtos/requests/HoldStockRequest.ts +28 -0
- package/src/retailCatalog/dtos/requests/ReserveStockRequest.ts +7 -1
- package/src/retailCatalog/dtos/requests/SuggestPiecesQuery.ts +7 -1
- package/src/retailCatalog/dtos/responses/GetInventorySkuResponse.ts +3 -0
- package/src/retailCatalog/dtos/responses/HoldStockResponse.ts +9 -0
- package/src/retailCatalog/dtos/responses/StoreCatalogItem.ts +6 -1
- package/src/retailCatalog/enums/InventoryInboundMessageTypeEnum.ts +5 -0
- package/src/retailCatalog/enums/InventoryItemStatusEnum.ts +3 -1
- package/src/retailCatalog/enums/ReservePurposeEnum.ts +4 -0
- package/src/retailCatalog/events/InventoryInboundMessage.ts +5 -0
- package/src/retailCatalog/events/InventoryReturnMessage.ts +26 -0
- package/src/retailCatalog/events/InventorySaleAppliedMessage.ts +26 -0
- package/src/retailCatalog/index.ts +9 -0
- package/src/retailPromotions/constants/bonusPreMoney.ts +19 -0
- package/src/retailPromotions/constants/retailPromotionsErrorHttpStatus.ts +21 -0
- package/src/retailPromotions/constants/salePromotionTransitions.ts +11 -0
- package/src/retailPromotions/dtos/DiscountCode.ts +36 -0
- package/src/retailPromotions/dtos/DiscountValue.ts +8 -0
- package/src/retailPromotions/dtos/LinePromotionDiscount.ts +10 -0
- package/src/retailPromotions/dtos/SalePromotion.ts +36 -0
- package/src/retailPromotions/dtos/SalePromotionLevers.ts +67 -0
- package/src/retailPromotions/dtos/SalePromotionLogEntry.ts +19 -0
- package/src/retailPromotions/dtos/requests/ChangeDiscountCodeStatusRequest.ts +15 -0
- package/src/retailPromotions/dtos/requests/ChangeSalePromotionStatusRequest.ts +15 -0
- package/src/retailPromotions/dtos/requests/CreateDiscountCodeRequest.ts +71 -0
- package/src/retailPromotions/dtos/requests/CreateSalePromotionRequest.ts +73 -0
- package/src/retailPromotions/dtos/requests/DiscountValueInput.ts +21 -0
- package/src/retailPromotions/dtos/requests/EvaluateSalePromotionsRequest.ts +16 -0
- package/src/retailPromotions/dtos/requests/HoldSalePromotionRequest.ts +32 -0
- package/src/retailPromotions/dtos/requests/ListDiscountCodesQuery.ts +33 -0
- package/src/retailPromotions/dtos/requests/ListSalePromotionLogQuery.ts +29 -0
- package/src/retailPromotions/dtos/requests/ListSalePromotionsQuery.ts +24 -0
- package/src/retailPromotions/dtos/requests/ListStoreSalePromotionsQuery.ts +10 -0
- package/src/retailPromotions/dtos/requests/SalePromotionLeversInput.ts +136 -0
- package/src/retailPromotions/dtos/requests/SalePromotionScopeInput.ts +45 -0
- package/src/retailPromotions/dtos/requests/UpdateSalePromotionRequest.ts +74 -0
- package/src/retailPromotions/dtos/responses/DiscountCodeResponses.ts +9 -0
- package/src/retailPromotions/dtos/responses/SalePromotionCrudResponses.ts +35 -0
- package/src/retailPromotions/dtos/responses/WizardSalePromotionResponses.ts +115 -0
- package/src/retailPromotions/enums/CouponScopeEnum.ts +11 -0
- package/src/retailPromotions/enums/CouponStatusEnum.ts +11 -0
- package/src/retailPromotions/enums/DiscountCodeOriginEnum.ts +8 -0
- package/src/retailPromotions/enums/DiscountCodeStatusEnum.ts +11 -0
- package/src/retailPromotions/enums/DiscountCodeTransitionEnum.ts +7 -0
- package/src/retailPromotions/enums/DiscountTypeEnum.ts +8 -0
- package/src/retailPromotions/enums/EntitlementKindEnum.ts +9 -0
- package/src/retailPromotions/enums/EntitlementStateEnum.ts +13 -0
- package/src/retailPromotions/enums/GiftModeEnum.ts +8 -0
- package/src/retailPromotions/enums/PromotionAppliesToEnum.ts +9 -0
- package/src/retailPromotions/enums/RetailPromotionsErrorCodeEnum.ts +23 -0
- package/src/retailPromotions/enums/SaleCouponAvailabilityEnum.ts +10 -0
- package/src/retailPromotions/enums/SalePromotionLeverEnum.ts +13 -0
- package/src/retailPromotions/enums/SalePromotionLogEventEnum.ts +14 -0
- package/src/retailPromotions/enums/SalePromotionLogFormatEnum.ts +5 -0
- package/src/retailPromotions/enums/SalePromotionPhaseEnum.ts +11 -0
- package/src/retailPromotions/enums/SalePromotionStatusEnum.ts +12 -0
- package/src/retailPromotions/enums/SalePromotionTransitionEnum.ts +13 -0
- package/src/retailPromotions/helpers/computeBudgetUsedBps.ts +15 -0
- package/src/retailPromotions/helpers/resolveSalePromotionTransition.ts +12 -0
- package/src/retailPromotions/index.ts +55 -0
- package/src/retailWizard/dtos/Sale.ts +8 -8
- package/src/retailWizard/dtos/SaleLine.ts +4 -1
- package/src/retailWizard/dtos/WizardFinancingPreview.ts +12 -0
- package/src/retailWizard/dtos/WizardGiftLine.ts +9 -0
- package/src/retailWizard/dtos/WizardLinePromotionFields.ts +16 -0
- package/src/retailWizard/dtos/WizardReservedLine.ts +4 -1
- package/src/retailWizard/dtos/WizardSession.ts +10 -0
- package/src/retailWizard/dtos/requests/AddProductRequest.ts +8 -1
- package/src/retailWizard/dtos/requests/ApplyLinePromotionRequest.ts +45 -0
- package/src/retailWizard/dtos/requests/ApplySalePromotionRequest.ts +24 -0
- package/src/retailWizard/dtos/requests/PinSessionPiecesRequest.ts +40 -0
- package/src/retailWizard/dtos/requests/QuoteRequest.ts +1 -1
- package/src/retailWizard/dtos/requests/SetAnchorGiftsRequest.ts +40 -0
- package/src/retailWizard/dtos/responses/PrivateWizardSessionResponse.ts +30 -0
- package/src/retailWizard/dtos/responses/SetAnchorGiftsResponse.ts +6 -0
- package/src/retailWizard/enums/RetailPromotionInboundMessageTypeEnum.ts +5 -0
- package/src/retailWizard/enums/WizardLineRoleEnum.ts +4 -0
- package/src/retailWizard/events/RetailCommissionInboundMessage.ts +54 -0
- package/src/retailWizard/events/RetailPromotionInboundMessage.ts +138 -0
- package/src/retailWizard/events/SaleCompletedV1.ts +2 -3
- package/src/retailWizard/index.ts +15 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.InventoryReturnMessage = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const InventoryInboundMessageTypeEnum_1 = require("../enums/InventoryInboundMessageTypeEnum");
|
|
15
|
+
const ReturnStockRequest_1 = require("../dtos/requests/ReturnStockRequest");
|
|
16
|
+
/** Aviso de devolución de una venta de la saga en la cola de inventario. */
|
|
17
|
+
class InventoryReturnMessage extends ReturnStockRequest_1.ReturnStockRequest {
|
|
18
|
+
}
|
|
19
|
+
exports.InventoryReturnMessage = InventoryReturnMessage;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_validator_1.Equals)(InventoryInboundMessageTypeEnum_1.InventoryInboundMessageTypeEnum.RETURN),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], InventoryReturnMessage.prototype, "type", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsString)(),
|
|
26
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], InventoryReturnMessage.prototype, "tenantId", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_validator_1.IsString)(),
|
|
31
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], InventoryReturnMessage.prototype, "storeId", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, class_validator_1.IsString)(),
|
|
36
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], InventoryReturnMessage.prototype, "sessionId", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, class_validator_1.IsISO8601)(),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], InventoryReturnMessage.prototype, "returnedAt", void 0);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InventoryInboundMessageTypeEnum } from '../enums/InventoryInboundMessageTypeEnum';
|
|
2
|
+
import { SellStockRequest } from '../dtos/requests/SellStockRequest';
|
|
3
|
+
/** Aviso de venta de la saga en la cola de inventario; el catálogo pasa las piezas HELD a SOLD. */
|
|
4
|
+
export declare class InventorySaleAppliedMessage extends SellStockRequest {
|
|
5
|
+
type: InventoryInboundMessageTypeEnum.SALE_APPLIED;
|
|
6
|
+
/** La cola es compartida entre silos; el tenant elige las tablas. */
|
|
7
|
+
tenantId: string;
|
|
8
|
+
storeId: string;
|
|
9
|
+
saleId: string;
|
|
10
|
+
/** Fecha de la venta; fecha el DAY# y el MOV#. */
|
|
11
|
+
soldAt: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.InventorySaleAppliedMessage = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const InventoryInboundMessageTypeEnum_1 = require("../enums/InventoryInboundMessageTypeEnum");
|
|
15
|
+
const SellStockRequest_1 = require("../dtos/requests/SellStockRequest");
|
|
16
|
+
/** Aviso de venta de la saga en la cola de inventario; el catálogo pasa las piezas HELD a SOLD. */
|
|
17
|
+
class InventorySaleAppliedMessage extends SellStockRequest_1.SellStockRequest {
|
|
18
|
+
}
|
|
19
|
+
exports.InventorySaleAppliedMessage = InventorySaleAppliedMessage;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_validator_1.Equals)(InventoryInboundMessageTypeEnum_1.InventoryInboundMessageTypeEnum.SALE_APPLIED),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], InventorySaleAppliedMessage.prototype, "type", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsString)(),
|
|
26
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], InventorySaleAppliedMessage.prototype, "tenantId", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_validator_1.IsString)(),
|
|
31
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], InventorySaleAppliedMessage.prototype, "storeId", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, class_validator_1.IsString)(),
|
|
36
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], InventorySaleAppliedMessage.prototype, "saleId", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, class_validator_1.IsISO8601)(),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], InventorySaleAppliedMessage.prototype, "soldAt", void 0);
|
|
@@ -74,3 +74,10 @@ export * from './dtos/requests/BackofficeCreateTransferRequest';
|
|
|
74
74
|
export * from './dtos/requests/BackofficeListTransfersQuery';
|
|
75
75
|
export * from './dtos/responses/TransferResponse';
|
|
76
76
|
export * from './dtos/responses/ListTransfersResponse';
|
|
77
|
+
export * from './enums/ReservePurposeEnum';
|
|
78
|
+
export * from './enums/InventoryInboundMessageTypeEnum';
|
|
79
|
+
export * from './dtos/requests/HoldStockRequest';
|
|
80
|
+
export * from './dtos/responses/HoldStockResponse';
|
|
81
|
+
export * from './events/InventorySaleAppliedMessage';
|
|
82
|
+
export * from './events/InventoryReturnMessage';
|
|
83
|
+
export * from './events/InventoryInboundMessage';
|
|
@@ -99,3 +99,11 @@ __exportStar(require("./dtos/requests/BackofficeCreateTransferRequest"), exports
|
|
|
99
99
|
__exportStar(require("./dtos/requests/BackofficeListTransfersQuery"), exports);
|
|
100
100
|
__exportStar(require("./dtos/responses/TransferResponse"), exports);
|
|
101
101
|
__exportStar(require("./dtos/responses/ListTransfersResponse"), exports);
|
|
102
|
+
// Venta saga (ciclo 3)
|
|
103
|
+
__exportStar(require("./enums/ReservePurposeEnum"), exports);
|
|
104
|
+
__exportStar(require("./enums/InventoryInboundMessageTypeEnum"), exports);
|
|
105
|
+
__exportStar(require("./dtos/requests/HoldStockRequest"), exports);
|
|
106
|
+
__exportStar(require("./dtos/responses/HoldStockResponse"), exports);
|
|
107
|
+
__exportStar(require("./events/InventorySaleAppliedMessage"), exports);
|
|
108
|
+
__exportStar(require("./events/InventoryReturnMessage"), exports);
|
|
109
|
+
__exportStar(require("./events/InventoryInboundMessage"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** HTTP con los que el request no llegó al handler del processor: los contesta la infraestructura. */
|
|
2
|
+
export declare const PRE_HANDLER_HTTP_STATUSES: ReadonlySet<number>;
|
|
3
|
+
/**
|
|
4
|
+
* Codes de transaction-processor que prueban que el bono NO movió saldo.
|
|
5
|
+
* Es whitelist: cualquier otro code se trata como ambiguo (`UNVERIFIED`).
|
|
6
|
+
*/
|
|
7
|
+
export declare const BONUS_PRE_MONEY_CODES: ReadonlySet<string>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BONUS_PRE_MONEY_CODES = exports.PRE_HANDLER_HTTP_STATUSES = void 0;
|
|
4
|
+
/** HTTP con los que el request no llegó al handler del processor: los contesta la infraestructura. */
|
|
5
|
+
exports.PRE_HANDLER_HTTP_STATUSES = new Set([401, 403, 404, 405]);
|
|
6
|
+
/**
|
|
7
|
+
* Codes de transaction-processor que prueban que el bono NO movió saldo.
|
|
8
|
+
* Es whitelist: cualquier otro code se trata como ambiguo (`UNVERIFIED`).
|
|
9
|
+
*/
|
|
10
|
+
exports.BONUS_PRE_MONEY_CODES = new Set([
|
|
11
|
+
'USER_NOT_ACTIVE',
|
|
12
|
+
'ACCOUNT_NOT_FOUND',
|
|
13
|
+
'ACCOUNT_BLOCKED',
|
|
14
|
+
'DOCUMENT_ID_NOT_FOUND',
|
|
15
|
+
'PRODUCT_NOT_FOUND',
|
|
16
|
+
'ACCOUNT_LEVEL_MAX_MONTHLY_AMOUNT_EXCEEDED',
|
|
17
|
+
'ACCOUNT_LEVEL_MAX_AVAILABLE_BALANCE_EXCEEDED',
|
|
18
|
+
'INVALID_REQUEST',
|
|
19
|
+
// Literal del decorador de idempotencia, no del enum del processor: por eso el Set es de string.
|
|
20
|
+
'IDEMPOTENCY_KEY_REQUIRED',
|
|
21
|
+
]);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { RetailPromotionsErrorCodeEnum as C } from '../enums/RetailPromotionsErrorCodeEnum';
|
|
2
|
+
/** Status HTTP de cada code: 404 no existe · 409 conflicto de estado · 422 regla de negocio. */
|
|
3
|
+
export declare const RETAIL_PROMOTIONS_ERROR_HTTP_STATUS: Readonly<Record<C, 404 | 409 | 422>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RETAIL_PROMOTIONS_ERROR_HTTP_STATUS = void 0;
|
|
4
|
+
const RetailPromotionsErrorCodeEnum_1 = require("../enums/RetailPromotionsErrorCodeEnum");
|
|
5
|
+
/** Status HTTP de cada code: 404 no existe · 409 conflicto de estado · 422 regla de negocio. */
|
|
6
|
+
exports.RETAIL_PROMOTIONS_ERROR_HTTP_STATUS = {
|
|
7
|
+
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.INVALID_PROMOTION_TRANSITION]: 409,
|
|
8
|
+
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.CODE_TEXT_TAKEN]: 409,
|
|
9
|
+
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.PROMOTION_NOT_ACTIVE]: 409,
|
|
10
|
+
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.PROMOTION_NOT_APPLICABLE]: 422,
|
|
11
|
+
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.CUSTOMER_NOT_IDENTIFIED]: 422,
|
|
12
|
+
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.GIFT_NOT_ALLOWED]: 422,
|
|
13
|
+
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.INSUFFICIENT_STOCK]: 409,
|
|
14
|
+
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.CODE_NOT_FOUND]: 404,
|
|
15
|
+
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.CODE_NOT_APPLICABLE]: 422,
|
|
16
|
+
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.CODE_NOT_OWNED]: 422,
|
|
17
|
+
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.CODE_NOT_ACTIVE]: 409,
|
|
18
|
+
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.CODE_EXHAUSTED]: 409,
|
|
19
|
+
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.CODE_ALREADY_APPLIED]: 409,
|
|
20
|
+
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.DISCOUNT_AFTER_QUOTE]: 409,
|
|
21
|
+
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.INVALID_SALE_PROMOTION]: 422,
|
|
22
|
+
[RetailPromotionsErrorCodeEnum_1.RetailPromotionsErrorCodeEnum.INVALID_DISCOUNT_CODE]: 422,
|
|
23
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SalePromotionStatusEnum as S } from '../enums/SalePromotionStatusEnum';
|
|
2
|
+
import { SalePromotionTransitionEnum as T } from '../enums/SalePromotionTransitionEnum';
|
|
3
|
+
/** Por cada transición: desde qué estados se permite y a cuál lleva. */
|
|
4
|
+
export declare const SALE_PROMOTION_TRANSITIONS: Readonly<Record<T, {
|
|
5
|
+
from: readonly S[];
|
|
6
|
+
to: S;
|
|
7
|
+
}>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SALE_PROMOTION_TRANSITIONS = void 0;
|
|
4
|
+
const SalePromotionStatusEnum_1 = require("../enums/SalePromotionStatusEnum");
|
|
5
|
+
const SalePromotionTransitionEnum_1 = require("../enums/SalePromotionTransitionEnum");
|
|
6
|
+
/** Por cada transición: desde qué estados se permite y a cuál lleva. */
|
|
7
|
+
exports.SALE_PROMOTION_TRANSITIONS = {
|
|
8
|
+
[SalePromotionTransitionEnum_1.SalePromotionTransitionEnum.PUBLISH]: { from: [SalePromotionStatusEnum_1.SalePromotionStatusEnum.DRAFT], to: SalePromotionStatusEnum_1.SalePromotionStatusEnum.ACTIVE },
|
|
9
|
+
[SalePromotionTransitionEnum_1.SalePromotionTransitionEnum.PAUSE]: { from: [SalePromotionStatusEnum_1.SalePromotionStatusEnum.ACTIVE], to: SalePromotionStatusEnum_1.SalePromotionStatusEnum.PAUSED },
|
|
10
|
+
[SalePromotionTransitionEnum_1.SalePromotionTransitionEnum.RESUME]: { from: [SalePromotionStatusEnum_1.SalePromotionStatusEnum.PAUSED], to: SalePromotionStatusEnum_1.SalePromotionStatusEnum.ACTIVE },
|
|
11
|
+
[SalePromotionTransitionEnum_1.SalePromotionTransitionEnum.EXPIRE]: { from: [SalePromotionStatusEnum_1.SalePromotionStatusEnum.ACTIVE, SalePromotionStatusEnum_1.SalePromotionStatusEnum.PAUSED], to: SalePromotionStatusEnum_1.SalePromotionStatusEnum.EXPIRED },
|
|
12
|
+
[SalePromotionTransitionEnum_1.SalePromotionTransitionEnum.ARCHIVE]: { from: [SalePromotionStatusEnum_1.SalePromotionStatusEnum.DRAFT, SalePromotionStatusEnum_1.SalePromotionStatusEnum.ACTIVE, SalePromotionStatusEnum_1.SalePromotionStatusEnum.PAUSED, SalePromotionStatusEnum_1.SalePromotionStatusEnum.EXPIRED], to: SalePromotionStatusEnum_1.SalePromotionStatusEnum.ARCHIVED },
|
|
13
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
* Código de descuento de Admin VL o cupón emitido por una venta (según `origin`).
|
|
9
|
+
* Los campos de cupón (`ownerCustomerId`, `issuedBySaleId`, `couponScope`) son `null` en los de Admin.
|
|
10
|
+
*/
|
|
11
|
+
export interface DiscountCode {
|
|
12
|
+
codeId: string;
|
|
13
|
+
codeText: string;
|
|
14
|
+
origin: DiscountCodeOriginEnum;
|
|
15
|
+
status: DiscountCodeStatusEnum | CouponStatusEnum;
|
|
16
|
+
discount: DiscountValue;
|
|
17
|
+
validFrom: string | null;
|
|
18
|
+
validUntil: string | null;
|
|
19
|
+
/** `null` = sin tope de usos. */
|
|
20
|
+
maxUses: number | null;
|
|
21
|
+
uses: number;
|
|
22
|
+
skus: string[] | null;
|
|
23
|
+
storeIds: string[] | null;
|
|
24
|
+
announceInStore: boolean;
|
|
25
|
+
appliesTo: PromotionAppliesToEnum;
|
|
26
|
+
ownerCustomerId: string | null;
|
|
27
|
+
issuedBySaleId: string | null;
|
|
28
|
+
issuingStoreId: string | null;
|
|
29
|
+
couponScope: CouponScopeEnum | null;
|
|
30
|
+
redeemedBySaleId: string | null;
|
|
31
|
+
createdBy: string;
|
|
32
|
+
updatedBy: string;
|
|
33
|
+
createdAt: string;
|
|
34
|
+
updatedAt: string;
|
|
35
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DiscountTypeEnum } from '../enums/DiscountTypeEnum';
|
|
2
|
+
/** Descuento en $ o %: `amountCents` si es `AMOUNT`, `percentBps` (1000 = 10%) si es `PERCENTAGE`. */
|
|
3
|
+
export interface DiscountValue {
|
|
4
|
+
type: DiscountTypeEnum;
|
|
5
|
+
amountCents: number | null;
|
|
6
|
+
percentBps: number | null;
|
|
7
|
+
}
|
|
@@ -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,35 @@
|
|
|
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
|
+
/** Promo de venta tal como la devuelve el CRUD. Dinero en centavos, fechas ISO. */
|
|
6
|
+
export interface SalePromotion {
|
|
7
|
+
promotionId: string;
|
|
8
|
+
retailerId: string;
|
|
9
|
+
name: string;
|
|
10
|
+
/** Texto que ve el cliente en el wizard. */
|
|
11
|
+
customerText: string;
|
|
12
|
+
levers: SalePromotionLevers;
|
|
13
|
+
scope: SalePromotionScope;
|
|
14
|
+
segmentation: SalePromotionSegmentation;
|
|
15
|
+
appliesTo: PromotionAppliesToEnum;
|
|
16
|
+
/** `null` = sin tope. */
|
|
17
|
+
budgetMaxCents: number | null;
|
|
18
|
+
budgetConsumedCents: number;
|
|
19
|
+
redemptionCount: number;
|
|
20
|
+
validFrom: string | null;
|
|
21
|
+
/** `null` = permanente. */
|
|
22
|
+
validUntil: string | null;
|
|
23
|
+
oncePerCustomer: boolean;
|
|
24
|
+
status: SalePromotionStatusEnum;
|
|
25
|
+
/** Derivada; `null` cuando el estado no es `ACTIVE`. */
|
|
26
|
+
phase: SalePromotionPhaseEnum | null;
|
|
27
|
+
version: number;
|
|
28
|
+
pausedAt: string | null;
|
|
29
|
+
pauseReason: string | null;
|
|
30
|
+
publishedAt: string | null;
|
|
31
|
+
createdBy: string;
|
|
32
|
+
updatedBy: string;
|
|
33
|
+
createdAt: string;
|
|
34
|
+
updatedAt: string;
|
|
35
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ProductCategoryEnum } from '../../retailCatalog/enums/ProductCategoryEnum';
|
|
2
|
+
import { ProductTierEnum } from '../../retailCatalog/enums/ProductTierEnum';
|
|
3
|
+
import { CouponScopeEnum } from '../enums/CouponScopeEnum';
|
|
4
|
+
import { GiftModeEnum } from '../enums/GiftModeEnum';
|
|
5
|
+
import { DiscountValue } from './DiscountValue';
|
|
6
|
+
/** Descuento en accesorios: % sobre los accesorios de la venta, con tope opcional en centavos. */
|
|
7
|
+
export interface AccessoryDiscountLever {
|
|
8
|
+
percentBps: number;
|
|
9
|
+
maxAmountCents: number | null;
|
|
10
|
+
}
|
|
11
|
+
/** Regalo por lista (`skus`) o por gama (`category` + `maxPriceCents`); el cliente elige `chooseCount`. */
|
|
12
|
+
export interface GiftLever {
|
|
13
|
+
mode: GiftModeEnum;
|
|
14
|
+
skus: string[] | null;
|
|
15
|
+
category: string | null;
|
|
16
|
+
maxPriceCents: number | null;
|
|
17
|
+
chooseCount: number;
|
|
18
|
+
}
|
|
19
|
+
/** Cupón que emite la venta: su descuento, días de vida y dónde vale. */
|
|
20
|
+
export interface CouponLever extends DiscountValue {
|
|
21
|
+
validityDays: number;
|
|
22
|
+
scope: CouponScopeEnum;
|
|
23
|
+
}
|
|
24
|
+
/** Tiempo aire: `rechargeCount` recargas de `rechargeAmountCents`. */
|
|
25
|
+
export interface AirtimeLever {
|
|
26
|
+
rechargeCount: number;
|
|
27
|
+
rechargeAmountCents: number;
|
|
28
|
+
}
|
|
29
|
+
/** Garantía extendida: meses extra sobre la de fábrica y su costo para el presupuesto. */
|
|
30
|
+
export interface ExtendedWarrantyLever {
|
|
31
|
+
extraMonths: number;
|
|
32
|
+
costCents: number;
|
|
33
|
+
}
|
|
34
|
+
export interface WalletBonusLever {
|
|
35
|
+
amountCents: number;
|
|
36
|
+
}
|
|
37
|
+
/** Las 7 palancas; una palanca ausente o `null` no se usa. */
|
|
38
|
+
export interface SalePromotionLevers {
|
|
39
|
+
deviceDiscount: DiscountValue | null;
|
|
40
|
+
accessoryDiscount: AccessoryDiscountLever | null;
|
|
41
|
+
gift: GiftLever | null;
|
|
42
|
+
coupon: CouponLever | null;
|
|
43
|
+
airtime: AirtimeLever | null;
|
|
44
|
+
extendedWarranty: ExtendedWarrantyLever | null;
|
|
45
|
+
walletBonus: WalletBonusLever | null;
|
|
46
|
+
}
|
|
47
|
+
/** Qué compra dispara la promo; cada lista `null` = sin restricción en esa dimensión. */
|
|
48
|
+
export interface SalePromotionScope {
|
|
49
|
+
productCategories: ProductCategoryEnum[] | null;
|
|
50
|
+
tiers: ProductTierEnum[] | null;
|
|
51
|
+
skus: string[] | null;
|
|
52
|
+
storeIds: string[] | null;
|
|
53
|
+
}
|
|
54
|
+
/** A quién va la promo: segmentos de loan-offerings y, aparte, si exige crédito SK activo. */
|
|
55
|
+
export interface SalePromotionSegmentation {
|
|
56
|
+
segmentIds: string[] | null;
|
|
57
|
+
requiresActiveSurekeepCredit: boolean;
|
|
58
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SalePromotionLogEventEnum } from '../enums/SalePromotionLogEventEnum';
|
|
2
|
+
import { SalePromotionStatusEnum } from '../enums/SalePromotionStatusEnum';
|
|
3
|
+
/** Evento del historial de una promo. */
|
|
4
|
+
export interface SalePromotionLogEntry {
|
|
5
|
+
logId: string;
|
|
6
|
+
promotionId: string;
|
|
7
|
+
promotionName: string;
|
|
8
|
+
version: number;
|
|
9
|
+
event: SalePromotionLogEventEnum;
|
|
10
|
+
fromStatus: SalePromotionStatusEnum | null;
|
|
11
|
+
toStatus: SalePromotionStatusEnum | null;
|
|
12
|
+
/** `null` = evento automático del sistema. */
|
|
13
|
+
performedByUserId: string | null;
|
|
14
|
+
/** Nombre visible del actor; «Sistema» en los automáticos. */
|
|
15
|
+
performedByName: string;
|
|
16
|
+
occurredAt: string;
|
|
17
|
+
reason: string | null;
|
|
18
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DiscountCodeTransitionEnum } from '../../enums/DiscountCodeTransitionEnum';
|
|
2
|
+
/** Body de publicChangeDiscountCodeStatus (anular un código o cupón). */
|
|
3
|
+
export declare class ChangeDiscountCodeStatusRequest {
|
|
4
|
+
transition: DiscountCodeTransitionEnum;
|
|
5
|
+
reason?: string | null;
|
|
6
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ChangeDiscountCodeStatusRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const DiscountCodeTransitionEnum_1 = require("../../enums/DiscountCodeTransitionEnum");
|
|
16
|
+
/** Body de publicChangeDiscountCodeStatus (anular un código o cupón). */
|
|
17
|
+
class ChangeDiscountCodeStatusRequest {
|
|
18
|
+
}
|
|
19
|
+
exports.ChangeDiscountCodeStatusRequest = ChangeDiscountCodeStatusRequest;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_transformer_1.Expose)(),
|
|
22
|
+
(0, class_validator_1.IsEnum)(DiscountCodeTransitionEnum_1.DiscountCodeTransitionEnum),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], ChangeDiscountCodeStatusRequest.prototype, "transition", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_transformer_1.Expose)(),
|
|
27
|
+
(0, class_validator_1.IsOptional)(),
|
|
28
|
+
(0, class_validator_1.IsString)(),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], ChangeDiscountCodeStatusRequest.prototype, "reason", void 0);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SalePromotionTransitionEnum } from '../../enums/SalePromotionTransitionEnum';
|
|
2
|
+
/** Body de publicChangeSalePromotionStatus; `reason` queda en el historial. */
|
|
3
|
+
export declare class ChangeSalePromotionStatusRequest {
|
|
4
|
+
transition: SalePromotionTransitionEnum;
|
|
5
|
+
reason?: string | null;
|
|
6
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ChangeSalePromotionStatusRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const SalePromotionTransitionEnum_1 = require("../../enums/SalePromotionTransitionEnum");
|
|
16
|
+
/** Body de publicChangeSalePromotionStatus; `reason` queda en el historial. */
|
|
17
|
+
class ChangeSalePromotionStatusRequest {
|
|
18
|
+
}
|
|
19
|
+
exports.ChangeSalePromotionStatusRequest = ChangeSalePromotionStatusRequest;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_transformer_1.Expose)(),
|
|
22
|
+
(0, class_validator_1.IsEnum)(SalePromotionTransitionEnum_1.SalePromotionTransitionEnum),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], ChangeSalePromotionStatusRequest.prototype, "transition", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_transformer_1.Expose)(),
|
|
27
|
+
(0, class_validator_1.IsOptional)(),
|
|
28
|
+
(0, class_validator_1.IsString)(),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], ChangeSalePromotionStatusRequest.prototype, "reason", void 0);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PromotionAppliesToEnum } from '../../enums/PromotionAppliesToEnum';
|
|
2
|
+
import { DiscountValueInput } from './DiscountValueInput';
|
|
3
|
+
/** Body de publicCreateDiscountCode. Que el texto sea único entre los vigentes es `CODE_TEXT_TAKEN`. */
|
|
4
|
+
export declare class CreateDiscountCodeRequest {
|
|
5
|
+
codeText: string;
|
|
6
|
+
discount: DiscountValueInput;
|
|
7
|
+
validFrom?: string | null;
|
|
8
|
+
validUntil?: string | null;
|
|
9
|
+
/** `null` = sin tope de usos. */
|
|
10
|
+
maxUses?: number | null;
|
|
11
|
+
/** Equipos donde vale; `null` = todos. */
|
|
12
|
+
skus?: string[] | null;
|
|
13
|
+
storeIds?: string[] | null;
|
|
14
|
+
announceInStore?: boolean;
|
|
15
|
+
/** Ausente = `SUREKEEP_ONLY`. */
|
|
16
|
+
appliesTo?: PromotionAppliesToEnum;
|
|
17
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CreateDiscountCodeRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const PromotionAppliesToEnum_1 = require("../../enums/PromotionAppliesToEnum");
|
|
16
|
+
const DiscountValueInput_1 = require("./DiscountValueInput");
|
|
17
|
+
/** Body de publicCreateDiscountCode. Que el texto sea único entre los vigentes es `CODE_TEXT_TAKEN`. */
|
|
18
|
+
class CreateDiscountCodeRequest {
|
|
19
|
+
}
|
|
20
|
+
exports.CreateDiscountCodeRequest = CreateDiscountCodeRequest;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, class_transformer_1.Expose)(),
|
|
23
|
+
(0, class_validator_1.IsString)(),
|
|
24
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
25
|
+
(0, class_validator_1.MaxLength)(32),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], CreateDiscountCodeRequest.prototype, "codeText", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_transformer_1.Expose)(),
|
|
30
|
+
(0, class_validator_1.IsDefined)(),
|
|
31
|
+
(0, class_validator_1.ValidateNested)(),
|
|
32
|
+
(0, class_transformer_1.Type)(() => DiscountValueInput_1.DiscountValueInput),
|
|
33
|
+
__metadata("design:type", DiscountValueInput_1.DiscountValueInput)
|
|
34
|
+
], CreateDiscountCodeRequest.prototype, "discount", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, class_transformer_1.Expose)(),
|
|
37
|
+
(0, class_validator_1.IsOptional)(),
|
|
38
|
+
(0, class_validator_1.IsISO8601)(),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], CreateDiscountCodeRequest.prototype, "validFrom", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, class_transformer_1.Expose)(),
|
|
43
|
+
(0, class_validator_1.IsOptional)(),
|
|
44
|
+
(0, class_validator_1.IsISO8601)(),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], CreateDiscountCodeRequest.prototype, "validUntil", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, class_transformer_1.Expose)(),
|
|
49
|
+
(0, class_validator_1.IsOptional)(),
|
|
50
|
+
(0, class_validator_1.IsInt)(),
|
|
51
|
+
__metadata("design:type", Number)
|
|
52
|
+
], CreateDiscountCodeRequest.prototype, "maxUses", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, class_transformer_1.Expose)(),
|
|
55
|
+
(0, class_validator_1.IsOptional)(),
|
|
56
|
+
(0, class_validator_1.IsArray)(),
|
|
57
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
58
|
+
__metadata("design:type", Array)
|
|
59
|
+
], CreateDiscountCodeRequest.prototype, "skus", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, class_transformer_1.Expose)(),
|
|
62
|
+
(0, class_validator_1.IsOptional)(),
|
|
63
|
+
(0, class_validator_1.IsArray)(),
|
|
64
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
65
|
+
__metadata("design:type", Array)
|
|
66
|
+
], CreateDiscountCodeRequest.prototype, "storeIds", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, class_transformer_1.Expose)(),
|
|
69
|
+
(0, class_validator_1.IsOptional)(),
|
|
70
|
+
(0, class_validator_1.IsBoolean)(),
|
|
71
|
+
__metadata("design:type", Boolean)
|
|
72
|
+
], CreateDiscountCodeRequest.prototype, "announceInStore", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, class_transformer_1.Expose)(),
|
|
75
|
+
(0, class_validator_1.IsOptional)(),
|
|
76
|
+
(0, class_validator_1.IsEnum)(PromotionAppliesToEnum_1.PromotionAppliesToEnum),
|
|
77
|
+
__metadata("design:type", String)
|
|
78
|
+
], CreateDiscountCodeRequest.prototype, "appliesTo", void 0);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PromotionAppliesToEnum } from '../../enums/PromotionAppliesToEnum';
|
|
2
|
+
import { SalePromotionLeversInput } from './SalePromotionLeversInput';
|
|
3
|
+
import { SalePromotionScopeInput, SalePromotionSegmentationInput } from './SalePromotionScopeInput';
|
|
4
|
+
/** Body de publicCreateSalePromotion. Nace en `DRAFT`; el retailer sale del token. */
|
|
5
|
+
export declare class CreateSalePromotionRequest {
|
|
6
|
+
name: string;
|
|
7
|
+
customerText: string;
|
|
8
|
+
levers: SalePromotionLeversInput;
|
|
9
|
+
scope?: SalePromotionScopeInput | null;
|
|
10
|
+
segmentation?: SalePromotionSegmentationInput | null;
|
|
11
|
+
/** Ausente = `SUREKEEP_ONLY`. */
|
|
12
|
+
appliesTo?: PromotionAppliesToEnum;
|
|
13
|
+
/** `null` = sin tope. */
|
|
14
|
+
budgetMaxCents?: number | null;
|
|
15
|
+
validFrom?: string | null;
|
|
16
|
+
/** `null` = permanente. */
|
|
17
|
+
validUntil?: string | null;
|
|
18
|
+
oncePerCustomer?: boolean;
|
|
19
|
+
}
|