Class DefaultOrderEntryAdjustActionStrategy
java.lang.Object
de.hybris.platform.promotionengineservices.action.impl.AbstractRuleActionStrategy<RuleBasedOrderEntryAdjustActionModel>
de.hybris.platform.promotionengineservices.action.impl.DefaultOrderEntryAdjustActionStrategy
- All Implemented Interfaces:
RuleActionStrategy,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware
public class DefaultOrderEntryAdjustActionStrategy
extends AbstractRuleActionStrategy<RuleBasedOrderEntryAdjustActionModel>
Encapsulates logic of Cart total calculation after Line Item Discount as a Promotion Rule is applied.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidadjustDiscountRaoValue(AbstractOrderEntryModel entry, DiscountRAO discountRao, BigDecimal discountAmount) apply(AbstractRuleActionRAO action) If the parameter action is of typeDiscountRAOand is applied to Order Entry the discount is added to corresponding Order Entry model.protected RuleBasedOrderEntryAdjustActionModelcreateOrderEntryAdjustAction(PromotionResultModel promoResult, AbstractRuleActionRAO action, AbstractOrderEntryModel entry, BigDecimal discountAmount) protected longgetConsumedQuantity(PromotionResultModel promoResult) Sums up quantities of all consumed entries of given order entry.voidRevokes the Promotion Action that was applied.Methods inherited from class de.hybris.platform.promotionengineservices.action.impl.AbstractRuleActionStrategy
createPromotionAction, getActionUtils, getCalculationService, getDefaultRuleMetadataKeys, getExtendedOrderDao, getForceImmediateRecalculation, getMetadataHandlers, getModelService, getPromotionAction, getPromotionActionService, getPromotionResultUtils, getRuleActionMetadataHandlers, getStrategyId, handleActionMetadata, handleUndoActionMetadata, recalculateIfNeeded, setActionUtils, setBeanName, setCalculationService, setDefaultRuleMetadataKeys, setExtendedOrderDao, setForceImmediateRecalculation, setModelService, setPromotionAction, setPromotionActionService, setPromotionResultUtils, setRuleActionMetadataHandlers, undoInternal
-
Constructor Details
-
DefaultOrderEntryAdjustActionStrategy
public DefaultOrderEntryAdjustActionStrategy()
-
-
Method Details
-
apply
If the parameter action is of typeDiscountRAOand is applied to Order Entry the discount is added to corresponding Order Entry model.- Parameters:
action- the action to apply- Returns:
- list of
PromotionResultModelas a result of theDiscountRAOapplication.
-
adjustDiscountRaoValue
protected void adjustDiscountRaoValue(AbstractOrderEntryModel entry, DiscountRAO discountRao, BigDecimal discountAmount) -
createOrderEntryAdjustAction
protected RuleBasedOrderEntryAdjustActionModel createOrderEntryAdjustAction(PromotionResultModel promoResult, AbstractRuleActionRAO action, AbstractOrderEntryModel entry, BigDecimal discountAmount) -
undo
Description copied from interface:RuleActionStrategyRevokes the Promotion Action that was applied.- Parameters:
action- the action to be undone
-
getConsumedQuantity
Sums up quantities of all consumed entries of given order entry.- Parameters:
promoResult- AbstractOrderEntryModel to find consumed quantity for- Returns:
- consumed quantity of given order entry
-