System Design Atlas

Tax returns and assessment

07 / 10Worked example

Critical flow

Which evidence survives response loss, and what may happen next?

Now the architecture is tested at its sensitive point of failure. 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.

Starting point The calculation job and delivery use the same manifest.

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.

Critical flow with commit and failure point

Calculate → review → commit → transmit → reconcile

1
Relational case datastore → Calculation processingRead frozen return and rule revisions
2
Calculation processing → Tax assessment APIReturn draft assessment notice with document hash
3
Approvers → Tax assessment APIApprove with expected version and return revision
4
Tax assessment API → Relational case datastoreCheck current revision and review status; amendment first causes a conflict
5
Tax assessment API → Relational case datastoreAtomically commit approval, command result and delivery request
6
Relational case datastore → Delivery processingProvide the unchanged document only after commit
7
Delivery processing → Delivery serviceTransmit approved document with the same hash
8
Delivery processing → Tax assessment APIMissing transport response: delivery remains unknown
9
Delivery processing → Delivery serviceReconcile the same request; create no new request
10
Delivery service → Tax assessment APIStore technical delivery evidence with matching document hash
11
Caseworkers → Tax assessment APIComplete the bounded technical workflow with evidence

An amendment before approval invalidates the previous review. After commit, the document remains unchanged; a missing transport response stays unresolved and does not establish legally effective notification.

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.

Ordering and failure outcomes

Required order
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.
Crash before commit
No new durable evidence exists for return E-37. The same command may be checked again; uncommitted intermediate work provides no domain guarantee.
Crash after commit, before response
The command journal entry records the original result. Identical replay returns that evidence; a fresh view of the current state comes from the read contract.
External uncertainty
A missing delivery-service response remains unknown. Confirmed acceptance, confirmed rejection and missing evidence have separate states; the responsible role investigates using the same reference.

Check amendments again before approval

Check amendments again before approval

Check amendments again before approval.

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.

An approved draft assessment notice binds exactly one return revision and one rule revision from the same model year; amendments require renewed review. Your test defines the input and expected result.

Alternative considered
Submitting a new request after a response is lost can execute the same business operation again.
Trade-off
Outstanding delivery-service evidence requires a work queue.
Reassess
Frequent unresolved outcomes require a more reliable contract for external reconciliation.

Try it yourself

Mark the commit point, failure point and next permitted action. Explain the effect of an identical retry.

A hint for your attempt

Trace the same request through the datastore and response path.

Compare with a possible solution
Flow and failure
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.
Commit and replay
The domain change and command result are stored together before responding. Response loss after commit leads to reading this result; return E-37 receives no duplicate effect.

Apply to your project

What feedback could be missing even though the underlying action has already taken place?

Next: document requests and calculation backlogs have separate signals.