Skip to content

feat: public cart domain + CartPort (ADR 0026) - #5

Merged
DanMat merged 1 commit into
mainfrom
feat/public-cart
Aug 31, 2026
Merged

DanMat merged 1 commit into
mainfrom
feat/public-cart

Conversation

@DanMat

@DanMat DanMat commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

PR② of Commerce checkout (Foodmart Slice 4). Commerce gains the cart domain + a published CartPort; the Storefront will drive it (next PR).

Server-side price (cart stores only {sku,qty}), active-sku-only, bounded whole qty + line cap, server-random cart token (unguessable, client can't choose), constant-time CSRF check, checkout via the atomic OrderBook.place, cart GC task. See ADR 0026. PHPStan max · 37 tests · cs-fixer clean.

🤖 Generated with Claude Code

Commerce gains the public shopping cart: commerce_cart (opaque-random
cart_token PK + per-cart csrf secret) + commerce_cart_line storing ONLY
{sku, qty} — never a price. A published CartPort (ADR 0019) the Storefront
drives: getOrCreate/add/setQty/remove/contents/checkout.

Security controls (ADR 0026): price + totals resolved SERVER-SIDE from the
Inventory item (CatalogReadPort) at render and checkout — the client sends
sku+qty only; add accepts only ACTIVE items + bounded whole quantities +
a line cap; the cart token is server-random (a client can't choose it);
csrf verified constant-time; checkout places via OrderBook (atomic stock
reservation) then clears the cart. Abandoned carts GC'd by a maintenance
task. PHPStan max, 37 tests, cs-fixer green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@DanMat
DanMat merged commit 92347b6 into main Aug 31, 2026
2 checks passed
@DanMat
DanMat deleted the feat/public-cart branch August 31, 2026 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant