**Not ready to start tomorrow.** The payment step can charge a customer twice, or take their money and leave no order. Both are fixable in the design in about a day, and neither is something to discover during the build.

## Must fix before building

**1. A payment retry can double-charge (step 4).** A 5-second timeout doesn't mean the charge failed. The provider may have charged the card and answered too slowly.
- Case: the charge succeeds at 5.2 s, we time out at 5 s and retry, and the customer is charged twice.
- Fix: send an idempotency key with every charge, derived from the order id, so a retry returns the first result. Spell out how each outcome is handled: decline (don't retry), timeout (retry with the same key), and provider 5xx.

**2. A failure after a successful charge loses the order (steps 5 and 6).** The `PENDING` insert sits inside the same transaction as the charge, so a crash or a failed commit rolls the order back after the money has moved.
- Case: the charge succeeds, the process dies before commit, and the customer is charged with no order record anywhere.
- Fix: commit the order as `PENDING` first, then charge, then update to `PAID` in a second short transaction. Add a reconciliation job that finds `PENDING` orders older than N minutes and asks the provider what happened.

**3. The transaction stays open during the payment call (steps 3–5).** Three retries at 5 s each means a database connection is held for 15 s or more. A slow provider day will use up the connection pool and take the whole service down, not only checkout. The fix for #2 (a short transaction on each side of the call) also solves this.

**4. A retried `POST /orders` creates duplicate orders.** If the client's request times out and it retries, the design creates a second order and a second charge. Require a client-supplied idempotency key on the request and enforce it with a unique constraint.

**5. The tests don't cover the risky parts.** The plan is unit tests per module plus one happy-path integration test. Every failure above lives on the unhappy path. Before building, add tests for:
- payment timeout then success, with a single charge
- a decline
- a crash between charge and commit
- a duplicate client request
- an email failure

Write these first, per your TDD standard.

## Fix, but smaller

- **Stock check and overselling.** A 5-minute-old cache with no reservation will oversell popular items. The tradeoff is defensible at 200 orders a day, but the design doesn't say what happens when it oversells. Add a rule (cancel and refund, or backorder) and name it as accepted debt.
- **Confirmation email.** It's sent inline after commit, and the design doesn't say what happens if sending fails. It must not fail the order. At minimum, record "email pending" on the order and retry from a small job. A full outbox pattern is probably overkill at this volume.
- **Backups.** Nightly backups on a single instance mean up to 24 hours of paid orders can be lost. The provider has those payments and you won't, so you'd have charges with no orders. Enable point-in-time recovery (WAL archiving); it's cheap and removes this gap.
- **Missing lifecycle states.** There's no `FAILED`, `CANCELLED` or `REFUNDED` state, and no provider webhook handling. Webhooks are the safety net when a response is lost.

## What's fine

The module boundaries, the thin routes, the `OrderCheckout` service and the order id in every log line are sound. You don't need queues or microservices at 2,000 orders a day, so keep it a simple service. The problems are correctness issues that don't depend on scale.

Revise the Flow section to a two-transaction flow with idempotency keys and a reconciliation job, add the failure-path tests to the plan, then start.

VERDICT: NOT READY
