adamsaghy commented on code in PR #4266:
URL: https://github.com/apache/fineract/pull/4266#discussion_r1918206503
##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/interestpauses/service/InterestPauseWritePlatformServiceImpl.java:
##########
@@ -178,9 +217,13 @@ private void validateVariations(Loan loan,
LoanTermVariations variation) {
List<LoanTermVariations> existingVariations =
loan.getLoanTermVariations();
for (LoanTermVariations existingVariation : existingVariations) {
- if (!existingVariation.equals(variation) &&
variation.getTermApplicableFrom().isBefore(existingVariation.getDateValue())
- &&
variation.getDateValue().isAfter(existingVariation.getTermApplicableFrom())) {
- throw new
GeneralPlatformDomainRuleException("interest.pause.overlapping", "Overlapping
interest pauses are not allowed.");
+ if (!existingVariation.equals(variation)
+ &&
Objects.equals(existingVariation.getTermType().getValue(),
INTEREST_PAUSE.getValue())) {
+ if
(!variation.getTermApplicableFrom().isAfter(existingVariation.getDateValue())
Review Comment:
I am not sure about this conditions...
So both of the dates are inclusive, so if we want to create interest pause
from 1 January to 2 January, the from date is 1 January and end date is 2
January.
If i create a new interest pause, i want to make sure the due date is
**BEFORE** the existing variation from date or the from date is **AFTER** the
existing variation due date, no?
--
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]