**Not ready to build tomorrow.** Steps 4–6 can charge a customer and leave them with no order. That needs a redesign of the payment step, which is about a day of design work, not a rewrite.

## Blockers (fix before writing code)

**1. Retrying the charge can double-charge.**
- **Failing case:** the charge API takes 6 s to answer, so our 5 s timeout fires. The provider has already charged the card. We retry, and the card is charged twice. After 3 timeouts we go to step 6 and return an error, but the customer has been charged up to 3 times.
- **Expected:** a timeout means "unknown", not "failed". Send an idempotency key with every charge call, derived from the order id, so a retry returns the original result. Before giving up, look up the charge status with the provider.
- The design never says whether the provider supports idempotency keys. Check that first.

**2. A charge can succeed and the order can still be lost.**
- **Failing case:** the charge succeeds, then the service crashes or the commit fails before step 5 finishes. The database rolls back, so the `PENDING` row is gone. The customer has paid and we have no record of the order.
- **Expected:** commit the `PENDING` order before calling the provider. Charge it, then update it to `PAID` in a second short transaction. Add a reconciliation job that finds `PENDING` orders older than N minutes and checks them against the provider, then marks them paid or cancels them. This also fixes the next problem.

**3. The database transaction stays open during the payment call.**
- It holds a connection and row locks for up to 15 s or more (3 × 5 s plus backoff). If the provider slows down, the connection pool fills and the whole service stops, including order reads.
- Solving blocker 2 removes this problem as well.

**4. Duplicate `POST /orders` has no protection.**
- **Failing case:** the user double-clicks, or the client retries after a network drop. Two orders are created, and each charges the card.
- **Expected:** require a client-supplied idempotency key on `POST /orders`, with a unique constraint in the database.

**5. Nightly backups on a single instance means up to 24 hours of paid orders can be lost.**
- A disk failure at 5 pm loses a day of orders that customers have already been charged for.
- Enable WAL archiving or point-in-time recovery. Most managed Postgres offers this as a setting. If you accept the loss, write that down as a deliberate decision.

## Must decide before building (the design is silent)

- **Overselling.** The inventory cache is up to 5 minutes stale, and the flow never reserves or decrements stock. At 2,000 orders a day, two customers can buy the last unit. This is a business decision: either accept it and define what happens (cancel and refund, or backorder), or reserve stock atomically. "We accept the cache" covers the 800 ms latency but not the oversell case.
- **Email after commit.** A crash between commit and send means no confirmation is ever sent. Either write an outbox row in the same transaction as the `PAID` update and send from a worker, or explicitly accept the gap.
- **Client-facing timing.** Three retries at 5 s means the client may wait 15 s or more. The design doesn't say what the client timeout is, or what the client sees when the outcome is "unknown".
- **Order states.** Only `PENDING` and `PAID` appear. You need at least `FAILED`/`CANCELLED` and a refund path, otherwise the reconciliation job in blocker 2 has nowhere to put its results.
- **Module boundaries.** Where does the payment record live? If payments has its own table, the single transaction in step 3 spans two modules, which conflicts with "no module reads another's tables". Define the interfaces between orders, payments and inventory.

## Tests (below your own standard)

"Unit tests per module and one happy-path integration test" would not catch any of the blockers above. Add these, written before the code:
- Charge timeout followed by a successful retry, asserting exactly one charge.
- Charge timeout on every attempt, asserting the order ends in a known state and the reconciliation job resolves it.
- Provider decline.
- Crash after charge and before the `PAID` update, asserting reconciliation recovers it.
- Duplicate `POST /orders` with the same idempotency key.
- A fake payment provider with configurable delays and failures, so these tests are repeatable.

## What's fine

- Separate modules and a thin route layer are sound.
- Structured logging with the order id is good. Add the idempotency key and payment reference to each log line.
- Scale is small, so a single Postgres instance and a synchronous flow are reasonable. The fixes above are all about correctness, not capacity.

## Suggested order for tomorrow morning

1. Confirm the provider's idempotency and charge-lookup support.
2. Rewrite steps 3–6 as: commit `PENDING`, charge with the idempotency key, update to `PAID`, then reconcile anything left unresolved.
3. Add the state list, the oversell decision and the PITR decision to the doc.
4. Write the failure-path tests above, then build.

VERDICT: NOT READY
