using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CafeTerrace.Models.DataBase
{
    public class Order
    {
        public string OrderId { get; set; }
        public DateTime Register { get; set; }
        public DateTime TimeReady { get; set; }
        public OrderStatus OrderStatus { get; set; }
        public OrderType OrderType { get; set; }
        public string DeskNumber { get; set; }
        public int UserId { get; set; }
        public string DiscountId { get; set; }
        public virtual Discount Discount { get; set; }
        public virtual User User { get; set; }
        public virtual Fish Fish { get; set; }
        public virtual ICollection<OrderFood> OrderFoods { get; set; }
        public virtual ICollection<OrderPayment> OrderPayments { get; set; }

        public long TotalPrice
        {
            get
            {
                long t = 0;
                if (OrderFoods != null)
                    foreach (var orderFood in OrderFoods)
                    {
                        t += orderFood.CountAmount;
                    }
                return 0;
            }
        }

    }

    public enum OrderStatus
    {
        Doing,
        Cancel,
        Done
    }

    public enum OrderType
    {
        Internal,
        Exterior
    }
}
