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

namespace FMSAdmin.Entities {
    public partial class CmDepartment {
        public CmDepartment() {
            CmUser = new HashSet<CmUser>();
            FmsAccident = new HashSet<FmsAccident>();
        }

        [Display(Name = "현장 고유번호"), Key]
        public int SiteId { get; set; }
        [Display(Name = "회사 고유번호"), Key]
        public int CompanyId { get; set; }
        [Display(Name = "부서 고유번호"), Key]
        public int DepartmentId { get; set; }
        [Display(Name = "부서명"), Required]
        [StringLength(50)]
        public string Name { get; set; }
        [Display(Name = "간략화된 부서명")]
        [StringLength(50)]
        public string ShortName { get; set; }
        [Display(Name = "팩스번호")]
        [StringLength(50)]
        public string FaxNo { get; set; }
        [Display(Name = "전화번호")]
        [StringLength(50)]
        public string PhoneNo { get; set; }
        [Display(Name = "설명")]
        [StringLength(1024)]
        public string Comment { get; set; }
        [Display(Name = "사용 유무")]
        public bool? IsUse { get; set; }

        [ForeignKey(nameof(SiteId))]
        [InverseProperty(nameof(CmSite.CmDepartment))]
        public virtual CmSite Site { get; set; }

        [ForeignKey("SiteId,CompanyId")]
        [InverseProperty("CmDepartment")]
        public virtual CmCompany CmCompany { get; set; }
        [InverseProperty("CmDepartment")]
        public virtual ICollection<CmUser> CmUser { get; set; }
        [InverseProperty("CmDepartment")]
        public virtual ICollection<FmsAccident> FmsAccident { get; set; }
    }
}
