Created new endpoint to upload company documents in application

This commit is contained in:
rajesh
2025-11-18 15:01:45 +05:30
parent 326ce77e8c
commit 57c767cea6
15 changed files with 124 additions and 7 deletions

View File

@@ -267,6 +267,19 @@ public interface ApplicationApi {
public ResponseEntity<byte[]> downloadRankingCsv(
HttpServletRequest request, @Parameter(description = "The call id", required = true) @PathVariable(value = "callId", required = true) Long callId);
@Operation(summary = "Api to upload company documents in application",
responses = {
@ApiResponse(responseCode = "200", description = "OK"),
@ApiResponse(responseCode = "404", description = "Not Found", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@ExampleObject(value = ErrorConstants.NOTFOUND_ERROR_EXAMPLE)})),
@ApiResponse(responseCode = "401", description = "Unauthorized", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@ExampleObject(value = ErrorConstants.UNAUTHORIZED_ERROR_EXAMPLE)})),
@ApiResponse(responseCode = "400", description = "Bad Request", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE, examples = {
@ExampleObject(value = ErrorConstants.BADREQUEST_ERROR_EXAMPLE)}))
})
@GetMapping(value = "/{applicationId}/companyDocuments")
public ResponseEntity<Response<Void>> uploadCompanyDocumentsToApplication(
HttpServletRequest request,@Parameter(description = "The application id", required = true) @PathVariable(value = "applicationId", required = true) Long applicationId, @Parameter(description = "The company document id", required = true) @RequestParam("companyDocumentIds") List<Long> companyDocumentIds);
}

View File

@@ -275,4 +275,15 @@ public class ApplicationApiController implements ApplicationApi {
.contentType(MediaType.APPLICATION_OCTET_STREAM)
.body(csvBytes);
}
@Override
public ResponseEntity<Response<Void>> uploadCompanyDocumentsToApplication(HttpServletRequest request, Long applicationId,List<Long> companyDocumentIds) {
loggingUtil.logUserAction(
UserActionRequest.builder().request(request).actionType(UserActionLogsEnum.UPDATE).actionContext(UserActionContextEnum.UPLOAD_COMPANY_DOCUMENT_TO_APPLICATION).build());
applicationService.uploadCompanyDocumentsToApplication(request, applicationId,companyDocumentIds);
return ResponseEntity.status(HttpStatus.OK).body(new Response<>(null, Status.SUCCESS, Translator.toLocale(GepafinConstant.UPLOAD_COMPANY_DOCUMENT_TO_APPLICATION_MSG)));
}
}