Final design
Which tests prove contention protection and completion for picking orders in the overall architecture?
The final design reuses the full topology from step 6. Inside the system boundary: interface → warehouse API → inventory by location, allocations, picks and handovers. Route and shipping processing reads durable work from this store. The shipping system is external. Domain messages follow the main flow; results reach the interface through the warehouse API. The test plan adds concurrency, retries, exact boundaries and terminal completion for picking order E-36. The table gives expected outcomes; test execution evidence remains outstanding.
Starting point Inventory corrections require a separate permission.
Assumptions for the example case
Own fictitious example design. A warehouse with integer quantities, manual picking and a heuristic route recommendation. A route plan is marked as requiring rechecking at age 60 seconds and older; confirmed picks remain valid evidence. All figures and test goals are illustrative assumptions.
Overall architecture with checks and review loops
Runtime topology
- 1 · Order planning → Warehouse API
- 2 · Warehouse API → stock by location and allocations
- 3 · Stock by location and allocations → route planner
- 4 · Scanner path → warehouse API
Warehouse fulfilment
Open allocations do not exceed available stock at the location; routes do not change commitments.
Test plan for the complete design
| Component | Test and expected result | Return to an earlier step |
|---|---|---|
| Warehouse API | With location stock of 1 item and open allocation of 0, two allocations compete for the last item. In either winning order, exactly one wins: stock remains 1, open allocation becomes 1 and newly available stock is 0. The losing order receives no partial allocation. Only confirmed picking changes both stock and open allocation to 0 together. | Steps 3 and 5 |
| Command journal | Identical retries take effect once; changed content produces a conflict. | Steps 4 and 7 |
| Domain boundary check | Check values 59, 60 and 61 seconds. Oracle: A route plan is marked as requiring rechecking at age 60 seconds and older; confirmed picks remain valid evidence. | Step 2 |
| Inventory by storage location, allocations, picks and handovers | An identical pick reduces physical stock and its open allocation exactly once. An identical shortage cancellation releases only the open allocation once and does not increase physical stock. Completed orders remain blocked against new picks. | Steps 5 and 9 |
| Route and shipping processing | A picker confirms a pick. Stock, allocation and pick record commit together. After response loss, a retry returns the same record. A shorter route calculated later must not trigger another pick. | Steps 6 and 7 |
Warehouse API
- Test and expected result
- With location stock of 1 item and open allocation of 0, two allocations compete for the last item. In either winning order, exactly one wins: stock remains 1, open allocation becomes 1 and newly available stock is 0. The losing order receives no partial allocation. Only confirmed picking changes both stock and open allocation to 0 together.
- Return to an earlier step
- Steps 3 and 5
Command journal
- Test and expected result
- Identical retries take effect once; changed content produces a conflict.
- Return to an earlier step
- Steps 4 and 7
Domain boundary check
- Test and expected result
- Check values 59, 60 and 61 seconds. Oracle: A route plan is marked as requiring rechecking at age 60 seconds and older; confirmed picks remain valid evidence.
- Return to an earlier step
- Step 2
Inventory by storage location, allocations, picks and handovers
- Test and expected result
- An identical pick reduces physical stock and its open allocation exactly once. An identical shortage cancellation releases only the open allocation once and does not increase physical stock. Completed orders remain blocked against new picks.
- Return to an earlier step
- Steps 5 and 9
Route and shipping processing
- Test and expected result
- A picker confirms a pick. Stock, allocation and pick record commit together. After response loss, a retry returns the same record. A shorter route calculated later must not trigger another pick.
- Return to an earlier step
- Steps 6 and 7
First end-to-end test and outstanding evidence
- End-to-end path
- The last piece and double pick form the end-to-end path. A picker confirms a pick. Stock, allocation and pick record commit together. After response loss, a retry returns the same record. A shorter route calculated later must not trigger another pick.
- Clarify before extending the scope
- Agree on the actual shipping-system contract, retention, recovery targets and roles. All limits here are design assumptions. The evidence table specifies tests to run; technical integration, browser checks and reader comprehension checks follow separately.
Test the last item and a duplicate pick end to end
Test the last item and a duplicate pick end to end.
Two picking orders compete for the last item in the same storage location. A shorter route plan shall not alter the quantity already allocated. Completion requires technical and domain evidence.
For stock at the storage location 1 piece and open allocation 0, two allocations compete for the last piece. In both winning orders, exactly one wins: space remains 1, open allocation becomes 1, newly available is 0. The unsuccessful contract shall not be sub-alloted. Only the confirmed pick sets the space available and open allocation together to 0. The exercise specifies the input and expected result.
- Alternative considered
- An initial end-to-end path limited to lists and forms postpones the critical state checks.
- Trade-off
- The first end-to-end path needs controlled concurrency and failure points.
- Reassess
- Passing the counterexample tests and checks with readers provides grounds for extending the case.
Try it yourself
Choose two architectural decisions: concurrency protection and evidence-backed completion. For each, name the test, expected result and step to revisit.
A hint for your attempt
Link the markers of the overall architecture with the associated design steps.
Compare with a possible solution
- Concurrency control
- For stock at the storage location 1 piece and open allocation 0, two allocations compete for the last piece. In both winning orders, exactly one wins: space remains 1, open allocation becomes 1, newly available is 0. The unsuccessful contract shall not be sub-alloted. Only the confirmed pick sets the space available and open allocation together to 0. The invariant is expected: Open allocations do not exceed the confirmed available stock at the location; route recommendations do not change the quantity commitment. Deviation leads back to step 5 and to the command contract in step 4.
- Test completion and retries
- Starting point: location stock 1 item, open allocation 1 item for one order, newly available stock 0 items. Confirm the full pick and retry the identical scan record. Expected result: stock 0, open allocation 0, exactly one pick record. After staging and shipping acknowledgement, the order is complete; a new pick command conflicts. Test cancellation separately before picking: investigate a shortage and cancel twice identically. Release the allocation once; cancellation does not increase physical stock. Failures lead back to step 9 for ownership and step 7 for the failure sequence.
Apply to your project
Which two counterexample tests will you run first in your own end-to-end implementation?
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
What proof of picking order would arise in your own project outside of the application?
In the example: Inventory management and route recommendations have separate responsibilities. One warehouse with whole-item quantities, manual picking and a heuristic route recommendation.
Requirements
Which rule of your project remains binding even with slow processing?
In the example: Picking requires an allocation and physical evidence. A route plan is marked for rechecking from age 60 seconds; confirmed picks remain valid records.
Scale estimates
Which single item concentrates the load more than the daily mean value for warehouse orders?
In the example: The last item determines the conflict test. An average of 2 events/s says little about 50 allocations competing for one item at the same location.
Interfaces
Which input fields make two change intentions different in your project?
In the example: A pick binds the storage location and actual quantity. The order, location, allocated quantity, actual item count and scan record must remain identical on replay.
Data and states
Which states must remain protected in your model against late replay?
In the example: Stock and open allocations change together. An identical pick reduces physical stock and its open allocation exactly once. An identical shortage cancellation releases only the open allocation once and does not increase physical stock. Completed orders remain blocked against new picks.
Overall architecture
Which planned service boundary would distribute a currently local guarantee across the network?
In the example: The route planner must not write authoritative quantities. Inventory by storage location, allocations, picks and handovers must express the same valid state.
Critical flow
What feedback could be missing even though the underlying action has already taken place?
In the example: Repeating a scan returns the same pick record. Open allocations do not exceed confirmed available stock at the location; route recommendations do not change quantity commitments.
Bottlenecks and trade-offs
Which similar display could have two different causes in your project?
In the example: Optimise route length and lock duration separately. Long walking distances and high lock wait times are different bottlenecks. Route length in metres is assessed against location order; lock duration is measured at the quantity-allocation commit.
Operations and security
Which open state in your project needs a domain specialist as well as technical operations?
In the example: Inventory corrections require a separate permission. An identical pick reduces physical stock and its open allocation exactly once. An identical shortage cancellation releases only the open allocation once and does not increase physical stock. Completed orders remain blocked against new picks.
Final design
Which two counterexample tests will you run first in your own end-to-end implementation?
In the example: Test the last item and a duplicate pick end to end. With location stock of 1 item and open allocation of 0, two allocations compete for the last item. In either winning order, exactly one wins: stock remains 1, open allocation becomes 1 and newly available stock is 0. The losing order receives no partial allocation. Only confirmed picking changes both stock and open allocation to 0 together.