adamsaghy commented on code in PR #6205:
URL: https://github.com/apache/fineract/pull/6205#discussion_r3749067233
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/domain/WorkingCapitalLoanDelinquencyPauseUtils.java:
##########
@@ -58,6 +58,27 @@ public static LocalDate resolveEffectivePauseEnd(final
WorkingCapitalLoanDelinqu
.map(WorkingCapitalLoanDelinquencyAction::getStartDate).min(Comparator.naturalOrder()).orElse(pauseEnd);
}
+ /**
+ * Extends an inclusive period end date by every recorded pause
overlapping the period, mirroring the pause replay
+ * performed by the schedule rebuild.
+ */
+ public static LocalDate extendToDateByRecordedPauses(final LocalDate
fromDate, final LocalDate baseToDate,
Review Comment:
The two extendToDateByRecordedPauses implementations have different
semantics under identical javadoc (medium, maintainability)
Breach version mutates toDate inside the loop, so the overlap check
(pauseStart.isAfter(toDate)) sees the growing end date — a pause starting past
the base end can still be absorbed.
Delinquency version sums against the fixed baseToDate, so it cannot.
Each mirrors its own applyRecordedPauses (breach's uses live
period.getToDate(), delinquency's captures periodToDate up front), so both are
probably correct today. But the doc comment is copy-pasted verbatim, which
invites someone to treat them as interchangeable or "fix" one into the other.
Neither replays the fromDate shift that applyRecordedPauses performs;
@oleksii-novikov-onix Is this correct to have different behaviour?
--
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]