Package de.hybris.platform.order
Interface DiscountService
- All Known Implementing Classes:
DefaultDiscountService
public interface DiscountService
Service around the
DiscountModel.
There are different kinds of discounts: absolute or relative, and global and non-global. Absolute discounts contain a real price value (price and currency), whereas relative discounts are discounts in percent. Global discounts are applied on order level, which means that they can not be applied to a single entry. Non-global discounts are only applicable on entry - level.
Since all price calculation is done be the currently installed pricefactory refer to it for maybe differing behavior.- Spring Bean ID:
- discountService
-
Method Summary
Modifier and TypeMethodDescriptiongetDiscountForCode(String code) Gets theDiscountModelwith the specified code.default List<DiscountInformation>getDiscountInformation(BaseCriteria baseCriteria) Get discountsDiscountInformations for given criteria.getDiscountsForCode(String matchedCode) Gets allDiscountModels which match the specified code.getDiscountsForCurrency(CurrencyModel currency) Gets allDiscountModels which match the specified currency.
-
Method Details
-
getDiscountForCode
Gets theDiscountModelwith the specified code.- Parameters:
code- the discount code- Returns:
- the found
DiscountModelwith the specified code
-
getDiscountsForCode
Gets allDiscountModels which match the specified code.- Parameters:
matchedCode- an SQL-Like statement as String, such as %discountCode%- Returns:
- the
Collectionof allDiscountModels which match the specified code
-
getDiscountsForCurrency
Gets allDiscountModels which match the specified currency.- Parameters:
currency- targetCurrencyModel- Returns:
- the
Collectionof allDiscountModels which matching currency. If no matching discounts were found, an empty collection is returned. - Throws:
IllegalArgumentException- if currency is null
-
getDiscountInformation
default List<DiscountInformation> getDiscountInformation(BaseCriteria baseCriteria) throws CalculationException Get discountsDiscountInformations for given criteria.- Parameters:
baseCriteria-BaseCriteria- Returns:
- the
Listof allDiscountInformations which matching baseCriteria. If no matching discounts were found, an empty collection is returned. - Throws:
CalculationException- if error occurred
-