This is a demo catalog. Create one for your own architecture with a single prompt.

Get started →

Shopping and promotions

How carts, checkout intent and discount calculation are modelled in the Shopping domain.

Domain guide

ShoppingDomainv1.0.0ShoppingThe Shopping domain owns the customer's path to purchase — building a cart, applying promotions, and checking out. It co...Ownershopping-platformDiagramOpen docs owns the customer’s active path to purchase before an order exists. The core state is the cart, not the order.

System context map

Cart System

Cart SystemSystemv1.0.0Cart SystemInternal system that owns the customer's shopping cart and the checkout flow. It is the source of truth for cart content...Ownershopping-platformDiagramOpen docs owns cart state in Cart DatabaseContainerv1.0.0Cart DatabasePostgreSQL database that is the system of record for shopping carts and their items.Ownershopping-platformDiagramOpen docs. Cart APIServicev1.0.0Cart APIThe 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-platformDiagramRepositoryOpen docs handles:

When a cart is checked out, it publishes Cart Checked OutEventv1.0.0Cart Checked OutPublished when a customer has checked out their cart. Ownershopping-platformSchemaDiagramOpen docs. That event is the handoff from Shopping to Ordering.

Promotion System

Promotion SystemSystemv1.0.0Promotion SystemInternal system that calculates the discounts and promotions that apply to a cart. It owns promotion rules and returns c...Ownershopping-platformDiagramOpen docs owns promotion rules in Promotion DatabaseContainerv1.0.0Promotion DatabasePostgreSQL store of promotion and discount rules.Ownershopping-platformDiagramOpen docs. It handles Calculate DiscountCommandv1.0.0Calculate DiscountCommand to calculate the discount that applies to a cart. Ownershopping-platformSchemaDiagramOpen docs and publishes Discount CalculatedEventv1.0.0Discount CalculatedPublished when a discount has been calculated for a cart. Ownershopping-platformSchemaDiagramOpen docs.

Discount calculation is deliberately separate from cart persistence. The Cart System owns what the customer is buying; the Promotion System owns how discounts are evaluated.

Boundary with Ordering

Shopping does not create orders. Once Cart Checked OutEventv1.0.0Cart Checked OutPublished when a customer has checked out their cart. Ownershopping-platformSchemaDiagramOpen docs is published, Checkout SystemSystemv1.0.0Checkout SystemInternal system that orchestrates checkout. When a cart is checked out it reserves inventory, authorizes payment, and as...Ownerordering-platformDiagramOpen docs takes responsibility for coordinating inventory, payment and order creation.

This boundary keeps cart behavior and order lifecycle behavior independent. It also gives checkout a clear recovery point if inventory or payment fails.