I wouldn't start building tomorrow on this design. The module layout and scale assumptions are fine, but the payment steps (3–6) can charge customers twice, or charge them and keep no record of the order. Those are flaws in the design itself, and they're much cheaper to fix now than after launch.

## Blockers

**1. The payment call happens inside an open database transaction (steps 3–5).**
- **Charged with no order.** If the charge succeeds but the commit fails (process crash, deploy, lost connection, a timeout after the provider already accepted the charge), the `PENDING` row is rolled back. The customer has paid and you have nothing in your database to show it.
- **Long-held connections.** With a 5 s timeout and 3 retries, one checkout can hold a transaction and a connection for about 20 s. At 2,000 orders a day the connection pool will cope, but you'll be holding row locks across a network call you don't control.
- **Fix:** commit `PENDING` first, in its own transaction. Then call the provider. Then update the order to `PAID` or `FAILED` in a second transaction. The order row becomes your record of what you tried.

**2. Retrying on timeout without an idempotency key (step 4) causes double charges.**
A timeout doesn't mean the charge failed. Usually the provider processed it and only the response was lost. Retrying a plain charge call can bill the customer up to 4 times.
- **Fix:** send an idempotency key with every charge attempt, such as the order id. Most providers support this. If all attempts time out, don't mark the order failed. Mark it `PAYMENT_UNKNOWN` and settle it with a reconciliation job or the provider's webhook.

**3. Failures roll back and leave no trace (step 6).**
Because of #1 and #2, "failure" includes cases where money may have moved. Rolling back deletes your only evidence, and support can't answer "was I charged?"
- **Fix:** never delete or roll back an order once a charge has been attempted. Move it through explicit states: `PENDING → PAID | FAILED | PAYMENT_UNKNOWN`.

**4. Nothing stops duplicate submissions of `POST /orders`.**
A double-click, a mobile client retrying, or a proxy retrying will create two orders and two charges. The idempotency key in #2 doesn't help here, because each duplicate request gets its own order id.
- **Fix:** have the client send an `Idempotency-Key` header, enforce it with a unique constraint, and return the existing order when it repeats.

## Should fix before launch

**5. Inventory can be oversold, and nothing reduces stock.**
The 5-minute cache can be stale, and two concurrent checkouts can both see the last unit. The design also never says who reserves or decrements stock after a sale. Skipping the 800 ms warehouse call is a reasonable trade-off, but you have to decide what happens when the cache was wrong: reject later, backorder, or reserve stock. Right now that decision isn't written down.

**6. The confirmation email is sent inside the request (step 5).**
If the email provider is slow or down, does the checkout fail even though the customer has paid? Send the email from an outbox table or a background job after commit, so a failed email can't affect a paid order.

**7. Nightly backups for payment data.**
A disk failure could lose up to 24 hours of paid orders. Turn on point-in-time recovery (WAL archiving, or the managed equivalent). It's a small setting.

**8. Tests only cover the happy path.**
The bugs above all live in the failure paths. Add integration tests for: provider timeout followed by success on retry (exactly one charge), crash between charge and commit, duplicate `POST`, and all retries timing out (order ends up `PAYMENT_UNKNOWN`).

## What's fine
- Single-instance Postgres at 2,000 orders a day. That's about one order every 40 s on average, so you have plenty of headroom.
- Separate modules that don't read each other's tables, thin routes, an `OrderCheckout` service class, and logging with the order id on every line. Leave all of that as it is.

## Suggested revised flow
1. `POST /orders` with an `Idempotency-Key` header. If the key was seen before, return the existing order.
2. Check stock against the cache, and write down what happens when the cache was wrong.
3. Insert the order as `PENDING` and commit.
4. Charge the card using the order id as the provider's idempotency key, retrying on timeout.
5. Mark the order `PAID` or `FAILED` and commit. If every attempt timed out, mark it `PAYMENT_UNKNOWN`, then settle it with the provider's webhook or a reconciliation job.
6. Send the email from an outbox table or a background job.

All of this fits in a few hours of design rework. If you update steps 3–6 today, starting tomorrow is realistic.

VERDICT: NOT READY
