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

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

        [Key]
        public int SiteId { get; set; }
        [Key]
        public int ScheduleId { get; set; }
        public int PlanId { get; set; }
        [Required]
        [StringLength(48)]
        public string Name { get; set; }
        [StringLength(128)]
        public string ScheduleDesc { get; set; }
        [Column("inDate", TypeName = "datetime")]
        public DateTime? InDate { get; set; }
        [Column("patrolDateTime", TypeName = "datetime")]
        public DateTime PatrolDateTime { get; set; }

        [ForeignKey("SiteId,PlanId")]
        [InverseProperty("CmPatrolSchedule")]
        public virtual CmPatrolPlan CmPatrolPlan { get; set; }
        [ForeignKey(nameof(SiteId))]
        [InverseProperty(nameof(CmSite.CmPatrolSchedule))]
        public virtual CmSite Site { get; set; }
        [InverseProperty("S")]
        public virtual ICollection<CmPatrolHistory> CmPatrolHistory { get; set; }
    }
}
