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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.boolean
isOrderLowerLimitValid(Order cart, OrderDiscount discount)
Checks if the subtotal is valid after application of the Discount to the Cart.
-
-
-
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 checkdiscount
- 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 checkdiscount
- Discount to apply- Returns:
- true if LineItem and Order subtotal is not lower than valid limit, false - otherwise
-
-