Interface ProductInterestService

All Known Implementing Classes:
DefaultProductInterestService

public interface ProductInterestService
Service to deal with the ProductInterests
  • Method Details

    • saveProductInterest

      void saveProductInterest(ProductInterestModel productInterest)
      This method will save the new or edited interest.
      Parameters:
      productInterest - the ProductInterestModel to be saved
    • removeProductInterest

      void removeProductInterest(ProductInterestModel productInterest)
      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 ProductInterest
      customerModel - the customer of the ProductInterest
      notificationType - the notificationType of the ProductInterest
      baseStore - the baseStore of the ProductInterest
      baseSite - 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 ProductInterest
      baseStore - the baseStore of the ProductInterest
      baseSite - the baseSite of the ProductInterest
      Returns:
      ProductInterestModel if found and an empty Optional otherwise
    • removeAllProductInterests

      void removeAllProductInterests(String productCode)
      This method will remove the interest for the current customer by product.
      Parameters:
      productCode - the code of the product
    • getProductsByCustomerInterests

      Map<ProductModel,Map<NotificationType,Date>> getProductsByCustomerInterests(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,Date>> findProductInterestsByCustomer()
      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

      int getProductsCountByCustomerInterests(PageableData pageableData)
      Finds the total size of search result.
      Parameters:
      pageableData - the pagination data
      Returns:
      the total size of search result