I read `design.md`. The context, code structure and scale assumptions are solid. The payment part of the flow (steps 3–6) has correctness bugs that can lose or double-charge customers' money. Those need fixing before you write the checkout code. You can start on the rest tomorrow.

## Must fix before building checkout

**1. Retrying the charge on timeout can charge the customer twice** (`design.md:14-15`)
A timeout doesn't mean the charge failed. It often succeeded and only the response was lost. Retrying up to 3 times without an idempotency key could charge one customer up to 4 times.
- **Fix:** generate an idempotency key per order (the order id works) and send it on every charge attempt. Check that your payment provider supports this; most do.

**2. If the last retry times out, the order is rolled back but the customer may still be charged** (`design.md:13-18`)
The `PENDING` row sits inside the open transaction, so a rollback erases it. If the charge actually went through, you have money taken and no order record at all.
- **Fix:** commit the `PENDING` order *before* calling the payment provider. Then update it to `PAID` or `FAILED`. When the outcome is unknown, mark it something like `PAYMENT_UNKNOWN` and resolve it with a reconciliation job that asks the provider about the charge (or with the provider's webhooks).

**3. The database transaction stays open during the payment call**
With 4 attempts × 5 s, one checkout can hold a connection and row locks for over 20 s. At 2,000 orders a day that's survivable, but it's a bad pattern, and fix #2 removes it anyway.

**4. A client retry of `POST /orders` creates a duplicate order** (`design.md:9`)
Mobile networks and double-clicks will cause this. Accept an `Idempotency-Key` header from the client, or a client-generated order id, and enforce it with a unique constraint.

## Should fix

**5. The 5-minute inventory cache allows overselling** (`design.md:10-12`)
Using the cache for a quick check is fine, but nothing ever reserves or decrements stock. Two customers can buy the last unit, and so can anyone within the 5 minutes after it sells out. Decide and write down either (a) a reservation or decrement step, or (b) "we accept oversells and handle them by refund or backorder." Either works, as long as you choose it on purpose.

**6. Sending the email should not be part of the request** (`design.md:16-17`)
The design doesn't say what happens if the email fails after commit. Queue it (an outbox table plus a worker, or a job queue) so an email outage can't fail or slow down checkout.

**7. Testing only the happy path misses where the bugs will be** (`design.md:24`)
Add integration tests for: payment timeout followed by success on retry, a declined payment, an unknown outcome, a duplicate client request, and out of stock.

## Worth considering

**8. Nightly backups mean losing up to a day of orders and payment records.** For financial data, turn on point-in-time recovery (WAL archiving or your host's PITR option). It's cheap.

## What's fine as is
The scale assumptions are right: a single Postgres instance easily handles 2,000 orders a day. The module boundaries, thin routes, `OrderCheckout` service class and structured logging with the order id are all good choices.

## Suggested plan
Rewrite steps 3–6 as: insert `PENDING` and commit → charge with the idempotency key → update the status → queue the email, with a reconciliation path for unknown outcomes. Add a line on the inventory decision. That's maybe an hour of design work. Tomorrow you can already scaffold the modules, routes, inventory cache and logging, none of which these changes affect.

VERDICT: READY WITH CHANGES
