System Design Atlas

Construction change orders, drawing revisions and cost impact

04 / 10Worked example

Interfaces

How does the approve-change-order contract distinguish a retry from a new intent?

The load profile now applies to the approve-change-order command. Its payload contains the change-order version, drawing hash, scope hash, cost revision and amount in cents. An idempotency key recognises the same intent after a response is lost; an aggregate version protects business state against concurrent changes.

Starting point Test document size and concurrent approvals separately.

Assumptions for the example case

Original fictional design: an internal approval workflow for a change order with frozen drawings and costs. The illustrative internal threshold is 500000 cents. Up to and including this amount, one approver is sufficient; above it, this case requires a second approver. All figures and test targets are illustrative assumptions.

Commands, retries and current state

Command and historical result

CommandChange order N-32 · Drawing revision P-32 · Cost revision K-32
Command → Nachtrags-APICheck content and expected version
Construction change order APIAccept the command or recognise a replay
Nachtrags-API → ErgebnisjournalCommit the result before responding
Result journalFingerprint + stored record

Identical replay returns the stored record; changed content produces a conflict.

The approval command binds the change-order version, drawing hash, scope hash, cost revision and amount in cents. Reusing the key leads back to the stored result; changed content produces a conflict.

Proposed API for this example

  1. POST/baunachtrag/{id}/commands

    Approve the change order

    Input
    Change-order version, drawing hash, scope hash, cost revision and amount in cents; 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/baunachtrag/{id}

    Read the current business state and reason for investigation.

    Input
    Authorised identity and business object.
    Result
    Change order with its current version, evidence and reason for pending work.
    Retry behaviour
    Repeating a read creates no business change; access is checked again.

Additional state changes

OperationInputResult and protection
Submit the change orderDrawing reference, scope hash and cost line itemsDraft → submitted; content is frozen.
Change the revisionCurrent version and new content referencesBefore approval, create a new revision requiring review; previous consents do not apply to it.
Reject the change orderApprover, version and reasonEingereicht → abgelehnt.
Complete implementationConstruction management, approved scope and actual implementation evidenceFreigegeben → abgeschlossen; a discrepancy requires a separate follow-up order.

Submit the change order

Input
Drawing reference, scope hash and cost line items
Result and protection
Draft → submitted; content is frozen.

Change the revision

Input
Current version and new content references
Result and protection
Before approval, create a new revision requiring review; previous consents do not apply to it.

Reject the change order

Input
Approver, version and reason
Result and protection
Eingereicht → abgelehnt.

Complete implementation

Input
Construction management, approved scope and actual implementation evidence
Result and protection
Freigegeben → abgeschlossen; a discrepancy requires a separate follow-up order.

Messages across the external boundary

Source contract
BCF supports domain issues with document references and permission-controlled changes. The change-order and approval model is our own design.
System responsibility
Approvers confirm a frozen change order. The API checks its version and content bindings before commit. Uploading a new drawing after this commit creates a new revision awaiting review; the existing approval remains traceable in history.

Approval specifies three concrete content references

Approval specifies three concrete content references

Approval specifies three concrete content references.

An approve-change-order command may arrive again after a response is lost.

The change-order version, drawing hash, scope hash, cost revision and amount in cents must remain identical on replay. The exercise specifies the input and expected result.

Alternative considered
A key stored only in volatile memory loses its evidence on restart.
Trade-off
The approval command 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 an identical approval retry, the same key with a different cost amount, 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 stored result for change order N-32 is returned; its 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: a drawing change creates a new revision requiring review.