The design is sound at its core and you can start building tomorrow, provided you fold in the three high-severity changes below first. Each is a few lines in the doc, not a restructure. I found no way for it to double-charge a customer, and the basic stock reservation is safe against overselling.

## High severity: settle before building

**1. Two workers can settle the same order twice and restore its stock twice.**
- **Case:** an order for 1 unit of a SKU with 0 available sits `PENDING`. The reconciliation job runs on both instances at once, both see a declined charge, and both restore stock. `available` becomes 2 instead of 1, and you sell a unit that does not exist.
- The same race exists between the reconciliation job and a slow request handler.
- **Fix:** make every status change conditional (`UPDATE orders SET status = ... WHERE id = ... AND status = 'PENDING'`) and restore stock only if that update changed a row.

**2. Reconciliation has no rule for "the provider has never heard of this charge".**
- **Case:** the instance crashes after step 2 commits and before the charge call in step 3. The order is `PENDING` with stock reserved, and the provider has no record. Step 6 only allows `PAID` or `FAILED`, so the order stays `PENDING` and holds stock indefinitely. The 30-minute alert is the only thing that notices.
- **Fix:** treat "not found" as `FAILED` once the order is older than the 2-minute cutoff.
- **Also state:** a `FAILED` set by reconciliation restores stock, the same as step 5. Step 6 does not say so.
- **Check tonight:** confirm the provider can look up a charge by your order id. On a timeout you never receive the provider's own charge id, so step 6 depends on this lookup.

**3. The design does not say where prices come from.**
- `POST /orders` takes "the cart", and there is no price or catalog table.
- **Case:** if `unit_price` is taken from the request, a client can send a 100.00 item priced at 0.01 and be charged 0.01.
- **Fix:** state that the server looks up prices and computes `total`, and name the source.

## Medium severity: fix during the build

**4. The idempotency key is unique globally, not per customer.**
- **Case:** customer B sends a key that customer A already used and gets A's order back.
- **Fix:** put the unique constraint on `(customer_id, idempotency_key)`.
- **Also decide:** what happens when the same key arrives with a different cart. Rejecting it with `422` is the usual choice.

**5. Overlapping orders can deadlock in step 2.**
- **Case:** order 1 reserves SKU A then B while order 2 reserves B then A. Postgres aborts one and that customer gets a 500.
- **Fix:** reserve SKUs in sorted order, and merge duplicate SKUs in a cart first.

**6. The test plan misses the riskiest paths.**
- The reconciliation job has no tests: settle as paid, settle as failed, charge not found, two runs at once.
- The duplicate `POST` and last-unit tests need concurrent versions: two simultaneous requests, exactly one wins.
- There is no test for a crash between reserving stock and charging.

**7. Confirmation emails can be lost or never sent.**
- **Case:** a crash after the `PAID` commit and before queuing loses the email.
- Orders that reconciliation settles as `PAID` are not stated to send an email at all.
- **Fix:** route both paths through one "mark paid" function, and record that the email was queued so a sweep can catch misses.

## Low severity

**8. The data model lists no keys or constraints.** Add primary keys, a foreign key on `order_items.order_id`, `CHECK (available >= 0)`, and an index on `(status, created_at)` for the reconciliation query.

**9. The order stores no provider charge id.** You will want it for refunds and support lookups.

**10. A request can hang for over 20 seconds.** That is four attempts at 5 s each plus backoff. Confirm the load balancer and client timeouts are longer, or cut the retries and lean on reconciliation.

VERDICT: READY WITH CHANGES
