oleksii-novikov-onix commented on code in PR #4925:
URL: https://github.com/apache/fineract/pull/4925#discussion_r2255989300
##########
fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/api/LoanCapitalizedIncomeApiResource.java:
##########
@@ -68,15 +68,44 @@ public LoanDeferredIncomeData
fetchDeferredIncomeDetails(@PathParam("loanId") @P
@Produces({ MediaType.APPLICATION_JSON })
@Operation(summary = "Get the amortization details of Capitalized Income
for a loan by external ID")
@ApiResponses({
- @ApiResponse(responseCode = "200", description = "OK", content =
@Content(schema = @Schema(implementation = LoanDeferredIncomeData.class))) })
- public LoanDeferredIncomeData fetchDeferredIncomeDetailsByExternalId(
+ @ApiResponse(responseCode = "200", description = "OK", content =
@Content(schema = @Schema(implementation = LoanCapitalizedIncomeData.class))) })
+ public LoanCapitalizedIncomeData fetchDeferredIncomeDetailsByExternalId(
@PathParam("loanExternalId") @Parameter(description =
"loanExternalId", required = true) final String loanExternalId) {
this.context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSIONS);
final ExternalId externalId =
ExternalIdFactory.produce(loanExternalId);
final Long resolvedLoanId =
loanReadPlatformService.getResolvedLoanId(externalId);
- return
this.capitalizedIncomeBalanceReadService.fetchLoanDeferredIncomeData(resolvedLoanId);
+ return
this.capitalizedIncomeBalanceReadService.fetchLoanCapitalizedIncomeData(resolvedLoanId);
+ }
+
+ @Path("/{loanId}/capitalized-income")
+ @GET
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Operation(summary = "Fetch the Capitalized Income related informations")
+ public LoanCapitalizedIncomeData fetchCapitalizedIncomeDetails(
Review Comment:
I think we can respond directly with `List<CapitalizedIncomeDetails>`
instead of using the `LoanCapitalizedIncomeData` wrapper, what do you think?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]