Interface ProductInterestService

  • All Known Implementing Classes:
    DefaultProductInterestService

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

      • 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

        java.util.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

        java.util.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​(java.lang.String productCode)
        This method will remove the interest for the current customer by product.
        Parameters:
        productCode - the code of the product
      • getProductsByCustomerInterests

        java.util.Map<ProductModel,​java.util.Map<NotificationType,​java.util.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

        java.util.Map<ProductModel,​java.util.Map<NotificationType,​java.util.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