Interface ProductInterestService
- All Known Implementing Classes:
DefaultProductInterestService
public interface ProductInterestService
Service to deal with the ProductInterests
-
Method Summary
Modifier and TypeMethodDescriptionFinds all interests watched by current customer.getProductInterest(ProductModel productModel, CustomerModel customerModel, NotificationType notificationType, BaseStoreModel baseStore, BaseSiteModel baseSite) This method is used to find the ProductInterestModel by productModel, customerModel, notificationType, baseStore,baseSite.getProductInterests(CustomerModel customerModel, BaseStoreModel baseStore, BaseSiteModel baseSite) This method is used to find the expired and effective ProductInterestModels by productModel, customerModel, notificationType, baseStore,baseSite.getProductsByCustomerInterests(PageableData pageableData) Finds interests watched by current customer.intgetProductsCountByCustomerInterests(PageableData pageableData) Finds the total size of search result.voidremoveAllProductInterests(String productCode) This method will remove the interest for the current customer by product.voidremoveProductInterest(ProductInterestModel productInterest) This method will remove the interest.voidsaveProductInterest(ProductInterestModel productInterest) This method will save the new or edited interest.
-
Method Details
-
saveProductInterest
This method will save the new or edited interest.- Parameters:
productInterest- the ProductInterestModel to be saved
-
removeProductInterest
This method will remove the interest.- Parameters:
productInterest- the ProductInterestModel to be removed
-
getProductInterest
Optional<ProductInterestModel> getProductInterest(ProductModel productModel, CustomerModel customerModel, NotificationType notificationType, BaseStoreModel baseStore, BaseSiteModel baseSite) This method is used to find the ProductInterestModel by productModel, customerModel, notificationType, baseStore,baseSite.- Parameters:
productModel- the product of the ProductInterestcustomerModel- the customer of the ProductInterestnotificationType- the notificationType of the ProductInterestbaseStore- the baseStore of the ProductInterestbaseSite- the baseSite of the ProductInterest- Returns:
- ProductInterestModel if found and an empty Optional otherwise
-
getProductInterests
List<ProductInterestModel> getProductInterests(CustomerModel customerModel, BaseStoreModel baseStore, BaseSiteModel baseSite) This method is used to find the expired and effective ProductInterestModels by productModel, customerModel, notificationType, baseStore,baseSite.- Parameters:
customerModel- the customer of the ProductInterestbaseStore- the baseStore of the ProductInterestbaseSite- the baseSite of the ProductInterest- Returns:
- ProductInterestModel if found and an empty Optional otherwise
-
removeAllProductInterests
This method will remove the interest for the current customer by product.- Parameters:
productCode- the code of the product
-
getProductsByCustomerInterests
Map<ProductModel,Map<NotificationType, getProductsByCustomerInterestsDate>> (PageableData pageableData) Finds interests watched by current customer.- Parameters:
pageableData- the pagination data- Returns:
- Map whose key is ProductMode and value is the Map of NotificationType as key and creation time as value.
-
findProductInterestsByCustomer
Map<ProductModel,Map<NotificationType, findProductInterestsByCustomer()Date>> Finds all interests watched by current customer.- Returns:
- Map whose key is ProductMode and value is the Map of NotificationType as key and creation time as value.
-
getProductsCountByCustomerInterests
Finds the total size of search result.- Parameters:
pageableData- the pagination data- Returns:
- the total size of search result
-