@Transactional
@PreAuthorize("hasAnyRole('PERMISSION_ALL_ORDER', 'ROLE_USER')")
@RequestMapping(value = "/{orderId}", method = RequestMethod.DELETE)
@ApiOperation(
value = "Delete an order",
notes = "Removes a specific order from customer's orders list",
response = Void.class)
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Successful removal of the specified order"),
@ApiResponse(code = 404, message = "The specified order does not exist")
})
public void deleteOrderForCustomer(
@ApiIgnore @AuthenticationPrincipal UserDetails userDetails,
@ApiParam(value = "ID of a specific order", required = true)
@PathVariable(value = "orderId") Long orderId) {
orderService.deleteOrder(orderServiceProxy.getProperCart(userDetails, orderId).orElse(null));
}