@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,9 @@
|
|
|
1
|
+
import { DiscountCode } from '../DiscountCode';
|
|
2
|
+
|
|
3
|
+
export type CreateDiscountCodeResponse = DiscountCode;
|
|
4
|
+
export type ChangeDiscountCodeStatusResponse = DiscountCode;
|
|
5
|
+
|
|
6
|
+
export interface ListDiscountCodesResponse {
|
|
7
|
+
items: DiscountCode[];
|
|
8
|
+
nextToken: string | null;
|
|
9
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { SalePromotion } from '../SalePromotion';
|
|
2
|
+
import { SalePromotionLogEntry } from '../SalePromotionLogEntry';
|
|
3
|
+
|
|
4
|
+
export type CreateSalePromotionResponse = SalePromotion;
|
|
5
|
+
export type GetSalePromotionResponse = SalePromotion;
|
|
6
|
+
export type UpdateSalePromotionResponse = SalePromotion;
|
|
7
|
+
export type ChangeSalePromotionStatusResponse = SalePromotion;
|
|
8
|
+
|
|
9
|
+
/** Fila del listado de Admin VL: la promo más sus canjes de los últimos 30 días. */
|
|
10
|
+
export interface SalePromotionListItem extends SalePromotion {
|
|
11
|
+
redemptionsLast30Days: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** KPIs de la cabecera de «Promos venta». */
|
|
15
|
+
export interface SalePromotionKpis {
|
|
16
|
+
activeCount: number;
|
|
17
|
+
expiringIn7DaysCount: number;
|
|
18
|
+
scheduledCount: number;
|
|
19
|
+
pausedCount: number;
|
|
20
|
+
redemptionsLast30Days: number;
|
|
21
|
+
/** Presupuesto consumido sobre el tope, en puntos base, de las promos con tope (`computeBudgetUsedBps`); `null` si ninguna tiene. */
|
|
22
|
+
budgetUsedBps: number | null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface ListSalePromotionsResponse {
|
|
26
|
+
items: SalePromotionListItem[];
|
|
27
|
+
kpis: SalePromotionKpis;
|
|
28
|
+
nextToken: string | null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Página JSON del historial; con `format=CSV` el endpoint responde `text/csv`. */
|
|
32
|
+
export interface ListSalePromotionLogResponse {
|
|
33
|
+
items: SalePromotionLogEntry[];
|
|
34
|
+
nextToken: string | null;
|
|
35
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { CouponScopeEnum } from '../../enums/CouponScopeEnum';
|
|
2
|
+
import { CouponStatusEnum } from '../../enums/CouponStatusEnum';
|
|
3
|
+
import { EntitlementKindEnum } from '../../enums/EntitlementKindEnum';
|
|
4
|
+
import { EntitlementStateEnum } from '../../enums/EntitlementStateEnum';
|
|
5
|
+
import { RetailPromotionsErrorCodeEnum } from '../../enums/RetailPromotionsErrorCodeEnum';
|
|
6
|
+
import { SaleCouponAvailabilityEnum } from '../../enums/SaleCouponAvailabilityEnum';
|
|
7
|
+
import { SalePromotionLeverEnum } from '../../enums/SalePromotionLeverEnum';
|
|
8
|
+
import { DiscountValue } from '../DiscountValue';
|
|
9
|
+
import { LinePromotionDiscount } from '../LinePromotionDiscount';
|
|
10
|
+
import { SalePromotionLevers, SalePromotionScope } from '../SalePromotionLevers';
|
|
11
|
+
|
|
12
|
+
/** Promo vigente en la tienda de la sesión, para los chips de «Elige el teléfono». */
|
|
13
|
+
export interface StoreSalePromotionItem {
|
|
14
|
+
promotionId: string;
|
|
15
|
+
version: number;
|
|
16
|
+
name: string;
|
|
17
|
+
customerText: string;
|
|
18
|
+
levers: SalePromotionLevers;
|
|
19
|
+
/** Para cruzar con cada equipo; todo `null` = fila «Toda la tienda». */
|
|
20
|
+
scope: SalePromotionScope;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface ListStoreSalePromotionsResponse {
|
|
24
|
+
items: StoreSalePromotionItem[];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Opción de regalo con su existencia en la tienda; sin existencia se muestra en gris. */
|
|
28
|
+
export interface GiftOption {
|
|
29
|
+
sku: string;
|
|
30
|
+
name: string;
|
|
31
|
+
listPriceCents: number;
|
|
32
|
+
inStock: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Lo que se entrega al cerrar («Después en la venta»). `quantity`: recargas o meses de garantía. */
|
|
36
|
+
export interface AfterSaleBenefit {
|
|
37
|
+
lever: SalePromotionLeverEnum;
|
|
38
|
+
amountCents: number | null;
|
|
39
|
+
quantity: number | null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Promo que aplica a la sesión, con el desglose que tendría al apartarla. */
|
|
43
|
+
export interface EvaluatedSalePromotion {
|
|
44
|
+
promotionId: string;
|
|
45
|
+
version: number;
|
|
46
|
+
name: string;
|
|
47
|
+
customerText: string;
|
|
48
|
+
levers: SalePromotionLeverEnum[];
|
|
49
|
+
lines: LinePromotionDiscount[];
|
|
50
|
+
totalDiscountCents: number;
|
|
51
|
+
giftOptions: GiftOption[];
|
|
52
|
+
giftChooseCount: number | null;
|
|
53
|
+
afterSale: AfterSaleBenefit[];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Resultado del código tecleado: si no aplica, `rejectionCode` dice por qué. */
|
|
57
|
+
export interface EvaluatedDiscountCode {
|
|
58
|
+
codeText: string;
|
|
59
|
+
applicable: boolean;
|
|
60
|
+
rejectionCode: RetailPromotionsErrorCodeEnum | null;
|
|
61
|
+
lines: LinePromotionDiscount[];
|
|
62
|
+
totalDiscountCents: number;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface EvaluateSalePromotionsResponse {
|
|
66
|
+
promotions: EvaluatedSalePromotion[];
|
|
67
|
+
discountCode: EvaluatedDiscountCode | null;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Lo que quedó apartado y escrito en la sesión. */
|
|
71
|
+
export interface HoldSalePromotionResponse {
|
|
72
|
+
sessionId: string;
|
|
73
|
+
promotionId: string | null;
|
|
74
|
+
promotionVersion: number | null;
|
|
75
|
+
discountCode: string | null;
|
|
76
|
+
giftSkus: string[];
|
|
77
|
+
lines: LinePromotionDiscount[];
|
|
78
|
+
totalDiscountCents: number;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** `released: false` = no había apartado; soltar es idempotente. */
|
|
82
|
+
export interface ReleaseSalePromotionResponse {
|
|
83
|
+
sessionId: string;
|
|
84
|
+
released: boolean;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** Respuesta del privado que llama el wizard al cancelar la sesión o la venta. */
|
|
88
|
+
export interface PrivateReleaseSalePromotionResponse {
|
|
89
|
+
sessionId: string;
|
|
90
|
+
released: boolean;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface SaleCoupon {
|
|
94
|
+
codeText: string;
|
|
95
|
+
discount: DiscountValue;
|
|
96
|
+
validUntil: string;
|
|
97
|
+
scope: CouponScopeEnum;
|
|
98
|
+
status: CouponStatusEnum;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** Entrega posterior a la venta. `quantity`: recargas o meses de garantía. */
|
|
102
|
+
export interface SaleEntitlement {
|
|
103
|
+
kind: EntitlementKindEnum;
|
|
104
|
+
state: EntitlementStateEnum;
|
|
105
|
+
amountCents: number | null;
|
|
106
|
+
quantity: number | null;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** Cupón y «lo que se lleva» de una venta cerrada (publicGetSaleCoupon). */
|
|
110
|
+
export interface GetSaleCouponResponse {
|
|
111
|
+
saleId: string;
|
|
112
|
+
availability: SaleCouponAvailabilityEnum;
|
|
113
|
+
coupon: SaleCoupon | null;
|
|
114
|
+
entitlements: SaleEntitlement[];
|
|
115
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dónde vale el cupón que emite la venta.
|
|
3
|
+
* @enum {string}
|
|
4
|
+
*/
|
|
5
|
+
export enum CouponScopeEnum {
|
|
6
|
+
/** Toda la cadena del retailer. */
|
|
7
|
+
CHAIN = 'CHAIN',
|
|
8
|
+
ISSUING_STORE = 'ISSUING_STORE',
|
|
9
|
+
/** Las tiendas del alcance de la promo que lo emitió. */
|
|
10
|
+
PROMOTION_STORES = 'PROMOTION_STORES',
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Estado del cupón emitido por una venta. `USED` puede volver a `ACTIVE` o `EXPIRED` si se
|
|
3
|
+
* cancela la venta donde se canjeó.
|
|
4
|
+
* @enum {string}
|
|
5
|
+
*/
|
|
6
|
+
export enum CouponStatusEnum {
|
|
7
|
+
ACTIVE = 'ACTIVE',
|
|
8
|
+
USED = 'USED',
|
|
9
|
+
EXPIRED = 'EXPIRED',
|
|
10
|
+
VOIDED = 'VOIDED',
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Estado de una entrega posterior a la venta (Wallet, garantía, tiempo aire).
|
|
3
|
+
* @enum {string}
|
|
4
|
+
*/
|
|
5
|
+
export enum EntitlementStateEnum {
|
|
6
|
+
PENDING = 'PENDING',
|
|
7
|
+
/** Reclamada con lease; hay una llamada al processor en curso. */
|
|
8
|
+
IN_FLIGHT = 'IN_FLIGHT',
|
|
9
|
+
SETTLED = 'SETTLED',
|
|
10
|
+
/** No se sabe si movió dinero: se concilia a mano, sin reintento. */
|
|
11
|
+
UNVERIFIED = 'UNVERIFIED',
|
|
12
|
+
VOID = 'VOID',
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Con qué financiera aplica una promo o un código. Sin valor, el lambda asume `SUREKEEP_ONLY`.
|
|
3
|
+
* @enum {string}
|
|
4
|
+
*/
|
|
5
|
+
export enum PromotionAppliesToEnum {
|
|
6
|
+
SUREKEEP_ONLY = 'SUREKEEP_ONLY',
|
|
7
|
+
/** También cuando el teléfono se deriva a otra financiera y la venta cuenta como contado. */
|
|
8
|
+
ANY_FINANCIER = 'ANY_FINANCIER',
|
|
9
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codes de error de retail-promotions-business; el status de cada uno está en
|
|
3
|
+
* `RETAIL_PROMOTIONS_ERROR_HTTP_STATUS`. Las clases `DomainError` viven en el lambda.
|
|
4
|
+
* @enum {string}
|
|
5
|
+
*/
|
|
6
|
+
export enum RetailPromotionsErrorCodeEnum {
|
|
7
|
+
INVALID_PROMOTION_TRANSITION = 'INVALID_PROMOTION_TRANSITION',
|
|
8
|
+
CODE_TEXT_TAKEN = 'CODE_TEXT_TAKEN',
|
|
9
|
+
PROMOTION_NOT_ACTIVE = 'PROMOTION_NOT_ACTIVE',
|
|
10
|
+
PROMOTION_NOT_APPLICABLE = 'PROMOTION_NOT_APPLICABLE',
|
|
11
|
+
CUSTOMER_NOT_IDENTIFIED = 'CUSTOMER_NOT_IDENTIFIED',
|
|
12
|
+
GIFT_NOT_ALLOWED = 'GIFT_NOT_ALLOWED',
|
|
13
|
+
INSUFFICIENT_STOCK = 'INSUFFICIENT_STOCK',
|
|
14
|
+
CODE_NOT_FOUND = 'CODE_NOT_FOUND',
|
|
15
|
+
CODE_NOT_APPLICABLE = 'CODE_NOT_APPLICABLE',
|
|
16
|
+
CODE_NOT_OWNED = 'CODE_NOT_OWNED',
|
|
17
|
+
CODE_NOT_ACTIVE = 'CODE_NOT_ACTIVE',
|
|
18
|
+
CODE_EXHAUSTED = 'CODE_EXHAUSTED',
|
|
19
|
+
CODE_ALREADY_APPLIED = 'CODE_ALREADY_APPLIED',
|
|
20
|
+
DISCOUNT_AFTER_QUOTE = 'DISCOUNT_AFTER_QUOTE',
|
|
21
|
+
INVALID_SALE_PROMOTION = 'INVALID_SALE_PROMOTION',
|
|
22
|
+
INVALID_DISCOUNT_CODE = 'INVALID_DISCOUNT_CODE',
|
|
23
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Las 7 palancas combinables de una promo de venta.
|
|
3
|
+
* @enum {string}
|
|
4
|
+
*/
|
|
5
|
+
export enum SalePromotionLeverEnum {
|
|
6
|
+
DEVICE_DISCOUNT = 'DEVICE_DISCOUNT',
|
|
7
|
+
ACCESSORY_DISCOUNT = 'ACCESSORY_DISCOUNT',
|
|
8
|
+
GIFT = 'GIFT',
|
|
9
|
+
COUPON = 'COUPON',
|
|
10
|
+
AIRTIME = 'AIRTIME',
|
|
11
|
+
EXTENDED_WARRANTY = 'EXTENDED_WARRANTY',
|
|
12
|
+
WALLET_BONUS = 'WALLET_BONUS',
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Evento del historial de promos de venta. Los automáticos (autopausa, reanudación, vencimiento)
|
|
3
|
+
* usan el mismo evento con autor `system`.
|
|
4
|
+
* @enum {string}
|
|
5
|
+
*/
|
|
6
|
+
export enum SalePromotionLogEventEnum {
|
|
7
|
+
CREATE = 'CREATE',
|
|
8
|
+
UPDATE = 'UPDATE',
|
|
9
|
+
PUBLISH = 'PUBLISH',
|
|
10
|
+
PAUSE = 'PAUSE',
|
|
11
|
+
RESUME = 'RESUME',
|
|
12
|
+
EXPIRE = 'EXPIRE',
|
|
13
|
+
ARCHIVE = 'ARCHIVE',
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fase derivada de la vigencia (hora CDMX) de una promo `ACTIVE`; no se persiste.
|
|
3
|
+
* @enum {string}
|
|
4
|
+
*/
|
|
5
|
+
export enum SalePromotionPhaseEnum {
|
|
6
|
+
/** Activa con inicio futuro. */
|
|
7
|
+
SCHEDULED = 'SCHEDULED',
|
|
8
|
+
LIVE = 'LIVE',
|
|
9
|
+
/** Vigente y termina en los próximos 7 días. */
|
|
10
|
+
EXPIRING_SOON = 'EXPIRING_SOON',
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Estado persistido de una promo de venta. Programada, permanente y vencida-por-fecha se derivan
|
|
3
|
+
* de la vigencia; `ARCHIVED` la oculta del listado salvo en el filtro «Archivadas».
|
|
4
|
+
* @enum {string}
|
|
5
|
+
*/
|
|
6
|
+
export enum SalePromotionStatusEnum {
|
|
7
|
+
DRAFT = 'DRAFT',
|
|
8
|
+
ACTIVE = 'ACTIVE',
|
|
9
|
+
PAUSED = 'PAUSED',
|
|
10
|
+
EXPIRED = 'EXPIRED',
|
|
11
|
+
ARCHIVED = 'ARCHIVED',
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Acción que pide Admin VL sobre una promo de venta. El destino lo resuelve
|
|
3
|
+
* `resolveSalePromotionTransition`; una transición no permitida es `INVALID_PROMOTION_TRANSITION`.
|
|
4
|
+
* @enum {string}
|
|
5
|
+
*/
|
|
6
|
+
export enum SalePromotionTransitionEnum {
|
|
7
|
+
PUBLISH = 'PUBLISH',
|
|
8
|
+
PAUSE = 'PAUSE',
|
|
9
|
+
RESUME = 'RESUME',
|
|
10
|
+
/** Fin ahora. Que no aplique a una promo permanente lo valida el lambda. */
|
|
11
|
+
EXPIRE = 'EXPIRE',
|
|
12
|
+
ARCHIVE = 'ARCHIVE',
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SalePromotion } from '../dtos/SalePromotion';
|
|
2
|
+
|
|
3
|
+
/** % de presupuesto consumido en puntos base sobre las promos con tope; `null` si ninguna tiene tope. */
|
|
4
|
+
export function computeBudgetUsedBps(
|
|
5
|
+
promotions: Pick<SalePromotion, 'budgetMaxCents' | 'budgetConsumedCents'>[],
|
|
6
|
+
): number | null {
|
|
7
|
+
let maxCents = 0;
|
|
8
|
+
let consumedCents = 0;
|
|
9
|
+
for (const { budgetMaxCents, budgetConsumedCents } of promotions) {
|
|
10
|
+
if (budgetMaxCents === null) continue;
|
|
11
|
+
maxCents += budgetMaxCents;
|
|
12
|
+
consumedCents += budgetConsumedCents;
|
|
13
|
+
}
|
|
14
|
+
return maxCents > 0 ? Math.floor((consumedCents * 10000) / maxCents) : null;
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SALE_PROMOTION_TRANSITIONS } from '../constants/salePromotionTransitions';
|
|
2
|
+
import { SalePromotionStatusEnum } from '../enums/SalePromotionStatusEnum';
|
|
3
|
+
import { SalePromotionTransitionEnum } from '../enums/SalePromotionTransitionEnum';
|
|
4
|
+
|
|
5
|
+
/** Estado destino de aplicar la transición, o `null` si no se permite desde `from`. */
|
|
6
|
+
export function resolveSalePromotionTransition(
|
|
7
|
+
from: SalePromotionStatusEnum,
|
|
8
|
+
transition: SalePromotionTransitionEnum,
|
|
9
|
+
): SalePromotionStatusEnum | null {
|
|
10
|
+
const rule = SALE_PROMOTION_TRANSITIONS[transition];
|
|
11
|
+
return rule.from.includes(from) ? rule.to : null;
|
|
12
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Enums
|
|
2
|
+
export * from './enums/SalePromotionStatusEnum';
|
|
3
|
+
export * from './enums/SalePromotionTransitionEnum';
|
|
4
|
+
export * from './enums/SalePromotionPhaseEnum';
|
|
5
|
+
export * from './enums/SalePromotionLeverEnum';
|
|
6
|
+
export * from './enums/SalePromotionLogEventEnum';
|
|
7
|
+
export * from './enums/SalePromotionLogFormatEnum';
|
|
8
|
+
export * from './enums/DiscountTypeEnum';
|
|
9
|
+
export * from './enums/GiftModeEnum';
|
|
10
|
+
export * from './enums/PromotionAppliesToEnum';
|
|
11
|
+
export * from './enums/CouponScopeEnum';
|
|
12
|
+
export * from './enums/CouponStatusEnum';
|
|
13
|
+
export * from './enums/DiscountCodeStatusEnum';
|
|
14
|
+
export * from './enums/DiscountCodeOriginEnum';
|
|
15
|
+
export * from './enums/DiscountCodeTransitionEnum';
|
|
16
|
+
export * from './enums/EntitlementStateEnum';
|
|
17
|
+
export * from './enums/EntitlementKindEnum';
|
|
18
|
+
export * from './enums/SaleCouponAvailabilityEnum';
|
|
19
|
+
export * from './enums/RetailPromotionsErrorCodeEnum';
|
|
20
|
+
|
|
21
|
+
// Constantes y helpers puros
|
|
22
|
+
export * from './constants/retailPromotionsErrorHttpStatus';
|
|
23
|
+
export * from './constants/salePromotionTransitions';
|
|
24
|
+
export * from './constants/bonusPreMoney';
|
|
25
|
+
export * from './helpers/resolveSalePromotionTransition';
|
|
26
|
+
export * from './helpers/computeBudgetUsedBps';
|
|
27
|
+
|
|
28
|
+
// Entidades del dominio
|
|
29
|
+
export * from './dtos/DiscountValue';
|
|
30
|
+
export * from './dtos/SalePromotionLevers';
|
|
31
|
+
export * from './dtos/SalePromotion';
|
|
32
|
+
export * from './dtos/SalePromotionLogEntry';
|
|
33
|
+
export * from './dtos/DiscountCode';
|
|
34
|
+
export * from './dtos/LinePromotionDiscount';
|
|
35
|
+
|
|
36
|
+
// Request DTOs
|
|
37
|
+
export * from './dtos/requests/DiscountValueInput';
|
|
38
|
+
export * from './dtos/requests/SalePromotionLeversInput';
|
|
39
|
+
export * from './dtos/requests/SalePromotionScopeInput';
|
|
40
|
+
export * from './dtos/requests/CreateSalePromotionRequest';
|
|
41
|
+
export * from './dtos/requests/UpdateSalePromotionRequest';
|
|
42
|
+
export * from './dtos/requests/ChangeSalePromotionStatusRequest';
|
|
43
|
+
export * from './dtos/requests/ListSalePromotionsQuery';
|
|
44
|
+
export * from './dtos/requests/ListSalePromotionLogQuery';
|
|
45
|
+
export * from './dtos/requests/CreateDiscountCodeRequest';
|
|
46
|
+
export * from './dtos/requests/ListDiscountCodesQuery';
|
|
47
|
+
export * from './dtos/requests/ChangeDiscountCodeStatusRequest';
|
|
48
|
+
export * from './dtos/requests/ListStoreSalePromotionsQuery';
|
|
49
|
+
export * from './dtos/requests/EvaluateSalePromotionsRequest';
|
|
50
|
+
export * from './dtos/requests/HoldSalePromotionRequest';
|
|
51
|
+
|
|
52
|
+
// Response DTOs
|
|
53
|
+
export * from './dtos/responses/SalePromotionCrudResponses';
|
|
54
|
+
export * from './dtos/responses/DiscountCodeResponses';
|
|
55
|
+
export * from './dtos/responses/WizardSalePromotionResponses';
|
|
@@ -27,18 +27,18 @@ export interface Sale {
|
|
|
27
27
|
skus?: string[];
|
|
28
28
|
/** La cancelación aún no confirma la devolución al inventario. */
|
|
29
29
|
inventoryReturnPending?: boolean;
|
|
30
|
+
/** Venta de la saga: el inventario se aplica y se devuelve por la cola, no por HTTP. */
|
|
31
|
+
inventoryViaQueue?: boolean;
|
|
32
|
+
/** Promo de venta congelada al cerrar; `null` = ninguna. */
|
|
33
|
+
salePromotionId?: string | null;
|
|
34
|
+
salePromotionVersion?: number | null;
|
|
30
35
|
/** IMEI consumido del silo también en contado (local-first); null en EXTERNAL_REFERRAL (D15). */
|
|
31
36
|
imei: string | null;
|
|
32
|
-
/**
|
|
33
|
-
* Lo COBRADO en caja al cerrar. En contado == precio del equipo (lo garantiza `registerPayment`);
|
|
34
|
-
* en crédito es SOLO el enganche. ⚠️ Su significado es contrato de `SaleCompletedV1` (La Central,
|
|
35
|
-
* comisión F4): no redefinir — el precio del equipo viaja aparte en `equipmentPriceCents`. 0 en
|
|
36
|
-
* EXTERNAL_REFERRAL.
|
|
37
|
-
*/
|
|
37
|
+
/** Lo cobrado en caja al cerrar: enganche + lo no financiado; 0 en EXTERNAL_REFERRAL. Contrato de `SaleCompletedV1`. */
|
|
38
38
|
amountCents: number;
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
41
|
-
* `
|
|
40
|
+
* Ancla neta al cerrar (precio − discountCents de la ancla); base de comisión.
|
|
41
|
+
* `null` en ventas anteriores al campo.
|
|
42
42
|
*/
|
|
43
43
|
equipmentPriceCents: number | null;
|
|
44
44
|
/** Enganche cobrado (solo ventas CREDIT; `null` en contado/externa). */
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { SoldLineComponent } from '../../retailCatalog/dtos/responses/SellStockResponse';
|
|
2
2
|
import type { LinePaymentTypeEnum } from '../enums/LinePaymentTypeEnum';
|
|
3
3
|
import type { WizardLineProduct } from './WizardLineProduct';
|
|
4
|
+
import type { WizardLinePromotionFields } from './WizardLinePromotionFields';
|
|
4
5
|
|
|
5
6
|
/** Línea de una venta cerrada; un producto suelto es un solo componente. */
|
|
6
|
-
export interface SaleLine {
|
|
7
|
+
export interface SaleLine extends WizardLinePromotionFields {
|
|
7
8
|
lineId: string;
|
|
8
9
|
sku: string;
|
|
9
10
|
qty: number;
|
|
@@ -12,6 +13,8 @@ export interface SaleLine {
|
|
|
12
13
|
/** Llave del registro PRICE# del que salió el precio. */
|
|
13
14
|
priceSk: string;
|
|
14
15
|
paymentType: LinePaymentTypeEnum;
|
|
16
|
+
/** Parte financiada de la línea, congelada en la venta. */
|
|
17
|
+
financedCents?: number;
|
|
15
18
|
components: SoldLineComponent[];
|
|
16
19
|
product?: WizardLineProduct | null;
|
|
17
20
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Parte financiada de una línea en el reparto provisional. */
|
|
2
|
+
export interface WizardFinancingPreviewLine {
|
|
3
|
+
lineId: string;
|
|
4
|
+
financedCents: number;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/** Reparto provisional de la sesión; se calcula al leer y no se persiste. */
|
|
8
|
+
export interface WizardFinancingPreview {
|
|
9
|
+
/** Tope de extras financiables: floor(30% × ancla neta). */
|
|
10
|
+
capCents: number;
|
|
11
|
+
lines: WizardFinancingPreviewLine[];
|
|
12
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WizardLineRoleEnum } from '../enums/WizardLineRoleEnum';
|
|
2
|
+
import type { WizardReservedLine } from './WizardReservedLine';
|
|
3
|
+
|
|
4
|
+
/** Línea GIFT: siempre ligada a un ancla y con el precio de lista que se regala. */
|
|
5
|
+
export type WizardGiftLine = WizardReservedLine & {
|
|
6
|
+
role: WizardLineRoleEnum.GIFT;
|
|
7
|
+
linkedLineId: string;
|
|
8
|
+
originalPriceCents: number;
|
|
9
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { WizardLineRoleEnum } from '../enums/WizardLineRoleEnum';
|
|
2
|
+
|
|
3
|
+
/** Campos de Promociones en la línea de sesión y de venta; solo los escribe su endpoint M2M. */
|
|
4
|
+
export interface WizardLinePromotionFields {
|
|
5
|
+
role?: WizardLineRoleEnum;
|
|
6
|
+
promotionId?: string;
|
|
7
|
+
promotionVersion?: number;
|
|
8
|
+
/** Línea ancla a la que va ligado el regalo. */
|
|
9
|
+
linkedLineId?: string;
|
|
10
|
+
/** Solo en la línea ancla. */
|
|
11
|
+
discountCode?: string;
|
|
12
|
+
/** Descuento total de la línea; neto = basePriceCents × qty − discountCents. */
|
|
13
|
+
discountCents?: number;
|
|
14
|
+
/** Precio antes del descuento; en un regalo, el valor de lista con la línea a $0. */
|
|
15
|
+
originalPriceCents?: number;
|
|
16
|
+
}
|
|
@@ -4,9 +4,10 @@ import type { LinePaymentTypeEnum } from '../enums/LinePaymentTypeEnum';
|
|
|
4
4
|
import type { WizardLineStatusEnum } from '../enums/WizardLineStatusEnum';
|
|
5
5
|
import type { WizardLineIdentifiers } from './WizardLineIdentifiers';
|
|
6
6
|
import type { WizardLineProduct } from './WizardLineProduct';
|
|
7
|
+
import type { WizardLinePromotionFields } from './WizardLinePromotionFields';
|
|
7
8
|
|
|
8
9
|
/** Línea de la venta en curso; los campos de precio son `null` mientras la línea está PENDING. */
|
|
9
|
-
export interface WizardReservedLine {
|
|
10
|
+
export interface WizardReservedLine extends WizardLinePromotionFields {
|
|
10
11
|
lineId: string;
|
|
11
12
|
sku: string;
|
|
12
13
|
qty: number;
|
|
@@ -27,6 +28,8 @@ export interface WizardReservedLine {
|
|
|
27
28
|
paymentType: LinePaymentTypeEnum | null;
|
|
28
29
|
/** Ítems que la línea suma al tope de 100 de la venta. */
|
|
29
30
|
sellItemCost: number | null;
|
|
31
|
+
/** Parte financiada de la línea; se escribe al cotizar y se congela con el crédito. */
|
|
32
|
+
financedCents?: number;
|
|
30
33
|
mdmEnabled?: boolean;
|
|
31
34
|
mdmProvider?: MdmProviderEnum | null;
|
|
32
35
|
/** Solo si la línea es un kit. */
|
|
@@ -6,6 +6,7 @@ import type { ExternalProviderEnum } from '../enums/ExternalProviderEnum';
|
|
|
6
6
|
import type { OccupationEnum } from '../enums/OccupationEnum';
|
|
7
7
|
import type { WizardBlockedSummary } from './WizardBlocked';
|
|
8
8
|
import type { WizardConsents } from './WizardConsents';
|
|
9
|
+
import type { WizardFinancingPreview } from './WizardFinancingPreview';
|
|
9
10
|
import type { WizardLoan } from './WizardLoan';
|
|
10
11
|
import type { WizardPayment } from './WizardPayment';
|
|
11
12
|
import type { WizardProduct } from './WizardProduct';
|
|
@@ -117,6 +118,15 @@ export interface WizardSession {
|
|
|
117
118
|
reservedLines?: WizardReservedLine[];
|
|
118
119
|
/** Línea elegida para financiar; `null` si la venta es de contado o aún no se elige. */
|
|
119
120
|
financedLineId?: string | null;
|
|
121
|
+
/** Reparto provisional mientras haya líneas; se calcula al leer, no se persiste. */
|
|
122
|
+
financingPreview?: WizardFinancingPreview | null;
|
|
123
|
+
/** Marca de la saga: todas las piezas rastreadas de las líneas vivas quedaron HELD. */
|
|
124
|
+
piecesHeldAt?: string | null;
|
|
125
|
+
/** Promo de venta que fijó Promociones; `null` = ninguna. */
|
|
126
|
+
salePromotionId?: string | null;
|
|
127
|
+
salePromotionVersion?: number | null;
|
|
128
|
+
/** Enganche cobrado que queda por reembolsar tras cancelar. */
|
|
129
|
+
refundPendingCents?: number;
|
|
120
130
|
paymentMethod: PaymentMethodEnum | null;
|
|
121
131
|
externalProvider: ExternalProviderEnum | null;
|
|
122
132
|
/** Folio de cobro server-side (D11), idempotente, sobrevive al volver atrás. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Expose } from 'class-transformer';
|
|
2
|
-
import { IsInt, IsOptional, IsString, Min } from 'class-validator';
|
|
2
|
+
import { IsInt, IsOptional, IsString, Min, MinLength } from 'class-validator';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* POST /wizard/sessions/:id/product — agrega una línea a la venta y reserva sus piezas en el catálogo.
|
|
@@ -27,4 +27,11 @@ export class AddProductRequest {
|
|
|
27
27
|
@IsInt()
|
|
28
28
|
@Min(1)
|
|
29
29
|
qty?: number;
|
|
30
|
+
|
|
31
|
+
/** Línea viva que este kit reemplaza («Cambiar por el kit»). */
|
|
32
|
+
@Expose()
|
|
33
|
+
@IsOptional()
|
|
34
|
+
@IsString()
|
|
35
|
+
@MinLength(1)
|
|
36
|
+
replacesLineId?: string;
|
|
30
37
|
}
|