You can start building tomorrow, but the design has one real bug to fix first: stock can be restored twice for the same failed order, which leads to overselling. The other three changes below are an afternoon of design edits, not a rework.

## Fix before building

**1. Double stock restore when two workers settle the same order.**
- **Case:** an order for 1 unit of SKU A is stuck `PENDING` with `available = 0`. The 5-minute reconciliation job fires on both instances, and both learn from the provider that the charge was declined. Each marks the order `FAILED` and adds 1 back.
- **Result:** `available = 2` when it should be 1, so the next two buyers both get a unit that exists once.
- **Fix:** make every status change conditional, `UPDATE orders SET status = ... WHERE id = :id AND status = 'PENDING'`, and restore stock only if that update changed a row. Apply this in steps 4, 5 and 6.
- **Optional:** have the job pick up rows with `FOR UPDATE SKIP LOCKED`, so the two instances do not duplicate provider calls.

**2. Step 6 does not say what happens when the provider has no record of the charge.**
- **Case:** the instance crashes after the step 2 commit and before the charge call, so the provider never saw the order.
- **Fix:** state that "not found" means `FAILED` plus stock restore, in one transaction as in step 5.
- **Also state:** a charge the provider reports as still processing stays `PENDING`. Otherwise you can release stock for an order that is later charged.

**3. The test plan skips the riskiest code.** Add tests for:
- Reconciliation settling a `PENDING` order as paid, as declined, and as not found.
- Two reconciliation runs on the same order, which is the case in item 1.
- Two concurrent buyers for the last unit; the current "last unit" test reads as a single buyer.
- Two concurrent `POST /orders` with the same key.

**4. Concurrent duplicate `POST /orders` is not handled explicitly.** Two requests with the same key can both pass the "does it exist" check. The loser then hits the unique constraint, and the design does not say what it returns. Say that it catches the violation, rolls back its stock reservation, and returns the existing order.

## Small additions, can be done while building

- **Deadlocks:** two carts holding the same SKUs in opposite order can deadlock in step 2. Reserve items in sorted SKU order.
- **Prices:** say that `unit_price` and `total` are computed server-side, not taken from the cart the client sends.
- **Lost email:** a crash between the `PAID` commit and queueing the email in step 4 loses the email. Either accept that in writing, or write the email job in the same transaction as the status change.
- **Keys:** `order_items` and `stock` show no primary keys. Use `(order_id, sku)` and `sku`.
- **Idempotency key scope:** make the key unique per customer rather than globally, and decide what a reused key with a different cart returns.

## What holds up

- The payment call sits outside any database transaction.
- The conditional `UPDATE` on stock prevents overselling at reservation time.
- Using the order id as the provider's idempotency key makes charge retries safe.
- The worst-case request path is roughly 30 seconds, well under the 2-minute reconciliation threshold, so the request and the job will not fight over a live order.
- One Postgres database and two instances is the right size for 2,000 orders a day.

VERDICT: READY WITH CHANGES
