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

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

        public int SiteId { get; set; }
        public int WorkRequestId { get; set; }
        public int? FacilityCode { get; set; }
        [Key]
        public int CheckItemId { get; set; }
        public bool? BoolResult { get; set; }
        [StringLength(1024)]
        public string TextResult { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime CheckDate { get; set; }
        public int? FileId1 { get; set; }
        public int? FileId2 { get; set; }

        [NotMapped]
        public bool IsComplete { get; set; }
        [NotMapped]
        public bool IsHold { get; set; }

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

        [ForeignKey("SiteId,FacilityCode")]
        [InverseProperty("FmsWorkResultCheckItem")]
        public virtual CmFacility CmFacility { get; set; }
        [ForeignKey("SiteId,FacilityCode,CheckItemId")]
        [InverseProperty("FmsWorkResultCheckItem")]
        public virtual FmsFacilityCheckItem FmsFacilityCheckItem { get; set; }
        [ForeignKey("SiteId,WorkRequestId")]
        [InverseProperty("FmsWorkResultCheckItem")]
        public virtual FmsWorkResult FmsWorkResult { get; set; }
        [InverseProperty("CheckItem")]
        public virtual ICollection<FmsWorkResultCheckItemMaterial> FmsWorkResultCheckItemMaterial { get; set; }
    }
}
