FINERACT-1838: Loan account external events with repayment schedule
This commit is contained in:
committed by
Arnold Gálovics
parent
9fba52abbb
commit
c4d065fc7c
+1
@@ -46,6 +46,7 @@ public class LoanBusinessEventSerializer extends AbstractBusinessEventSerializer
|
||||
protected <T> ByteBufferSerializable toAvroDTO(BusinessEvent<T> rawEvent) {
|
||||
LoanBusinessEvent event = (LoanBusinessEvent) rawEvent;
|
||||
LoanAccountData data = service.retrieveOne(event.get().getId());
|
||||
data = service.fetchRepaymentScheduleData(data);
|
||||
return mapper.map(data);
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -48,6 +48,8 @@ public interface LoanReadPlatformService {
|
||||
|
||||
LoanAccountData retrieveOne(Long loanId);
|
||||
|
||||
LoanAccountData fetchRepaymentScheduleData(LoanAccountData accountData);
|
||||
|
||||
LoanScheduleData retrieveRepaymentSchedule(Long loanId, RepaymentScheduleRelatedLoanData repaymentScheduleRelatedData,
|
||||
Collection<DisbursementData> disbursementData, boolean isInterestRecalculationEnabled, BigDecimal totalPaidFeeCharges);
|
||||
|
||||
|
||||
+14
@@ -230,6 +230,20 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoanAccountData fetchRepaymentScheduleData(LoanAccountData accountData) {
|
||||
final RepaymentScheduleRelatedLoanData repaymentScheduleRelatedData = accountData.getTimeline().repaymentScheduleRelatedData(
|
||||
accountData.getCurrency(), accountData.getPrincipal(), accountData.getApprovedPrincipal(),
|
||||
accountData.getInArrearsTolerance(), accountData.getFeeChargesAtDisbursementCharged());
|
||||
|
||||
final Collection<DisbursementData> disbursementData = retrieveLoanDisbursementDetails(accountData.getId());
|
||||
final LoanScheduleData repaymentSchedule = retrieveRepaymentSchedule(accountData.getId(), repaymentScheduleRelatedData,
|
||||
disbursementData, accountData.isInterestRecalculationEnabled(),
|
||||
accountData.getSummary() != null ? accountData.getSummary().getFeeChargesPaid() : BigDecimal.ZERO);
|
||||
accountData.setRepaymentSchedule(repaymentSchedule);
|
||||
return accountData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoanScheduleData retrieveRepaymentSchedule(final Long loanId,
|
||||
final RepaymentScheduleRelatedLoanData repaymentScheduleRelatedLoanData, Collection<DisbursementData> disbursementData,
|
||||
|
||||
Reference in New Issue
Block a user