Interface CustomerReviewService

All Known Implementing Classes:
DefaultCustomerReviewService

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

    • createCustomerReview

      CustomerReviewModel createCustomerReview(Double rating, String headline, 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

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

      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

      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

      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

      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