Not quite: the core flow is sound and can stay as it is, but four gaps in `design.md` will produce wrong stock, wrong charges, or a stuck order, and should be fixed on paper before you build. They are all edits to the document, about an hour of work, not a redesign.

## Fix before building

1. **Status changes are not guarded, so stock can be restored twice.**
   - **Case:** the reconciliation job runs on both instances. Both pick up the same `PENDING` order whose charge was declined, and both run step 5. A SKU with 3 available and 1 reserved ends at 5 instead of 4, and you oversell.
   - **Fix:** make every transition conditional (`UPDATE orders SET status = ... WHERE id = ... AND status = 'PENDING'`) and only restore stock if that update changed a row. Have the job claim rows with `FOR UPDATE SKIP LOCKED`, or run it on one instance only.

2. **Reconciliation has no rule for "the provider has never heard of this order".**
   - **Case:** the instance crashes after step 2 commits and before step 3 sends the charge. The provider returns not-found, which is neither `PAID` nor `FAILED`, so the order stays `PENDING` and holds its stock indefinitely.
   - **Fix:** treat not-found as `FAILED` and restore the stock. Say what happens if a charge does appear afterwards (refund it and alert).

3. **The design never says where prices come from.**
   - **Case:** there is no price or catalogue table, and step 1 says the client sends "the cart". If `unit_price` or `total` comes from the request, a customer can pay 0.01 for anything.
   - **Fix:** name the server-side price source, and state that the service computes `total` and sends that amount to the provider.

4. **The idempotency key is unique across all customers and is not tied to the cart.**
   - **Case A:** customer B sends a key that customer A already used and gets A's order back, which is a data leak.
   - **Case B:** the same customer reuses a key with a different cart and silently gets the old order back.
   - **Fix:** make the constraint `(customer_id, idempotency_key)`. Store a hash of the request and return `422` when the key matches but the body differs.

## Cheap to fix now

- **Deadlocks in step 2:** two carts holding the same two SKUs in opposite order will deadlock, and one customer gets a 500. Update stock rows in sorted `sku` order.
- **Lost confirmation email:** a crash between the `PAID` commit and the queue push means the email is never sent, and nothing retries it. Write the email job in the same transaction as `PAID`, or have the reconciliation job sweep paid orders with no email sent.
- **Missing columns and constraints:**
  - The provider's charge id is not stored on `orders`; you need it for refunds and support.
  - No primary keys are stated.
  - `stock` has no `CHECK (available >= 0)`.
  - `orders` has no index on `(status, created_at)` for the reconciliation query.
- **The `202` path has no follow-up:** the design does not say how the client learns the outcome. Add `GET /orders/{id}` and say the client polls it.
- **Retry rules:** state that only timeouts and 5xx responses are retried, never declines.
- **Module boundary:** step 2 spans the inventory and orders tables in one transaction. State that `OrderCheckout` owns the transaction and passes it into both modules, so the "no module reads another's tables" rule survives.
- **Test plan:** add a test for each of the four fixes above:
  - two reconcilers settling the same order
  - a crash between reserve and charge
  - a reused key with a different cart
  - a tampered price

## What is right and should not change

- Reserving stock with a conditional `UPDATE` inside one transaction.
- Charging outside any transaction, with the order id as the provider's idempotency key.
- A reconciliation job plus an alert on orders `PENDING` for more than 30 minutes.
- One Postgres database and no message broker or saga framework, which is the right size for 2,000 orders a day and a team of four.

VERDICT: READY WITH CHANGES
