**design.md isn't ready to build from. The payment step can charge customers twice or charge them with no order recorded.** The fixes are small, but they change the flow, so make them before you start.

## Blocking issues

1. **Retrying the charge can double-charge (step 4).** A timeout doesn't mean the charge failed. It often means the provider processed it and the response was lost. The doc retries up to 3 times and never mentions an idempotency key. Send a stable key per order (for example the order id) on every attempt. Also decide what happens when all retries time out: look up the charge status with the provider instead of assuming failure.

2. **A failed request can leave a customer charged with no order (steps 5–6).** If the charge succeeds but the `PAID` update or the commit fails, or the final attempt times out after the provider has charged, the doc rolls back. The order row disappears and the money stays taken. The doc needs a durable record of the payment attempt that survives failure, plus a reconciliation or refund path. A cleaner approach is:
   - Commit the `PENDING` order first.
   - Charge outside any transaction.
   - Update the status to `PAID` or `FAILED` afterwards.
   - Run a sweeper that resolves orders stuck in `PENDING`.

3. **The database transaction stays open during external calls (steps 3–4).** The worst case is about 20 s (4 attempts × 5 s) holding a connection and row locks. That is manageable at 200 orders a day but will hurt at 2,000. It is also the reason issue 2 exists, so the same restructuring fixes both.

4. **`POST /orders` has no idempotency.** If the client retries after a network drop, it creates a second order and a second charge. Require a client-supplied idempotency key, enforced with a unique constraint.

## Should fix, but not blocking

- **Overselling.** A cache that is up to 5 minutes stale is fine for a pre-check. Nothing actually reserves or decrements stock, though, so two buyers can get the last item. State the policy: oversell and apologise, or reserve stock at order time.
- **Confirmation email.** It is sent inline after commit with no retry or outbox, so a failure there is silent. A simple outbox row or a retry is enough.
- **Backups.** Nightly backups on a single instance means up to 24 hours of lost orders and payments. That may be acceptable, but make it a conscious decision. Enabling WAL archiving or point-in-time recovery is cheap on managed Postgres.
- **Tests.** Only the happy path is covered, and the risks above are all failure paths. Add tests for payment timeout then success, retries exhausted, and a commit failure after a successful charge.
- **Missing details.** Auth, the order state machine (`PENDING`, `PAID`, `FAILED`, `REFUNDED`), and the error contract returned to the client are not specified.

The code structure section is fine for a four-person team and needs no changes.

Fix items 1–4 in the doc first. That is probably an hour of rewriting, and you can start building the day after.

VERDICT: NOT READY
