pending, and waits for an operator to publish or reject it. The Review module ships inside @mercurjs/core, so it’s registered with the rest of the marketplace modules and needs no extra install. It connects to products, stores, orders, and customers through module links.
The panels call the target a store. The code calls the same record a
Seller, so a store review has reference: "seller". Reviews use the id prefix rev and resolve with MercurModules.REVIEW.Key features
The Review module covers a review from submission to the number on a storefront:- One model, two targets: a single
Reviewrecord rates a product or a store, chosen by itsreferencefield - Order-backed: the order must belong to the customer, and each order can review a given target once
- Moderation: reviews start
pending, and an operator sets them topublishedorrejected - Store responses: a store answers a review once through
seller_note - Rating helpers: service methods compute average ratings per product or per store at query time
- Compensation: every review workflow rolls its write back if a later step fails
How it works
A review moves through four stages:- A customer calls
POST /store/reviewswith an order they own, which runscreateReviewWorkflow - The workflow validates the order, creates the review as
pending, and links it to its customer, order, and target - An operator publishes or rejects it with
updateReviewWorkflow, and the store answers it withrespondReviewWorkflow - Your own storefront route reads published reviews and averages them with the service’s rating helpers
Get started
Learn how reviews, their targets, and their statuses fit together.The review model
The fields of a review: rating, notes, status, and display id.
Product vs seller reviews
How
reference picks the target and which links anchor each review.Ratings & moderation
Status changes, store responses, and how averages are computed.
Examples
Build against reviews in your own server code.Create a review
Run
createReviewWorkflow from a custom route.Moderate a review
Publish, reject, and delete reviews in code.
Respond to a review
Attach a store’s answer with
respondReviewWorkflow.Aggregate ratings
Serve average ratings for products and stores.
Resources
The data model, links, workflows, service methods, and events behind reviews.Data models
The
Review model, its fields, and its indexes.Links
The four links to products, sellers, orders, and customers.
Workflows
Create, update, respond, and delete workflows with their steps.
Service
Generated methods and the rating helpers.
Events
The mutation events the module emits.