AshharAhmadKhan opened a new pull request, #5590: URL: https://github.com/apache/fineract/pull/5590
## Description Fixed Deposit accounts had an undo transaction endpoint that was silently broken in two ways. The API resource was calling `undoSavingsAccountTransaction` on the command builder, which set `entityName = "SAVINGSACCOUNT"` — meaning every undo request was routed to the regular savings handler, completely bypassing the Fixed Deposit command handler that already existed and was correctly wired. On top of that, `undoFDTransaction` in the service layer was an unconditional stub that always threw `DepositAccountTransactionNotAllowedException`, so even if routing had been correct, nothing would have worked. This PR fixes both issues and makes undo transactions fully functional for Fixed Deposit accounts. `CommandWrapperBuilder.java` — Added the missing `undoFixedDepositAccountTransaction()` builder method, correctly setting `entityName = "FIXEDDEPOSITACCOUNT"` and `actionName = "UNDOTRANSACTION"`. `FixedDepositAccountTransactionsApiResource.java` — Fixed the routing bug by calling the new FD-specific builder method instead of the savings one. `DepositAccountWritePlatformServiceJpaRepositoryImpl.java` — Replaced the throw stub with a full implementation adapted from `undoRDTransaction`, with FD-specific adjustments: `FixedDepositAccount` cast, `isTransactionsAllowed()` status check for ACTIVE and MATURED states, 7-param `postInterest` signature, and `updateMaturityDateAndAmount` instead of RD-specific schedule calls. `FixedDepositAccountHelper.java` — Added `getFixedDepositTransactions()` and `undoFixedDepositTransaction()` helper methods following the existing deprecated helper pattern. `FixedDepositTest.java` — Added `testFixedDepositAccountUndoTransaction` covering the full flow: create client, open and activate FD account, post interest, undo the interest transaction, assert `totalInterestPosted` returns to zero. ## Checklist - [x] Write the commit message as per our guidelines - [x] Create/update unit or integration tests for verifying the changes made - [x] Follow our coding conventions -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
