Class AbstractFindCouponStrategy
java.lang.Object
de.hybris.platform.couponservices.strategies.impl.AbstractFindCouponStrategy
- All Implemented Interfaces:
FindCouponStrategy
- Direct Known Subclasses:
DefaultFindCustomerCouponStrategy,DefaultFindMultiCodeCouponStrategy,DefaultFindSingleCodeCouponStrategy
Abstract base class for all out of the box FindCouponStrategy implementations
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Optional<AbstractCouponModel>couponValidation(AbstractCouponModel coupon) findCouponForCouponCode(String couponCode) Find the coupon for the providedcouponCodewithout any validaton.findValidatedCouponForCouponCode(String couponCode) Find the coupon for the providedcouponCodewith the validation of the coupon throws CouponServiceException if the coupon Code is not active or not within the date range.protected ConfigurationServiceprotected Optional<AbstractCouponModel>getCouponByCode(String couponCode) protected CouponDaoprotected abstract StringgetCouponId(String couponCode) returns the couponId based on the givencouponCodeprotected booleanisActive(AbstractCouponModel coupon) protected booleanprotected booleanisEndDateAfter(Date date, Date endDate) protected booleanisStartDateBefore(Date date, Date startDate) protected booleanisWithinDateRange(AbstractCouponModel coupon) voidsetConfigurationService(ConfigurationService configurationService) voidsetCouponDao(CouponDao couponDao)
-
Constructor Details
-
AbstractFindCouponStrategy
public AbstractFindCouponStrategy()
-
-
Method Details
-
findCouponForCouponCode
Description copied from interface:FindCouponStrategyFind the coupon for the providedcouponCodewithout any validaton.- Specified by:
findCouponForCouponCodein interfaceFindCouponStrategy- Parameters:
couponCode- the coupon code (i.e. as entered in a storefront etc)- Returns:
- AbstractCouponModel if a coupon model is found for the given coupon code.
-
findValidatedCouponForCouponCode
Description copied from interface:FindCouponStrategyFind the coupon for the providedcouponCodewith the validation of the coupon throws CouponServiceException if the coupon Code is not active or not within the date range.- Specified by:
findValidatedCouponForCouponCodein interfaceFindCouponStrategy- Parameters:
couponCode- the coupon code (i.e. as entered in a storefront etc)- Returns:
- AbstractCouponModel if a coupon model is found for the given coupon code.
-
getCouponByCode
-
getCouponId
returns the couponId based on the givencouponCode -
couponValidation
-
isActive
-
isWithinDateRange
-
isCouponUsedInPromotion
-
isStartDateBefore
-
isEndDateAfter
-
getCouponDao
-
setCouponDao
-
getConfigurationService
-
setConfigurationService
-