public async Task <Models.Order> FindByNumber(int orderNumber) { Models.Order order = await findOrderByNumberAdapter.FindByNumberAsync(orderNumber); var orderExists = order != null; if (!orderExists) { throw new OrderNotFoundException($"Order {orderNumber} not found"); } return(order); }
public async Task <bool> CancelOrderAsync(int orderNumber) { Models.Order order = await findOrderByNumberAdapter.FindByNumberAsync(orderNumber); return(await cancelOrderAdapter.CancelOrderAsync(order)); }
public async Task <bool> ApproveOrderAsync(int orderNumber) { Models.Order order = await findOrderByNumberAdapter.FindByNumberAsync(orderNumber); return(await approveOrderAdapter.ApproveOrderAsync(order)); }
public async Task <bool> DeliveryOrderAsync(int orderNumber) { Models.Order order = await findOrderByNumberAdapter.FindByNumberAsync(orderNumber); return(await deliveryOrderAdapter.DeliveryOrderAsync(order)); }