Beneficiary must be able to Delete Company
This commit is contained in:
@@ -142,5 +142,15 @@ public interface CompanyApi {
|
||||
@DeleteMapping(value = "{companyId}/delegation", produces = { "application/json" })
|
||||
ResponseEntity<Response<Void>> deleteCompanyDelegation(HttpServletRequest request,
|
||||
@Parameter(description = "The company id", required = true) @PathVariable("companyId") Long companyId);
|
||||
@Operation(summary = "Api to remove a company from user ", 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) })) })
|
||||
@DeleteMapping(value = "user/{companyId}", produces = { "application/json" })
|
||||
ResponseEntity<Response<Void>> removeCompanyFromList(HttpServletRequest request,
|
||||
@Parameter(description = "The company id", required = true) @PathVariable("companyId") Long companyId);
|
||||
|
||||
}
|
||||
|
||||
@@ -128,4 +128,12 @@ public class CompanyApiController implements CompanyApi{
|
||||
return ResponseEntity.status(HttpStatus.OK)
|
||||
.body(new Response<>(null, Status.SUCCESS, Translator.toLocale(GepafinConstant.DELEGATION_DELETE_SUCCESS)));
|
||||
}
|
||||
@Override
|
||||
public ResponseEntity<Response<Void>> removeCompanyFromList(HttpServletRequest request, Long companyId) {
|
||||
log.info("Api to remove a company from user's list");
|
||||
companyService.removeCompanyFromList(request, companyId);
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK)
|
||||
.body(new Response<>(null, Status.SUCCESS, Translator.toLocale(GepafinConstant.COMPANY_DELETE_SUCCESS_MSG)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user