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

namespace FMSAdmin.Entities
{
    public partial class CmPatrolHistory
    {
        public int SiteId { get; set; }
        [Key]
        public int PatrolHistoryId { get; set; }
        public int ScheduleId { get; set; }
        [Column("startDate", TypeName = "datetime")]
        public DateTime StartDate { get; set; }
        [Column("endDate", TypeName = "datetime")]
        public DateTime? EndDate { get; set; }
        [Column("resultTypeId")]
        public int ResultTypeId { get; set; }
        [Column("resultDesc")]
        [StringLength(1024)]
        public string ResultDesc { get; set; }
        [Column("resultPosCnt")]
        public int? ResultPosCnt { get; set; }
        [Column("resultNormalCnt")]
        public int? ResultNormalCnt { get; set; }
        [Column("resultAbnormalCnt")]
        public int? ResultAbnormalCnt { get; set; }

        [ForeignKey("SiteId,ResultTypeId")]
        [InverseProperty("CmPatrolHistory")]
        public virtual CmPatrolType CmPatrolType { get; set; }
        [ForeignKey("SiteId,ScheduleId")]
        [InverseProperty(nameof(CmPatrolSchedule.CmPatrolHistory))]
        public virtual CmPatrolSchedule S { get; set; }
        [ForeignKey(nameof(SiteId))]
        [InverseProperty(nameof(CmSite.CmPatrolHistory))]
        public virtual CmSite Site { get; set; }
    }
}
