**The design is sound overall, but fix a few gaps in the doc before you build.** Four of them could lose stock or money, and fixing them should take about an hour. Each one is noted below with a severity.

## Fix before building (High)

1. **Reconciliation never puts stock back.** Step 5 restores stock when a charge is declined. Step 6 settles `PENDING` orders as `FAILED` but says nothing about stock.
   - Example: the provider times out on every attempt, the client gets `202`, and the provider later reports a decline. The reconciler marks the order `FAILED`, but the reserved units stay gone. Stock slowly leaks, and the last unit of a SKU can show as sold out forever.
   - Fix: make "settle as `FAILED`" one shared operation that includes the stock restore, and use it from both step 5 and step 6.

2. **Concurrent settling can double-restore or flip a status.** Two reconciler runs (one per instance) or a reconciler plus a live request can touch the same order.
   - Example: both see order X as `PENDING`, both mark it `FAILED`, and both restore stock, so `available` goes up twice.
   - Fix: require every status change to be `UPDATE ... WHERE status = 'PENDING'` and only restore stock if a row changed. Have the reconciler pick orders with `FOR UPDATE SKIP LOCKED`, or run on one instance.

3. **The reconciler has no answer for "provider has no such charge."** If the service crashes between step 2 (commit) and step 3 (charge), the provider has never seen the order. The doc only covers `PAID` or `FAILED`.
   - Fix: state that "no charge found" after a grace period means `FAILED` plus a stock restore.

4. **Item prices and the total are not defined.** The client sends the cart, and the data model stores `unit_price` and `total`. The doc doesn't say where those come from.
   - If the client supplies them, anyone can buy at any price.
   - Fix: say the server prices every item from its own source and computes the amount charged.

## Should fix (Medium)

5. **Module rule vs. transaction.** Steps 2 and 5 update inventory and orders in one transaction, but "no module reads another module's tables" is a stated rule.
   - Decide how `OrderCheckout` shares one transaction across both modules, for example by passing a transaction handle into each module.
   - Otherwise the rule gets broken on day one.

6. **The confirmation email can be lost.** If the service crashes after the `PAID` commit but before queueing, no email is ever sent. Orders settled by the reconciler have the same gap.
   - Fix: write an "email to send" row in the same transaction that marks the order `PAID`, and have the queue worker read from it. Also name the queue technology, since the context lists none.

7. **Missing tests.** Under your own standards, the reconciler should not ship untested. Add tests for:
   - Reconciler settling to `PAID`, `FAILED` and "no charge found", with stock checked in each case.
   - Two reconcilers running at once.
   - A decline restoring stock.
   - Two simultaneous `POST /orders` with the same key.
   - A crash between the step 2 commit and the charge.
   - The `202` path.

## Minor (Low)

8. **Stock updates can deadlock.** A multi-item cart updates SKUs in whatever order they arrive. Sort the SKUs before updating.
9. **Schema gaps.** `stock` and `order_items` list no primary keys or foreign keys. Add `CHECK (available >= 0)` as a safety net.
10. **Idempotency edge cases.** The doc doesn't say what happens if the same key arrives with a different cart. A concurrent duplicate also hits the unique constraint and needs to return the existing order, not a `500`.
11. **Slow requests.** Four attempts at 5 s each plus backoff can hold a request open for 20 s or more. That's acceptable at this volume, but set the client-facing timeout on purpose.

## What's good
- The charge call happens outside any transaction.
- The order id is sent to the provider as its idempotency key.
- Stock is reserved with a guarded `UPDATE`.
- The `PENDING` alert and the 2-minute reconciler threshold fit together with the retry timing.

If you're short on time, items 1–4 are the ones to settle first.

VERDICT: READY WITH CHANGES
