FINERACT-2326: Add additional field which would return available disbursement amount with over applied amount
This commit is contained in:
committed by
Adam Saghy
parent
8bd9444689
commit
2cba4430c7
+2
@@ -1020,6 +1020,8 @@ final class LoansApiResourceSwagger {
|
||||
|
||||
@Schema(example = "100.000000")
|
||||
public BigDecimal availableDisbursementAmount;
|
||||
@Schema(example = "150.000000")
|
||||
public BigDecimal availableDisbursementAmountWithOverApplied;
|
||||
@Schema(example = "12")
|
||||
public Integer pastDueDays;
|
||||
@Schema(example = "[2022, 07, 01]")
|
||||
|
||||
+7
-2
@@ -643,8 +643,10 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService, Loa
|
||||
public LoanApprovalData retrieveApprovalTemplate(final Long loanId) {
|
||||
final Loan loan = this.loanRepositoryWrapper.findOneWithNotFoundDetection(loanId, true);
|
||||
final ApplicationCurrency appCurrency = applicationCurrencyRepository.findOneWithNotFoundDetection(loan.getCurrency());
|
||||
final BigDecimal availableDisbursementAmountWithOverApplied = delinquencyReadPlatformService
|
||||
.calculateAvailableDisbursementAmountWithOverApplied(loan);
|
||||
return new LoanApprovalData(loan.getProposedPrincipal(), DateUtils.getBusinessLocalDate(), loan.getNetDisbursalAmount(),
|
||||
appCurrency.toData());
|
||||
appCurrency.toData(), availableDisbursementAmountWithOverApplied);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -656,9 +658,12 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService, Loa
|
||||
paymentOptions = this.paymentTypeReadPlatformService.retrieveAllPaymentTypes();
|
||||
}
|
||||
final ApplicationCurrency appCurrency = applicationCurrencyRepository.findOneWithNotFoundDetection(loan.getCurrency());
|
||||
final BigDecimal availableDisbursementAmountWithOverApplied = delinquencyReadPlatformService
|
||||
.calculateAvailableDisbursementAmountWithOverApplied(loan);
|
||||
return LoanTransactionData.loanTransactionDataForDisbursalTemplate(transactionType,
|
||||
loan.getExpectedDisbursedOnLocalDateForTemplate(), loan.getDisburseAmountForTemplate(), loan.getNetDisbursalAmount(),
|
||||
paymentOptions, loan.retriveLastEmiAmount(), loan.getNextPossibleRepaymentDateForRescheduling(), appCurrency.toData());
|
||||
paymentOptions, loan.retriveLastEmiAmount(), loan.getNextPossibleRepaymentDateForRescheduling(), appCurrency.toData(),
|
||||
availableDisbursementAmountWithOverApplied);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user