using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;

namespace FMSAdmin.Entities {
    public enum EmploymentType {
        정규직 = 1,
        비정규직
    }
    public enum EmploymentStatus {
        재직 = 1,
        휴직,
        퇴직,
    }

    public partial class CmUser {
        public CmUser() {
            CmAnnouncement = new HashSet<CmAnnouncement>();
            CmGuideline = new HashSet<CmGuideline>();
            CmPatrolGroupUser = new HashSet<CmPatrolGroupUser>();
            CmUserLoginHistory = new HashSet<CmUserLoginHistory>();
            CmUserToLicense = new HashSet<CmUserToLicense>();
            FmsConstructionEstimation = new HashSet<FmsConstructionEstimation>();
            FmsDailyCheckReport = new HashSet<FmsDailyCheckReport>();
            FmsDailyReport = new HashSet<FmsDailyReport>();
            FmsDrawingHistory = new HashSet<FmsDrawingHistory>();
            FmsEquipment = new HashSet<FmsEquipment>();
            FmsEquipmentRegisterUser = new HashSet<FmsEquipmentRentInfo>();
            FmsEquipmentRentUser = new HashSet<FmsEquipmentRentInfo>();
            FmsFacilityOperationReport = new HashSet<FmsFacilityOperationReport>();
            FmsManualHistory = new HashSet<FmsManualHistory>();
            FmsMaterialPurchaseOrder = new HashSet<FmsMaterialPurchaseOrder>();
            FmsMaterialPurchaseRequestCmUser = new HashSet<FmsMaterialPurchaseRequest>();
            FmsMaterialPurchaseRequestCmUserNavigation = new HashSet<FmsMaterialPurchaseRequest>();
            FmsMaterialReleaseCmUser = new HashSet<FmsMaterialRelease>();
            FmsMaterialReleaseCmUserNavigation = new HashSet<FmsMaterialRelease>();
            FmsMaterialStoredCmUser = new HashSet<FmsMaterialStored>();
            FmsMaterialStoredS = new HashSet<FmsMaterialStored>();
            FmsMonthlyReport = new HashSet<FmsMonthlyReport>();
            FmsReportCmUser = new HashSet<FmsReport>();
            FmsReportCmUser1 = new HashSet<FmsReport>();
            FmsReportCmUserNavigation = new HashSet<FmsReport>();
            FmsWorkOrder = new HashSet<FmsWorkOrder>();
            FmsWorkRequestCmUser = new HashSet<FmsWorkRequest>();
            FmsWorkRequestCmUserNavigation = new HashSet<FmsWorkRequest>();
            FmsWorkResultCmUser = new HashSet<FmsWorkResult>();
            FmsWorkResultCmUserNavigation = new HashSet<FmsWorkResult>();
            FmsWorkSchedule = new HashSet<FmsWorkSchedule>();
            FmsEquipmentHistory = new HashSet<FmsEquipmentHistory>();
            MobileShortcuts = new List<MobileShortcut>();
            CmRentalStatus = new HashSet<CmRentalStatus>();
            CmSurvey = new HashSet<CmSurvey>();
            BemsReportFormatCmUser = new HashSet<BemsReportHistory>();
            BemsReportFormatCmUserNavigation = new HashSet<BemsReportHistory>();
        }

