System Design Atlas

Tax returns and assessment

04 / 10Worked example

Interfaces

How does the draft-approval contract distinguish a retry from a new intent?

The load profile leads to the command “Approve draft assessment notice”. It binds the return revision, model year, rule revision, calculation result and document hash. An idempotency key identifies the same intent after response loss; an aggregate version protects the current domain state.

Starting point Concurrent amendments complement the volume test profile.

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.

Commands, retries and current state

Command and replay

CommandTax return E-37 · Rule revision R-37 · Assessment notice B-37
Command → Veranlagungs-APICheck content and expected version
Tax assessment APIAccept the command or recognise a replay
Veranlagungs-API → ErgebnisjournalCommit the result before responding
Result journalFingerprint + stored record

Identical content returns the same record; changed content produces a conflict.

Approval binds return revision, model year, rule revision, calculation result and document hash. The same key refers to the stored result; changed content causes a conflict.

Proposed API for this example

  1. POST/steuerveranlagung/{id}/commands

    Approve the draft assessment notice.

    Input
    Return revision, model year, rule revision, calculation result and document hash; expected aggregate version, authorised role and stable command key.
    Result
    Durably stored business result and new version; version or content conflicts produce no partial effects. An accepted external request receives an open status.
    Retry behaviour
    The key is scoped to the actor, operation and business object. After authentication, first compare the existing result and canonical content: identical content returns the stored evidence; changed content produces a conflict. Only new keys trigger validation of the current version.
  2. GET/steuerveranlagung/{id}

    Read the current business state and reason for investigation.

    Input
    Authorised identity and business object.
    Result
    The return with its current version, evidence and unresolved processing reason.
    Retry behaviour
    Repeating a read creates no business change; access is checked again.

Additional state changes

OperationInputResult and protection
Amend the returnAuthorised tax filer, case identifier, expected aggregate version, current return revision, model year, new immutable information and retry keyBefore approval: a new return revision enters in_prüfung; the old calculation and draft review remain historical. After approval: create a linked follow-up review. Version conflicts require a fresh read; identical replay returns the same revision or follow-up identifier.
Request further evidenceCaseworker, missing document and versionUnder review → evidence requested.
Supplementary evidenceAuthorised person, evidence-request reference and immutable documentEvidence requested → under review; review the calculation again.
Calculate the draftReturn revision, rule revision and model yearSave result and document hash; completing calculation grants no approval.
Acknowledge transmissionDelivery service, order, document hash and statusSave technical status; missing response remains open.

Amend the return

Input
Authorised tax filer, case identifier, expected aggregate version, current return revision, model year, new immutable information and retry key
Result and protection
Before approval: a new return revision enters in_prüfung; the old calculation and draft review remain historical. After approval: create a linked follow-up review. Version conflicts require a fresh read; identical replay returns the same revision or follow-up identifier.

Request further evidence

Input
Caseworker, missing document and version
Result and protection
Under review → evidence requested.

Supplementary evidence

Input
Authorised person, evidence-request reference and immutable document
Result and protection
Evidence requested → under review; review the calculation again.

Calculate the draft

Input
Return revision, rule revision and model year
Result and protection
Save result and document hash; completing calculation grants no approval.

Acknowledge transmission

Input
Delivery service, order, document hash and status
Result and protection
Save technical status; missing response remains open.

Messages across the external boundary

Source contract
AO § 155 links tax assessment to a tax assessment notice. This example covers only an invented technical workflow and claims no legally effective notification.
System responsibility
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.

Approval binds the tax return and document hash

Approval binds the tax return and document hash

Approval binds the tax return and document hash.

The draft-approval command may arrive again after a response is lost.

Return revision, model year, rule revision, calculation result and document hash must stay identical on replay. Your test defines the input and expected result.

Alternative considered
A key stored only in volatile memory loses its evidence on restart.
Trade-off
The draft-approval journal requires durable retention and protected access.
Reassess
The documented retry window and journal volume determine the future archiving strategy.

Try it yourself

Predict the results of identical approval replay, the same key with a different return revision, and a new key with an old version.

A hint for your attempt

Retry identity and current state require separate checks.

Compare with a possible solution
Identical
The saved result for declaration E-37 is returned; the effect is not repeated.
Changed
The same key with altered canonical content results in conflict.
New intent with a stale version
A new key with a stale version is rejected before any business change. The interface reloads the current state and asks the user to confirm the decision again.

Apply to your project

Which input fields make two change intentions different in your project?

Next: draft assessment notices remain immutable versions.