System Design Atlas

Account posting and bank transfers

05 / 10Worked example

Authoritative data and states

When can a reversal posting be created and how does it remain unique?

The interfaces require an authoritative state. Each posting set adds up to zero per currency. Available funds remain at least zero without granted credit. For U-41, there is at most one original and at most one rejection-related reversal posting set. The following table separates current states from the evidence of their formation.

Starting point Persist the key with canonical content and the original result.

Assumptions for the example case

Our own fictitious example draft: transfer in EUR with positive whole cent amounts; a debited customer account and an internal settlement account; external settlement with status query; reversal posting after proven rejection. Figures and quality goals are illustrative test assumptions. Outside are foreign exchange, interest, fees, regulatory approval check and a complete bank ledger.

Data relationships and permitted transitions

Leading Data · Relationships and Life Cycle

Customer account K-41Debit −7,000 cents · remaining 3,000
K-41 → U-411:n Transfers
Transfer U-417,000 cents EUR
U-41 → Buchungssatz1:1 original posting set
Posting setK-41 −7,000 · V-41 +7,000 · Total 0
Buchungssatz → V-41local counterpart
Settlement account V-41Credit +7,000 cents
U-41 → A-411:1 Settlement order
Settlement instruction A-41external reference + result
Released
Sufficient balance → gebuchtabwicklung_offenConfirmed → DecommissionedCertainly rejected. Counter-booked
Insufficient balance → abgelehnt

Journal, order, and command result share a commit; terminal results block new effects.

An already booked transfer receives a definitive rejection. Create a referenced reversal posting with its own uniqueness. The sum is balanced and the original decision remains verifiable.

Entities and relationships

EntityAuthoritative dataResponsibility
Transfer U-41Amount 7,000 cents, EUR, recipient, authorisation reference, versionOwns exactly one original posting set.
Customer account K-41Initial balance of 10,000 cents, amount committedChecked atomically when debits compete.
Settlement account V-41Offsetting entry in EUROffsets every local debit.
Posting setTwo lines, sum zero, transfer referenceImmutable; correction by referenced reversal posting.
Settlement instruction A-41Stable external reference, result, last matchDouble delivery remains the same order.

Transfer U-41

Authoritative data
Amount 7,000 cents, EUR, recipient, authorisation reference, version
Responsibility
Owns exactly one original posting set.

Customer account K-41

Authoritative data
Initial balance of 10,000 cents, amount committed
Responsibility
Checked atomically when debits compete.

Settlement account V-41

Authoritative data
Offsetting entry in EUR
Responsibility
Offsets every local debit.

Posting set

Authoritative data
Two lines, sum zero, transfer reference
Responsibility
Immutable; correction by referenced reversal posting.

Settlement instruction A-41

Authoritative data
Stable external reference, result, last match
Responsibility
Double delivery remains the same order.

Permitted state transitions

Starting pointTargetCondition
freigegebengebuchtBalance is sufficient; two journal lines and A-41 are stored together.
freigegebenabgelehntInsufficient funds; no journal line.
gebuchtabwicklung_offenOrder has been transmitted or its outcome is unknown.
abwicklung_offenabgewickeltAppropriate final external proof is available.
abwicklung_offengegengebuchtSecure final rejection and one-time referenced reversal posting.
abgewickelt or gegengebucht or abgelehntterminalNew effects are locked; recall after final settlement is a process of its own.

freigegeben

Target
gebucht
Condition
Balance is sufficient; two journal lines and A-41 are stored together.

freigegeben

Target
abgelehnt
Condition
Insufficient funds; no journal line.

gebucht

Target
abwicklung_offen
Condition
Order has been transmitted or its outcome is unknown.

abwicklung_offen

Target
abgewickelt
Condition
Appropriate final external proof is available.

abwicklung_offen

Target
gegengebucht
Condition
Secure final rejection and one-time referenced reversal posting.

abgewickelt or gegengebucht or abgelehnt

Target
terminal
Condition
New effects are locked; recall after final settlement is a process of its own.

Append to the ledger

Append to the ledger

Create a referenced reversal posting with its own uniqueness guarantee.

An already booked transfer receives a definitive rejection.

The sum is balanced and the original decision remains verifiable.

Alternative considered
Overwriting the original lines loses the chronology.
Trade-off
Balances must be declared from several supporting documents.
Reassess
Partial returns extend the hitherto complete reversal posting case.

Terms in this step

Append to the ledger
The sum is balanced and the original decision remains verifiable.

Try it yourself

Let U-41 receive a definitive rejection and deliver that rejection twice. Calculate the account balance, reversal records and ledger total; compare this with a timeout alone.

A hint for your attempt

Use the specific entities and conditions from this step. The two solution parts distinguish the decision from its evidenced outcome.

Compare with a possible solution
First part of the solution
After initial charge to 3,000 cents, the first definitive rejection generates a reversal record. The balance returns to 10,000 cents; the repetition does not produce a second reversal record. Each posting set adds up to zero.
Second part of the solution
A timeout leaves the settlement open and the balance at 3,000 cents. Without a definitive rejection, no reversal record arises; A-41 is matched.

Apply to your project

Which corresponding assumption in your project would you check first? Use as an occasion: Partial returns extend the hitherto complete reversal posting case.

Step 6: Preserve local atomicity.