FINERACT-2326: Delinquent section in loan details using associations

This commit is contained in:
Jose Alberto Hernandez
2025-09-02 20:21:13 +02:00
committed by Arnold Gálovics
parent 937bfe529c
commit 9ba17bf79a
4 changed files with 18 additions and 13 deletions
@@ -1037,7 +1037,7 @@ public class LoansApiResource {
List<LoanTermVariationsData> loanTermVariations = null;
Collection<LoanCollateralResponseData> loanCollateralManagements;
Collection<LoanCollateralManagementData> loanCollateralManagementData = new ArrayList<>();
CollectionData collectionData = this.delinquencyReadPlatformService.calculateLoanCollectionData(resolvedLoanId);
CollectionData collectionData = null;
final Set<String> mandatoryResponseParameters = new HashSet<>();
final Set<String> associationParameters = ApiParameterHelper.extractAssociationsForResponseIfProvided(uriInfo.getQueryParameters());
@@ -1062,6 +1062,11 @@ public class LoansApiResource {
}
}
if (associationParameters.contains(DataTableApiConstant.collectionAssociateParamName)) {
mandatoryResponseParameters.add(DataTableApiConstant.collectionAssociateParamName);
collectionData = this.delinquencyReadPlatformService.calculateLoanCollectionData(resolvedLoanId);
}
if (associationParameters.contains(DataTableApiConstant.transactionsAssociateParamName)) {
mandatoryResponseParameters.add(DataTableApiConstant.transactionsAssociateParamName);
loanRepayments = this.loanReadPlatformService.retrieveLoanTransactions(resolvedLoanId);