using System.ComponentModel.DataAnnotations.Schema;

namespace Back.Data.Models
{
    public class Promotion
    {
        public int ID { get; set; }
        public string Name { get; set; }
        public bool Status { get; set; }

        public virtual IEnumerable<PromotionDetails>  PromotionDetails { get; set; }
    }
    public class PromotionDetails
    {
        public int ID { get; set; }
        public int PromotionID { get; set; }
        public int PermissionID { get; set; }
        public int CreditAmount { get; set; }
        public decimal APrice { get; set; }
        public decimal TPrice { get { return APrice * CreditAmount; } }

        [ForeignKey("PermissionID")]
        public virtual Permission  Permission { get; set; }
        [ForeignKey("PromotionID")]
        public virtual Promotion Promotion { get; set; }
    }

}
