Interface CustomerReviewService

  • All Known Implementing Classes:
    DefaultCustomerReviewService

    public interface CustomerReviewService
    Service managing customer reviews.
    Spring Bean ID:
    customerReviewService
    • Method Detail

      • createCustomerReview

        CustomerReviewModel createCustomerReview​(java.lang.Double rating,
                                                 java.lang.String headline,
                                                 java.lang.String comment,
                                                 UserModel user,
                                                 ProductModel product)
        Creates a new customer review based on the given parameters
        Parameters:
        rating - the rating
        headline - the headline
        comment - the comments
        user - the user who created the review
        product - the product reviewed
        Returns:
        the newly created review
      • getAverageRating

        java.lang.Double getAverageRating​(ProductModel product)
        Returns the average rating of all reviews for the given product.
        Parameters:
        product - the product
        Returns:
        the average rating
      • getNumberOfReviews

        java.lang.Integer getNumberOfReviews​(ProductModel product)
        Returns the number of reviews for the given product
        Parameters:
        product - instance of ProductModel to find the number of reviews for
        Returns:
        the number of reviews
      • getReviewsForProduct

        java.util.List<CustomerReviewModel> getReviewsForProduct​(ProductModel product)
        Get the reviews for the specified product. Gets all the reviews in any language. (Reviews are restricted by approval status) The reviews are ordered by creation date with the most recent first.
        Parameters:
        product - the product
        Returns:
        the reviews
      • getReviewsForCustomer

        java.util.List<CustomerReviewModel> getReviewsForCustomer​(UserModel userModel)
        Get the reviews for the specified customer. Gets all the reviews in any language. (Reviews are restricted by approval status) The reviews are ordered by created date with the most recent first.
        Parameters:
        userModel - the customer
        Returns:
        the reviews
      • getReviewsForProductAndLanguage

        java.util.List<CustomerReviewModel> getReviewsForProductAndLanguage​(ProductModel product,
                                                                            LanguageModel language)
        Get the reviews for the specified product in the specified language. The reviews are ordered by creation date with the most recent first.
        Parameters:
        product - the product
        language - the language
        Returns:
        the reviews