You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "mariiaKraievska (via GitHub)" <gi...@apache.org> on 2026/07/03 09:58:32 UTC
[PR] FINERACT-2455: WC -Delinquency Reschedule - Multi Reschedule and Reprocess Support [fineract]
mariiaKraievska opened a new pull request, #6082:
URL: https://github.com/apache/fineract/pull/6082
## Description
Describe the changes made and why they were made. (Ignore if these details are present on the associated Apache Fineract JIRA ticket.)
## Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
- [ ] Write the commit message as per [our guidelines](https://github.com/apache/fineract/blob/develop/CONTRIBUTING.md#pull-requests)
- [ ] Acknowledge that we will not review PRs that are not passing the build _("green")_ - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
- [ ] Create/update [unit or integration tests](https://fineract.apache.org/docs/current/#_testing) for verifying the changes made.
- [ ] Follow our [coding conventions](https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions).
- [ ] Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
- [ ] [This PR must not be a "code dump"](https://cwiki.apache.org/confluence/display/FINERACT/Pull+Request+Size+Limit). Large changes can be made in a branch, with assistance. Ask for help on the [developer mailing list](https://fineract.apache.org/#contribute).
Your assigned reviewer(s) will follow our [guidelines for code reviews](https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide).
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: WC -Delinquency Reschedule - Multi Reschedule and Reprocess Support [fineract]
Posted by "mariiaKraievska (via GitHub)" <gi...@apache.org>.
mariiaKraievska commented on code in PR #6082:
URL: https://github.com/apache/fineract/pull/6082#discussion_r3534489387
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanTransactionReprocessingServiceImpl.java:
##########
@@ -136,6 +137,38 @@ public void reprocessTransactions(final WorkingCapitalLoan loan, final List<Work
amortizationScheduleWriteService.rebuildScheduleFromPrincipalPayments(loan, principalPayments);
}
+ @Override
+ public void reprocessAfterBackdatedTransaction(final WorkingCapitalLoan loan,
+ final List<WorkingCapitalLoanTransaction> allTransactions) {
+ final List<WorkingCapitalLoanTransaction> replayable = replayableInChronologicalOrder(allTransactions);
+ reprocessReplayableTransactions(loan, replayable);
+ delinquencyRangeScheduleService.reprocessScheduleFromTransactions(loan, replayable);
+ }
+
+ @Override
+ public void reprocessAfterUndo(final WorkingCapitalLoan loan) {
+ final List<WorkingCapitalLoanTransaction> allTransactions = transactionRepository
+ .findByWcLoan_IdOrderByTransactionDateAscIdAsc(loan.getId());
+ final List<WorkingCapitalLoanTransaction> replayable = replayableInChronologicalOrder(allTransactions);
+ final List<WorkingCapitalLoanCharge> charges = chargeRepository.findByLoanIdAndActiveTrueOrderByDueDateAscIdAsc(loan.getId());
+ if (!charges.isEmpty()) {
+ reprocessReplayableTransactions(loan, replayable);
+ }
+ delinquencyRangeScheduleService.reprocessScheduleFromTransactions(loan, replayable);
+ }
+
+ @Override
+ public void reprocessDelinquencySchedule(final WorkingCapitalLoan loan) {
Review Comment:
Done
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanTransactionReprocessingServiceImpl.java:
##########
@@ -136,6 +137,38 @@ public void reprocessTransactions(final WorkingCapitalLoan loan, final List<Work
amortizationScheduleWriteService.rebuildScheduleFromPrincipalPayments(loan, principalPayments);
}
+ @Override
+ public void reprocessAfterBackdatedTransaction(final WorkingCapitalLoan loan,
+ final List<WorkingCapitalLoanTransaction> allTransactions) {
+ final List<WorkingCapitalLoanTransaction> replayable = replayableInChronologicalOrder(allTransactions);
+ reprocessReplayableTransactions(loan, replayable);
+ delinquencyRangeScheduleService.reprocessScheduleFromTransactions(loan, replayable);
+ }
+
+ @Override
+ public void reprocessAfterUndo(final WorkingCapitalLoan loan) {
+ final List<WorkingCapitalLoanTransaction> allTransactions = transactionRepository
+ .findByWcLoan_IdOrderByTransactionDateAscIdAsc(loan.getId());
+ final List<WorkingCapitalLoanTransaction> replayable = replayableInChronologicalOrder(allTransactions);
+ final List<WorkingCapitalLoanCharge> charges = chargeRepository.findByLoanIdAndActiveTrueOrderByDueDateAscIdAsc(loan.getId());
+ if (!charges.isEmpty()) {
+ reprocessReplayableTransactions(loan, replayable);
+ }
+ delinquencyRangeScheduleService.reprocessScheduleFromTransactions(loan, replayable);
Review Comment:
Done
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: WC -Delinquency Reschedule - Multi Reschedule and Reprocess Support [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #6082:
URL: https://github.com/apache/fineract/pull/6082#discussion_r3529053110
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanTransactionReprocessingServiceImpl.java:
##########
@@ -136,6 +137,38 @@ public void reprocessTransactions(final WorkingCapitalLoan loan, final List<Work
amortizationScheduleWriteService.rebuildScheduleFromPrincipalPayments(loan, principalPayments);
}
+ @Override
+ public void reprocessAfterBackdatedTransaction(final WorkingCapitalLoan loan,
+ final List<WorkingCapitalLoanTransaction> allTransactions) {
+ final List<WorkingCapitalLoanTransaction> replayable = replayableInChronologicalOrder(allTransactions);
+ reprocessReplayableTransactions(loan, replayable);
+ delinquencyRangeScheduleService.reprocessScheduleFromTransactions(loan, replayable);
+ }
+
+ @Override
+ public void reprocessAfterUndo(final WorkingCapitalLoan loan) {
+ final List<WorkingCapitalLoanTransaction> allTransactions = transactionRepository
+ .findByWcLoan_IdOrderByTransactionDateAscIdAsc(loan.getId());
+ final List<WorkingCapitalLoanTransaction> replayable = replayableInChronologicalOrder(allTransactions);
+ final List<WorkingCapitalLoanCharge> charges = chargeRepository.findByLoanIdAndActiveTrueOrderByDueDateAscIdAsc(loan.getId());
+ if (!charges.isEmpty()) {
+ reprocessReplayableTransactions(loan, replayable);
+ }
+ delinquencyRangeScheduleService.reprocessScheduleFromTransactions(loan, replayable);
Review Comment:
this should not be part of transaction reprocessing. separate service, separate responsibilities
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanTransactionReprocessingServiceImpl.java:
##########
@@ -136,6 +137,38 @@ public void reprocessTransactions(final WorkingCapitalLoan loan, final List<Work
amortizationScheduleWriteService.rebuildScheduleFromPrincipalPayments(loan, principalPayments);
}
+ @Override
+ public void reprocessAfterBackdatedTransaction(final WorkingCapitalLoan loan,
+ final List<WorkingCapitalLoanTransaction> allTransactions) {
+ final List<WorkingCapitalLoanTransaction> replayable = replayableInChronologicalOrder(allTransactions);
+ reprocessReplayableTransactions(loan, replayable);
+ delinquencyRangeScheduleService.reprocessScheduleFromTransactions(loan, replayable);
Review Comment:
this should not be part of transaction reprocessing. separate service, separate responsibilities
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: WC -Delinquency Reschedule - Multi Reschedule and Reprocess Support [fineract]
Posted by "mariiaKraievska (via GitHub)" <gi...@apache.org>.
mariiaKraievska commented on code in PR #6082:
URL: https://github.com/apache/fineract/pull/6082#discussion_r3534494473
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanWritePlatformServiceImpl.java:
##########
@@ -770,11 +769,11 @@ private CommandProcessingResult makeRepaymentLikeTransaction(final Long loanId,
amortizationScheduleWriteService.applyRepayment(loan, transactionDate, principalPortion);
}
if (backdated) {
- transactionReprocessingService.reprocessTransactions(loan, allTransactions);
Review Comment:
Done
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: WC -Delinquency Reschedule - Multi Reschedule and Reprocess Support [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #6082:
URL: https://github.com/apache/fineract/pull/6082#discussion_r3528779100
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanDelinquencyActionWriteServiceImpl.java:
##########
@@ -64,6 +65,7 @@ public CommandProcessingResult createDelinquencyAction(final Long workingCapital
rangeScheduleService.extendPeriodsForPause(workingCapitalLoan, action.getStartDate(), action.getEndDate());
} else if (DelinquencyAction.RESCHEDULE.equals(action.getAction())) {
rangeScheduleService.rescheduleMinimumPayment(workingCapitalLoan, action);
+ transactionReprocessingService.reprocessDelinquencySchedule(workingCapitalLoan);
Review Comment:
Reprocessing delinquency schedule has nothing to do with transaction reprocessing, so using this service is incorrect.
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: WC -Delinquency Reschedule - Multi Reschedule and Reprocess Support [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #6082:
URL: https://github.com/apache/fineract/pull/6082#discussion_r3529050110
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanTransactionReprocessingServiceImpl.java:
##########
@@ -136,6 +137,38 @@ public void reprocessTransactions(final WorkingCapitalLoan loan, final List<Work
amortizationScheduleWriteService.rebuildScheduleFromPrincipalPayments(loan, principalPayments);
}
+ @Override
+ public void reprocessAfterBackdatedTransaction(final WorkingCapitalLoan loan,
+ final List<WorkingCapitalLoanTransaction> allTransactions) {
+ final List<WorkingCapitalLoanTransaction> replayable = replayableInChronologicalOrder(allTransactions);
+ reprocessReplayableTransactions(loan, replayable);
+ delinquencyRangeScheduleService.reprocessScheduleFromTransactions(loan, replayable);
+ }
+
+ @Override
+ public void reprocessAfterUndo(final WorkingCapitalLoan loan) {
+ final List<WorkingCapitalLoanTransaction> allTransactions = transactionRepository
+ .findByWcLoan_IdOrderByTransactionDateAscIdAsc(loan.getId());
+ final List<WorkingCapitalLoanTransaction> replayable = replayableInChronologicalOrder(allTransactions);
+ final List<WorkingCapitalLoanCharge> charges = chargeRepository.findByLoanIdAndActiveTrueOrderByDueDateAscIdAsc(loan.getId());
+ if (!charges.isEmpty()) {
+ reprocessReplayableTransactions(loan, replayable);
+ }
+ delinquencyRangeScheduleService.reprocessScheduleFromTransactions(loan, replayable);
+ }
+
+ @Override
+ public void reprocessDelinquencySchedule(final WorkingCapitalLoan loan) {
Review Comment:
This should be in delinquency schedule service
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: WC -Delinquency Reschedule - Multi Reschedule and Reprocess Support [fineract]
Posted by "mariiaKraievska (via GitHub)" <gi...@apache.org>.
mariiaKraievska commented on PR #6082:
URL: https://github.com/apache/fineract/pull/6082#issuecomment-4891075000
> In `WorkingCapitalLoanWritePlatformServiceImpl.java` / `WorkingCapitalLoanTransactionReprocessingServiceImpl.java`:
>
> ```java
> - transactionReprocessingService.reprocessTransactions(loan, transactionsToReprocess);
> - }
> + }
> +
> + transactionReprocessingService.reprocessAfterUndo(loan);
> ```
>
> `reprocessAfterUndo` -> `reprocessScheduleFromTransactions` resets every delinquency period on the loan (paid/outstanding/criteria/delinquent amount all wiped) and replays every non-reversed repayment-like transaction from scratch, and it now runs unconditionally on every single undo, not just when the loan has actually been rescheduled. Was the old incremental `applyRepaymentUndo` provably wrong once multiple reschedules are possible, or is this just the simpler path? If it's the former a one-line comment saying so would help the next reader; if it's just simplicity, might be worth gating the full replay to loans with reschedule history.
>
> Also: `WorkingCapitalLoanDelinquencyRangeScheduleService.applyRepaymentUndo(WorkingCapitalLoan, LocalDate, BigDecimal)` has no callers left anywhere in the codebase after this change (the only call site got replaced above). Let's get rid of it, or keep it if I'm missing a caller.
>
> Small thing: the docstring you touched now reads "The breach schedule are intentionally not rebuilt" - singular/plural typo.
@galovics Thanks for the review!
**On reprocessAfterUndo running unconditionally**: I went with full replay because AC in my task says "Any backdated repayments or reversals should triger the reprocess of Delinquency schedule and evaluation" — so, as I understand the reprocess and evaluation should happen not only after reschedule, @adamsaghy please correct me if I`m wrong. That’s why it runs on every undo. Documented on reprocessAfterUndo.
**On applyRepaymentUndo:** Agreed — no callers left. Removed it from the service/interface, along with the private helper and the unused repository method.
**On the typo:** Fixed.
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: WC -Delinquency Reschedule - Multi Reschedule and Reprocess Support [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #6082:
URL: https://github.com/apache/fineract/pull/6082#discussion_r3528779100
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanDelinquencyActionWriteServiceImpl.java:
##########
@@ -64,6 +65,7 @@ public CommandProcessingResult createDelinquencyAction(final Long workingCapital
rangeScheduleService.extendPeriodsForPause(workingCapitalLoan, action.getStartDate(), action.getEndDate());
} else if (DelinquencyAction.RESCHEDULE.equals(action.getAction())) {
rangeScheduleService.rescheduleMinimumPayment(workingCapitalLoan, action);
+ transactionReprocessingService.reprocessDelinquencySchedule(workingCapitalLoan);
Review Comment:
We dont need to reprocess any transactions, neither any periods what was before the current rescheduled one
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: WC -Delinquency Reschedule - Multi Reschedule and Reprocess Support [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #6082:
URL: https://github.com/apache/fineract/pull/6082#discussion_r3528779100
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanDelinquencyActionWriteServiceImpl.java:
##########
@@ -64,6 +65,7 @@ public CommandProcessingResult createDelinquencyAction(final Long workingCapital
rangeScheduleService.extendPeriodsForPause(workingCapitalLoan, action.getStartDate(), action.getEndDate());
} else if (DelinquencyAction.RESCHEDULE.equals(action.getAction())) {
rangeScheduleService.rescheduleMinimumPayment(workingCapitalLoan, action);
+ transactionReprocessingService.reprocessDelinquencySchedule(workingCapitalLoan);
Review Comment:
We dont need to reprocess any transactions.
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: WC -Delinquency Reschedule - Multi Reschedule and Reprocess Support [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #6082:
URL: https://github.com/apache/fineract/pull/6082#discussion_r3528779100
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanDelinquencyActionWriteServiceImpl.java:
##########
@@ -64,6 +65,7 @@ public CommandProcessingResult createDelinquencyAction(final Long workingCapital
rangeScheduleService.extendPeriodsForPause(workingCapitalLoan, action.getStartDate(), action.getEndDate());
} else if (DelinquencyAction.RESCHEDULE.equals(action.getAction())) {
rangeScheduleService.rescheduleMinimumPayment(workingCapitalLoan, action);
+ transactionReprocessingService.reprocessDelinquencySchedule(workingCapitalLoan);
Review Comment:
We dont need this.
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: WC -Delinquency Reschedule - Multi Reschedule and Reprocess Support [fineract]
Posted by "mariiaKraievska (via GitHub)" <gi...@apache.org>.
mariiaKraievska commented on code in PR #6082:
URL: https://github.com/apache/fineract/pull/6082#discussion_r3534486903
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanDelinquencyActionWriteServiceImpl.java:
##########
@@ -64,6 +65,7 @@ public CommandProcessingResult createDelinquencyAction(final Long workingCapital
rangeScheduleService.extendPeriodsForPause(workingCapitalLoan, action.getStartDate(), action.getEndDate());
} else if (DelinquencyAction.RESCHEDULE.equals(action.getAction())) {
rangeScheduleService.rescheduleMinimumPayment(workingCapitalLoan, action);
+ transactionReprocessingService.reprocessDelinquencySchedule(workingCapitalLoan);
Review Comment:
Fixed
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: WC -Delinquency Reschedule - Multi Reschedule and Reprocess Support [fineract]
Posted by "mariiaKraievska (via GitHub)" <gi...@apache.org>.
mariiaKraievska commented on code in PR #6082:
URL: https://github.com/apache/fineract/pull/6082#discussion_r3534491656
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanTransactionReprocessingServiceImpl.java:
##########
@@ -136,6 +137,38 @@ public void reprocessTransactions(final WorkingCapitalLoan loan, final List<Work
amortizationScheduleWriteService.rebuildScheduleFromPrincipalPayments(loan, principalPayments);
}
+ @Override
+ public void reprocessAfterBackdatedTransaction(final WorkingCapitalLoan loan,
+ final List<WorkingCapitalLoanTransaction> allTransactions) {
+ final List<WorkingCapitalLoanTransaction> replayable = replayableInChronologicalOrder(allTransactions);
+ reprocessReplayableTransactions(loan, replayable);
+ delinquencyRangeScheduleService.reprocessScheduleFromTransactions(loan, replayable);
+ }
+
+ @Override
+ public void reprocessAfterUndo(final WorkingCapitalLoan loan) {
+ final List<WorkingCapitalLoanTransaction> allTransactions = transactionRepository
+ .findByWcLoan_IdOrderByTransactionDateAscIdAsc(loan.getId());
+ final List<WorkingCapitalLoanTransaction> replayable = replayableInChronologicalOrder(allTransactions);
+ final List<WorkingCapitalLoanCharge> charges = chargeRepository.findByLoanIdAndActiveTrueOrderByDueDateAscIdAsc(loan.getId());
+ if (!charges.isEmpty()) {
+ reprocessReplayableTransactions(loan, replayable);
+ }
+ delinquencyRangeScheduleService.reprocessScheduleFromTransactions(loan, replayable);
Review Comment:
Done
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: WC -Delinquency Reschedule - Multi Reschedule and Reprocess Support [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on PR #6082:
URL: https://github.com/apache/fineract/pull/6082#issuecomment-4902070978
@mariiaKraievska please rebase
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: WC -Delinquency Reschedule - Multi Reschedule and Reprocess Support [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy merged PR #6082:
URL: https://github.com/apache/fineract/pull/6082
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: WC -Delinquency Reschedule - Multi Reschedule and Reprocess Support [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on PR #6082:
URL: https://github.com/apache/fineract/pull/6082#issuecomment-4892353967
> > In `WorkingCapitalLoanWritePlatformServiceImpl.java` / `WorkingCapitalLoanTransactionReprocessingServiceImpl.java`:
> > ```java
> > - transactionReprocessingService.reprocessTransactions(loan, transactionsToReprocess);
> > - }
> > + }
> > +
> > + transactionReprocessingService.reprocessAfterUndo(loan);
> > ```
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > `reprocessAfterUndo` -> `reprocessScheduleFromTransactions` resets every delinquency period on the loan (paid/outstanding/criteria/delinquent amount all wiped) and replays every non-reversed repayment-like transaction from scratch, and it now runs unconditionally on every single undo, not just when the loan has actually been rescheduled. Was the old incremental `applyRepaymentUndo` provably wrong once multiple reschedules are possible, or is this just the simpler path? If it's the former a one-line comment saying so would help the next reader; if it's just simplicity, might be worth gating the full replay to loans with reschedule history.
> > Also: `WorkingCapitalLoanDelinquencyRangeScheduleService.applyRepaymentUndo(WorkingCapitalLoan, LocalDate, BigDecimal)` has no callers left anywhere in the codebase after this change (the only call site got replaced above). Let's get rid of it, or keep it if I'm missing a caller.
> > Small thing: the docstring you touched now reads "The breach schedule are intentionally not rebuilt" - singular/plural typo.
>
> @galovics Thanks for the review!
>
> **On reprocessAfterUndo running unconditionally**: I went with full replay because AC in my task says "Any backdated repayments or reversals should triger the reprocess of Delinquency schedule and evaluation" — so, as I understand the reprocess and evaluation should happen not only after reschedule, @adamsaghy please correct me if I`m wrong. That’s why it runs on every undo. Documented on reprocessAfterUndo.
>
> **On applyRepaymentUndo:** Agreed — no callers left. Removed it from the service/interface, along with the private helper and the unused repository method.
>
> **On the typo:** Fixed.
Yeah, but only from the relevant period(s). We dont need full reprocessing or anything...
Delinquency reschedule should not affect or reprocess any transactions. They are not related...
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: WC -Delinquency Reschedule - Multi Reschedule and Reprocess Support [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #6082:
URL: https://github.com/apache/fineract/pull/6082#discussion_r3529059216
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanTransactionReprocessingServiceImpl.java:
##########
@@ -136,6 +137,38 @@ public void reprocessTransactions(final WorkingCapitalLoan loan, final List<Work
amortizationScheduleWriteService.rebuildScheduleFromPrincipalPayments(loan, principalPayments);
}
+ @Override
+ public void reprocessAfterBackdatedTransaction(final WorkingCapitalLoan loan,
+ final List<WorkingCapitalLoanTransaction> allTransactions) {
+ final List<WorkingCapitalLoanTransaction> replayable = replayableInChronologicalOrder(allTransactions);
+ reprocessReplayableTransactions(loan, replayable);
+ delinquencyRangeScheduleService.reprocessScheduleFromTransactions(loan, replayable);
+ }
+
+ @Override
+ public void reprocessAfterUndo(final WorkingCapitalLoan loan) {
+ final List<WorkingCapitalLoanTransaction> allTransactions = transactionRepository
+ .findByWcLoan_IdOrderByTransactionDateAscIdAsc(loan.getId());
+ final List<WorkingCapitalLoanTransaction> replayable = replayableInChronologicalOrder(allTransactions);
+ final List<WorkingCapitalLoanCharge> charges = chargeRepository.findByLoanIdAndActiveTrueOrderByDueDateAscIdAsc(loan.getId());
+ if (!charges.isEmpty()) {
+ reprocessReplayableTransactions(loan, replayable);
+ }
+ delinquencyRangeScheduleService.reprocessScheduleFromTransactions(loan, replayable);
Review Comment:
`delinquencyRangeScheduleService.reprocessScheduleFromTransactions` and `WorkingCapitalLoanTransactionReprocessingServiceImpl.reprocessDelinquencySchedule` seems equivalent and hence latter can be removed safely
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: WC -Delinquency Reschedule - Multi Reschedule and Reprocess Support [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #6082:
URL: https://github.com/apache/fineract/pull/6082#discussion_r3529068783
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanWritePlatformServiceImpl.java:
##########
@@ -770,11 +769,11 @@ private CommandProcessingResult makeRepaymentLikeTransaction(final Long loanId,
amortizationScheduleWriteService.applyRepayment(loan, transactionDate, principalPortion);
}
if (backdated) {
- transactionReprocessingService.reprocessTransactions(loan, allTransactions);
Review Comment:
I dont think we need different behaviour between backdated transaction vs undo transaction. Lets undo these and leave delinquency handling outside of transaction reprocessing.
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org