**Not ready.** The scale and code structure are fine. The payment flow in steps 3–6 will charge customers wrongly, and you'd be building on it tomorrow.

## Blockers

1. **Retried charges can double-charge (step 4).** A 5 s timeout doesn't mean the charge failed. The provider may have processed it and only the response was slow. Retrying up to 3 times without an idempotency key can charge the customer up to 3 times. Generate one key per order, for example the order id, and send it on every attempt. The provider will then dedupe.

2. **The charge happens inside the DB transaction (steps 3–6), so money and state can disagree.**
   - If the charge succeeds and the commit fails, or the process crashes between them, the customer is charged and you have no order.
   - If all retries time out, step 6 rolls back, but the charge may have gone through. You'd have no record of it.
   - The transaction also stays open for up to about 15 s (3 × 5 s) while it waits on a network call, which holds a connection and any locks.

   The fix is to commit `PENDING` first, outside any long transaction. Then call the provider with the idempotency key. Then move the order to `PAID` or `FAILED` in a short second transaction. Add a reconciliation job that finds `PENDING` orders older than N minutes and asks the provider for their real status. Without that job, a crash leaves orders stuck forever. Also decide whether you need the provider's webhooks as the source of truth for the final state.

3. **There's no idempotency on `POST /orders`.** If the client times out during that 15 s window and retries, the user gets two orders. Require a client-supplied idempotency key with a unique constraint on it.

## Must decide before building

4. **Stock is checked but never reserved or decremented.** A 5-minute-stale cache with no decrement means two buyers can both get the last unit. Accepting a stale cache is a reasonable trade-off at this scale. But the doc has to say what happens on oversell: backorder, cancel and refund, or an apology email. It also has to say who owns that path. At 2,000 orders a day this is probably a manual process, but write it down.

5. **Failed attempts leave no trace.** Rolling back on failure erases the order, so you can't debug or support "I got an error but was charged." Keep failed orders with a `FAILED` status and a reason. Write down the full state machine: `PENDING → PAID | FAILED`, plus cancel and refund, even if those two are out of scope for v1.

6. **Nightly backups on a single instance means up to 24 h of lost orders after a disk failure.** Provider charges would exist for orders you've lost. Turn on WAL archiving or point-in-time recovery. On managed Postgres this is usually a setting, not a project.

## Smaller issues

7. **Email after commit.** If the send fails or the process dies, there is no retry. Don't fail the order over it. Record `confirmation_sent` and retry from the reconciliation job, or use a simple outbox table.
8. **The request can block for 15 s or more.** Decide the client-facing behavior. Either return `202` with a pollable status, or set a hard overall deadline.
9. **Testing covers only the happy path.** The risk is entirely in the failure paths. Add integration tests for these cases:
   - charge timeout followed by success on retry
   - charge timeout where the charge actually succeeded
   - crash between charge and commit
   - duplicate client request
10. **Missing pieces:** auth, rate limiting, and metrics or alerts on stuck `PENDING` orders and charge failures. Logging the order id on every line is good, but it isn't alerting.

## What's fine

- The cache decision is sound once item 4 is addressed.
- Modules with no cross-table reads and a thin routes layer are fine.
- Plain Postgres and a synchronous flow are the right size for 2,000 orders a day. Don't add queues or microservices.

The rewrite is small: steps 3–6 plus a status table and a reconciler. Fix those in the doc first, then start building.

VERDICT: NOT READY
