private OrderService orderService;
@RequestMapping(method = RequestMethod.POST)
public ResponseEntity<Order> createOrder(@RequestBody Order order, UriComponentsBuilder builder) {
OrderCreatedEvent orderCreated = orderService.createOrder(new CreateOrderEvent(order.toOrderDetails()));
Order newOrder = Order.fromOrderDetails(orderCreated.getDetails());
HttpHeaders headers = new HttpHeaders();
headers.setLocation(
builder.path("/aggregators/orders/{id}")
.buildAndExpand(orderCreated.getNewOrderKey().toString()).toUri());
return new ResponseEntity<Order>(newOrder, headers, HttpStatus.CREATED);
}