Skip to content

FINERACT-2690: Fix undo account transfer to resolve and scope by tran…#6136

Open
Samer-Melhem-FOO wants to merge 1 commit into
apache:developfrom
foodeveloper:cherry-pick/FINERACT-2690-fix-undo-account-transfer
Open

FINERACT-2690: Fix undo account transfer to resolve and scope by tran…#6136
Samer-Melhem-FOO wants to merge 1 commit into
apache:developfrom
foodeveloper:cherry-pick/FINERACT-2690-fix-undo-account-transfer

Conversation

@Samer-Melhem-FOO

Copy link
Copy Markdown

AccountTransfersWritePlatformServiceImpl.undo() had two related defects, discovered while testing the undo-account-transfer capability added in FINERACT-2604 and extended in FINERACT-2613:

  1. Wrong lookup table. The endpoint's path id was resolved against m_account_transfer_details, but AccountTransfersReadPlatformServiceImpl.retrieveOne (which backs the transfer read/list APIs) queries by m_account_transfer_transaction.id. These are two
    independent, unrelated id sequences that drift apart over time, so a caller undoing a transfer they can clearly see via the list/read endpoints could get a 404.
  2. Over-reversal on recurring transfers. undo() reversed every AccountTransferTransaction tied to the resolved AccountTransferDetails record, rather than only the single transaction the caller asked to undo. This incorrectly reversed every execution of a
    recurring transfer (e.g. a standing instruction) sharing one details row across many runs.

This PR fixes undo() to resolve and scope by m_account_transfer_transaction id instead, for both the savings-to-loan and savings-to-savings paths, so:

  • the id passed to undo matches what the read/list APIs actually expose, and
  • only the specific transaction requested is reversed, leaving sibling executions of a recurring transfer untouched.

It also adds the missing UNDO_ACCOUNTTRANSFER permission (entityName=ACCOUNTTRANSFER, actionName=UNDO) via a new Liquibase changelog part — the command handler was already wired to check this permission, but no matching m_permission row was ever shipped, so
the command failed permission validation before reaching the (buggy) logic above.

…saction id

undo() resolved the path id against m_account_transfer_details, but the
transfer read/list APIs expose m_account_transfer_transaction.id instead -
two independent id sequences that drift apart, so undo could 404 on a
transfer a caller could clearly see. It also reversed every transaction
tied to the resolved details record instead of only the one requested,
over-reversing recurring transfers (e.g. standing instructions) that share
one details row across many executions. Fixed for both the savings-to-loan
(FINERACT-2604) and savings-to-savings (FINERACT-2613) paths.

Also adds the missing UNDO_ACCOUNTTRANSFER permission (entityName=
ACCOUNTTRANSFER, actionName=UNDO) referenced by the command wiring, which
had no matching m_permission row and so failed permission validation.
@Samer-Melhem-FOO
Samer-Melhem-FOO force-pushed the cherry-pick/FINERACT-2690-fix-undo-account-transfer branch from b920603 to 3c0a655 Compare July 16, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant