Final design
How can “the first end-to-end path ends with comprehensible settlement” be proven in the specific case?
A document-only demo would leave out contention and settlement.
Starting point From 60 seconds, property management tracks the existing command in an investigation list.
Assumptions for the example case
Fictitious design for a house, a completed annual period and a contractually specified area key. The application documents released billings and correction versions; the legal examination of individual costs remains with property management. All quantities, thresholds and operational targets are illustrative assumptions. The signed amount due equals the allocated cost share minus advance payments already accounted for. A separate immutable payment ledger records only additional positive payments received later. Outstanding balance = current amount due minus the sum of these additional payments. A positive balance is the remaining amount due, zero means settled, and a negative balance is a credit equal to its absolute value. Corrections replace the amount due, retain all payments and post only the difference from the previous amount due. They remain permitted after settlement and for credit balances. Actual positive payments are accepted and deduplicated even when they exceed the remaining amount due or arrive after settlement. Advance payments are not counted again in the additional ledger. Refunds are outside this case; a credit documents a balance and does not receivable a payout.
Check marker settlement
Runtime architecture · manage the document and receivable together
- 1 · Check receipts and keys
- 2 · Document + Claim commits
- 3 · Delivering the document
- 4 · Balance payment
Billing system
Approval writes the manifest and receivable atomically. Delivery and payment import follow separate, documented paths.
Test plan with expected outcomes
| Input and initial state | Expected result | Return to an earlier step |
|---|---|---|
| A-39 ready for review, version=3 → Release X and correction Y each with expected=3 in order X/Y and Y/X | Exactly one commit on version 4; the loser gets conflict; receivable corresponds to the winner. | Step 4 and 5 |
| Release X with 2,000 cents committed → repeat X identically; then send X with 2,001 cents | Identical response and one receivable; altered repetition of conflict without writing effect. | Step 4 |
| Delivery request starts at t=0 ms → t=59,999, 60,000, 60,001 ms | Clarification list only from 60,000 ms; no automatic delivery confirmation. | Step 9 |
| Receivable=2,000 cents, paid=1,999 cents → Payment of 1 cent with the same payment reference import twice | Exactly 2,000 cents allocated; state balanced; second delivery ineffective. | Step 5 and 10 |
| Amount due 2,000, additional payments 1,000; correction to Amount due 2,100 cents | Payment ledger still 1,000; remaining receivable 1,100 cents | Step 5 |
| Amount due 2,000, additional payments 2,000; correction to 2,100, then 1,500 cents | First 100 cents remain due, then a credit of 500 cents; payments remain 2,000 | Step 5 |
| Amount due 0, additional payments 0; then amount due −500 cents | Initially settled without a payment import; then a credit of 500 cents | Steps 2 and 5 |
| Amount due 2,000; payment 2,500 cents; repeat the same import; further payment 100 cents | Initially a credit of 500, unchanged on replay, then a credit of 600 cents; ledger total 2,600 cents | Step 4 and 5 |
A-39 ready for review, version=3 → Release X and correction Y each with expected=3 in order X/Y and Y/X
- Expected result
- Exactly one commit on version 4; the loser gets conflict; receivable corresponds to the winner.
- Return to an earlier step
- Step 4 and 5
Release X with 2,000 cents committed → repeat X identically; then send X with 2,001 cents
- Expected result
- Identical response and one receivable; altered repetition of conflict without writing effect.
- Return to an earlier step
- Step 4
Delivery request starts at t=0 ms → t=59,999, 60,000, 60,001 ms
- Expected result
- Clarification list only from 60,000 ms; no automatic delivery confirmation.
- Return to an earlier step
- Step 9
Receivable=2,000 cents, paid=1,999 cents → Payment of 1 cent with the same payment reference import twice
- Expected result
- Exactly 2,000 cents allocated; state balanced; second delivery ineffective.
- Return to an earlier step
- Step 5 and 10
Amount due 2,000, additional payments 1,000; correction to Amount due 2,100 cents
- Expected result
- Payment ledger still 1,000; remaining receivable 1,100 cents
- Return to an earlier step
- Step 5
Amount due 2,000, additional payments 2,000; correction to 2,100, then 1,500 cents
- Expected result
- First 100 cents remain due, then a credit of 500 cents; payments remain 2,000
- Return to an earlier step
- Step 5
Amount due 0, additional payments 0; then amount due −500 cents
- Expected result
- Initially settled without a payment import; then a credit of 500 cents
- Return to an earlier step
- Steps 2 and 5
Amount due 2,000; payment 2,500 cents; repeat the same import; further payment 100 cents
- Expected result
- Initially a credit of 500, unchanged on replay, then a credit of 600 cents; ledger total 2,600 cents
- Return to an earlier step
- Step 4 and 5
End-to-end test and unresolved agreements
- First end-to-end path
- Calculate A-39, test release against parallel correction, lose response, repeat identically, deliver document and balance 2,000 cents in two payments.
- Clarify before real use
- Before real use, domain specialists must check which costs may be allocated, deadlines, document-inspection rights, retention and correction procedures for the jurisdiction and contract. This example does not perform an operational legal review.
The first end-to-end test ends with traceable reconciliation.
Test approval, response loss, delivery and partial payments together.
A document-only demo would leave out contention and settlement.
Concurrency testing belongs to API and data store and leads back to step 5 in case of errors; exactly one version wins. Double payment import belongs to the reconciliation and leads back to step 4; one cent acts once and reaches the settlement.
- Alternative considered
- A portal showing an example amount does not demonstrate an immutable receivable.
- Trade-off
- The first end-to-end path requires simulated external feedback.
- Reassess
- Extend to further allocation keys after the counterexample tests pass.
Try it yourself
Assign each of three checks to its responsible component and the design step to revisit: competing approvals, correction after settlement, and delivery without evidence. State each expected outcome.
A hint for your attempt
Track the released settlement up to the proven result; note the return to the causing decision.
Compare with a possible solution
- Release and correction
- The API and relational data store allow exactly one winner for the same version; failures return to step 5. A correction after settlement retains all payments: an amount due of 2,100 against payments of 2,000 leaves 100 due; an amount due of 1,500 creates a credit of 500. Failures also return to step 5.
- Notification
- The worker and property management investigation list keep delivery open until evidence for the correct document version arrives. The timer opens an investigation at 60 seconds without receivableing delivery success; failures return to step 4 or 9.
Apply to your project
What decision do you need in your project for the first complete end-to-end path?
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 corresponding decision do you need in your project for the limit of the commitment?
In the example: Approval binds the evidence manifest, allocation keys and receivable to one shared version.
Requirements
Which corresponding decision do you need in your project for a permanently applicable domain rule?
In the example: Integer amounts in cents and a fixed remainder-allocation rule preserve equal totals.
Scale estimates
What decision do you need in your project for the strongest local contention?
In the example: Test peak load separately from two competing approvals of the same statement.
Interfaces
What decision do you need in your project for a repeated assignment?
In the example: Store the command key and normalised input hash with the result.
Data and states
Which corresponding decision do you need in your project for an documented final state?
In the example: Version the amounts due; preserve additional payments with stable references in one continuous ledger.
Overall architecture
What decision do you need in your project for leading and derived data?
In the example: A delivery worker processes durably stored commands outside the approval transaction.
Critical flow
What decision do you need in your project for a crash after commit?
In the example: The repeated call reads the stored approval result.
Bottlenecks and trade-offs
What decision do you need in your project for a measurable scaling limit?
In the example: The application calculates in advance and checks the manifest hash and version at commit time.
Operations and security
Which corresponding decision do you need in your project for the role with final responsibility?
In the example: From 60 seconds, property management tracks the existing command in an investigation list.
Final design
What decision do you need in your project for the first complete end-to-end path?
In the example: Test approval, response loss, delivery and partial payments together.