Design and evidence
Which evidence establishes joint commitment and one-time receivable creation?
The final design reuses the complete runtime topology from step 6. Test markers connect key decisions to expected results and earlier steps to revisit. The following items form a test plan; measured evidence is still outstanding.
Starting point Retain reservations until reconciliation is evidenced.
Assumptions for the example case
A fictional example design with one customer, one currency and one warehouse; a binding price offer; complete local stock and credit reservations; and one complete delivery. Figures and quality goals are illustrative test assumptions. Multiple currencies, tax calculation, partial delivery and credit insurance are outside the scope.
Overall architecture with evidence
Runtime architecture · Local reservations, asynchronous fulfilment
- 1 · Accept the order
- 2 · Reserve together
- 3 · Deliver outbox work
- 4 · Reconcile the inbox
Wholesale platform
The API commits the order, both reservations and outbox; inbox and reconciliation bring external delivery evidence back into the system.
Test plan with review loops
| Validation | Expected result | Return to an earlier step |
|---|---|---|
| Concurrency in both orders | Two orders each request 10 boxes and 20,000 cents against 15 boxes and 30,000 cents available. In either commit order, one wins; 5 boxes and 10,000 cents remain. No order may reserve only stock or only credit. | Steps 3 and 5 |
| Identical and changed retries | Retry A-101 with the same offer and 10 boxes: return the existing confirmation. Reusing the key with 11 boxes produces a conflict. Duplicate delivery evidence converts the credit reservation to a receivable only once. | Step 4 |
| Exact value or time limit | Available credit of 19,999 cents rejects A-101; 20,000 and 20,001 cents permit the reservation, leaving 0 and 1 cent respectively. The offer is valid until 13:00 UTC, exclusively; at exactly 13:00 it has expired. | Steps 2 and 5 |
| Lost response and restart | Inventory management delivers, but its response is missing. The order remains erfüllung_offen or klärung; order support reconciles the same reference. A timeout releases neither stock nor credit reservations automatically. | Steps 7 and 9 |
Concurrency in both orders
- Expected result
- Two orders each request 10 boxes and 20,000 cents against 15 boxes and 30,000 cents available. In either commit order, one wins; 5 boxes and 10,000 cents remain. No order may reserve only stock or only credit.
- Return to an earlier step
- Steps 3 and 5
Identical and changed retries
- Expected result
- Retry A-101 with the same offer and 10 boxes: return the existing confirmation. Reusing the key with 11 boxes produces a conflict. Duplicate delivery evidence converts the credit reservation to a receivable only once.
- Return to an earlier step
- Step 4
Exact value or time limit
- Expected result
- Available credit of 19,999 cents rejects A-101; 20,000 and 20,001 cents permit the reservation, leaving 0 and 1 cent respectively. The offer is valid until 13:00 UTC, exclusively; at exactly 13:00 it has expired.
- Return to an earlier step
- Steps 2 and 5
Lost response and restart
- Expected result
- Inventory management delivers, but its response is missing. The order remains erfüllung_offen or klärung; order support reconciles the same reference. A timeout releases neither stock nor credit reservations automatically.
- Return to an earlier step
- Steps 7 and 9
First end-to-end validation
- End-to-end path
- Test two competing orders and a duplicate delivery record. There is one winner, 5 crates remain and one receivable is created.
- Open decision
- Next, design partial deliveries separately. Multiple currencies, tax calculation, partial delivery and credit insurance require a separate follow-up design.
Prevent duplicate commitments
Test two competing orders and a duplicate delivery record.
A normal-flow test can overlook the two scarce resources.
One winner, 5 boxes remaining and one receivable.
- Alternative considered
- Credit checks alone do not establish stock consistency.
- Trade-off
- Tests require both authoritative states.
- Reassess
- Next, design partial deliveries separately.
Terms in this step
- Prevent duplicate commitments
- One winner, 5 boxes remaining and one receivable.
Try it yourself
Define a joint-commitment test and a duplicate-delivery test, each with a step to revisit.
A hint for your attempt
Use the specific entities and conditions from this step. The two solution parts distinguish the decision from its evidenced outcome.
Compare with a possible solution
- First part of the solution
- Two requests for ten boxes and 20,000 cents compete against 15 boxes and 30,000 cents: one winner, five boxes and 10,000 cents remaining. Revisit step 5 on failure.
- Second part of the solution
- Delivery evidence arrives twice: one receivable for 20,000 cents. Revisit step 7 on failure. The two tests check different transitions.
Apply to your project
Which corresponding assumption would you test first in your project? Consider this trigger: Next, design partial deliveries separately.
Start your own design
Choose a small case from your project. The template collects the ten design tasks and leaves space for your sketches, decisions, and open assumptions. You can edit it in your text editor or note-taking app.
Download design template (.md)Compare the ten tasks with the example case
Purpose and boundary
Which corresponding assumption would you test first in your project? Consider this trigger: Pre-orders are offered separately.
In the example: Treat price, stock and credit as one commitment. A confirmed order satisfies all three prerequisites.
Requirements
Which corresponding assumption would you test first in your project? Consider this trigger: Real credit-limit changes come from an external authoritative system.
In the example: Check credit reservations atomically against the remaining limit. Reserve 20,000 cents from the available 30,000 at most once.
Scale estimates
Which corresponding assumption would you test first in your project? Consider this trigger: Tiered prices are introduced.
In the example: Calculate order totals as integer cents. 20,000 cents matches the offer exactly.
Interfaces
Which corresponding assumption would you test first in your project? Consider this trigger: Dynamic prices are explicitly introduced.
In the example: Bind the order to P-101 and the quantity. A retry does not adopt a new price version.
Data and states
Which corresponding assumption would you test first in your project? Consider this trigger: Independent warehouses require a distributed commitment contract.
In the example: Perform both checks and reservations in one transaction. Rejection leaves no partial commitment.
Overall architecture
Which corresponding assumption would you test first in your project? Consider this trigger: Inventory management offers a shared atomic interface.
In the example: Persist the local commitment and transmit the external order separately. Network waits hold no inventory lock.
Critical flow
Which corresponding assumption would you test first in your project? Consider this trigger: Partial delivery requires partial delivery records.
In the example: Convert the reservation into a receivable exactly once. Credit exposure remains 20,000 cents rather than doubling to 40,000.
Bottlenecks and trade-offs
Which corresponding assumption would you test first in your project? Consider this trigger: A single customer dominates permanently.
In the example: Measure lock duration separately by item and customer. Targeted optimisation preserves the joint commitment.
Operations and security
Which corresponding assumption would you test first in your project? Consider this trigger: Reconciliation with the provider is not reliably available.
In the example: Retain reservations until reconciliation is evidenced. Stock is not promised again and credit is not released.
Final design
Which corresponding assumption would you test first in your project? Consider this trigger: Next, design partial deliveries separately.
In the example: Test two competing orders and a duplicate delivery record. There is one winner, 5 crates remain and one receivable is created.