feat(web): cart (add to cart, cart page, header link) (#40) #123
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!123
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/40-cart"
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?
Slice 3 of the ticket storefront (#40): a server-side cart for signed-in customers. Design
docs/superpowers/specs/2026-10-29-storefront-cart-design.md, plandocs/superpowers/plans/2026-10-29-storefront-cart.md. No change underapi/, no OpenAPI change, no migration. No checkout, promo code or payment (#41).What it does
park_entryandvehicletickets that are priced and available in the page currency; nevermaster. States: signed out (Sign in, returns to the same URL), auth off (nothing), cart in another currency (fixed note), past visit date (fixed message, no request), write in flight (disabled), too many lines / over 100 / invalid cart lines / error (fixed messages)./cart: lines with name, park, visit date, quantity (Update), unit price in the cart's currency, Remove, Empty cart, the fixed note that the final price is confirmed at checkout, empty/loading/error/signed-out/auth-off states. A line that is unavailable, past or failed shows a fixed note and can still be removed. No total and no arithmetic on money anywhere.src/cart): one serialised write queue (two quick Adds both land),addreads the fresh server cart before merging, the last line removed is aDELETE, a failed write refetches, sign-out mid-write cannot refill the cache.pnpm --filter @kws/ticket e2e:idp(+deploy/dev-idp/seed-cart.sql, idempotent, dev only): sign in, add two, see the count, edit, remove, empty, no cart data in storage,Authorizationonly on/v1, 320 px, a 401 signs out.Verification
pnpm typecheck,pnpm test(231),pnpm buildgreen; standard Playwright e2e in Playwright's image: 114 passed / 46 skipped by design (new auth-off cart spec at five viewports, axe, no overflow).make cover: 91.3% (minimum 80%; Go code unchanged).Author calls (owner to check)
shortcut:comment; the real fix is an API change returning park, product and unit price on cart lines, before checkout builds on it. [verify]checkout_date = visit_date); one currency per cart; two tabs: last write wins (the API's design); seats are not shown (409 at checkout)./cart).useMutation({scope})(concurrency rewrite risk), thecurrencyIdprop chain, test-overlap cleanup.Not verified
Refs #40 (does not close it).
🤖 Generated with Claude Code