**You can start tomorrow, but fix the four must-fix items below first (about an hour of design edits).** The core flow is sound. Reserving stock and inserting the order in one transaction is right, so is charging outside any transaction, and so is using the order id as the provider's idempotency key. Reconciling `PENDING` orders is the right safety net. The gaps are mostly in what happens when that safety net settles an order.

## Must fix before building

**1. High: reconciliation doesn't say it restores stock.** Step 5 restores stock on a decline. Step 6 only says the job "settles them as `PAID` or `FAILED`".
- Failing case: the charge times out on every attempt, the order stays `PENDING` with its stock held, and the job later finds the charge was declined. Without a restore, that stock stays reserved forever.
- Fix: say that any move to `FAILED`, from either path, restores stock in the same transaction.

**2. High: stock can be restored twice.** Two instances run behind the load balancer, and nothing stops both from running the 5-minute job at once. The job can also race with a request that is still retrying.
- Failing case: both instances settle order X as `FAILED` and each adds the quantity back, so `available` is now too high and you can oversell.
- Fix: make every status change conditional, for example `UPDATE orders SET status='FAILED' WHERE id=:id AND status='PENDING'`. Restore stock only if that update changed a row. Optionally add `FOR UPDATE SKIP LOCKED` to the job's query.

**3. Medium-high: a crash between steps 2 and 3 is undefined.** If the service dies after the commit but before the charge call, the order is `PENDING` and the provider has never heard of it.
- Failing case: the reconciler asks the provider about that order and gets "not found". The design doesn't say what that maps to.
- Fix: say that "not found" after the 2-minute grace period means `FAILED` plus a stock restore.

**4. Medium: a client that gets `202` has no way to find out the result.** The design has no `GET /orders/{id}`, webhook, or other way to learn the outcome. Orders settled by the job also never get the confirmation email, because only step 4 queues it. Decide both before building the endpoints.

## Should fix (small, and cheaper now than later)

- **Email can be lost.** Step 4 commits `PAID` and then queues the email. A crash in between loses it. Also, no queue appears in the Context section, which lists only Postgres. Name the queue, or write the email to an outbox table in the same transaction.
- **The module rule conflicts with the transactions.** Steps 2 and 5 need one transaction across inventory and orders, but "no module reads another module's tables" doesn't say who owns that transaction. I suggest `OrderCheckout` owns it and passes the connection or unit of work to each module.
- **Deadlock risk.** Reserving several SKUs in arbitrary order can deadlock two concurrent carts. Sort SKUs before updating.
- **Duplicate key handling.** Two concurrent `POST`s with the same key means one insert fails on the unique constraint. Specify that the handler catches this and returns the existing order. Also decide whether the key is scoped per customer, and what happens if the same key arrives with a different cart.
- **Price source.** The cart comes from the client, but the design doesn't say whether `unit_price` and `total` are looked up server-side. They must be.
- **Missing schema details.** No primary keys or indexes are listed, for example on `stock.sku` or `order_items.order_id`. There is also no `CHECK (available >= 0)` as a backstop.
- **Status transitions.** `PAID` and `FAILED` should be terminal. Write the allowed transitions down.

## Tests: the gap is in the most error-prone part

The list covers the happy paths well but has nothing for reconciliation. Add these:
- The job settles an order as `PAID`.
- The job settles an order as `FAILED` and restores stock.
- The job gets "not found" from the provider.
- Two job runs overlap, and stock is restored once.
- A decline test that asserts stock is restored.
- Two concurrent duplicate `POST`s.
- A crash between steps 2 and 3, simulated.
- An email failure that leaves the order `PAID`.

## Speculative, so not blockers

- A client request can be held for roughly 25 seconds or more (4 attempts × 5 s plus backoff). That is fine at 2,000 orders a day, but check your load balancer timeout.
- The 2-minute grace plus the 5-minute job means a stuck order holds stock for up to about 7 minutes. That is probably acceptable.
- Refunds and cancellations are out of scope here. That is fine, but confirm it is intended.

Scale, recovery, the alert, and the code structure all look right for a team of four at this volume.

VERDICT: READY WITH CHANGES
