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

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

        [Display(Name = "현장 고유번호"), Key]
        public int SiteId { get; set; }
        [Display(Name = "알람 대상 설비의 TypeId"), Key]
        public int FacilityTypeId { get; set; }
        [Display(Name = "알람 대상 설비의 Code"), Key]
        public int FacilityCode { get; set; }
        [Display(Name = "알람 대상 설비의 PropertyId"), Key]
        public int PropertyId { get; set; }
        [Display(Name = "관제점 분석 요소 ID"), Key]
        public int FormulaId { get; set; }
        [Display(Name = "설비 이름"), Required]
        [StringLength(80)]
        public string FacilityName { get; set; }
        [Display(Name = "관제점 이름"), Required]
        [StringLength(64)]
        public string PointName { get; set; }
        [Display(Name = "알람 상한값 사용 여부"), Required]
        public bool? UseUpperLimit { get; set; }
        [Display(Name = "알람 상한값")]
        public double? UpperLimit { get; set; }
        [Display(Name = "알람 하한값 사용 여부"), Required]
        public bool? UseLowerLimit { get; set; }
        [Display(Name = "알람 하한값")]
        public double? LowerLimit { get; set; }
        [Display(Name = "알람 설정 여부"), Required]
        public bool? UseAlarm { get; set; }
        [Display(Name = "SMS 전송 기능 사용 여부"), Required]
        public bool? UseSMS { get; set; }
        [Display(Name = "Email 기능 사용 여부"), Required]
        public bool? UseEmail { get; set; }
        [Display(Name = "알람 그룹 이름"), Required]
        [StringLength(50)]
        public string AlarmGroupName { get; set; }
        [Display(Name = "알람 조치 방법")]
        [StringLength(1000)]
        public string Content { get; set; }

        [ForeignKey("SiteId,FacilityCode")]
        public virtual CmFacility CmFacility { get; set; }
        [ForeignKey(nameof(FacilityTypeId))]
        [InverseProperty(nameof(BemsFacilityType.BemsAlarmSetting))]
        public virtual BemsFacilityType FacilityType { get; set; }
        [ForeignKey(nameof(SiteId))]
        [InverseProperty(nameof(CmSite.BemsAlarmSetting))]
        public virtual CmSite Site { get; set; }
        [InverseProperty("BemsAlarmSetting")]
        public virtual ICollection<BemsAlarmLog> BemsAlarmLog { get; set; }
    }
}
