Interface AddOrderEntryDiscountRAOAction


  • public interface AddOrderEntryDiscountRAOAction
    AddOrderEntryDiscountRAOAction adds a discount on order/cart entry level.
    • 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 given orderEntryRao, recalculates the cart totals and returns the discount. The absolute flag determines whether the discount is absolute or percentage based. For absolute values, the cart's currency is used. The amount specifies the amount used, e.g. $20 or 10%. The ruleContext can be used to enhance the returned DiscountRAO.
        Parameters:
        orderEntryRao - the OrderEntryRAO to apply the discount to
        absolute - the type of discount
        amount - the amount of the discount
        result - the result rao
        ruleContext - 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 in orderEntryList, recalculates the cart totals and returns the discount. The absolute flag determines whether the discount is absolute or percentage based. For absolute values, the cart's currency is used. The amount specifies the amount used, e.g. $20 or 10%. The ruleContext can be used to enhance the returned DiscountRAO.
        Parameters:
        orderEntryList - Collection of OrderEntryRAO to apply the discount to
        absolute - the type of discount
        amount - the amount of the discount
        result - the result rao
        ruleContext - 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 from entriesSelectionStrategyRPDs 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 have isTargetOfAction = 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 percentage
        result - RuleEngineResultRAO that will be updated with discounts
        ruleContext - an optional context object that can be used to provide additional information for the returned DiscountRAO
        Returns:
        List of created discounts