Created new endpoint to upload company documents in application
This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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)));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user