Interface MinimumAmountValidationStrategy

  • All Known Implementing Classes:
    DefaultMinimumAmountValidationStrategy

    public interface MinimumAmountValidationStrategy
    The strategy validates if Discount is applicable or not checking lower price limit of Order and LineItem.
    • Method Detail

      • isOrderLowerLimitValid

        boolean isOrderLowerLimitValid​(Order cart,
                                       OrderDiscount discount)
        Checks if the subtotal is valid after application of the Discount to the Cart.
        Parameters:
        cart - Cart to check
        discount - Discount to apply
        Returns:
        true if Cart subtotal is not lower than valid limit, false - otherwise
      • isLineItemLowerLimitValid

        boolean isLineItemLowerLimitValid​(LineItem lineItem,
                                          LineItemDiscount discount)
        Checks if the LineItem subtotal and the Order subtotal are valid after application of the Discount to the LineItem.
        Parameters:
        lineItem - LineItem to check
        discount - Discount to apply
        Returns:
        true if LineItem and Order subtotal is not lower than valid limit, false - otherwise