Aman-Mittal commented on code in PR #6072:
URL: https://github.com/apache/fineract/pull/6072#discussion_r3519258718
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/api/WorkingCapitalLoanDelinquencyActionApiResource.java:
##########
@@ -98,6 +101,79 @@ public CommandProcessingResult createDelinquencyAction(
return createDelinquencyAction(resolveExternalId(loanExternalId),
apiRequestBodyAsJson);
}
+ @POST
+ @Path("{loanId}/delinquency-actions/disable")
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Operation(summary = "Disable Delinquency", description = "Disables
delinquency evaluation for a Working Capital loan as of the current business
date. "
Review Comment:
Can use java textblock here instead of concatination
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/api/WorkingCapitalLoanDelinquencyActionApiResource.java:
##########
@@ -98,6 +101,79 @@ public CommandProcessingResult createDelinquencyAction(
return createDelinquencyAction(resolveExternalId(loanExternalId),
apiRequestBodyAsJson);
}
+ @POST
+ @Path("{loanId}/delinquency-actions/disable")
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Operation(summary = "Disable Delinquency", description = "Disables
delinquency evaluation for a Working Capital loan as of the current business
date. "
+ + "Any active delinquency classification is lifted as of the
disable date. "
+ + "Requires the DISABLE_WC_DELINQUENCY_ACTION permission (or
ALL_FUNCTIONS).")
+ @ApiResponses({
+ @ApiResponse(responseCode = "200", description = "OK", content =
@Content(schema = @Schema(implementation =
WorkingCapitalLoanDelinquencyActionApiResourceSwagger.PostWorkingCapitalLoansDelinquencyActionResponse.class))),
+ @ApiResponse(responseCode = "400", description = "Bad Request"),
+ @ApiResponse(responseCode = "404", description = "Working Capital
Loan not found") })
+ public CommandProcessingResult disableDelinquency(@PathParam("loanId")
@Parameter(description = "loanId") final Long loanId,
+ @Parameter(hidden = true) final String apiRequestBodyAsJson) {
+
this.context.authenticatedUser().validateHasPermissionTo(PERMISSION_DISABLE_DELINQUENCY);
+ final CommandWrapper commandRequest = new CommandWrapperBuilder() //
+ .disableWorkingCapitalLoanDelinquency(loanId) //
+ .withJson(StringUtils.defaultIfBlank(apiRequestBodyAsJson,
"{}")) //
+ .build();
+ return
this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
+ }
+
+ @POST
+ @Path("external-id/{loanExternalId}/delinquency-actions/disable")
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Operation(operationId = "disableDelinquencyByExternalId", summary =
"Disable Delinquency by external id", description = "Disables delinquency
evaluation for a Working Capital loan identified by external id as of the
current business date.")
+ @ApiResponses({
+ @ApiResponse(responseCode = "200", description = "OK", content =
@Content(schema = @Schema(implementation =
WorkingCapitalLoanDelinquencyActionApiResourceSwagger.PostWorkingCapitalLoansDelinquencyActionResponse.class))),
+ @ApiResponse(responseCode = "400", description = "Bad Request"),
+ @ApiResponse(responseCode = "404", description = "Working Capital
Loan not found") })
Review Comment:
"Bad Request"
"Working Capital Loan not found"
Magic strings
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/api/WorkingCapitalLoanDelinquencyActionApiResource.java:
##########
@@ -98,6 +101,79 @@ public CommandProcessingResult createDelinquencyAction(
return createDelinquencyAction(resolveExternalId(loanExternalId),
apiRequestBodyAsJson);
}
+ @POST
+ @Path("{loanId}/delinquency-actions/disable")
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Operation(summary = "Disable Delinquency", description = "Disables
delinquency evaluation for a Working Capital loan as of the current business
date. "
+ + "Any active delinquency classification is lifted as of the
disable date. "
+ + "Requires the DISABLE_WC_DELINQUENCY_ACTION permission (or
ALL_FUNCTIONS).")
+ @ApiResponses({
Review Comment:
Use ApiResponse directly, No need of @ ApiResponses
--
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]