Package com.skava.ratingandreviews.batch
Class RatingAggregation
java.lang.Object
com.skava.ratingandreviews.batch.RatingAggregation
RatingAggregation class
This Class provides aggregate and triggerEvent methods which is used to produce the rating summary process collection and trigger event with the details of collectionId, itemId, ratingsCount, ratingDistribution, finalRating, storeId, authToken .
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRatingAggregation
(RatingSummaryRepository ratingSummaryRepository, RatingSummaryFactory ratingSummaryFactory, RatingSummaryProcess ratingSummaryProcess, RatingandReviewEventSender ratingandReviewEventSender) -
Method Summary
Modifier and TypeMethodDescriptionvoid
aggregate
(RatingReviewDomain ratingsReviewsDomain, String storeId, String authToken) aggregate method is used to create rating summary domain in which accumulatedTotal, finalRating,ratingCount,ratingDistribution,collectionId and itemId of ratingReviewdomain and maximum rating is stored and from here the event is triggered with the help of trigger event function with required details.
-
Field Details
-
ROUTING_KEY
routing_ key - holds the key for routing- See Also:
-
-
Constructor Details
-
RatingAggregation
@Autowired public RatingAggregation(RatingSummaryRepository ratingSummaryRepository, RatingSummaryFactory ratingSummaryFactory, RatingSummaryProcess ratingSummaryProcess, RatingandReviewEventSender ratingandReviewEventSender)
-
-
Method Details
-
aggregate
aggregate method is used to create rating summary domain in which accumulatedTotal, finalRating,ratingCount,ratingDistribution,collectionId and itemId of ratingReviewdomain and maximum rating is stored and from here the event is triggered with the help of trigger event function with required details.- Parameters:
ratingsReviewsDomain
- Holds the collection id and item id of the microservice.storeId
- Holds the identifier of the store of the microservice.authToken
- Holds the authToken of the microservice.
-