FINERACT-1992: Backdated delinquency pause events
This commit is contained in:
committed by
Adam Saghy
parent
cd2f2f8102
commit
5edd18aec2
+7
-6
@@ -157,12 +157,13 @@ public class LoanDelinquencyRangeChangeBusinessEventSerializer implements Busine
|
||||
.build();
|
||||
|
||||
// get list of charges for installments in same range
|
||||
List<LoanCharge> chargesForInstallmentsInSameRange = loan.getLoanCharges().stream()
|
||||
.filter(loanCharge -> !loanCharge.isPaid() && delinquentInstallmentsInSameRange.stream().anyMatch(
|
||||
installmentForCharge -> (DateUtils.isAfter(loanCharge.getDueDate(), installmentForCharge.getFromDate())
|
||||
|| DateUtils.isEqual(loanCharge.getDueDate(), installmentForCharge.getFromDate()))
|
||||
&& (DateUtils.isBefore(loanCharge.getDueDate(), installmentForCharge.getDueDate())
|
||||
|| DateUtils.isEqual(loanCharge.getDueDate(), installmentForCharge.getDueDate()))))
|
||||
List<LoanCharge> chargesForInstallmentsInSameRange = loan.getLoanCharges().stream().filter(loanCharge -> !loanCharge
|
||||
.isPaid()
|
||||
&& delinquentInstallmentsInSameRange.stream().anyMatch(installmentForCharge -> (DateUtils
|
||||
.isAfter(loanCharge.getEffectiveDueDate(), installmentForCharge.getFromDate())
|
||||
|| DateUtils.isEqual(loanCharge.getEffectiveDueDate(), installmentForCharge.getFromDate()))
|
||||
&& (DateUtils.isBefore(loanCharge.getEffectiveDueDate(), installmentForCharge.getDueDate())
|
||||
|| DateUtils.isEqual(loanCharge.getEffectiveDueDate(), installmentForCharge.getDueDate()))))
|
||||
.toList();
|
||||
|
||||
List<LoanChargeDataRangeViewV1> charges = new ArrayList<>();
|
||||
|
||||
+4
@@ -236,6 +236,10 @@ public class DelinquencyWritePlatformServiceImpl implements DelinquencyWritePlat
|
||||
if (DateUtils.isBefore(parsedDelinquencyAction.getStartDate(), businessDate)
|
||||
&& DelinquencyAction.PAUSE.equals(parsedDelinquencyAction.getAction())) {
|
||||
recalculateLoanDelinquencyData(loan);
|
||||
// if pause end date is after current business date, loan delinquency pause flag is changed, emit event
|
||||
if (DateUtils.isAfter(parsedDelinquencyAction.getEndDate(), businessDate)) {
|
||||
businessEventNotifierService.notifyPostBusinessEvent(new LoanDelinquencyRangeChangeBusinessEvent(loan));
|
||||
}
|
||||
}
|
||||
businessEventNotifierService.notifyPostBusinessEvent(new LoanAccountDelinquencyPauseChangedBusinessEvent(loan));
|
||||
return new CommandProcessingResultBuilder().withCommandId(command.commandId()) //
|
||||
|
||||
Reference in New Issue
Block a user