}
@PreAuthorize("hasRole('USER_REQUEST_DELETE')")
@RequestMapping(method = RequestMethod.GET, value = "/deleteRequest/{requestId}")
public UserRequestTO deleteRequest(@PathVariable("requestId") final Long requestId) throws NotFoundException {
UserRequest request = userRequestDAO.find(requestId);
if (request == null) {
throw new NotFoundException("User request " + requestId);
}
UserRequestTO requestToDelete = dataBinder.getUserRequestTO(request);
auditManager.audit(Category.userRequest, UserRequestSubCategory.delete, Result.success,
"Successfully deleted user request for user" + request.getUserId());
userRequestDAO.delete(requestId);
return requestToDelete;
}