Interface CustomerRatingService<D extends RatingDetail>
- All Known Implementing Classes:
DefaultCustomerRatingService
public interface CustomerRatingService<D extends RatingDetail>
Actions that customers can perform with their
Rating Details.- Author:
- Cade Rea (cade-rea)
-
Method Summary
Modifier and TypeMethodDescriptionaddRatingByCustomer(RatingRequest ratingRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Add a newRatingDetail.voiddeleteRatingByCustomer(String id, String customerId, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Delete a rating.org.springframework.data.domain.Page<D>readAllRatingsByCustomer(String customerId, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Read all of a customer'sRatingDetailsupdateRatingByCustomer(String id, RatingRequest ratingRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Update an existingRatingDetail.
-
Method Details
-
readAllRatingsByCustomer
org.springframework.data.domain.Page<D> readAllRatingsByCustomer(String customerId, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Read all of a customer'sRatingDetails- Parameters:
customerId- The customer that created the rating.page- information about which page of results to return from the databasecontextInfo- Context information around sandbox and multitenant state.- Returns:
- A page of
RatingDetail
-
addRatingByCustomer
D addRatingByCustomer(RatingRequest ratingRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Add a newRatingDetail. This will also update the correspondingRatingSummary.- Parameters:
ratingRequest- The data to populate the detail.context- Context information around sandbox and multitenant state.- Returns:
- A persisted
RatingDetail
-
updateRatingByCustomer
D updateRatingByCustomer(String id, RatingRequest ratingRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Update an existingRatingDetail. The status will reset to PENDING if there is a review title or review text. This will also update the correspondingRatingSummary.- Parameters:
id- The id of the RatingDetail to edit.ratingRequest- The data to populate the detail.context- Context information around sandbox and multitenant state.- Returns:
- The updated
RatingDetail
-
deleteRatingByCustomer
void deleteRatingByCustomer(String id, String customerId, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Delete a rating. This will also update the correspondingRatingSummary.- Parameters:
id- The id of the RatingDetail to delete.customerId- The customer that owns the RatingDetail to deletecontext- Context information around sandbox and multitenant state.
-