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

namespace CafeTerrace.Models.DataBase
{
    public class OrderFood
    {
        public string FoodId { get; set; }
        public string OrderId { get; set; }
        public int CountFood { get; set; }
        public bool ServiceNow { get; set; }
        public string FoodType { get; set; }

        public Int64 CountAmount
        {
            get
            {
                if(Food!=null) return CountFood * Food.Price.FinalAmount;
                else
                {
                    return 0;
                }
            }
        }

        public string NameWType
        {
            get
            {
                if (string.IsNullOrEmpty(FoodType))
                    return Food.Name;
                else
                    return Food.Name + $"({FoodType})";
            }
        }
        public virtual Food Food { get; set; }
        public virtual Order Order { get; set; }
    }
}
