Interface AddOrderEntryDiscountRAOAction
-
public interface AddOrderEntryDiscountRAOAction
AddOrderEntryDiscountRAOAction adds a discount on order/cart entry level.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DiscountRAO
addOrderEntryLevelDiscount(OrderEntryRAO orderEntryRao, boolean absolute, java.math.BigDecimal amount, RuleEngineResultRAO result, java.lang.Object ruleContext)
Adds an order entry level discount to the givenorderEntryRao
, recalculates the cart totals and returns the discount.java.util.List<DiscountRAO>
addOrderEntryLevelDiscount(java.util.List<EntriesSelectionStrategyRPD> entriesSelectionStrategyRPDs, boolean absolute, java.math.BigDecimal amount, RuleEngineResultRAO result, java.lang.Object ruleContext)
Adds order entry level discounts to the order entries selected by strategies fromentriesSelectionStrategyRPDs
which are marked to be target for the action.java.util.List<DiscountRAO>
addOrderEntryLevelDiscounts(java.util.Collection<OrderEntryRAO> orderEntryList, boolean absolute, java.math.BigDecimal amount, RuleEngineResultRAO result, java.lang.Object ruleContext)
Adds an order entry level discount for each order entry element inorderEntryList
, recalculates the cart totals and returns the discount.
-
-
-
Method Detail
-
addOrderEntryLevelDiscount
DiscountRAO addOrderEntryLevelDiscount(OrderEntryRAO orderEntryRao, boolean absolute, java.math.BigDecimal amount, RuleEngineResultRAO result, java.lang.Object ruleContext)
Adds an order entry level discount to the givenorderEntryRao
, recalculates the cart totals and returns the discount. Theabsolute
flag determines whether the discount is absolute or percentage based. For absolute values, the cart's currency is used. Theamount
specifies the amount used, e.g. $20 or 10%. TheruleContext
can be used to enhance the returned DiscountRAO.- Parameters:
orderEntryRao
- the OrderEntryRAO to apply the discount toabsolute
- the type of discountamount
- the amount of the discountresult
- the result raoruleContext
- an optional context object that can be used to provide additional information for the returned DiscountRAO
-
addOrderEntryLevelDiscounts
java.util.List<DiscountRAO> addOrderEntryLevelDiscounts(java.util.Collection<OrderEntryRAO> orderEntryList, boolean absolute, java.math.BigDecimal amount, RuleEngineResultRAO result, java.lang.Object ruleContext)
Adds an order entry level discount for each order entry element inorderEntryList
, recalculates the cart totals and returns the discount. Theabsolute
flag determines whether the discount is absolute or percentage based. For absolute values, the cart's currency is used. Theamount
specifies the amount used, e.g. $20 or 10%. TheruleContext
can be used to enhance the returned DiscountRAO.- Parameters:
orderEntryList
- Collection of OrderEntryRAO to apply the discount toabsolute
- the type of discountamount
- the amount of the discountresult
- the result raoruleContext
- an optional context object that can be used to provide additional information for the returned DiscountRAO
-
addOrderEntryLevelDiscount
java.util.List<DiscountRAO> addOrderEntryLevelDiscount(java.util.List<EntriesSelectionStrategyRPD> entriesSelectionStrategyRPDs, boolean absolute, java.math.BigDecimal amount, RuleEngineResultRAO result, java.lang.Object ruleContext)
Adds order entry level discounts to the order entries selected by strategies fromentriesSelectionStrategyRPDs
which are marked to be target for the action. The discount is either absolute or percentage.- Parameters:
entriesSelectionStrategyRPDs
- list of strategies used to select order entries and their applicable quantities. Discounts are created for the entries from the strategies which haveisTargetOfAction
= true. Other entries are just consumed, but not discounted.absolute
- type of discount to be applied. Absolute discount will provide a currency amount discount, rather than a percentage.amount
- amount of discount to apply. Can be currency amount of percentageresult
- RuleEngineResultRAO that will be updated with discountsruleContext
- an optional context object that can be used to provide additional information for the returned DiscountRAO- Returns:
- List of created discounts
-
-