Cart API
The public-facing API for shopping carts. Handles commands to add and remove items and to check out, and publishes an event when a cart is checked out.
Overview
The Cart API is the front door to the Cart System. It validates incoming commands, persists cart contents to the Cart DatabaseCart DatabaseContainerv1.0.0PostgreSQL database that is the system of record for shopping carts and their items.MapView docs, asks the Promotion SystemPromotion SystemSystemv1.0.0Internal system that calculates the discounts and promotions that apply to a cart. It owns promotion rules and returns c...Ownershopping-platformMapView docs to calculate discounts via Calculate DiscountCalculate DiscountCommandv1.0.0Command to calculate the discount that applies to a cart.
Ownershopping-platformSchemaMapView docs, and publishes a Cart Checked OutCart Checked OutEventv1.0.0Published when a customer has checked out their cart.
Ownershopping-platformSchemaMapView docs event when the customer checks out.
Responsibilities
| Area | Description |
|---|---|
| Cart management | Validates and applies Add Item To CartAdd Item To CartCommandv1.0.0Command to add an item to a shopping cart. Ownershopping-platformSchemaMapView docs, Remove Item From CartRemove Item From CartCommandv1.0.0Command to remove an item from a shopping cart. Ownershopping-platformSchemaMapView docs and Checkout CartCheckout CartCommandv1.0.0Command to check out a shopping cart. Ownershopping-platformSchemaMapView docs. |
| Discounts | Requests pricing from the Promotion System via Calculate DiscountCalculate DiscountCommandv1.0.0Command to calculate the discount that applies to a cart. Ownershopping-platformSchemaMapView docs. |
| Event publishing | Emits Cart Checked OutCart Checked OutEventv1.0.0Published when a customer has checked out their cart. Ownershopping-platformSchemaMapView docs when a cart is checked out. |
| Persistence | Reads from and writes to the Cart DatabaseCart DatabaseContainerv1.0.0 |