Skip to content

Bug: Revert transaction uses direct accounting entry code/description instead of revert block #2016

@gandalf-at-lerian

Description

@gandalf-at-lerian

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

  1. Create an operation route with operationType: "bidirectional" and distinct direct and revert accounting entries (with different code/description values to distinguish them)
  2. Create a transaction using this route — works correctly (uses direct entries)
  3. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions