Package com.yummynoodlebar.core.events.orders

Examples of com.yummynoodlebar.core.events.orders.OrderStatusEvent


  private OrderService orderService;

  @RequestMapping(method = RequestMethod.GET)
  public ResponseEntity<OrderStatus> getOrderStatus(@PathVariable String id) {

    OrderStatusEvent orderStatusEvent = orderService.requestOrderStatus(new RequestOrderStatusEvent(UUID.fromString(id)));

    if (!orderStatusEvent.isEntityFound()) {
      return new ResponseEntity<OrderStatus>(HttpStatus.NOT_FOUND);
    }

    return new ResponseEntity<OrderStatus>(
            OrderStatus.fromOrderStatusDetails(
                    orderStatusEvent.getKey(),
                    orderStatusEvent.getOrderStatus()),
            HttpStatus.OK);
  }
View Full Code Here

TOP

Related Classes of com.yummynoodlebar.core.events.orders.OrderStatusEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.