**Not ready to build as written, but the fix is small.** The structure, scale assumptions and module boundaries are solid. The problem is the payment step (steps 3–6). As written, it will sometimes charge a customer twice, or charge them and leave no order behind. That needs fixing in the doc before anyone writes the payment code. It's probably a half-day revision, not a redesign.

## What will go wrong

**1. Retrying on timeout can charge the customer twice.** A timeout means you don't know whether the charge happened, not that it failed.
- Case: the first charge call reaches the provider and succeeds, but the response takes longer than 5 s. The service retries, and the second call succeeds too.
- Actual result: the customer is charged twice for one order.
- Expected result: one charge.
- Fix: send an idempotency key with every charge call, such as the order id (Stripe, Adyen and Braintree all support this). Retries then can't create a second charge.

**2. The order is rolled back even when the charge may have gone through.** The `PENDING` row is created inside the same transaction that wraps the payment call (step 3). So any failure after the charge erases the only record of the order.
- Case: all three retries time out, but one of them actually charged the card. Step 6 rolls back. Or: the charge succeeds and then the commit fails, or the process crashes.
- Actual result: the customer is charged, and there's no order in the database to refund or fulfil.
- Expected result: a durable order record whose status can be reconciled.
- Side effect: holding a transaction open across up to 20 s of network calls (4 attempts × 5 s) ties up a database connection the whole time.

**3. Double-submits from the client create duplicate orders.** `POST /orders` has no idempotency key. A double-click, or a mobile client retrying on a flaky network, creates two orders and two charges. Fix: the client sends an `Idempotency-Key` header, and the service returns the existing order if it has already seen that key.

## Suggested flow

```mermaid
flowchart TD
    A[POST /orders with Idempotency-Key] --> B{Key seen before?}
    B -- yes --> R[Return existing order]
    B -- no --> C[Check stock via inventory cache]
    C --> D[Insert order PENDING and COMMIT]
    D --> E[Charge provider, idempotency key = order id, retry on timeout]
    E -- success --> F[Mark PAID, commit, send email]
    E -- declined --> G[Mark FAILED, return error]
    E -- still unknown after retries --> H[Mark PAYMENT_UNKNOWN, reconcile job checks provider]
```

The key change: commit `PENDING` *before* calling the provider, and never delete the order afterwards. Every outcome becomes a status change on a row that already exists.

## Smaller gaps worth one line each in the doc

- **Overselling from the 5-minute cache.** Accepting the cache is a reasonable tradeoff at this volume. But the doc should say what happens when the warehouse can't fulfil a paid order: auto-refund, backorder, or a manual process.
- **Confirmation email failure.** Sending after commit is right. Just say whether a failed send is retried or dropped, so it doesn't block or fail the order.
- **Tests.** One happy-path integration test isn't enough for this flow. Add tests for: a charge that succeeds on retry after a timeout (no second charge), retries exhausted (order ends up `PAYMENT_UNKNOWN`), a declined card, a duplicate `Idempotency-Key`, and a commit failure after a successful charge. These are exactly the cases above, and a fake payment provider makes them cheap to write.

## What's already good

- Sized for the real load. 2,000 orders a day on a single Postgres instance is comfortable, and you haven't over-engineered for it.
- Clean module boundaries, with no reads across another module's tables, and the flow kept out of the routes in `OrderCheckout`.
- Logging every line with the order id will make the reconciliation work above much easier to debug.

Once you revise steps 3–6 along the lines of the diagram and expand the test list, I'd expect this to be ready. You could reasonably start tomorrow on the inventory and orders modules while that revision happens.

VERDICT: NOT READY
