feat(api): cart line details (park, product, availability, unit price) (#40) #124
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/kws!124
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/40-cart-line-details"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
GETandPUT /v1/me/cartnow return read-only details on each cart line, so the web cart page (and checkout, #41) no longer needs parks × dates requests to find names and prices. Request bodies are unchanged. API only; the web change is a separate PR.New line fields:
park_id,available(always), andpark_name,product_name,age_group,resident_type,unit_price(optional).Rules
unit_price= price of one ticket for the whole stay, in the cart currency, before promo/tax/fee. Not an order total; checkout stays the only pricer.dayQuotes,dayPrice,stayDays), one quote per distinct (park, day), summed withmoney.Amount. A test compares the cart price with what a real checkout charges.available: false(nounit_price) when any stay day has no price/rate, the visit day is before today (Nairobi), or the park/product is off. A switched-off park or product also has no names. An unknown currency makes every line unavailable, not a 500.no-store; owner from the token.Docs
Spec
docs/superpowers/specs/2026-10-29-cart-line-details-design.md, plan, CLAUDE.md cart note, ADR 0011, OpenAPICartLine. Calls marked [verify] in the spec await the owner.Checks
make cover: 91.3% total (minimum 80%), run after the last code changemake lint,make contractpass; TS and Dart clients regenerate (scripts/generate-clients.sh)Not covered / known
No test for a concurrent PUT during the read (relies on the single statement); no USD parity test against checkout, no inactive-currency DB test, no unavailable-line live contract case (all optional, parked).
🤖 Generated with Claude Code