refactor: delete superseded checkout routes and dedupe cart checkout #17

Merged
bermudalamb merged 2 commits from refactor/remove-dead-checkout-routes into main 2026-08-14 17:59:47 -05:00
2 Commits
Author SHA1 Message Date
bermudalamb 1848adb7ce Merge branch 'main' into refactor/remove-dead-checkout-routes
SonarQube Analysis / sonarqube (pull_request) Successful in 6m0s
Tests / backend-unit (pull_request) Successful in 1m2s
Tests / backend-integration (pull_request) Successful in 3m0s
Tests / frontend-e2e (pull_request) Failing after 47s
2026-08-14 17:58:47 -05:00
bermudalambandClaude Opus 5 135cd2364d refactor: delete superseded checkout routes and dedupe cart checkout
SonarQube Analysis / sonarqube (pull_request) Successful in 8m12s
Tests / backend-unit (pull_request) Successful in 1m1s
Tests / backend-integration (pull_request) Successful in 2m0s
Tests / frontend-e2e (pull_request) Failing after 50s
routes/paypal.ts and routes/demo.ts were the pre-cart single-item
checkout flow. Nothing has imported them since the cart flow landed:
app.ts mounts only cartCheckout, the frontend calls /api/checkout/cart/*,
and no test touches them. They duplicated PAYPAL_BASE, getAccessToken,
and a second handler for the /webhooks/paypal mount.

Also extract openCheckout() from /paypal/create and /demo/purchase in
cartCheckout.ts, which repeated the same address-ownership check, cart
lock, and checkouts/checkout_items inserts. It returns a discriminated
union so callers keep control of the transaction and the response. Add
CartItem/LockedCart interfaces, dropping the (it: any) casts.

Note: paypal.ts was the only writer of items.reserved_until and
items.paypal_order_id. Those columns are now write-dead; the schema is
left alone for a separate migration.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-14 17:18:56 -05:00