This page provides the list of events and associated payload for internal events (via RabbitMQ/AWS MQ) and external events (via EventBridge) for the Ratings and Reviews microservice.
External Events via EventBridge
The following events contain the entity changed in the event message payload.
List of Events
Sl. # | API Call | Call Detail | Event Type | Identifier |
---|---|---|---|---|
1. | POST | CreateRatingReview | ratingsreviewsservice/ratingreview/create | response_id |
2. | PATCH | UpdateImage | ratingsreviewsservice/image/patch | response_id |
3. | PUT | UpdateRatingReview | ratingsreviewsservice/ratingreview/update | response_id |
4. | POST | CreateRatingFeedback | ratingsreviewsservice/ratingfeedback/create | response_id |
5. | PUT | UpdateRatingFeedback | ratingsreviewsservice/ratingfeedback/update | response_id |
6. | DELETE | DeleteRatingReviewPreference | ratingsreviewsservice/ratingreviewpreference/delete | response_id |
7. | POST | CreateReviewAnswers | ratingsreviewsservice/reviewanswers/create | response_id |
8. | POST | CreateRatingAnswers | ratingsreviewsservice/ratinganswers/create | response_id |
9. | POST | CreateCreateVotes | ratingsreviewsservice/createvotes/create | response_id |
10. | PUT | UpdateRatingAnswers | ratingsreviewsservice/ratinganswers/update | response_id |
11. | PATCH | UpdateReviewQuestions | ratingsreviewsservice/reviewquestions/patch | response_id |
12. | PATCH | UpdateReviewAnswers | ratingsreviewsservice/reviewanswers/patch | response_id |
13. | DELETE | DeleteQuestionById | ratingsreviewsservice/deleteByIdQuestion/delete | response_id |
Payload
CreateRatingReview
Event Type: ratingsreviewsservice/ratingreview/create
{
"version": "0",
"id": "3d2e4acb-8007-e30d-1bae-b0913571a713",
"detail-type": "ratingsreviewsservice/ratingreview/create",
"source": "ratingsreviewsservice",
"account": "277827593990",
"time": "2024-05-22T05:46:16Z",
"region": "us-east-1",
"resources": [
],
"detail": {
"id": "2331",
"timestamp": 1716356776335,
"payload": {
"id": 2331,
"collectionId": 546,
"userPreferenceId": "1",
"itemId": "LPBG2121",
"imageUrls": [
""
],
"rating": 3,
"review": "Good quality",
"status": "PENDING",
"locale": "en_US",
"properties": {
"minlength": "25"
},
"createdTime": 1716356776310,
"updatedTime": 1716356776310,
"updatedBy": "1"
},
"collectionId": "546",
"eventType": "ratingsreviewsservice/ratingreview/create",
"userId": "1",
"actOnBehalfOfUser": 0,
"roles": [
"ROLE_SUPER_ADMIN"
],
"channel": "CSR"
}
}
UpdateImage
Event Type: ratingsreviewsservice/image/patch
{
"version": "0",
"id": "0e417aec-734b-8999-8396-e12fa13e3c26",
"detail-type": "ratingsreviewsservice/image/patch",
"source": "ratingsreviewsservice",
"account": "277827593990",
"time": "2024-05-22T05:46:24Z",
"region": "us-east-1",
"resources": [
],
"detail": {
"id": "2331",
"timestamp": 1716356784112,
"payload": {
"id": 2331,
"collectionId": 546,
"userPreferenceId": "1",
"itemId": "LPBG2121",
"imageUrls": [
""
],
"rating": 3,
"review": "Good quality",
"status": "PENDING",
"locale": "en_US",
"properties": {
"minlength": "25"
},
"createdTime": 1716356776000,
"updatedTime": 1716356776000,
"updatedBy": "1"
},
"collectionId": "546",
"eventType": "ratingsreviewsservice/image/patch",
"userId": "1",
"actOnBehalfOfUser": 0,
"roles": [
"ROLE_SUPER_ADMIN"
],
"channel": "CSR"
}
}
UpdateRatingReview
Event Type: ratingsreviewsservice/ratingreview/update
{
"version": "0",
"id": "de13573c-74b4-29c5-1003-58adfda4dc62",
"detail-type": "ratingsreviewsservice/ratingreview/update",
"source": "ratingsreviewsservice",
"account": "277827593990",
"time": "2024-05-22T05:46:29Z",
"region": "us-east-1",
"resources": [
],
"detail": {
"id": "2331",
"timestamp": 1716356789627,
"payload": {
"id": 2331,
"collectionId": 546,
"userPreferenceId": "1",
"itemId": "LPBG2121",
"imageUrls": [
""
],
"rating": 3,
"review": "Good quality",
"status": "APPROVED",
"locale": "en_US",
"properties": {
"minlength": "50"
},
"createdTime": 1716356776000,
"updatedTime": 1716356789591,
"updatedBy": "1"
},
"collectionId": "546",
"eventType": "ratingsreviewsservice/ratingreview/update",
"userId": "1",
"actOnBehalfOfUser": 0,
"roles": [
"ROLE_SUPER_ADMIN"
],
"channel": "CSR"
}
}
CreateRatingFeedback
Event Type: ratingsreviewsservice/ratingfeedback/create
{
"version": "0",
"id": "02106bad-74f6-50b8-f914-f04d2ee7746c",
"detail-type": "ratingsreviewsservice/ratingfeedback/create",
"source": "ratingsreviewsservice",
"account": "277827593990",
"time": "2024-05-22T05:46:33Z",
"region": "us-east-1",
"resources": [
],
"detail": {
"id": "63",
"timestamp": 1716356793087,
"payload": {
"id": 63,
"feedback": "LIKE",
"properties": {
"additionalProp1": "PROP1",
"additionalProp2": "PROP2",
"additionalProp3": "PROP2"
},
"createdTime": 1716356793062,
"updatedTime": 1716356793062
},
"eventType": "ratingsreviewsservice/ratingfeedback/create",
"actOnBehalfOfUser": 0,
"roles": [
],
"channel": "CSR"
}
}
UpdateRatingFeedback
Event Type: ratingsreviewsservice/ratingfeedback/update
{
"version": "0",
"id": "54425978-3602-9075-0b46-ce90936fb534",
"detail-type": "ratingsreviewsservice/ratingfeedback/update",
"source": "ratingsreviewsservice",
"account": "277827593990",
"time": "2024-05-22T05:46:36Z",
"region": "us-east-1",
"resources": [
],
"detail": {
"id": "63",
"timestamp": 1716356796602,
"payload": {
"id": 63,
"feedback": "DISLIKE",
"properties": {
"additionalProp1": "PROP1",
"additionalProp2": "PROP2",
"additionalProp3": "PROP2"
},
"createdTime": 1716356793000,
"updatedTime": 1716356796571
},
"eventType": "ratingsreviewsservice/ratingfeedback/update",
"actOnBehalfOfUser": 0,
"roles": [
],
"channel": "CSR"
}
}
DeleteRatingReviewPreference
Event Type: ratingsreviewsservice/ratingreviewpreference/delete
{
"version": "0",
"id": "658b7812-c7e6-1c66-e88e-5933252792e1",
"detail-type": "ratingsreviewsservice/ratingreviewpreference/delete",
"source": "ratingsreviewsservice",
"account": "277827593990",
"time": "2024-05-22T05:46:39Z",
"region": "us-east-1",
"resources": [
],
"detail": {
"id": "2331",
"timestamp": 1716356799834,
"collectionId": "546",
"eventType": "ratingsreviewsservice/ratingreviewpreference/delete",
"userId": "1",
"actOnBehalfOfUser": 0,
"roles": [
"ROLE_SUPER_ADMIN"
],
"channel": "CSR"
}
}
CreateReviewAnswers
Event Type: ratingsreviewsservice/reviewanswers/create
{
"version": "0",
"id": "7f429e0c-65b4-3cab-938a-5f0cfc15027c",
"detail-type": "ratingsreviewsservice/reviewanswers/create",
"source": "ratingsreviewsservice",
"account": "277827593990",
"time": "2024-05-22T05:46:43Z",
"region": "us-east-1",
"resources": [
],
"detail": {
"id": "4651095",
"timestamp": 1716356803726,
"payload": {
"itemId": "4651095",
"collectionId": 546,
"questionsAndAnswers": [
{
"questions": "is product worth the money?",
"answers": [
{
"answers": "Yes",
"id": 353,
"createdBy": "1",
"createdTime": 1716356803717,
"likesCount": 0,
"unlikesCount": 0,
"workFlowStatus": "PENDING"
}
],
"status": "ACTIVE",
"workFlowStatus": "PENDING",
"id": 214,
"createdBy": "1",
"createdTime": 1716356803706,
"itemId": "4651095"
}
]
},
"collectionId": "546",
"eventType": "ratingsreviewsservice/reviewanswers/create",
"userId": "1",
"actOnBehalfOfUser": 0,
"roles": [
"ROLE_SUPER_ADMIN"
],
"channel": "CSR"
}
}
CreateRatingAnswers
Event Type: ratingsreviewsservice/ratinganswers/create
{
"version": "0",
"id": "129e9521-c455-64eb-1803-75101ed39b83",
"detail-type": "ratingsreviewsservice/ratinganswers/create",
"source": "ratingsreviewsservice",
"account": "277827593990",
"time": "2024-05-22T05:46:47Z",
"region": "us-east-1",
"resources": [
],
"detail": {
"timestamp": 1716356807488,
"payload": {
"itemId": "30885979",
"collectionId": 546,
"questionsAndAnswers": [
{
"questions": "is size mentioned correct?",
"answers": [
{
"answers": "Yes",
"id": 354,
"createdBy": "1",
"createdTime": 1716356807000,
"likesCount": 0,
"unlikesCount": 0,
"workFlowStatus": "PENDING"
},
{
"answers": "yes",
"id": 355,
"createdBy": "1",
"createdTime": 1716356807477,
"likesCount": 0,
"unlikesCount": 0,
"workFlowStatus": "PENDING"
}
],
"status": "ACTIVE",
"workFlowStatus": "PENDING",
"id": 215,
"createdBy": "1",
"createdTime": 1716356807000,
"itemId": "30885979"
}
]
},
"collectionId": "546",
"eventType": "ratingsreviewsservice/ratinganswers/create",
"userId": "1",
"actOnBehalfOfUser": 0,
"roles": [
"ROLE_SUPER_ADMIN"
],
"channel": "CSR"
}
}
CreateCreateVotes
Event Type: ratingsreviewsservice/createvotes/create
{
"version": "0",
"id": "129e9521-c455-64eb-1803-75101ed39b83",
"detail-type": "ratingsreviewsservice/ratinganswers/create",
"source": "ratingsreviewsservice",
"account": "277827593990",
"time": "2024-05-22T05:46:47Z",
"region": "us-east-1",
"resources": [
],
"detail": {
"timestamp": 1716356807488,
"payload": {
"itemId": "30885979",
"collectionId": 546,
"questionsAndAnswers": [
{
"questions": "is size mentioned correct?",
"answers": [
{
"answers": "Yes",
"id": 354,
"createdBy": "1",
"createdTime": 1716356807000,
"likesCount": 0,
"unlikesCount": 0,
"workFlowStatus": "PENDING"
},
{
"answers": "yes",
"id": 355,
"createdBy": "1",
"createdTime": 1716356807477,
"likesCount": 0,
"unlikesCount": 0,
"workFlowStatus": "PENDING"
}
],
"status": "ACTIVE",
"workFlowStatus": "PENDING",
"id": 215,
"createdBy": "1",
"createdTime": 1716356807000,
"itemId": "30885979"
}
]
},
"collectionId": "546",
"eventType": "ratingsreviewsservice/ratinganswers/create",
"userId": "1",
"actOnBehalfOfUser": 0,
"roles": [
"ROLE_SUPER_ADMIN"
],
"channel": "CSR"
}
}
UpdateRatingAnswers
Event Type: ratingsreviewsservice/ratinganswers/update
{
"version": "0",
"id": "b2aecdca-5f80-e531-3119-8a7b02ecc93d",
"detail-type": "ratingsreviewsservice/ratinganswers/update",
"source": "ratingsreviewsservice",
"account": "277827593990",
"time": "2024-05-22T05:46:55Z",
"region": "us-east-1",
"resources": [
],
"detail": {
"timestamp": 1716356815074,
"payload": {
"answersResponses": [
{
"id": 358,
"answers": "Yes",
"questionId": 217,
"createdBy": "1",
"createdTime": 1716356815000,
"likesCount": 0,
"unlikesCount": 0,
"workFlowStatus": "REJECTED"
},
{
"id": 359,
"answers": "yes",
"questionId": 217,
"createdBy": "1",
"createdTime": 1716356815046,
"likesCount": 0,
"unlikesCount": 0,
"workFlowStatus": "PENDING"
}
]
},
"collectionId": "546",
"eventType": "ratingsreviewsservice/ratinganswers/update",
"userId": "1",
"actOnBehalfOfUser": 0,
"roles": [
"ROLE_SUPER_ADMIN"
],
"channel": "CSR"
}
}
UpdateReviewQuestions
Event Type: ratingsreviewsservice/reviewquestions/patch
{
"version": "0",
"id": "472eb082-d68a-c014-647c-96629c28443f",
"detail-type": "ratingsreviewsservice/reviewquestions/patch",
"source": "ratingsreviewsservice",
"account": "277827593990",
"time": "2024-05-22T05:46:58Z",
"region": "us-east-1",
"resources": [
],
"detail": {
"timestamp": 1716356818840,
"payload": {
"questionResponses": [
{
"id": 218,
"questions": "is the product quality?",
"createdBy": "1",
"createdTime": 1716356819000,
"workFlowStatus": "APPROVED"
}
]
},
"collectionId": "546",
"eventType": "ratingsreviewsservice/reviewquestions/patch",
"userId": "1",
"actOnBehalfOfUser": 0,
"roles": [
"ROLE_SUPER_ADMIN"
],
"channel": "CSR"
}
}
UpdateReviewAnswers
Event Type: ratingsreviewsservice/reviewanswers/patch
{
"version": "0",
"id": "f9b0d275-af8e-fdbc-7f2c-7f881e448e7e",
"detail-type": "ratingsreviewsservice/reviewanswers/patch",
"source": "ratingsreviewsservice",
"account": "277827593990",
"time": "2024-05-22T05:47:02Z",
"region": "us-east-1",
"resources": [
],
"detail": {
"timestamp": 1716356822764,
"payload": {
"answersResponse": [
{
"id": 361,
"answers": "Yes",
"questionId": 361,
"createdBy": "1",
"createdTime": 1716356823000,
"likesCount": 0,
"unlikesCount": 0,
"workFlowStatus": "APPROVED"
}
]
},
"collectionId": "546",
"eventType": "ratingsreviewsservice/reviewanswers/patch",
"userId": "1",
"actOnBehalfOfUser": 0,
"roles": [
"ROLE_SUPER_ADMIN"
],
"channel": "CSR"
}
}
DeleteQuestionById
Event Type: ratingsreviewsservice/deleteByIdQuestion/delete
{
"version": "0",
"id": "52b9dc82-7ceb-9f6c-8732-83e48221acde",
"detail-type": "ratingsreviewsservice/deleteByIdQuestion/delete",
"source": "ratingsreviewsservice",
"account": "277827593990",
"time": "2024-05-22T05:47:06Z",
"region": "us-east-1",
"resources": [
],
"detail": {
"id": "220",
"timestamp": 1716356826521,
"payload": {
"id": 220,
"questions": "is the product quality?",
"status": "INACTIVE",
"workFlowStatus": "PENDING",
"createdBy": "1",
"createdTime": 1716356826000,
"collectionId": 546,
"itemId": "52111968",
"answers": [
{
"id": 362,
"answers": "Yes",
"questionId": 220,
"createdBy": "1",
"createdTime": 1716356826000,
"likesCount": 0,
"unlikesCount": 0,
"workFlowStatus": "PENDING"
}
]
},
"collectionId": "546",
"eventType": "ratingsreviewsservice/deleteByIdQuestion/delete",
"userId": "1",
"actOnBehalfOfUser": 0,
"roles": [
"ROLE_SUPER_ADMIN"
],
"channel": "CSR"
}
}
Internal Events via RabbitMQ/AWS MQ
The following events communicate with the internal microservices.
List of Events
SL.# | Name | Description | Publish Location | Routing Key | Durability | Payload Type |
---|---|---|---|---|---|---|
1 | Review Moderation | This event is triggered to moderate the newly submitted rating and review. | Topic: ecomm | reviews.moderation | TRUE | Notification |
2 | Review Aggregation | This event is triggered to update the rating summary when there is a new moderated rating and review. | Topic: ecomm | reviews.aggregation | TRUE | Catalog |
Payload Models
Below is the payloads for the Ratings and Reviews microservice events:
Notification
Property | Type | Description | Example |
---|---|---|---|
collectionId | long | Indicates the ID of the collection. | 123 |
ratingId | long | Indicates the ID of the rating and review. | 340 |
userId | String | Indicates the ID of the customer. | USER_A10 |
itemid | String | Indicates the ID of the item. | MOBILE_BRAND_23 |
itemname | String | Indicates the name of the item. | Mobile Phone |
itemdescription | String | Indicates the description of the item. | Supports 2G/3G/4G network, frontend and backend cameras, and 8GB RAM. |
properties | Map | Specifies a list of properties of the rating and review. | {"ratingcolor":red} |
review | String | Denotes the review contents given by the user. | Very excellent product with all the features for less cost. |
reviewTitle | String | Denotes the review title given by the user. | Excellent Product |
locale | String | Indicates the locale of the rating and review. | en_US |
imageUrls | List | Indicates a list of comma-separated image URLs. | https://www.skava.com/wp-content/uploads/2019/02/Product_Banner_v4.6.jpg |
status | RatingStatus | Specifies the status of the rating. The value can be:
| PENDING |
storeId | String | Refers to the ID of the store. | WEST_STORE |
businessId | long | Indicates the ID of the business. | 100 |
Catalog
Property | Type | Description | Example |
---|---|---|---|
collectionId | long | Indicates the ID of the collection. | COL45 |
itemid | String | Indicates the ID of the item. | PRODUCT124 |
ratingdistribution | Map | Indicates the rating distribution of the item. | {"1":10,"2":20} |
ratingfinal | Double | Specifies the average rating of the item. | 4.5 |
ratingsCount | int | Specifies the total number of reviews submitted by the customers on a specific item. | 198 |
Revision History
2024-05-24 | JP – Added the external event details for 8.17.4 release.
2020-03-03 | AN – Created the page for April 2020 release.