Final design
Which tests verify concurrency control and completion for a return in the overall architecture?
The conclusion retains the full topology from step 6. Inside the boundary: interface → assessment API → return revisions, rules, evidence and draft notices. Calculation and delivery processing read durable work from this store. The delivery service is external. Processing exchanges domain messages; results reach the interface through the API. The evidence plan tests concurrency, retries, boundaries and terminal closure for return E-37. Table entries are expected outcomes, not executed tests.
Starting point Approval and technical delivery remain separate roles.
Assumptions for the example case
A fictional administrative workflow using an invented calculation model to bind return year, rule revision and draft assessment notice. The model uses an allowance of 100000 cents; only the excess is charged at 10 % and rounded to whole cents using round-half-up. All figures and test targets are illustrative assumptions.
Overall architecture with checks and review loops
Runtime topology
- 1 · Tax filer → Tax assessment API
- 2 · Tax assessment API → Relational case datastore
- 3 · Relational case datastore → Calculation processing
- 4 · Calculation processing → Tax assessment API
- 5 · Tax assessment API → Delivery processing
Bounded tax-assessment workflow
Approval binds exactly one return revision and one rule revision from the same model year.
Test plan for the complete design
| Component | Test and expected result | Return to an earlier step |
|---|---|---|
| Tax assessment API | Amendment and approval both expect version 5. Amendment first prevents approval of the old draft. Approval first preserves the old version; after a fresh read, amendment opens a linked follow-up review. | Steps 3 and 5 |
| Command journal | Identical retries take effect once; changed content produces a conflict. | Steps 4 and 7 |
| Domain boundary check | Test 99999, 100000 and 100001 cents. Expected rule: the fictional model uses an allowance of 100000 cents; only the excess is charged at 10 % and rounded to whole cents using round-half-up. | Step 2 |
| Tax return revisions, rule versions, evidence and draft assessment notices | After technical completion, an amendment changes neither the old document hash nor the calculation result; it creates a linked follow-up review. | Steps 5 and 9 |
| Calculation and delivery processing | A calculation job generates the draft assessment notice from a frozen return revision. Approval checks the current revision again. After commit, the unchanged document is transmitted. A missing transport response remains unknown and does not establish legally effective notification. | Steps 6 and 7 |
Tax assessment API
- Test and expected result
- Amendment and approval both expect version 5. Amendment first prevents approval of the old draft. Approval first preserves the old version; after a fresh read, amendment opens a linked follow-up review.
- 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
- Test 99999, 100000 and 100001 cents. Expected rule: the fictional model uses an allowance of 100000 cents; only the excess is charged at 10 % and rounded to whole cents using round-half-up.
- Return to an earlier step
- Step 2
Tax return revisions, rule versions, evidence and draft assessment notices
- Test and expected result
- After technical completion, an amendment changes neither the old document hash nor the calculation result; it creates a linked follow-up review.
- Return to an earlier step
- Steps 5 and 9
Calculation and delivery processing
- Test and expected result
- A calculation job generates the draft assessment notice from a frozen return revision. Approval checks the current revision again. After commit, the unchanged document is transmitted. A missing transport response remains unknown and does not establish legally effective notification.
- Return to an earlier step
- Steps 6 and 7
First end-to-end test and outstanding evidence
- End-to-end path
- Test amendment against approval end to end. A calculation job generates the draft assessment notice from a frozen return revision. Approval checks the current revision again. After commit, the unchanged document is transmitted. A missing transport response remains unknown and does not establish legally effective notification.
- Clarify before extending the scope
- Agree the real delivery-service contract, retention, recovery targets and roles before extending the scope. All limits here are design assumptions. This evidence table specifies tests to run; integration, browser checks and reader comprehension tests follow separately.
Test an amendment against approval end to end
Test an amendment against approval end to end.
An amended return arrives while draft approval is pending. Closure requires both technical and domain evidence.
Amendment and approval both expect version 5. Amendment first prevents approval of the old draft. Approval first preserves the old version; after a fresh read, amendment opens a linked follow-up review. Your test defines 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
- Amendment and approval both expect version 5. Amendment first prevents approval of the old draft. Approval first preserves the old version; after a fresh read, amendment opens a linked follow-up review. Expected invariant: exactly one return revision and one rule revision from the same model year bind the approved draft; amendment requires renewed review. Failures lead back to step 5 and the command contract in step 4.
- Test completion and retries
- Start: a technically completed case has an immutable document hash, calculation result and transmission record. Submit an amendment with a new return revision, then repeat the same key and content. Expected: exactly one linked follow-up review; the old document hash, calculation result and transmission record remain identical. Replay returns the same follow-up record; a new approval of the old case conflicts. 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
Which evidence about a tax return would originate outside the application in your project?
In the example: The rule year and tax return remain explicitly linked. A fictional administrative workflow with an invented calculation model linking the tax return year, rule revision and draft assessment notice.
Requirements
Which rule of your project remains binding even with slow processing?
In the example: The calculation model and rounding are identified as fictional. The invented model uses an allowance of 100000 cents; only the amount above it is charged at 10 % and rounded to whole cents using round-half-up.
Scale estimates
Which individual object concentrates load more strongly than the daily average when processing return revisions?
In the example: Concurrent amendments complement the volume test profile. An average of 1 events/s says little about amendment and approval of the same tax return.
Interfaces
Which input fields make two change intentions different in your project?
In the example: Approval binds the tax return and document hash. The return revision, model year, rule revision, calculation result and document hash must remain identical on replay.
Data and states
Which states must remain protected in your model against late replay?
In the example: Draft assessment notices remain immutable versions. After technical completion, an amendment changes neither the old document hash nor the calculation result; it creates a linked follow-up review.
Overall architecture
Which planned service boundary would distribute a currently local guarantee across the network?
In the example: The calculation job and delivery use the same manifest. Tax return revisions, rule versions, evidence and draft assessment notices 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: Check amendments again before approval. The approved draft assessment notice binds exactly one return revision and one rule revision from the same model year; an amendment requires renewed review.
Bottlenecks and trade-offs
Which similar display could have two different causes in your project?
In the example: Document requests and calculation backlogs have separate signals. Long processing time may result from requests for additional evidence or a calculation backlog. Waiting reason, run manifest and delivery status are measured separately.
Operations and security
Which open state in your project needs a domain specialist as well as technical operations?
In the example: Approval and technical delivery remain separate roles. After technical completion, an amendment changes neither the old document hash nor the calculation result; it creates a linked follow-up review.
Final design
Which two counterexample tests will you run first in your own end-to-end implementation?
In the example: Test an amendment against approval end to end. Amendment and approval both expect version 5. Amendment first prevents approval of the old draft. Approval first preserves the old version; after a fresh read, amendment opens a linked follow-up review.