Class DefaultCustomerCouponService
- java.lang.Object
-
- de.hybris.platform.couponservices.services.impl.DefaultCouponService
-
- de.hybris.platform.customercouponservices.impl.DefaultCustomerCouponService
-
- All Implemented Interfaces:
CouponService,CustomerCouponService
public class DefaultCustomerCouponService extends DefaultCouponService implements CustomerCouponService
Default implementation ofCustomerCouponService
-
-
Constructor Summary
Constructors Constructor Description DefaultCustomerCouponService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassignCouponToCustomer(java.lang.String couponCode, CustomerModel customer)Assigns the customer coupon to the current customerintcountProductOrCategoryForPromotionSourceRule(java.lang.String code)Counts the number of products and categories mapped with promotion source rulejava.util.List<CustomerCouponModel>getAssignableCustomerCoupons(CustomerModel customer, java.lang.String text)Gets assignable customer couponsjava.util.List<CustomerCouponModel>getAssignedCustomerCouponsForCustomer(CustomerModel customer, java.lang.String text)Gets assigned customer couponsprotected CategoryServicegetCategoryService()protected CommonI18NServicegetCommonI18NService()java.util.List<java.lang.String>getCouponCodeForPromotionSourceRule(java.lang.String code)Gets customer coupon codes by promotion source ruleprotected CouponDaogetCouponDao()protected CouponNotificationDaogetCouponNotificationDao()java.util.List<CouponNotificationModel>getCouponNotificationsForCustomer(CustomerModel customer)Gets coupon notifications for the customerbooleangetCouponNotificationStatus(java.lang.String couponCode)Gets coupon notification status by coupon codeprotected CouponRedemptionDaogetCouponRedemptionDao()protected CustomerCouponDaogetCustomerCouponDao()java.util.Optional<CustomerCouponModel>getCustomerCouponForCode(java.lang.String couponCode)Gets customer coupon models by coupon codeSearchPageData<CustomerCouponModel>getCustomerCouponsForCustomer(CustomerModel customer, PageableData pageableData)Gets paginated customer coupon models for the customer by pageableDatajava.util.List<CustomerCouponModel>getEffectiveCustomerCouponsForCustomer(CustomerModel customer)Gets effective customer coupons of the customerjava.util.List<PromotionSourceRuleModel>getExclPromotionSourceRulesForCategory(java.lang.String categoryCode)Gets excluded promotion source rules by categoryjava.util.List<PromotionSourceRuleModel>getExclPromotionSourceRulesForProduct(java.lang.String productCode)Gets excluded promotion source rules by product codeprotected LanguageDaogetLanguageDao()SearchPageData<CustomerCouponModel>getPaginatedCouponsForCustomer(CustomerModel customer, SearchPageData searchPageData)Gets paginated customer coupon data by searchPageDataprotected PromotionsDaogetPromotionsDao()java.util.List<PromotionSourceRuleModel>getPromotionSourceRuleForCouponCode(java.lang.String couponCode)Gets promotion source rule by coupon codejava.util.List<PromotionSourceRuleModel>getPromotionSourceRulesForCategory(java.lang.String categoryCode)Gets promotion source rules by categoryjava.util.List<PromotionSourceRuleModel>getPromotionSourceRulesForProduct(java.lang.String productCode)Gets promotion source rules by product codejava.util.List<PromotionSourceRuleModel>getPromotionSourcesRuleForProductCategories(ProductModel product)Gets promotionSourceRule for categories of productprotected UserServicegetUserService()java.util.Optional<CustomerCouponModel>getValidCustomerCouponByCode(java.lang.String couponCode)Gets valid customer coupon models by coupon codevoidremoveCouponForCustomer(java.lang.String couponCode, CustomerModel customer)Removes customer coupon for the customervoidremoveCouponNotificationByCode(java.lang.String couponCode)Removes customer coupon notificationjava.util.Optional<CouponNotificationModel>saveCouponNotification(java.lang.String couponCode)Saves customer coupon notificationvoidsetCategoryService(CategoryService categoryService)voidsetCommonI18NService(CommonI18NService commonI18NService)voidsetCouponDao(CouponDao couponDao)voidsetCouponNotificationDao(CouponNotificationDao couponNotificationDao)voidsetCouponRedemptionDao(CouponRedemptionDao couponRedemptionDao)voidsetCustomerCouponDao(CustomerCouponDao customerCouponDao)voidsetLanguageDao(LanguageDao languageDao)voidsetPromotionsDao(PromotionsDao promotionsDao)voidsetUserService(UserService userService)protected java.lang.BooleanvalidateCouponDate(java.util.Date startDate, java.util.Date endDate, java.util.Date now)-
Methods inherited from class de.hybris.platform.couponservices.services.impl.DefaultCouponService
assertCouponCodeInOrder, checkMatch, clearCouponCode, containsCouponCode, getBaseSiteService, getCalculationService, getCouponCodeGenerationService, getCouponForCode, getCouponManagementService, getModelService, getPromotionGroups, getPromotionsService, getValidatedCouponForCode, recalculateOrder, redeemCoupon, redeemCoupon, redeemCouponCode, releaseCouponCode, removeCouponAndTriggerCalculation, setBaseSiteService, setCalculationService, setCouponCodeGenerationService, setCouponManagementService, setModelService, setPromotionsService, validateCouponCode, verifyCouponCode
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.couponservices.services.CouponService
getCouponForCode, getValidatedCouponForCode, redeemCoupon, redeemCoupon, releaseCouponCode, validateCouponCode, verifyCouponCode
-
-
-
-
Method Detail
-
getCustomerCouponsForCustomer
public SearchPageData<CustomerCouponModel> getCustomerCouponsForCustomer(CustomerModel customer, PageableData pageableData)
Description copied from interface:CustomerCouponServiceGets paginated customer coupon models for the customer by pageableData- Specified by:
getCustomerCouponsForCustomerin interfaceCustomerCouponService- Parameters:
customer- the customer modelpageableData- the data used for pagination- Returns:
- the paginated customer coupon models
-
getValidCustomerCouponByCode
public java.util.Optional<CustomerCouponModel> getValidCustomerCouponByCode(java.lang.String couponCode)
Description copied from interface:CustomerCouponServiceGets valid customer coupon models by coupon code- Specified by:
getValidCustomerCouponByCodein interfaceCustomerCouponService- Parameters:
couponCode- the coupon code- Returns:
- the optional of CustomerCouponModel
-
validateCouponDate
protected java.lang.Boolean validateCouponDate(java.util.Date startDate, java.util.Date endDate, java.util.Date now)
-
assignCouponToCustomer
public void assignCouponToCustomer(java.lang.String couponCode, CustomerModel customer)Description copied from interface:CustomerCouponServiceAssigns the customer coupon to the current customer- Specified by:
assignCouponToCustomerin interfaceCustomerCouponService- Parameters:
couponCode- the coupon codecustomer- the customer model
-
getPromotionSourceRuleForCouponCode
public java.util.List<PromotionSourceRuleModel> getPromotionSourceRuleForCouponCode(java.lang.String couponCode)
Description copied from interface:CustomerCouponServiceGets promotion source rule by coupon code- Specified by:
getPromotionSourceRuleForCouponCodein interfaceCustomerCouponService- Parameters:
couponCode- the coupon code- Returns:
- the list of PromotionSourceRuleModel
-
getPromotionSourceRulesForProduct
public java.util.List<PromotionSourceRuleModel> getPromotionSourceRulesForProduct(java.lang.String productCode)
Description copied from interface:CustomerCouponServiceGets promotion source rules by product code- Specified by:
getPromotionSourceRulesForProductin interfaceCustomerCouponService- Parameters:
productCode- the product code- Returns:
- the list of PromotionSourceRuleModel
-
getExclPromotionSourceRulesForProduct
public java.util.List<PromotionSourceRuleModel> getExclPromotionSourceRulesForProduct(java.lang.String productCode)
Description copied from interface:CustomerCouponServiceGets excluded promotion source rules by product code- Specified by:
getExclPromotionSourceRulesForProductin interfaceCustomerCouponService- Parameters:
productCode- the product code- Returns:
- the list of PromotionSourceRuleModel
-
getPromotionSourceRulesForCategory
public java.util.List<PromotionSourceRuleModel> getPromotionSourceRulesForCategory(java.lang.String categoryCode)
Description copied from interface:CustomerCouponServiceGets promotion source rules by category- Specified by:
getPromotionSourceRulesForCategoryin interfaceCustomerCouponService- Parameters:
categoryCode- the category code- Returns:
- the list of PromotionSourceRuleModel
-
getExclPromotionSourceRulesForCategory
public java.util.List<PromotionSourceRuleModel> getExclPromotionSourceRulesForCategory(java.lang.String categoryCode)
Description copied from interface:CustomerCouponServiceGets excluded promotion source rules by category- Specified by:
getExclPromotionSourceRulesForCategoryin interfaceCustomerCouponService- Parameters:
categoryCode- the category code- Returns:
- the list of PromotionSourceRuleModel
-
getCouponCodeForPromotionSourceRule
public java.util.List<java.lang.String> getCouponCodeForPromotionSourceRule(java.lang.String code)
Description copied from interface:CustomerCouponServiceGets customer coupon codes by promotion source rule- Specified by:
getCouponCodeForPromotionSourceRulein interfaceCustomerCouponService- Parameters:
code- the promotion source rule code- Returns:
- the list of customer coupon codes
-
countProductOrCategoryForPromotionSourceRule
public int countProductOrCategoryForPromotionSourceRule(java.lang.String code)
Description copied from interface:CustomerCouponServiceCounts the number of products and categories mapped with promotion source rule- Specified by:
countProductOrCategoryForPromotionSourceRulein interfaceCustomerCouponService- Parameters:
code- the promotion source rule code- Returns:
- the total number of products and categories mapped with promotion source rule
-
saveCouponNotification
public java.util.Optional<CouponNotificationModel> saveCouponNotification(java.lang.String couponCode)
Description copied from interface:CustomerCouponServiceSaves customer coupon notification- Specified by:
saveCouponNotificationin interfaceCustomerCouponService- Parameters:
couponCode- the coupon code- Returns:
- the optional of CouponNotificationModel
-
removeCouponNotificationByCode
public void removeCouponNotificationByCode(java.lang.String couponCode)
Description copied from interface:CustomerCouponServiceRemoves customer coupon notification- Specified by:
removeCouponNotificationByCodein interfaceCustomerCouponService- Parameters:
couponCode- the coupon code
-
getCouponNotificationStatus
public boolean getCouponNotificationStatus(java.lang.String couponCode)
Description copied from interface:CustomerCouponServiceGets coupon notification status by coupon code- Specified by:
getCouponNotificationStatusin interfaceCustomerCouponService- Parameters:
couponCode- the coupon code- Returns:
- true if the current customer has subscribed to the coupon notification and false otherwise
-
removeCouponForCustomer
public void removeCouponForCustomer(java.lang.String couponCode, CustomerModel customer)Description copied from interface:CustomerCouponServiceRemoves customer coupon for the customer- Specified by:
removeCouponForCustomerin interfaceCustomerCouponService- Parameters:
couponCode- the coupon codecustomer- the customer model
-
getCustomerCouponForCode
public java.util.Optional<CustomerCouponModel> getCustomerCouponForCode(java.lang.String couponCode)
Description copied from interface:CustomerCouponServiceGets customer coupon models by coupon code- Specified by:
getCustomerCouponForCodein interfaceCustomerCouponService- Parameters:
couponCode- the coupon code- Returns:
- the optional of CustomerCouponModel, single and multi coupon will return null
-
getCouponNotificationsForCustomer
public java.util.List<CouponNotificationModel> getCouponNotificationsForCustomer(CustomerModel customer)
Description copied from interface:CustomerCouponServiceGets coupon notifications for the customer- Specified by:
getCouponNotificationsForCustomerin interfaceCustomerCouponService- Parameters:
customer- the customer model- Returns:
- the list of CouponNotificationModel
-
getEffectiveCustomerCouponsForCustomer
public java.util.List<CustomerCouponModel> getEffectiveCustomerCouponsForCustomer(CustomerModel customer)
Description copied from interface:CustomerCouponServiceGets effective customer coupons of the customer- Specified by:
getEffectiveCustomerCouponsForCustomerin interfaceCustomerCouponService- Parameters:
customer- the customer model- Returns:
- the list of CustomerCouponModel
-
getAssignableCustomerCoupons
public java.util.List<CustomerCouponModel> getAssignableCustomerCoupons(CustomerModel customer, java.lang.String text)
Description copied from interface:CustomerCouponServiceGets assignable customer coupons- Specified by:
getAssignableCustomerCouponsin interfaceCustomerCouponService- Parameters:
customer- the customer modeltext- the text used for searching assignable customer coupons- Returns:
- the list of CustomerCouponModel
-
getAssignedCustomerCouponsForCustomer
public java.util.List<CustomerCouponModel> getAssignedCustomerCouponsForCustomer(CustomerModel customer, java.lang.String text)
Description copied from interface:CustomerCouponServiceGets assigned customer coupons- Specified by:
getAssignedCustomerCouponsForCustomerin interfaceCustomerCouponService- Parameters:
customer- the customer modeltext- the text used for searching assigned customer coupons- Returns:
- the list of CustomerCouponModel
-
getPaginatedCouponsForCustomer
public SearchPageData<CustomerCouponModel> getPaginatedCouponsForCustomer(CustomerModel customer, SearchPageData searchPageData)
Description copied from interface:CustomerCouponServiceGets paginated customer coupon data by searchPageData- Specified by:
getPaginatedCouponsForCustomerin interfaceCustomerCouponService- Parameters:
customer- the customer modelsearchPageData- the data used for pagination- Returns:
- the paginated customer coupon models
-
getPromotionSourcesRuleForProductCategories
public java.util.List<PromotionSourceRuleModel> getPromotionSourcesRuleForProductCategories(ProductModel product)
Description copied from interface:CustomerCouponServiceGets promotionSourceRule for categories of product- Specified by:
getPromotionSourcesRuleForProductCategoriesin interfaceCustomerCouponService- Parameters:
product- the product model- Returns:
- the list of PromotionSourceRuleModel
-
getCouponRedemptionDao
protected CouponRedemptionDao getCouponRedemptionDao()
-
setCouponRedemptionDao
public void setCouponRedemptionDao(CouponRedemptionDao couponRedemptionDao)
-
getCustomerCouponDao
protected CustomerCouponDao getCustomerCouponDao()
-
setCustomerCouponDao
public void setCustomerCouponDao(CustomerCouponDao customerCouponDao)
-
getUserService
protected UserService getUserService()
-
setUserService
public void setUserService(UserService userService)
-
getPromotionsDao
protected PromotionsDao getPromotionsDao()
-
setPromotionsDao
public void setPromotionsDao(PromotionsDao promotionsDao)
-
getLanguageDao
protected LanguageDao getLanguageDao()
-
setLanguageDao
public void setLanguageDao(LanguageDao languageDao)
-
getCouponDao
protected CouponDao getCouponDao()
-
setCouponDao
public void setCouponDao(CouponDao couponDao)
-
getCouponNotificationDao
protected CouponNotificationDao getCouponNotificationDao()
-
setCouponNotificationDao
public void setCouponNotificationDao(CouponNotificationDao couponNotificationDao)
-
getCommonI18NService
protected CommonI18NService getCommonI18NService()
-
setCommonI18NService
public void setCommonI18NService(CommonI18NService commonI18NService)
-
getCategoryService
protected CategoryService getCategoryService()
-
setCategoryService
public void setCategoryService(CategoryService categoryService)
-
-