Description
When creating a revert transaction that uses a transaction route with an operation route configured with both direct and revert accounting entries, the resulting operations incorrectly use the code and description from the direct block instead of the revert block.
Steps to Reproduce
- Create an operation route with
operationType: "bidirectional" and distinct direct and revert accounting entries (with different code/description values to distinguish them)
- Create a transaction using this route — works correctly (uses
direct entries)
- Revert the transaction
Expected Behavior
The revert transaction operations should use routeCode and routeDescription from the revert block of the operation route accounting entries.
For example, if the operation route defines:
"revert": {
"debit": {
"code": "4.1.9.50.01.01.00005",
"description": "Ordens de Pagamento em Moeda Nacional (revert)"
},
"credit": {
"code": "1.4.2.35.01.01.00005",
"description": "Banco Central - Outros Depósitos (revert)"
}
}
The revert operations should reflect these values.
Actual Behavior
The revert transaction operations use the code and description from the direct block:
- Debit operation shows
routeCode: "1.4.2.35.01.01.00005" / routeDescription: "Banco Central - Outros Depósitos" (from direct.debit)
- Credit operation shows
routeCode: "4.1.9.50.01.01.00005" / routeDescription: "Ordens de Pagamento em Moeda Nacional" (from direct.credit)
Impact
- Incorrect chart of accounts mapping on revert entries
- Financial reporting/reconciliation can be affected since revert operations carry wrong accounting metadata
Environment
- Midaz ledger v3.6.0-beta.112
- Reported by: Ops team (Lazari)
Description
When creating a revert transaction that uses a transaction route with an operation route configured with both
directandrevertaccounting entries, the resulting operations incorrectly use thecodeanddescriptionfrom thedirectblock instead of therevertblock.Steps to Reproduce
operationType: "bidirectional"and distinctdirectandrevertaccounting entries (with different code/description values to distinguish them)directentries)Expected Behavior
The revert transaction operations should use
routeCodeandrouteDescriptionfrom therevertblock of the operation route accounting entries.For example, if the operation route defines:
The revert operations should reflect these values.
Actual Behavior
The revert transaction operations use the
codeanddescriptionfrom thedirectblock:routeCode: "1.4.2.35.01.01.00005"/routeDescription: "Banco Central - Outros Depósitos"(fromdirect.debit)routeCode: "4.1.9.50.01.01.00005"/routeDescription: "Ordens de Pagamento em Moeda Nacional"(fromdirect.credit)Impact
Environment