using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace FMSAdmin.Entities
{
    public partial class FmsBudgetDetail
    {
        public FmsBudgetDetail()
        {
            FmsBudgetDetailExecution = new HashSet<FmsBudgetDetailExecution>();
        }

        [Key]
        public int SiteId { get; set; }
        [Key]
        public int Year { get; set; }
        [Key]
        public int BudgetClassId { get; set; }
        [Required]
        [StringLength(6)]
        public string BudgetSeq { get; set; }
        [Key]
        public int ParentBudgetClassId { get; set; }
        public int? RootBudgetClassId { get; set; }
        public int Depth { get; set; }
        [Required]
        [StringLength(32)]
        public string Name { get; set; }
        [StringLength(16)]
        public string Abbreviation { get; set; }
        public bool? IsUse { get; set; }
        public double YearlyBudget { get; set; }
        public double MonthlyBudget { get; set; }

        [ForeignKey("SiteId,Year")]
        [InverseProperty("FmsBudgetDetail")]
        public virtual FmsBudget FmsBudget { get; set; }
        [ForeignKey("SiteId,BudgetClassId")]
        [InverseProperty("FmsBudgetDetail")]
        public virtual FmsBudgetCodeClass FmsBudgetCodeClass { get; set; }
        [InverseProperty("FmsBudgetDetail")]
        public virtual ICollection<FmsBudgetDetailExecution> FmsBudgetDetailExecution { get; set; }
    }
}
