The design is sound for a team of four at 2,000 orders a day, but it is not quite ready to build from as written. Two gaps can corrupt stock, and the test plan does not cover the reconciliation job at all. All of it is fixable in the doc in an hour or two.

## Must fix before building

**1. Stock can be restored twice for one order.**
- Nothing says status changes are conditional on the current status, and nothing stops both service instances from running the reconciliation job at once.
- **Failing case:** both instances run the job at 12:05 and both see order A (1 unit of SKU X) as `PENDING`. The provider tells each it was declined, and each marks it `FAILED` and restores stock. `available` goes up by 2 instead of 1, and you later sell a unit you do not have.
- **Fix:** make every transition `UPDATE orders SET status = … WHERE id = :id AND status = 'PENDING'`, and restore stock or queue the email only if that update changed a row. This covers steps 4 and 5 as well as the job.

**2. The reconciliation job has no rule for "the provider has never heard of this order".**
- Step 6 says the job settles orders as `PAID` or `FAILED`, which assumes a charge exists.
- **Failing case:** an instance is killed during a deploy after step 2 commits and before step 3 sends the charge. The order is `PENDING` with stock reserved, and the provider returns "not found". If that is treated as unknown, the stock stays reserved until someone answers the 30-minute alert.
- **Fix:** treat "not found" as `FAILED` and restore the stock.
- **Also decide:** what happens if a charge succeeds after the order is already `FAILED`. With fix 1, the `PAID` update will change no row; that should trigger a refund or an alert, not silence.

**3. The test plan misses the riskiest paths.** Add:
- Reconciliation job: charge succeeded, charge declined, charge not found, and two runs on the same order.
- Two concurrent buyers for the last unit; the current "last unit" test reads as single-buyer.
- Two concurrent `POST /orders` with the same key.
- A crash between reservation and charge.

## Should fix; small

- **Idempotency key scope:** make the unique constraint `(customer_id, idempotency_key)`. A global key lets one customer's colliding key return another customer's order. Also say what happens when the same key arrives with a different cart; I recommend `422`.
- **Deadlocks:** two carts containing SKUs X and Y in opposite order can deadlock in step 2. Update stock in sorted SKU order.
- **Price source:** the doc does not say where `unit_price` and `total` come from. If they come from the client's cart, a customer can set their own price. State that the server looks them up.
- **Email after reconciliation:** say that the job also queues the confirmation email when it settles an order as `PAID`. Step 4 only covers the in-request path.
- **Request duration:** four attempts at 5 s plus backoff is roughly 27 s or more. Check that this is under the load balancer's timeout, or cut the retries and lean on the `202` path.
- **Retry conditions:** retry only on timeouts and 5xx responses, not on 4xx.
- **Keys:** the tables list no primary keys. `order_items` needs `(order_id, sku)` and `stock` needs `sku`.

## What is already right

- Reserving stock with a conditional `UPDATE` avoids overselling without explicit locks.
- The payment call is outside any database transaction.
- Using the order id as the provider's idempotency key makes retries safe.
- An unknown result is left `PENDING` and settled later rather than guessed.
- Email never fails the order.
- The module boundaries and thin routes fit the service's size.

VERDICT: READY WITH CHANGES
