FINERACT-2463: Allow undo of Fixed Deposit transactions#5590
Conversation
|
@AshharAhmadKhan Please review the failing test cases! |
857ff33 to
e1bbb7f
Compare
|
The failing Root cause: After undoing an interest transaction, the DB column Fix: Added a null check in the test assertion so that a null The service implementation, routing fix, and journal entry logic are all unchanged. |
|
@adamsaghy went through the changes again to see if I missed anything and I came out with notihng. Please let me know if there is anything else needed. |
adamsaghy
left a comment
There was a problem hiding this comment.
Please see my concerns around testing.
e1bbb7f to
7bad2f6
Compare
|
@adamsaghy thanks for the review! For the test I switched it to CASH_BASED accounting and added all three checks you mentioned — transaction marked as reversed, totalInterestPosted going back to zero, and the reversal journal entries (opposite signs on the same date). For the feign point I had a look at the generated FixedDepositAccountApi and it only exposes handleCommands4 which hits the account level endpoint and takes a single accountId. The undo transaction endpoint needs both accountId and transactionId so there is no matching method in the generated client. I also noticed RecurringDepositAccountHelper.undoTransactionForRecurringDeposit follows the same raw HTTP pattern for the same reason, so this is consistent with the existing deposit helper approach. I have added a comment in the helper explaining the gap. Happy to extend the generated client if you would prefer that approach though. |
|
7bad2f6 to
259cc66
Compare
|
@adamsaghy the failure on |
|
Would either of you mind triggering the runs when you get a chance? |
adamsaghy
left a comment
There was a problem hiding this comment.
Please use fineract-client-feign only in the integration tests.
Let me know if you need any help with that.
259cc66 to
689126b
Compare
|
@adamsaghy thanks for pushing on this, you were right. I was looking at
|
If a field is missing, we should add it to the swagger definition and it will be generated in the fineract-client automatically. |
a54521d to
5f10b35
Compare
|
@adamsaghy done — added |
5f10b35 to
7e2cd28
Compare
|
@adamsaghy just pushed a fix for the API backward compatibility failure. The new |
|
I’ve gone through the changes again end-to-end, especially around the earlier feedback on test coverage, client usage, and API alignment, and made sure everything is consistent. @adamsaghy could you take a look when you get a chance and let me know if anything still needs adjustment? Happy to iterate on your feedback. |
7e2cd28 to
f6d2c78
Compare
|
@adamsaghy All issues addressed. Please trigger checks when you get a chance. |
|
@adamsaghy hey, repushed with all five comments addressed. the CI failures on the last run were the |
f740f8c to
46facf6
Compare
46facf6 to
c6d3160
Compare
|
Hey @adamsaghy, I realised I hadn't addressed your last comment correctly. You asked to drop the manual JSON parsing and return the response object directly, but I was still doing To fix this properly, I added a swagger class Could you take a look when you get a chance? Thanks! |
c6d3160 to
6090558
Compare
|
Hey @adamsaghy, wanted to give you a quick update on what changed in this latest push. The previous approach for The fix was to add a proper dedicated The swagger response class for this endpoint lives in Could you take a look and trigger the checks when you get a chance? Thanks! |
6090558 to
2c12358
Compare
|
Hey @adamsaghy, one additional fix in this push (2c12358). The API compat check was failing with R012 — The E2E shard failures (3 and 9) were both |
2c12358 to
58f70c6
Compare
|
Hey @adamsaghy, one more fix in this push (58f70c6). Made a small fix, also The E2E shard failures (8 and 11) are the same infra OOM pattern as before — across two runs now, four different shards have failed (3, 9, 8, 11) with zero overlap, all running loan/EMI feature files unrelated to this PR. Consistent with random runner heap exhaustion on the first SDK generation attempt. Could you trigger the checks when you get a chance? Thanks! |
|
Hey @adamsaghy, the cancelled test-core-2 MySQL job looks like a CI timeout rather than an actual failure. Tests were still passing right up to the 60 minute limit and the same shard passed fine on MariaDB. Could you take a look and let me know if anything needs to change on my end? |
Description
Fixed Deposit accounts had an undo transaction endpoint that was silently broken in two ways. The API resource was calling
undoSavingsAccountTransactionon the command builder, which setentityName = "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,undoFDTransactionin the service layer was an unconditional stub that always threwDepositAccountTransactionNotAllowedException, 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 missingundoFixedDepositAccountTransaction()builder method, correctly settingentityName = "FIXEDDEPOSITACCOUNT"andactionName = "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 fromundoRDTransaction, with FD-specific adjustments:FixedDepositAccountcast,isTransactionsAllowed()status check for ACTIVE and MATURED states, 7-parampostInterestsignature, andupdateMaturityDateAndAmountinstead of RD-specific schedule calls.FixedDepositAccountHelper.java— AddedgetFixedDepositTransactions()andundoFixedDepositTransaction()helper methods following the existing deprecated helper pattern.FixedDepositTest.java— AddedtestFixedDepositAccountUndoTransactioncovering the full flow: create client, open and activate FD account, post interest, undo the interest transaction, asserttotalInterestPostedreturns to zero.Checklist