**Not ready as written, but it needs a few small edits, not a rewrite.** The scale, module split, and thin-route structure are fine for a team of four at 2,000 orders a day. The problems are all in the payment flow (steps 3–6).

## Must fix before building

1. **Retrying the charge can double-charge customers (step 4).** A 5 s timeout doesn't mean the charge failed. The provider may have processed it and only the response was lost. Retrying without an idempotency key can charge the customer up to 4 times.
   - Generate one idempotency key per order, for example the order id, and send it on every charge attempt.
   - Most providers support this natively.

2. **Rolling back after a possible charge loses the order (step 6).** If every attempt times out, the money may have been taken, yet you roll back and tell the client it failed. The customer is charged and no order record exists.
   - Commit the `PENDING` order first, then call the provider outside any transaction.
   - Move the order to `PAID` or `FAILED`.
   - Add an `UNKNOWN` or `PAYMENT_UNCERTAIN` state, plus a reconciliation job that queries the provider for stuck orders.

3. **A database transaction stays open during the external call (steps 3–5).** With 3 retries at 5 s each, it can be held for 15 s or more, which holds a connection and locks on a single Postgres instance. Fixing #2 fixes this too.

4. **`POST /orders` has no idempotency (step 1).** If a client retries because of a network blip, it creates a duplicate order. Accept a client-supplied idempotency key and enforce it with a unique constraint.

## Should fix, can be decided tomorrow

5. **Stock check against a 5-minute-old cache with no reservation (step 2).** You can oversell, and the doc doesn't say what happens then. The 800 ms trade-off is reasonable at this volume. Either state that oversell is handled manually or by a backorder or refund path, or add a decrement or reservation step.

6. **The confirmation email is sent inline after commit (step 5).** If it fails, either the request fails after a successful payment or the email is silently lost. Write it to an outbox table or enqueue it, and send it asynchronously.

7. **Only the happy path is tested.** Every bug above lives in failure paths. Add integration tests for charge timeout then success, all timeouts, a duplicate request, and a provider error.

8. **Nightly backups on a single instance means up to 24 hours of lost orders and payments.** That's tolerable for a first version only if you accept it explicitly. Otherwise enable point-in-time recovery (WAL archiving or a managed service), which is cheap.

The code-structure section is fine. Add one note that the payments module owns the idempotency key and provider reconciliation.

You can start tomorrow if you revise steps 3–6 to the commit-first, idempotent flow with a reconciliation state. That is about an hour of editing.

VERDICT: READY WITH CHANGES
