using IRaCIS.Core.Domain.Share;

namespace IRaCIS.Core.Domain.Models;

[Comment("医生 - 基础信息表")]
[Table("Doctor")]
public class Doctor : BaseFullAuditEntity
{
    #region 导航属性

    [Comment("导航属性")]
    [JsonIgnore]
    public List<DoctorDictionary> DoctorDicRelationList { get; set; } = new List<DoctorDictionary>();
    [JsonIgnore]
    public List<TrialExperienceCriteria> TrialExperienceCriteriaList { get; set; }
    [JsonIgnore]
    public List<Enroll> EnrollList { get; set; }

    [JsonIgnore]
    public List<Vacation> VacationList { get; set; }

    [JsonIgnore]
    [ForeignKey("HospitalId")]
    public Hospital Hospital { get; set; }
    [JsonIgnore]
    [ForeignKey("SpecialityId")]
    public virtual Dictionary Speciality { get; set; }
    [JsonIgnore]
    [ForeignKey("DepartmentId")]
    public virtual Dictionary Department { get; set; }

    [JsonIgnore]
    [ForeignKey("RankId")]
    public virtual Dictionary Rank { get; set; }

    [JsonIgnore]
    [ForeignKey("PositionId")]
    public virtual Dictionary Position { get; set; }
    [JsonIgnore]
    public List<Attachment> AttachmentList { get; set; }
    [JsonIgnore]
    public List<DoctorCriterionFile> CriterionFileList { get; set; }

    [JsonIgnore]
    public UserRole UserRole { get; set; }
    #endregion

    public bool AcceptingNewTrial { get; set; }

    public bool ActivelyReading { get; set; }
    [MaxLength]
    public string? AdminComment { get; set; }

    public DateTime? AuditTime { get; set; }

    public Guid AuditUserId { get; set; }

    public string BlindName { get; set; } = string.Empty;

    public string BlindNameCN { get; set; } = string.Empty;
    [MaxLength]
    public string? BlindPublications { get; set; }


    public string ChineseName { get; set; } = string.Empty;

    public int Code { get; set; }

    public ContractorStatusEnum CooperateStatus { get; set; } = ContractorStatusEnum.Noncooperation;

    public Guid? DepartmentId { get; set; }


    public string DepartmentOther { get; set; } = string.Empty;


    public string DepartmentOtherCN { get; set; } = string.Empty;


    public string EMail { get; set; } = string.Empty;


    public string FirstName { get; set; } = string.Empty;

    public int GCP { get; set; }

    /// <summary>
    /// GCP证书的时间
    /// </summary>
    public DateTime? GCPTime { get; set; }

    /// <summary>
    /// GCP机构
    /// </summary>
    [MaxLength]
    public string GCPAgencies { get; set; }

    public Guid GCPId { get; set; }

    public Guid? HospitalId { get; set; }

    public string HospitalOther { get; set; } = string.Empty;

    public string HospitalOtherCN { get; set; } = string.Empty;

    [MaxLength]
    public string Introduction { get; set; } = string.Empty;

    public bool IsVirtual { get; set; }

    public DateTime? LastLoginTime { get; set; }


    public string LastName { get; set; } = string.Empty;

    public DoctorNation Nation { get; set; }

    public Guid OrganizationId { get; set; }
    [MaxLength]
    public string? OtherClinicalExperience { get; set; }
    [MaxLength]
    public string? OtherClinicalExperienceCN { get; set; }


    public string Password { get; set; } = string.Empty;


    public string Phone { get; set; } = string.Empty;

    public string PhotoPath { get; set; } = string.Empty;

    public string Physician { get; set; } = string.Empty;

    public string PhysicianCN { get; set; } = string.Empty;

    public Guid? PhysicianId { get; set; }

    public Guid? PositionId { get; set; }


    public string PositionOther { get; set; } = string.Empty;


    public string PositionOtherCN { get; set; } = string.Empty;

    public Guid? RankId { get; set; }


    public string RankOther { get; set; } = string.Empty;


    public string RankOtherCN { get; set; } = string.Empty;


    public string ReadingTypeOther { get; set; } = string.Empty;


    public string ReadingTypeOtherCN { get; set; } = string.Empty;

    [StringLength(1000)]
    public string ResumePath { get; set; } = string.Empty;

    public ResumeStatusEnum ResumeStatus { get; set; } = ResumeStatusEnum.Failed;


    public string ReviewerCode { get; set; } = string.Empty;

    public ReviewerInformationConfirmStatus ReviewStatus { get; set; } = ReviewerInformationConfirmStatus.ConfirmRefuse;

    public int Sex { get; set; }

    public Guid? SpecialityId { get; set; }

    [MaxLength]
    public string SpecialityOther { get; set; } = string.Empty;

    [MaxLength]
    public string SpecialityOtherCN { get; set; } = string.Empty;

    [MaxLength]
    public string SubspecialityOther { get; set; } = string.Empty;

    [MaxLength]
    public string SubspecialityOtherCN { get; set; } = string.Empty;


    public string WeChat { get; set; } = string.Empty;

    /// <summary>
    /// 工作兼职
    /// </summary>
    [MaxLength]
    public string WorkPartTime { get; set; } = string.Empty;

    /// <summary>
    /// 工作兼职En
    /// </summary>
    [MaxLength]
    public string WorkPartTimeEn { get; set; } = string.Empty;

    /// <summary>
    /// 概述
    /// </summary>
    [MaxLength]
    public string Summarize { get; set; } = string.Empty;

    /// <summary>
    /// 概述
    /// </summary>
    [MaxLength]
    public string SummarizeEn { get; set; } = string.Empty;


    /// <summary>
    /// 银行卡号
    /// </summary>
    public string BankNum { get; set; } = string.Empty;

    /// <summary>
    /// 银行名称
    /// </summary>
    [MaxLength]
    public string BankName { get; set; } = string.Empty;

    /// <summary>
    /// 开户行
    /// </summary>
    public string OpeningBank { get; set; } = string.Empty;

    /// <summary>
    /// 身份证号
    /// </summary>
    public string IdCard { get; set; } = string.Empty;

    /// <summary>
    /// 银行手机号
    /// </summary>
    public string BankPhoneNum { get; set; } = string.Empty;


    [NotMapped]
    public string FullName => LastName + " / " + FirstName;

    /// <summary>
    /// 医生Id
    /// </summary>
    public Guid? DoctorId { get; set; }

    /// <summary>
    /// 项目Id
    /// </summary>
    public Guid? TrialId { get; set; }

    /// <summary>
    /// 大学
    /// </summary>
    public string UniversityAffiliated { get; set; } = string.Empty;

    /// <summary>
    /// 大学
    /// </summary>
    public string UniversityAffiliatedCN { get; set; } = string.Empty;

    /// <summary>
    /// 城市
    /// </summary>
    public string City { get; set; } = string.Empty;

    /// <summary>
    /// 城市
    /// </summary>
    public string CityCN { get; set; } = string.Empty;

    /// <summary>
    /// 医院
    /// </summary>
    public string HospitalName { get; set; } = string.Empty;

    /// <summary>
    /// 医院
    /// </summary>
    public string HospitalNameCN { get; set; } = string.Empty;
}

public enum DoctorNation
{
    CN = 0,
    US = 1,
    Europe = 2,
    Other = 3

}