Esempio n. 1
0
 public static CreatedOrder From(LastOrderDetails order)
 {
     return(new CreatedOrder
     {
         Id = order.Id.Value,
         Created = order.Created.ToString("o"),
         StatusCode = order.Status.Code,
         StatusName = order.Status.Name,
         TotalPrice = order.TotalPrice.Amount,
         OrderNumber = order.OrderNumber.Value
     });
 }
Esempio n. 2
0
 public static LastOrder From(LastOrderDetails order)
 {
     return(new LastOrder
     {
         Id = order.Id.Value,
         Created = order.Created.ToString("o"),
         StatusCode = order.Status.Code,
         StatusName = order.Status.Name,
         TotalPrice = order.TotalPrice.Amount,
         OrderNumber = order.OrderNumber.Value,
         Comment = order.Comment.Value,
         Drinks = order.Drinks.Select(LastDrinkItem.From)
     });
 }
        public async Task <LastOrderDetails?> LastUserOrder(User user, CancellationToken token = default)
        {
            var order = await LastDomainOrderOfUser(user);

            if (order == null)
            {
                return(null);
            }

            return(LastOrderDetails.Available(
                       order.Id,
                       order.Created,
                       order.OrderNumber,
                       order.TotalPrice,
                       order.Status,
                       order.Comment,
                       ToLastOrderDrinks(order.Draft.Items)
                       ));
        }