        [Display(Name = "현장 고유번호")]
        public int SiteId { get; set; }
        [Display(Name = "사용자 고유번호"), Key]
        [StringLength(24)]
        public string UserId { get; set; }
        [Display(Name = "사용자 회사 고유번호")]
        public int? CompanyId { get; set; }
        [Display(Name = "사용자 부서 고유번호")]
        public int? DepartmentId { get; set; }
        [Display(Name = "사용자 직급 고유번호")]
        public int? PositionId { get; set; }
        [Display(Name = "업무분야 고유번호")]
        public int? BusinessFieldId { get; set; }
        [Display(Name = "사용자 그룹 고유번호")]
        public int? UserGroupId { get; set; }
        [Display(Name = "사용자 이름"), Required]
        [StringLength(30)]
        public string Name { get; set; }
        [Display(Name = "사용자 비밀번호"), Required]
        [StringLength(30)]
        public string Passwd { get; set; }
        [Display(Name = "사용자 생일")]
        [Column(TypeName = "datetime")]
        public DateTime? Birthday { get; set; }
        [Display(Name = "사용자 음력생일")]
        public bool? Lunar { get; set; }
        [Display(Name = "사용자 상태 고유번호")]
        public int? StateId { get; set; }
        [Display(Name = "고용형태")]
        public EmploymentType? EmploymentType { get; set; }
        [Display(Name = "재직상태")]
        public EmploymentStatus? EmploymentStatus { get; set; }
        [Display(Name = "사용자 사무실 전화번호")]
        [StringLength(50)]
        public string OfficePhoneNo { get; set; }
        [Display(Name = "사용자 집 전화번호")]
        [StringLength(50)]
        public string HomePhoneNo { get; set; }
        [Display(Name = "사용자 모바일 전화번호")]
        [StringLength(50)]
        public string MobilePhoneNo { get; set; }
        [Display(Name = "사용자 우편번호 1")]
        [StringLength(3)]
        public string HomeZip1 { get; set; }
        [Display(Name = "사용자 우편번호 2")]
        [StringLength(3)]
        public string HomeZip2 { get; set; }
        [Display(Name = "사용자 주소 1")]
        [StringLength(50)]
        public string HomeAddress1 { get; set; }
        [Display(Name = "사용자 주소 2")]
        [StringLength(100)]
        public string HomeAdderss2 { get; set; }
        [Display(Name = "사용자 이메일")]
        [StringLength(50)]
        public string Email { get; set; }
        [Display(Name = "사용자 입사일")]
        [Column(TypeName = "datetime")]
        public DateTime? EnterDate { get; set; }
        [Display(Name = "사용자 퇴사일")]
        [Column(TypeName = "datetime")]
        public DateTime? RetireDate { get; set; }
        [Display(Name = "사용자 상세정보")]
        [StringLength(1024)]
        public string Comment { get; set; }
        [Display(Name = "사원증 고유번호")]
        [StringLength(30)]
        public string Rfcsn { get; set; }
        [Display(Name = "사용자 비밀번호 변경날짜")]
        [Column(TypeName = "datetime")]
        public DateTime? PasswordUpdatedDate { get; set; }
        [Display(Name = "사용자 근무분야 고유번호")]
        public int? FileId { get; set; }
        [Display(Name = "BEMS 담당자 유무")]
        public bool? IsBems { get; set; }
        [Display(Name = "사용 유무")]
        public bool? IsUse { get; set; }
        [Display(Name = "스케쥴 가동 책임자 유무")]
        public bool? IsScheduleUser { get; set; }
        [Display(Name = "자격증")]
        [StringLength(512)]
        public string Certificated { get; set; }
        [Display(Name = "SI 접근 권한")]
        [Column("IsSI")]
        public bool? IsSi { get; set; }
        [Display(Name = "모바일 책임자 유무")]
        public bool? IsMobile { get; set; }
        [Display(Name = "사용안함")]
        [StringLength(500)]
        public string Devicetoken { get; set; }
        [Display(Name = "파일 고유번호")]
        public int? ImageFileId { get; set; }

        [Display(Name = "관리자 여부")]
        public bool IsAdmin { get; set; }

        [Display(Name = "아이콘트롤스 관리자 여부")]
        public bool IsSysop { get; set; }

        [Display(Name = "결제 싸인 이미지파일 ID")]
        public int? SignImageFileId { get; set; }

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

