**Verdict: you can start tomorrow, but fix the items under "Before you write code" first. The core flow is sound, and most of the fixes are one or two sentences in design.md.**

The main design choices are good:
- Stock is reserved atomically in the database.
- The payment call sits outside any transaction.
- The provider gets a stable idempotency key.
- There is a reconciliation job and a stuck-order alert.
- It is sized sensibly for 200 to 2,000 orders a day, with no extra infrastructure.

## Before you write code

1. **Settling an order twice can oversell stock.** The request path (step 5) and the reconciliation job (step 6) can both settle the same `PENDING` order. The job also runs on both instances. Suppose a decline restores stock and the job then settles the same order as `FAILED`. The stock is restored twice and `available` ends up higher than reality. State that every settlement is a guarded update, such as `UPDATE orders SET status=… WHERE id=:id AND status='PENDING'`. Restore stock only if that update changed a row. Also say how the job runs on only one instance, for example an advisory lock or `FOR UPDATE SKIP LOCKED`.

2. **The reconciliation job only half-specified.** It says "settles as `PAID` or `FAILED`", but not three cases:
   - Settling as `FAILED` must restore stock, like step 5.
   - A crash between the step 2 commit and the charge leaves a `PENDING` order the provider has never seen. Say what "no such charge" means. I'd say treat it as `FAILED` and restore stock.
   - The provider may report the charge as still processing. Leave the order `PENDING`.

3. **The module rule conflicts with step 2.** "No module reads another module's tables" is incompatible with reserving stock and inserting the order in one transaction. Pick one:
   - `OrderCheckout` owns the transaction and passes it into the orders and inventory modules.
   - Or, simpler, drop the rule for this transaction and say so.

## Small gaps to settle in the doc

- **Deadlocks:** reserve SKUs in sorted order. Otherwise two carts with the same SKUs in opposite order can deadlock.
- **Duplicate key race:** two simultaneous requests with the same key hit the unique constraint. Say that the loser rolls back, which releases its stock, and returns the winner's order. Scope the key per customer, and decide what happens if the same key arrives with a different cart.
- **Pricing:** say that `unit_price` and `total` come from the server's catalog, not the client's cart.
- **API responses:** list the status codes and bodies for created, repeated key, decline, and `202`. A decline currently has no defined client response.
- **Schema:** add primary keys, the unique index on `idempotency_key`, an index on `orders(status, created_at)` for the job, and a place to store the provider's charge id.
- **Email:** a crash between the `PAID` commit and the queue write loses the email. At this volume that is acceptable, but write it down as a known gap. Also name the queue technology.

## Tests: your global rules need these added

The test list leaves out the riskiest code. Add these:
- Reconciliation job: settles `PAID`, settles `FAILED` with stock restored, the provider has no record of the charge, and the provider still processing.
- Request path and job settling the same order at once, with stock restored exactly once.
- Concurrent duplicate `POST /orders`, not just sequential.
- Decline restores stock.
- A crash after the reserve commit and before the charge.
- Two carts with the same SKUs in opposite order.

VERDICT: READY WITH CHANGES
