**Mostly ready, but fix the reconciliation gaps before you start.** The checkout flow itself is sound for 2,000 orders a day on one Postgres. The stock reservation is atomic, the charge happens outside the transaction, and the provider-side idempotency key is the right call. The problems are in the paths that run when something goes wrong.

## Fix before building (these change the code you write)

1. **Settling an order can race with the request that is still handling it.**
   - Case: the request's retries finish at about 100 s and the charge succeeds. The 5-minute job picks up the same `PENDING` order at the same time and the provider reports "declined", so it marks the order `FAILED` and restores stock. The request then marks it `PAID`. You now have a paid order with its stock given back.
   - Fix: every status change is a conditional update (`... SET status = :new WHERE id = :id AND status = 'PENDING'`). Restore stock only if that update changed a row. This also stops stock being restored twice when the decline path and the job both act.
   - Add a sentence to the design saying this.

2. **Step 6 doesn't say what happens when the provider has no record of the charge.**
   - Case: the request never reached the provider, so "charge not found" comes back. Is that `FAILED` (restore stock) or "keep waiting"?
   - It also doesn't separate a decline from a provider error such as a 5xx. Only a decline should reach step 5.
   - It assumes the provider can look up a charge by the idempotency key. Please confirm that against the provider's API docs, because step 6 depends on it.

3. **Both service instances will run the reconciliation job.** With two instances, every `PENDING` order gets queried twice. Pick one way to prevent that (a Postgres advisory lock, or `FOR UPDATE SKIP LOCKED`). Fix 1 keeps the result correct, but you would still make duplicate provider calls.

4. **Step 2 conflicts with "no module reads another module's tables".** It reserves stock (inventory) and inserts the order (orders) in one transaction. State how that works, for example the inventory module exposes `reserve(tx, items)` and `OrderCheckout` owns the transaction. Also lock rows in a fixed order, sorted by `sku`. Otherwise two carts with the same items in different order can deadlock.

5. **Price and total are undefined.**
   - Where does `unit_price` come from? There is no product or price table.
   - The design must say the server computes `total`, not the client.
   - It also doesn't mention how the client supplies payment details or how the customer is authenticated.

## Smaller gaps (fine to settle during the build)

- **Idempotency key:** scope the unique constraint to `(customer_id, idempotency_key)`. Say what happens to a concurrent duplicate. The loser gets a unique-violation and should then fetch and return the winner's order. Also say whether reusing a key with a different cart is an error.
- **`202` has no follow-up:** the client needs a `GET /orders/{id}` to see the final status. It isn't in the design.
- **Email after commit:** if the process dies between the `PAID` commit and the enqueue, the email is lost. Either accept this and write it down, or insert an outbox row in the same transaction.
- **Schema:** no primary keys, foreign keys, or `stock.sku` uniqueness are listed. The `UPDATE` in step 2 relies on `sku` being unique.

## Tests

The test list covers the main paths but leaves out most of the failure handling. Your standards call for these to be tested, so add:

- the reconciliation job (settles to `PAID`, settles to `FAILED`, provider says "not found")
- stock restored exactly once on decline
- the race in fix 1 (request and job settling the same order)
- two concurrent requests with the same key
- two concurrent buyers of the last unit (the current item looks sequential)

## Time estimate

Items 1–5 and the test additions are about an hour of editing, not a redesign. I'd do that first, then start building.

VERDICT: READY WITH CHANGES
