Eventing model
How commands, events and queries are used across Acme Inc's event-driven commerce platform.
The catalog separates messages by intent.
- Commands ask another capability to do something.
- Events announce that something has already happened.
- Queries request information without changing state.
Commands
Commands are named in the imperative and should have one clear handler. Examples:
- Checkout CartCheckout CartCommand•v1.0.0Command to check out a shopping cart.
Ownershopping-platformSchemaMapView docs asks Cart APICart APIService•v1.0.0
The public-facing API for shopping carts. Handles commands to add and remove items and to check out, and publishes an ev...Publishescart-checked-out, calculate-discountSubscribesadd-item-to-cart, remove-item-from-cart +1APIsOpenAPIOwnershopping-platformMapRepoView docs to check out a cart.
- Reserve InventoryReserve InventoryCommand•v1.0.0Command to reserve stock for the items in a checked-out cart.
Ownerordering-platformSchemaMapView docs asks Inventory ServiceInventory ServiceService•v1.0.0
The system of record for stock. Reserves and releases inventory, serves stock-level queries, and publishes events when s...Publishesinventory-reserved, inventory-unavailableSubscribesreserve-inventory, release-inventory +1Ownerfulfilment-platformMapRepoView docs to hold stock.
- Authorize PaymentAuthorize PaymentCommand•v1.0.0Command to authorize payment for the total of a checked-out cart.
Ownerordering-platformSchemaMapView docs asks Payment APIPayment APIService•v1.0.0
Receives payment authorization requests from the Ordering domain and records the payment intent, kicking off the charge ...Subscribesauthorize-paymentOwnerpayments-platformMapRepoView docs to authorize payment.
- Create OrderCreate OrderCommand•v1.0.0Command to create a new order from a checked-out cart.
Ownerordering-platformSchemaMapView docs asks Order ServiceOrder ServiceService•v1.0.0
The system of record for orders. Creates and cancels orders, serves order lookups, and publishes events as orders move t...Publishesorder-created, order-completed +1Subscribescreate-order, cancel-order +1APIsAsyncAPIOwnerordering-platformMapRepoView docs to create an order.
- Submit ReviewSubmit ReviewCommand•v1.0.0Command issued by a customer to submit a review and rating for a product.
Ownerreviews-platformSchemaMapView docs asks Review APIReview APIService•v1.0.0
The public-facing API for product reviews. Accepts review submissions, serves published reviews, and is the entry point ...Publishesreview-submitted, review-flagged +1Subscribessubmit-review, flag-review +2Ownerreviews-platformMapRepoView docs to accept a product review.
Events
Events are facts and should be safe for multiple consumers. Examples:
- Cart Checked OutCart Checked OutEvent•v1.0.0Published when a customer has checked out their cart. Ownershopping-platformSchemaMapView docs starts the checkout process.
- Order CreatedOrder CreatedEvent•v1.0.0Published when a new order has been created. Ownerordering-platformSchemaMapView docs signals that an order exists.
- Payment SucceededPayment SucceededEvent•v1.0.0Published by Stripe when a charge succeeds. Ownerpayments-platformSchemaMapView docs and Payment FailedPayment FailedEvent•v1.0.0Published by Stripe when a charge fails. Ownerpayments-platformSchemaMapView docs report external processor outcomes.
- Order Ready For ShippingOrder Ready For ShippingEvent•v1.0.0Published when a packed order is ready to be handed to a carrier for shipping. Ownerfulfilment-platformSchemaMapView docs hands fulfilment to shipping.
- Review PublishedReview PublishedEvent•v1.0.0Published when a submitted review passes moderation and becomes visible on the storefront. Ownerreviews-platformSchemaMapView docs updates review read models and product trust signals.
Queries
Queries are explicit read contracts. Examples include Get ProductGet ProductQuery•v1.0.0Query to fetch a single product by its identifier. Ownerproduct-platformSchemaMapView docs, Search ProductsSearch ProductsQuery•v1.0.0Query to search the catalog for products matching a term, with optional filters and pagination. Ownersearch-platformSchemaMapView docs, Get OrderGet OrderQuery•v1.0.0Query to fetch a single order by its identifier. Ownerordering-platformSchemaMapView docs, Get CustomerGet CustomerQuery•v1.0.0Query to fetch a single customer by their identifier. Ownercustomer-platformSchemaMapView docs, Get Stock LevelGet Stock LevelQuery•v1.0.0Query to fetch the current available stock level for a product. Ownerfulfilment-platformSchemaMapView docs and Get Product ReviewsGet Product ReviewsQuery•v1.0.0Query to fetch the published reviews and aggregate rating for a product. Ownerreviews-platformSchemaMapView docs.
Versioning expectations
Backward-compatible additions are preferred. Removing fields or changing semantics requires a versioned contract and a migration plan. For customer-critical flows, review the flow page and all participating messages before changing a schema.
Failure expectations
Consumers should be idempotent. Producers should publish facts after durable state changes. Long-running processes should persist their progress, especially Checkout SagaCheckout SagaFlow•v1.0.0How the Checkout Orchestrator turns a checked-out cart into an order — reserving inventory, authorizing payment and crea...Ownerordering-platformView flowView docs, payment processing, search indexing and review moderation.