Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        public async Task <bool> CancelOrderAsync(int orderNumber)
        {
            Models.Order order = await findOrderByNumberAdapter.FindByNumberAsync(orderNumber);

            return(await cancelOrderAdapter.CancelOrderAsync(order));
        }
Ejemplo n.º 3
0
        public async Task <bool> ApproveOrderAsync(int orderNumber)
        {
            Models.Order order = await findOrderByNumberAdapter.FindByNumberAsync(orderNumber);

            return(await approveOrderAdapter.ApproveOrderAsync(order));
        }
Ejemplo n.º 4
0
        public async Task <bool> DeliveryOrderAsync(int orderNumber)
        {
            Models.Order order = await findOrderByNumberAdapter.FindByNumberAsync(orderNumber);

            return(await deliveryOrderAdapter.DeliveryOrderAsync(order));
        }