Class DefaultPriceCalculateToOrderMapper
java.lang.Object
com.sap.retail.sapppspricing.opps.PPSClientBeanAccessorImpl
com.sap.retail.sapppspricing.impl.DefaultPPSClientBeanAccessor
com.sap.retail.sapppspricing.impl.DefaultPriceCalculateToOrderMapper
- All Implemented Interfaces:
PPSClientBeanAccessor,PriceCalculateToOrderMapper,org.springframework.core.Ordered
public class DefaultPriceCalculateToOrderMapper
extends DefaultPPSClientBeanAccessor
implements PriceCalculateToOrderMapper
Helper class mapping the result of a PPS call back to the Commerce order
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringcodeForDiscount(List<LineItemDomainSpecific> lineItems, RetailPriceModifierDomainSpecific priceModifier, String defaultPrefix) protected StringcodeForItemDiscount(List<LineItemDomainSpecific> lineItems, RetailPriceModifierDomainSpecific priceModifier, AbstractOrderModel order) This method determine the ERP conditionType out of the PriceDerivationRule->PromotionPriceDerivationRuleTypeCode.protected booleancontainsInvalidCoupons(List<LineItemDomainSpecific> lineItems, AbstractOrderModel order) protected List<de.hybris.platform.util.DiscountValue>convertToEntryDiscounts(List<LineItemDomainSpecific> lineItems, SaleBase item, AbstractOrderModel order) protected OrderPromotionModelDeprecated, for removal: This API element is subject to removal in a future version.since 2211.FP4.protected OrderPromotionModelcreatePromotionModel(PriceDerivationRuleBase rule, PromotionID promotionID) Creates and returns an Order Promotion Model based on the provided Price Derivation Rule and Promotion ID.protected voidextractPromotionDetails(PromotionID promotionID, List<PriceDerivationRuleBase> priceDerivationRules, AbstractOrderModel order, Set<PromotionResultModel> promotionResults) Extracts promotion details based on the provided Promotion ID, list of Price Derivation Rules, an Abstract Order Model, and a set of Promotion Result Models.protected voidextractPromotionDetails(List<PriceDerivationRuleBase> priceDerivationRules, AbstractOrderModel order, Set<PromotionResultModel> promotionResults) Deprecated, for removal: This API element is subject to removal in a future version.since 2211.FP4.de.hybris.platform.servicelayer.config.ConfigurationServicede.hybris.platform.servicelayer.search.FlexibleSearchServicede.hybris.platform.servicelayer.model.ModelServiceintgetOrder()protected voidgetPromotions(LineItemDomainSpecific lineItem, AbstractOrderModel order, Set<PromotionResultModel> promotionResults) Populates the promotion results based on line item discountsprotected booleanisDistributedItemDiscount(RetailPriceModifierDomainSpecific priceModifier) protected booleanisItemDiscount(RetailPriceModifierDomainSpecific priceModifier) voidmap(PriceCalculateResponse response, AbstractOrderModel order) Maps the given response to the given order / cart modelprotected voidmapResponseToCartEntries(List<LineItemDomainSpecific> lineItems, AbstractOrderModel order) voidsetAccessorHelper(PPSAccessorHelper accessorHelper) voidsetConfigurationService(de.hybris.platform.servicelayer.config.ConfigurationService configurationService) voidsetFlexibleSearchService(de.hybris.platform.servicelayer.search.FlexibleSearchService flexibleSearchService) voidsetModelService(de.hybris.platform.servicelayer.model.ModelService modelService) protected voidupdateOrderWithPromotionResults(AbstractOrderModel order, Set<PromotionResultModel> promotionResults, PriceDerivationRuleBase rule, PromotionResultModel promoResult, OrderPromotionModel orderPromotionModel) Methods inherited from class com.sap.retail.sapppspricing.opps.PPSClientBeanAccessorImpl
getHelper, getObjectFactory, setHelper, setObjectFactory
-
Constructor Details
-
DefaultPriceCalculateToOrderMapper
public DefaultPriceCalculateToOrderMapper()
-
-
Method Details
-
getModelService
public de.hybris.platform.servicelayer.model.ModelService getModelService() -
setModelService
public void setModelService(de.hybris.platform.servicelayer.model.ModelService modelService) -
getAccessorHelper
-
setAccessorHelper
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-
map
Description copied from interface:PriceCalculateToOrderMapperMaps the given response to the given order / cart model- Specified by:
mapin interfacePriceCalculateToOrderMapper
-
mapResponseToCartEntries
protected void mapResponseToCartEntries(List<LineItemDomainSpecific> lineItems, AbstractOrderModel order) -
containsInvalidCoupons
protected boolean containsInvalidCoupons(List<LineItemDomainSpecific> lineItems, AbstractOrderModel order) -
updateOrderWithPromotionResults
protected void updateOrderWithPromotionResults(AbstractOrderModel order, Set<PromotionResultModel> promotionResults, PriceDerivationRuleBase rule, PromotionResultModel promoResult, OrderPromotionModel orderPromotionModel) -
getPromotions
protected void getPromotions(LineItemDomainSpecific lineItem, AbstractOrderModel order, Set<PromotionResultModel> promotionResults) Populates the promotion results based on line item discounts- Parameters:
lineItem-order-promotionResults-
-
extractPromotionDetails
protected void extractPromotionDetails(PromotionID promotionID, List<PriceDerivationRuleBase> priceDerivationRules, AbstractOrderModel order, Set<PromotionResultModel> promotionResults) Extracts promotion details based on the provided Promotion ID, list of Price Derivation Rules, an Abstract Order Model, and a set of Promotion Result Models. For each Price Derivation Rule, a new Promotion Result Model is created and associated with the given Abstract Order Model.- Parameters:
promotionID- The unique identifier for the promotion.priceDerivationRules- The list of Price Derivation Rules to be applied.order- The Abstract Order Model on which the promotions are to be applied.promotionResults- The set of Promotion Result Models to store the results of applied promotions.
-
createPromotionModel
protected OrderPromotionModel createPromotionModel(PriceDerivationRuleBase rule, PromotionID promotionID) Creates and returns an Order Promotion Model based on the provided Price Derivation Rule and Promotion ID. If a matching promotion already exists in the system, it is fetched and returned. If no existing promotion is found, a new promotion is created based on the eligibility criteria specified in the Price Derivation Rule.- Parameters:
rule- The Price Derivation Rule used to determine the properties of the promotion.promotionID- The unique identifier for the promotion.- Returns:
- The created or fetched Order Promotion Model.
-
extractPromotionDetails
@Deprecated(since="2211.FP4", forRemoval=true) protected void extractPromotionDetails(List<PriceDerivationRuleBase> priceDerivationRules, AbstractOrderModel order, Set<PromotionResultModel> promotionResults) Deprecated, for removal: This API element is subject to removal in a future version.since 2211.FP4. useextractPromotionDetails(PromotionID, List, AbstractOrderModel, Set) -
createPromotionModel
@Deprecated(since="2211.FP4", forRemoval=true) protected OrderPromotionModel createPromotionModel(PriceDerivationRuleBase rule) Deprecated, for removal: This API element is subject to removal in a future version.since 2211.FP4. usecreatePromotionModel(PriceDerivationRuleBase, PromotionID) -
codeForDiscount
protected String codeForDiscount(List<LineItemDomainSpecific> lineItems, RetailPriceModifierDomainSpecific priceModifier, String defaultPrefix) -
codeForItemDiscount
protected String codeForItemDiscount(List<LineItemDomainSpecific> lineItems, RetailPriceModifierDomainSpecific priceModifier, AbstractOrderModel order) This method determine the ERP conditionType out of the PriceDerivationRule->PromotionPriceDerivationRuleTypeCode. It do it for the 'real' item discounts as well as for the distributed header discounts -
convertToEntryDiscounts
protected List<de.hybris.platform.util.DiscountValue> convertToEntryDiscounts(List<LineItemDomainSpecific> lineItems, SaleBase item, AbstractOrderModel order) -
isItemDiscount
-
isDistributedItemDiscount
-
getConfigurationService
public de.hybris.platform.servicelayer.config.ConfigurationService getConfigurationService() -
setConfigurationService
public void setConfigurationService(de.hybris.platform.servicelayer.config.ConfigurationService configurationService) -
getFlexibleSearchService
public de.hybris.platform.servicelayer.search.FlexibleSearchService getFlexibleSearchService()- Returns:
- the flexibleSearchService
-
setFlexibleSearchService
public void setFlexibleSearchService(de.hybris.platform.servicelayer.search.FlexibleSearchService flexibleSearchService) - Parameters:
flexibleSearchService- the flexibleSearchService to set
-