**Not quite ready: the payment step can charge a customer twice or charge them with no order recorded. The rest of the design is sound, and the fixes are small enough to settle before you start building tomorrow.**

The module boundaries, thin routes, the `OrderCheckout` class and the logging are good choices for a four-person team. Accepting the 5-minute inventory cache is also reasonable at 200 to 2,000 orders a day.

## Fix before building

**1. Retrying the charge can double-charge (step 4).**
- **Failing case:** The charge call times out at 5 s, but the provider did process it. You retry, and the customer is charged twice.
- **Expected:** One charge.
- **Fix:** Send an idempotency key on every charge call, for example the order id. Most providers support this, so retries become safe.

**2. A charge can succeed with no order recorded (steps 3, 5 and 6).**
- **Failing case:** The charge succeeds, then the process crashes or the commit fails. Alternatively, the final retry times out after the provider actually charged. The transaction rolls back, so the `PENDING` order disappears. The customer paid, and you have no record.
- **Expected:** Either the order is `PAID`, or the money is refunded.
- **Fix:** Don't hold the transaction open across the payment call. Commit `PENDING`, call the provider, then update the status in a second short transaction. On failure or an unknown outcome, leave the order in a state a reconciliation job can resolve by asking the provider what happened. This also stops a database connection being held for up to 15 s or more (3 retries × 5 s).

The same idea applies one level up: ask the client to send an idempotency key on `POST /orders`, so a user double-clicking or retrying doesn't create two orders.

## Worth a line in the doc (not blockers)
- **Oversell:** Say what happens when the cache said "in stock" but the warehouse is out. Backorder, cancel and refund, or something else?
- **Confirmation email:** Say what happens if it fails after commit. A simple retry or outbox row is enough.
- **Backups:** Nightly backups mean a failure could lose up to a day of paid orders. That's probably fine for now. Note it as a known risk, and consider point-in-time recovery once you're nearer 2,000 orders a day.
- **Tests:** The plan covers only the happy-path integration test. Add integration tests for payment timeout then success, payment failure, and the crash-after-charge case, since those are where the bugs above would show up.

Once the charge flow in steps 3 to 6 is updated for the first two points, you can start building.

VERDICT: READY WITH CHANGES
