The order of operations in our DSL (Domain-Specific Language) affects the outcome. Consider the following example:
A transaction debits BRL 0.0030 from Account A (3172933b-50d2-4b17-96aa-9b378d6a6eac). If there isn't enough balance, the remainder is debited from Account B (01de90bf-5d09-461e-8a24-8e5cdb94968e).
If the sequence is reversed, first, Account B is debited. If there isn't enough balance, Account A is debited.
This principle applies to any other part of the DSL, including destinations and similar structures. The sequence determines the flow of operations and must be carefully considered.
Code examples
(transaction v1
(chart-of-accounts-group-name PAG_CONTAS_CODE_123182371973821973981)
(metadata
(anyKey anyValue)
(anotherKey anotherValue)
)
(description "description for the transaction not for the operation")
(send BRL 30|4
(source
(from 3172933b-50d2-4b17-96aa-9b378d6a6eac)
(from 01de90bf-5d09-461e-8a24-8e5cdb94968e
(description "remaining from transaction")
)
)
)
(distribute
(to 540b504c-8f9d-480f-9354-3728cf7025ef :share 100)
)
)
(transaction v1
(chart-of-accounts-group-name PAG_CONTAS_CODE_123182371973821973981)
(metadata
(anyKey anyValue)
(anotherKey anotherValue)
)
(description "description for the transaction not for the operation")
(send BRL 30|4
(source
(from 01de90bf-5d09-461e-8a24-8e5cdb94968e
(description "remaining from transaction")
)
(from 3172933b-50d2-4b17-96aa-9b378d6a6eac)
)
)
(distribute
(to 540b504c-8f9d-480f-9354-3728cf7025ef :share 100
(description "received from 01de90bf-5d09-461e-8a24-8e5cdb94968e")
)
)
)