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

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

        [Display(Name = "고유번호"), Key]
        public int SiteId { get; set; }
        public int ComplaintId { get; set; }
        [Display(Name = "민원명"), Required]
        [StringLength(256)]
        public string Name { get; set; }
        [Display(Name = "민원 발생일")]
        [Column(TypeName = "datetime")]
        public DateTime? StartDate { get; set; }
        [Display(Name = "조치 완료일")]
        [Column(TypeName = "datetime")]
        public DateTime? EndDate { get; set; }
        [Display(Name = "민원 유형 고유번호")]
        public int ComplaintTypeId { get; set; }
        [Display(Name = "부서 고유번호")]
        public int? DepartmentId { get; set; }
        [Display(Name = "최초목격자")]
        public string Firstwitness { get; set; }
        [Display(Name = "공사위치")]
        [StringLength(256)]
        public string ComplaintLocation { get; set; }
        [Display(Name = "민원원인")]
        [StringLength(1024)]
        public string Reason { get; set; }
        [Display(Name = "조치내용")]
        [StringLength(1024)]
        public string Action { get; set; }
        [Display(Name = "피해내용")]
        [StringLength(1024)]
        public string Damage { get; set; }
        [Display(Name = "향후대책")]
        [StringLength(1024)]
        public string Measurement { get; set; }
        [Display(Name = "첨부화일1 ID")]
        public int? FileId1 { get; set; }
        [Display(Name = "첨부화일2 ID")]
        public int? FileId2 { get; set; }
        [Display(Name = "첨부화일3 ID")]
        public int? FileId3 { get; set; }
        [Display(Name = "회사 고유번호")]
        public int? CompanyId { get; set; }

        [ForeignKey("SiteId")]
        public virtual CmSite CmSite { get; set; }

        [ForeignKey("SiteId,CompanyId")]
        public virtual CmCompany CmCompany { get; set; }

        [ForeignKey("SiteId,CompanyId,DepartmentId")]
        public virtual CmDepartment CmDepartment { get; set; }

        [ForeignKey("SiteId,FileId1")]
        public virtual CmFile CmFile1 { get; set; }
        [ForeignKey("SiteId,FileId2")]
        public virtual CmFile CmFile2 { get; set; }
        [ForeignKey("SiteId,FileId3")]
        public virtual CmFile CmFile3 { get; set; }

        [ForeignKey("ComplaintTypeId")]
        public virtual FmsComplaintCodeType FmsComplaintCodeType { get; set; }

        [InverseProperty("FmsComplaints")]
        public virtual ICollection<FmsWorkRequestToComplaint> FmsWorkRequestToComplaint { get; set; }

    }
}
