17 lines
595 B
Markdown
17 lines
595 B
Markdown
# cart Specification
|
|
|
|
## Purpose
|
|
TBD - created by archiving change cart-checkout-orders. Update Purpose after archive.
|
|
## Requirements
|
|
### Requirement: Server-side cart
|
|
Authenticated shoppers SHALL have a Redis-backed cart keyed by user id, containing sku_id + qty entries.
|
|
|
|
#### Scenario: add and update
|
|
- **WHEN** a shopper POSTs sku + qty, then PUTs a new qty
|
|
- **THEN** GET /api/cart reflects the latest qty with current price/name snapshot
|
|
|
|
#### Scenario: unpurchasable SKU rejected
|
|
- **WHEN** adding a SKU that is inactive or whose product is not published
|
|
- **THEN** the API returns 400
|
|
|