Class AbstractFindCouponStrategy

java.lang.Object
de.hybris.platform.couponservices.strategies.impl.AbstractFindCouponStrategy
All Implemented Interfaces:
FindCouponStrategy
Direct Known Subclasses:
DefaultFindCustomerCouponStrategy, DefaultFindMultiCodeCouponStrategy, DefaultFindSingleCodeCouponStrategy

public abstract class AbstractFindCouponStrategy extends Object implements FindCouponStrategy
Abstract base class for all out of the box FindCouponStrategy implementations
  • Constructor Details

    • AbstractFindCouponStrategy

      public AbstractFindCouponStrategy()
  • Method Details

    • findCouponForCouponCode

      public Optional<AbstractCouponModel> findCouponForCouponCode(String couponCode)
      Description copied from interface: FindCouponStrategy
      Find the coupon for the provided couponCode without any validaton.
      Specified by:
      findCouponForCouponCode in interface FindCouponStrategy
      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

      public Optional<AbstractCouponModel> findValidatedCouponForCouponCode(String couponCode)
      Description copied from interface: FindCouponStrategy
      Find the coupon for the provided couponCode with the validation of the coupon throws CouponServiceException if the coupon Code is not active or not within the date range.
      Specified by:
      findValidatedCouponForCouponCode in interface FindCouponStrategy
      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

      protected Optional<AbstractCouponModel> getCouponByCode(String couponCode)
    • getCouponId

      protected abstract String getCouponId(String couponCode)
      returns the couponId based on the given couponCode
    • couponValidation

      protected Optional<AbstractCouponModel> couponValidation(AbstractCouponModel coupon)
    • isActive

      protected boolean isActive(AbstractCouponModel coupon)
    • isWithinDateRange

      protected boolean isWithinDateRange(AbstractCouponModel coupon)
    • isCouponUsedInPromotion

      protected boolean isCouponUsedInPromotion(AbstractCouponModel coupon)
    • isStartDateBefore

      protected boolean isStartDateBefore(Date date, Date startDate)
    • isEndDateAfter

      protected boolean isEndDateAfter(Date date, Date endDate)
    • getCouponDao

      protected CouponDao getCouponDao()
    • setCouponDao

      public void setCouponDao(CouponDao couponDao)
    • getConfigurationService

      protected ConfigurationService getConfigurationService()
    • setConfigurationService

      public void setConfigurationService(ConfigurationService configurationService)