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 Constructor Description DefaultOrderEntryAdjustActionStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidadjustDiscountRaoValue(AbstractOrderEntryModel entry, DiscountRAO discountRao, java.math.BigDecimal discountAmount)java.util.List<PromotionResultModel>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, java.math.BigDecimal discountAmount)protected longgetConsumedQuantity(PromotionResultModel promoResult)Sums up quantities of all consumed entries of given order entry.voidundo(ItemModel action)Revokes the Promotion Action that was applied.-
Methods inherited from class de.hybris.platform.promotionengineservices.action.impl.AbstractRuleActionStrategy
createPromotionAction, getActionUtils, getCalculationService, getExtendedOrderDao, getForceImmediateRecalculation, getMetadataHandlers, getModelService, getPromotionAction, getPromotionActionService, getPromotionResultUtils, getRuleActionMetadataHandlers, getStrategyId, handleActionMetadata, handleUndoActionMetadata, recalculateIfNeeded, setActionUtils, setBeanName, setCalculationService, setExtendedOrderDao, setForceImmediateRecalculation, setModelService, setPromotionAction, setPromotionActionService, setPromotionResultUtils, setRuleActionMetadataHandlers, undoInternal
-
-
-
-
Method Detail
-
apply
public java.util.List<PromotionResultModel> apply(AbstractRuleActionRAO action)
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, java.math.BigDecimal discountAmount)
-
createOrderEntryAdjustAction
protected RuleBasedOrderEntryAdjustActionModel createOrderEntryAdjustAction(PromotionResultModel promoResult, AbstractRuleActionRAO action, AbstractOrderEntryModel entry, java.math.BigDecimal discountAmount)
-
undo
public void undo(ItemModel action)
Description copied from interface:RuleActionStrategyRevokes the Promotion Action that was applied.- Parameters:
action- the action to be undone
-
getConsumedQuantity
protected long getConsumedQuantity(PromotionResultModel promoResult)
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
-
-