        [ForeignKey("BusinessFieldId")]
        [InverseProperty("CmUser")]
        public virtual CmBusinessField CmBusinessField { get; set; }
        [ForeignKey("SiteId,CompanyId")]
        [InverseProperty("CmUser")]
        public virtual CmCompany CmCompany { get; set; }
        [ForeignKey("SiteId,CompanyId,DepartmentId")]
        [InverseProperty("CmUser")]
        public virtual CmDepartment CmDepartment { get; set; }
        [ForeignKey("PositionId")]
        [InverseProperty("CmUser")]
        public virtual CmPosition CmPosition { get; set; }
        [ForeignKey("UserGroupId")]
        [InverseProperty("CmUser")]
        public virtual CmUserGroup CmUserGroup { get; set; }
        [ForeignKey("SiteId,ImageFileId")]
        public virtual CmFile CmFile { get; set; }
        [ForeignKey("SiteId,SignImageFileId")]
        public virtual CmFile CmFile1 { get; set; }
        [InverseProperty("CmUser")]
        public virtual ICollection<CmAnnouncement> CmAnnouncement { get; set; }
        [InverseProperty("CmUser")]
        public virtual ICollection<CmGuideline> CmGuideline { get; set; }
        [InverseProperty("CmUser")]
        public virtual ICollection<FmsEquipmentHistory> FmsEquipmentHistory { get; set; }
        [InverseProperty("CmUser")]
        public virtual ICollection<CmPatrolGroupUser> CmPatrolGroupUser { get; set; }
        [InverseProperty("CmUser")]
        public virtual ICollection<CmUserLoginHistory> CmUserLoginHistory { get; set; }
        [InverseProperty("CmUser")]
        public virtual ICollection<CmUserToLicense> CmUserToLicense { get; set; }
        [InverseProperty("CmUser")]
        public virtual ICollection<FmsConstructionEstimation> FmsConstructionEstimation { get; set; }
        [InverseProperty("CmUser")]
        public virtual ICollection<FmsDailyCheckReport> FmsDailyCheckReport { get; set; }
        [InverseProperty("CmUser")]
        public virtual ICollection<FmsDailyReport> FmsDailyReport { get; set; }
        [InverseProperty("CmUser")]
        public virtual ICollection<FmsDrawingHistory> FmsDrawingHistory { get; set; }
        [InverseProperty("CmUser")]
        public virtual ICollection<FmsEquipment> FmsEquipment { get; set; }
        [InverseProperty(nameof(FmsEquipmentRentInfo.RegisterUser))]
        public virtual ICollection<FmsEquipmentRentInfo> FmsEquipmentRegisterUser { get; set; }
        [InverseProperty(nameof(FmsEquipmentRentInfo.RentUser))]
        public virtual ICollection<FmsEquipmentRentInfo> FmsEquipmentRentUser { get; set; }
        [InverseProperty("CmUser")]
        public virtual ICollection<FmsFacilityOperationReport> FmsFacilityOperationReport { get; set; }
        [InverseProperty("CmUser")]
        public virtual ICollection<FmsManualHistory> FmsManualHistory { get; set; }
        [InverseProperty("CmUser")]
        public virtual ICollection<FmsMaterialPurchaseOrder> FmsMaterialPurchaseOrder { get; set; }
        [InverseProperty(nameof(FmsMaterialPurchaseRequest.CmUser))]
        public virtual ICollection<FmsMaterialPurchaseRequest> FmsMaterialPurchaseRequestCmUser { get; set; }
        [InverseProperty(nameof(FmsMaterialPurchaseRequest.CmUserNavigation))]
        public virtual ICollection<FmsMaterialPurchaseRequest> FmsMaterialPurchaseRequestCmUserNavigation { get; set; }
        [InverseProperty(nameof(FmsMaterialRelease.CmUser))]
        public virtual ICollection<FmsMaterialRelease> FmsMaterialReleaseCmUser { get; set; }
        [InverseProperty(nameof(FmsMaterialRelease.CmUserNavigation))]
        public virtual ICollection<FmsMaterialRelease> FmsMaterialReleaseCmUserNavigation { get; set; }
        [InverseProperty(nameof(FmsMaterialStored.CmUser))]
        public virtual ICollection<FmsMaterialStored> FmsMaterialStoredCmUser { get; set; }
        [InverseProperty(nameof(FmsMaterialStored.S))]
        public virtual ICollection<FmsMaterialStored> FmsMaterialStoredS { get; set; }
        [InverseProperty("CmUser")]
        public virtual ICollection<FmsMonthlyReport> FmsMonthlyReport { get; set; }
        [InverseProperty(nameof(FmsReport.CmUser))]
        public virtual ICollection<FmsReport> FmsReportCmUser { get; set; }
        [InverseProperty(nameof(FmsReport.CmUser1))]
        public virtual ICollection<FmsReport> FmsReportCmUser1 { get; set; }
        [InverseProperty(nameof(FmsReport.CmUserNavigation))]
        public virtual ICollection<FmsReport> FmsReportCmUserNavigation { get; set; }
        [InverseProperty("CmUser")]
        public virtual ICollection<FmsWorkOrder> FmsWorkOrder { get; set; }
        [InverseProperty(nameof(FmsWorkRequest.CmUser))]
        public virtual ICollection<FmsWorkRequest> FmsWorkRequestCmUser { get; set; }
        [InverseProperty(nameof(FmsWorkRequest.CmUserNavigation))]
        public virtual ICollection<FmsWorkRequest> FmsWorkRequestCmUserNavigation { get; set; }
        [InverseProperty(nameof(FmsWorkResult.CmUser))]
        public virtual ICollection<FmsWorkResult> FmsWorkResultCmUser { get; set; }
        [InverseProperty(nameof(FmsWorkResult.CmUserNavigation))]
        public virtual ICollection<FmsWorkResult> FmsWorkResultCmUserNavigation { get; set; }
        [InverseProperty("CmUser")]
        public virtual ICollection<FmsWorkSchedule> FmsWorkSchedule { get; set; }
        [InverseProperty(nameof(MobileShortcut.CmUser))]
        public virtual ICollection<MobileShortcut> MobileShortcuts { get; set; }
        [InverseProperty("CmUser")]
        public virtual ICollection<CmRentalStatus> CmRentalStatus { get; set; }
        [InverseProperty("CmUser")]
        public virtual ICollection<CmSurvey> CmSurvey { get; set; }
        [InverseProperty("ApproverUser1")]
        public virtual ICollection<BemsReportHistory> BemsReportFormatCmUser { get; set; }
        [InverseProperty("ApproverUser2")]
        public virtual ICollection<BemsReportHistory> BemsReportFormatCmUserNavigation { get; set; }
        [NotMapped]
        public string AccessToken { get; set; }
        [NotMapped]
        public string RefreshToken { get; set; }
    }
}
