Most of this design is in good shape. The module boundaries, thin routes, a single `OrderCheckout` class and logging the order id on every line will make the service easy to change and debug, and none of it is over-built for 2,000 orders a day. The cache trade-off in step 2 is also reasoned through, not just assumed.

The problem is the payment part (steps 3–6). As written, it can lose or double-charge real money, and those are the bugs that are hardest to clean up once you're live. You don't need to start over, but these changes should be in the doc before anyone writes that code.

## Must fix before building

**1. Retrying the charge can bill a customer twice (step 4).** A timeout doesn't tell you the charge failed. Often the provider charged the card and the response was just slow. Retrying up to 3 times without an idempotency key could charge someone four times. Fix: create one idempotency key per order (the order id works) and send it on every attempt. Most payment providers support this.

**2. A charge can succeed with no order saved (steps 3, 5, 6).** The `PENDING` row lives inside a transaction that isn't committed, so nothing else can see it, and a rollback deletes it. If the charge succeeds and then the process crashes, the commit fails, or the retries run out on an ambiguous timeout, the customer has paid and you have no order on record. Fix:
- Insert `PENDING` and **commit** before calling the payment provider.
- Call the provider outside any transaction.
- Update to `PAID` or `FAILED` in a second short transaction.
- Add an `UNKNOWN`/needs-check outcome for timeouts. Settle it with a reconciliation job that asks the provider for the charge status by idempotency key.

**3. The transaction stays open during a slow network call.** Up to about 20 s (4 × 5 s) per order holds a database connection and row locks. The fix for #2 removes this as well.

## Worth deciding now (small)

- **Overselling:** a cache that can be 5 minutes old will sometimes accept orders for stock that has run out. That may be fine, but write down what happens when it does (cancel and refund? backorder?) so it's a policy rather than a surprise.
- **Email failure:** if the confirmation email fails after commit, does anything retry it? A simple outbox table or job queue covers this.
- **Tests:** add integration tests for a payment timeout, a decline, and a crash after the charge. With one happy-path test, the risky paths above go untested.

The rest (stack, team size, structure) is fine to start building tomorrow. Updating steps 3–6 should take an hour or two, and you can start the orders and inventory modules in parallel.

VERDICT: READY WITH CHANGES
