**The design is sound enough to start building tomorrow, provided you settle the four items under "Fix before you write the code" first.** Each is a paragraph added to design.md, not a redesign. The core is correct: stock is reserved atomically, the charge happens outside the transaction with the order id as the provider idempotency key, and a reconciliation job settles unknown outcomes.

## Fix before you write the code

**1. High: the design does not say where prices come from.**
`POST /orders` takes "the cart", and there is no price or catalog table in the data model. If `unit_price` and `total` are taken from the request, a client can send `unit_price: 0.01` for a 500.00 item and be charged 0.01. State that the server looks up prices and computes `total`, and name which module owns prices. The same goes for `customer_id`: it should come from the authenticated session, not the request body.

**2. High: status changes are not guarded, so stock can be restored twice.**
With two instances, the 5-minute reconciliation job will run on both unless you prevent it. For example, order A holds 1 unit and the provider reports it declined. Both instances mark it `FAILED` and each adds 1 back, so `available` is 1 too high and you later sell a unit you don't have. Make every transition `UPDATE orders SET status = ... WHERE id = :id AND status = 'PENDING'`, and restore stock or queue email only if that changed a row. Running the job under a Postgres advisory lock as well is cheap.

**3. High: the reconciliation job's rules are incomplete (step 6).**
- **No charge on record:** if an instance crashes after step 2 commits but before step 3 calls the provider, the provider has never heard of the order. The design only says "settles as `PAID` or `FAILED`". It should say this case becomes `FAILED`.
- **Stock on `FAILED`:** step 5 restores stock, but step 6 doesn't say the job does too. If it doesn't, every timed-out-then-declined order leaks stock permanently.
- **Email on `PAID`:** step 6 doesn't say the job queues the confirmation email. If it doesn't, those customers are charged with no confirmation.

The clean fix is one `settlePaid` and one `settleFailed` function in `OrderCheckout`, used by both the request path and the job.

**4. Medium: the test plan misses the cases most likely to break.**
Add these to the test list:
- The reconciliation job for each outcome: paid, declined, no charge on record, and still unknown.
- Two concurrent buyers for the last unit; "buying the last unit" as written reads as a single buyer.
- Two concurrent `POST /orders` with the same key.
- Two reconciliation runs on the same order.
- An email queue failure after `PAID`.

## Fix during the build

**5. Medium: the confirmation email can be lost.**
Step 4 commits `PAID` and then queues the email. A crash between the two means the customer is charged and never gets an email, and nothing retries it. Either write an outbox row in the same transaction as `PAID`, or add a `confirmation_queued_at` column that a job sweeps.

**6. Medium: idempotency key behaviour is underspecified (step 1).**
- **Scope:** the unique constraint is global. If customer B sends a key customer A already used, B gets A's order back. Make it unique on `(customer_id, idempotency_key)`.
- **Same key, different cart:** say what happens; `422` is the usual answer.
- **Concurrent duplicates:** the second insert will hit the unique violation. The handler must catch it and return the existing order rather than a `500`.

**7. Low to medium: overlapping orders can deadlock.**
Order 1 reserves SKU X then Y while order 2 reserves Y then X. Postgres kills one, and that customer sees a `500`. Reserve SKUs in sorted order.

**8. Low: the worst-case request is about 27 seconds.**
That is four attempts at 5 s plus backoff. Check that the load balancer and client timeouts are longer, or reduce to 2 retries. Also state that retries happen only on timeout or provider 5xx, never on a decline.

**9. Low: the data model lacks constraints and a payment reference.**
- No primary keys are stated.
- There is no `CHECK (available >= 0)` on `stock` and no `CHECK (quantity > 0)` on `order_items`.
- `status` has no `CHECK`.
- There is no column for the provider's charge id, which you will want for support and refunds.

**10. Low: there is no refund or cancel path.**
`PAID` is terminal. That is fine for a first version, but say explicitly that it is out of scope.

VERDICT: READY WITH CHANGES
