OSS-first docs
These docs teach the open system first: contracts, generated surfaces, runtimes, governance, and incremental adoption. Studio shows up as the operating layer on top, not as the source of truth.
Create a product/store review.
Goal
Allow buyers to leave feedback.
Context
Post-purchase.
Emitted Events
•
`marketplace.review.created` (v1.0.0)
Source Definition
import {
defineCommand,
defineQuery,
} from '@lssm-tech/lib.contracts-spec/operations';
import {
CreateReviewInputModel,
ListReviewsInputModel,
ListReviewsOutputModel,
ReviewModel,
} from './review.schema';
export const CreateReviewContract = defineCommand({
meta: {
key: 'marketplace.review.create',
version: '1.0.0',
stability: 'stable',
owners: ['@example.marketplace'],
tags: ['marketplace', 'review', 'create'],
description: 'Create a product/store review.',
goal: 'Allow buyers to leave feedback.',
context: 'Post-purchase.',
},
io: { input: CreateReviewInputModel, output: ReviewModel },
policy: { auth: 'user' },
sideEffects: {
emits: [
{
key: 'marketplace.review.created',
version: '1.0.0',
when: 'Review is created',
payload: ReviewModel,
},
],
audit: ['marketplace.review.created'],
},
acceptance: {
scenarios: [
{
key: 'create-review-happy-path',
given: ['User purchased product'],
when: ['User leaves a review'],
then: ['Review is created', 'ReviewCreated event is emitted'],
},
],
examples: [
{
key: 'create-5-star',
input: { productId: 'prod-456', rating: 5, comment: 'Great product!' },
output: { id: 'rev-789', status: 'published' },
},
],
},
});