**The core flow is sound, but it isn't ready to start from as written.** Reserve stock, charge outside the transaction, send the order id as the provider's idempotency key, and reconcile unknown results is the right shape for 2,000 orders a day. The gaps below are mostly missing decisions, and each one would otherwise get decided ad hoc in code. Fix the five blockers in the doc first, which should take about an hour, then start.

## Blockers (settle before writing code)

1. **Nothing says where prices come from.**
   - `order_items.unit_price` and `orders.total` are stored, but step 1 only says the client sends "the cart".
   - If the client supplies prices, a customer can send a unit price of 0.01 and be charged that.
   - Say that the server looks up prices from a catalog, or that the cart holds only sku and quantity. This also forces a decision on where the catalog lives, because it isn't in the data model.

2. **Reconciliation can release stock for an order that later gets paid.**
   - Say the provider has no record of an order's charge (a "not found" response) because the charge request is still in flight at the provider. Reconciliation marks the order `FAILED` and restores the stock. The charge then lands.
   - The customer is charged for an order that is `FAILED`, and the stock may already be sold to someone else.
   - The design must say what "not found" means. Options are to treat it as unknown, or to wait until after the provider's idempotency window closes.
   - A `FAILED` order that later turns out to be charged also needs a path: void or refund, and an alert.

3. **State changes aren't guarded, and there are two instances.**
   - Both instances run the 5-minute reconciliation job, and the request path can settle the same order at the same moment.
   - Case: reconciliation and a slow request both see a declined `PENDING` order. Both run "mark `FAILED` and restore stock", so the stock is restored twice and `available` goes above reality.
   - Require that every transition is `UPDATE ... WHERE status = 'PENDING'` and that stock is restored only if that update changed a row.
   - Also pick one of: a single reconciliation runner (advisory lock or `FOR UPDATE SKIP LOCKED`), or confirm that guarded transitions make concurrent runs safe.

4. **The module rule conflicts with step 2.**
   - "No module reads another module's tables" is incompatible with one transaction that updates `stock` (inventory) and inserts into `orders` (orders).
   - You need to name how the two modules share a transaction. A unit-of-work object passed into both is one option.
   - Alternatively, accept that inventory and orders are one module at this scale. That is a legitimate choice, but it should be stated.

5. **The idempotency key is unique globally and isn't tied to a customer.**
   - Case: customer A and customer B both generate key `abc`. B's `POST` returns A's order, which leaks A's data.
   - Make the constraint `(customer_id, idempotency_key)`.
   - Also decide what happens when the same key arrives with a different cart. Returning the old order silently is wrong; return `422`.
   - Say where `customer_id` comes from (auth), and that a unique-violation on insert is caught and turned into "return existing" rather than a `500`.

## Fix in the doc, then build

- **Schema:**
  - `stock.sku` needs a primary key.
  - Add a `CHECK (available >= 0)` as a backstop.
  - `order_items` needs a primary key `(order_id, sku)` and a foreign key to `orders`.
  - Add `status` and `created_at` to an index, since reconciliation scans on them.
  - Store the provider's charge id and a failure reason on `orders`. You will need them for support and for the case in blocker 2.
  - `status` as free text needs a check constraint.
- **Deadlocks:** two carts containing the same two SKUs in opposite order will deadlock in step 2. Say that SKUs are sorted before updating.
- **Lost email:** the process can die after the `PAID` commit and before the email is queued, so the email is silently lost. At your volume, a `confirmation_sent` flag or a small outbox table that reconciliation also sweeps is enough.
- **Request time:** four attempts at 5 s plus backoff can hold a request for 20 s or more. State the client-facing timeout, or accept it knowingly.
- **Observability:** the 30-minute `PENDING` alert is good. Add a counter for reconciliation outcomes and one for "charged but `FAILED`".

## Test plan gaps

The list covers the happy paths but not the risky parts. Add these before you build:
- Reconciliation settling to `PAID`, to `FAILED`, and leaving unknown orders alone.
- A crash between a successful charge and marking `PAID`, resolved by reconciliation.
- Concurrent duplicate `POST /orders` with the same key, not just sequential.
- A decline restoring exactly the reserved quantities, including a multi-SKU cart where the second SKU fails and the first rolls back.
- Two reconciliation runs at once restoring stock only once.
- The same key from a different customer, and the same key with a different cart.

Per your standards, also put the file and module layout and the order of test-first work in the doc. Right now the doc has the behaviour but not the build plan.

VERDICT: READY WITH CHANGES
