FINERACT-1724: Loans API get loan details/delinquent data wrong

This commit is contained in:
Jose Alberto Hernandez
2023-03-24 18:15:39 +01:00
committed by Adam Saghy
parent 36c5d103d7
commit b40e700cc6
@@ -844,7 +844,9 @@ public class LoansApiResource {
Collection<LoanCollateralResponseData> loanCollateralManagements;
Collection<LoanCollateralManagementData> loanCollateralManagementData = new ArrayList<>();
CollectionData collectionData = CollectionData.template();
if (loanBasicDetails.isActive()) {
collectionData = this.delinquencyReadPlatformService.calculateLoanCollectionData(resolvedLoanId);
}
final Set<String> mandatoryResponseParameters = new HashSet<>();
final Set<String> associationParameters = ApiParameterHelper.extractAssociationsForResponseIfProvided(uriInfo.getQueryParameters());
final Collection<LoanTransactionData> currentLoanRepayments = this.loanReadPlatformService.retrieveLoanTransactions(resolvedLoanId);
@@ -948,13 +950,6 @@ public class LoansApiResource {
mandatoryResponseParameters.add(DataTableApiConstant.linkedAccountAssociateParamName);
linkedAccount = this.accountAssociationsReadPlatformService.retriveLoanLinkedAssociation(resolvedLoanId);
}
if (associationParameters.contains(DataTableApiConstant.collectionAssociateParamName)) {
mandatoryResponseParameters.add(DataTableApiConstant.collectionAssociateParamName);
if (loanBasicDetails.isActive()) {
collectionData = this.delinquencyReadPlatformService.calculateLoanCollectionData(resolvedLoanId);
}
}
}
Collection<LoanProductData> productOptions = null;