adamsaghy commented on code in PR #4235:
URL: https://github.com/apache/fineract/pull/4235#discussion_r1899462072
##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/interestpauses/service/InterestPauseWritePlatformServiceImpl.java:
##########
@@ -68,6 +69,38 @@ public CommandProcessingResult createInterestPause(Long
loanId, String startDate
locale);
}
+ @Override
+ public CommandProcessingResult deleteInterestPause(Long loanId, Long
variationId) {
+ LoanTermVariations variation =
loanTermVariationsRepository.findByIdAndLoanId(variationId, loanId).orElseThrow(
+ () -> new
GeneralPlatformDomainRuleException("error.msg.variation.not.found", "Variation
not found for the given loan ID"));
+
+ loanTermVariationsRepository.delete(variation);
+
+ return new
CommandProcessingResultBuilder().withEntityId(variationId).build();
+ }
+
+ @Override
+ public CommandProcessingResult updateInterestPause(Long loanId, Long
variationId, String startDateString, String endDateString,
+ String dateFormat, String locale) {
+ Loan loan = loanRepositoryWrapper.findOneWithNotFoundDetection(loanId);
+
+ LocalDate startDate = parseDate(startDateString, dateFormat, locale);
+ LocalDate endDate = parseDate(endDateString, dateFormat, locale);
+
+ validateInterestPauseDates(loan, startDate, endDate, dateFormat,
locale);
Review Comment:
Also there are many missing validations:
- only supported for progressive loans and with recalculate interest = true
- Multiple Interest pause can happen in a loan life cycle, but no
overlapping should be allowed
- Loan must be Active
--
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]