Shopping and promotions
How carts, checkout intent and discount calculation are modelled in the Shopping domain.
ShoppingShoppingDomain•v1.0.0The Shopping domain owns the customer's path to purchase — building a cart, applying promotions, and checking out. It co...Ownershopping-platformMapView 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 SystemCart SystemSystem•v1.0.0Internal system that owns the customer's shopping cart and the checkout flow. It is the source of truth for cart content...Ownershopping-platformMapView docs owns cart state in Cart DatabaseCart DatabaseContainer•v1.0.0PostgreSQL database that is the system of record for shopping carts and their items.MapView docs. 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 handles:
- Add Item To CartAdd Item To CartCommand•v1.0.0Command to add an item to a shopping cart. Ownershopping-platformSchemaMapView docs
- Remove Item From CartRemove Item From CartCommand•v1.0.0Command to remove an item from a shopping cart. Ownershopping-platformSchemaMapView docs
- Checkout CartCheckout CartCommand•v1.0.0Command to check out a shopping cart. Ownershopping-platformSchemaMapView docs
When a cart is checked out, it publishes Cart Checked OutCart Checked OutEvent•v1.0.0Published when a customer has checked out their cart. Ownershopping-platformSchemaMapView docs. That event is the handoff from Shopping to Ordering.
Promotion System
Promotion SystemPromotion SystemSystem•v1.0.0Internal system that calculates the discounts and promotions that apply to a cart. It owns promotion rules and returns c...Ownershopping-platformMapView docs owns promotion rules in Promotion DatabasePromotion DatabaseContainer•v1.0.0PostgreSQL store of promotion and discount rules.MapView docs. It handles Calculate DiscountCalculate DiscountCommand•v1.0.0Command to calculate the discount that applies to a cart.
Ownershopping-platformSchemaMapView docs and publishes Discount CalculatedDiscount CalculatedEvent•v1.0.0Published when a discount has been calculated for a cart.
Ownershopping-platformSchemaMapView 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 OutCart Checked OutEvent•v1.0.0Published when a customer has checked out their cart. Ownershopping-platformSchemaMapView docs is published, Checkout SystemCheckout SystemSystem•v1.0.0Internal system that orchestrates checkout. When a cart is checked out it reserves inventory, authorizes payment, and as...Ownerordering-platformMapView 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.