Skip to content

FINERACT-754: Preserve transfer links during overdraft recalculation - #6192

Open
aditya-786 wants to merge 1 commit into
apache:developfrom
aditya-786:fix/FINERACT-754-transfer-link
Open

FINERACT-754: Preserve transfer links during overdraft recalculation#6192
aditya-786 wants to merge 1 commit into
apache:developfrom
aditya-786:fix/FINERACT-754-transfer-link

Conversation

@aditya-786

Copy link
Copy Markdown

Description

Fixes FINERACT-754.

When backdated savings activity changes overdraft allocation, Fineract reverses and replaces affected transactions. The account transfer row remained linked to the reversed transaction, so the active replacement appeared as a regular withdrawal and transfer undo could no longer find it.

This change:

  • records exact old-to-new replacement chains during savings recalculation;
  • classifies every replacement-chain member as an account transfer for corrected journal posting;
  • posts reversal and replacement journals before retargeting the transfer reference to the final active replacement in the same JPA transaction;
  • excludes audit-only reversal rows from accounting;
  • routes regular savings posting and manual interest calculation through the canonical replacement-aware service.

Scope

This patch fixes the entity-backed transaction flow used by FINERACT-754, including manual interest posting and backdated transaction recalculation. The scheduled post-interest job uses an independent DTO/JDBC batch pipeline and is unchanged.

Verification

  • 20 focused unit tests passed across fineract-savings and fineract-provider.
  • AccountTransferOverdraftTest passed against a rebuilt local image with PostgreSQL. It verifies transfer-link continuity, exact original reversal and replacement GL entries, no journal for the audit-only reversal row, successful transfer undo, and final balances.
  • Spotless, Checkstyle, license checks, full RAT, SpotBugs, and git diff --check passed.

Checklist

  • Write the commit message as per the contribution guidelines.
  • Acknowledge that the pull request must pass the build before review.
  • Add unit and integration tests for the change.
  • Follow the project coding conventions.
  • No API contract changed, so Swagger and legacy API documentation updates are not required.
  • Keep the change reviewable and focused.
  • If this PR resolves the Jira issue, update its resolution and Fix Version after merge.

Keep account transfer references attached when savings overdraft recalculation reverses and replaces a transaction.

Record exact replacement chains, preserve transfer accounting for the reversed and replacement transactions, and relink the transfer only after journal posting succeeds.

Add focused unit coverage and a PostgreSQL-backed integration regression for transfer undo and journal entries.
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