**Not ready.** The flow can double-charge customers and can lose paid orders. Both fixes are small, and neither is in the doc yet.

## Blockers

**1. Retrying the charge can double-charge (step 4).**
- A timeout doesn't mean the charge failed. The provider may have processed it and the response was lost. Retrying without an idempotency key charges the customer again.
- Fix: generate a payment idempotency key per order, store it on the order row, and send it on every attempt.

**2. A paid order can be lost (steps 4–6).**
- If all retries time out, the payment state is unknown, but step 6 rolls back and returns an error. The customer may be charged with no order record.
- The same happens if the commit fails after a successful charge, or the process crashes between the charge and the commit.
- Fix: commit `PENDING` with its idempotency key before calling the provider, and call the provider outside the transaction. Move to `PAID` or `FAILED` afterward. Resolve unknown states by querying the provider or handling its webhook, and run a reconciliation job over stuck `PENDING` orders.
- Holding a DB connection open through up to 4 attempts at 5 s each (about 20 s or more) is a separate smaller problem, which the fix above also removes.

**3. Nightly backups on a single instance.**
- You can lose up to 24 hours of orders, and the provider will still hold the charges for those orders. Reconciliation would be impossible.
- Fix: enable WAL archiving or point-in-time recovery. On managed Postgres this is a config change.

## Needs a decision before you build

**4. No client-side idempotency.** If the client retries `POST /orders` after a timeout, you get duplicate orders. Accept an idempotency key from the client, with a unique constraint.

**5. Stock check doesn't reserve anything.**
- The cache is up to 5 minutes stale and nothing decrements it, so you can oversell. At 200 orders a day that may be acceptable, but the doc says "we accept the cache" without saying what happens when it's wrong.
- Decide the oversell policy: backorder, cancel and refund, or a local reservation count. Write it down.

**6. Confirmation email is sent inline after commit.** If it fails, either the request errors for a paid order or the email is silently lost. Write an outbox row in the same transaction and send from a worker.

**7. Missing states and flows.** There is no `FAILED` or `CANCELLED` state, no refund path, and no provider webhook handling. Rolling back on failure also leaves no record of failed attempts, which makes support and debugging hard.

## Smaller points

- **Tests:** only the happy path is covered, and every risk above is a failure path. Add integration tests for provider timeout then success, timeout on every attempt, crash after charge, and duplicate client request.
- **Structure:** this is good. Module boundaries, a thin routes layer and logging with the order id are all fine. Keep the order id and idempotency key in every log line.
- **Scale:** 2,000 orders a day is trivial for a single Postgres instance. Don't add queues or services beyond the outbox and reconciliation job.

Fixing items 1–3 means restructuring step 3 onward into "commit `PENDING` first, charge, then update", which is about a day of design. I'd do that before writing code, because the rest of the code is built around that flow.

VERDICT: NOT READY
