using IRaCIS.Core.Domain.Share;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;

namespace IRaCIS.Core.Domain.Models
{
    public class QCChallenge : Entity, IAuditAdd
    {
        [JsonIgnore]
        [ForeignKey("CreateUserId")]
      
        public User CreateUser { get; set; }



        public Guid TrialId { get; set; }
        public Guid SubjectVisitId { get; set; }

        public DateTime? DeadlineTime { get; set; }

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

        public QCChanllengeReuploadEnum ReuploadEnum { get; set; }


        public DateTime CreateTime { get; set; } = DateTime.Now;
        public Guid CreateUserId { get; set; } = Guid.Empty;

        public DateTime? ReUploadedTime { get; set; }

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

        public Guid? ReUploadUserId { get; set; }

        public TrialQCProcess QCProcessEnum { get; set; }

        public CurrentQC CurrentQCEnum { get; set; }

        public DateTime? LatestMsgTime { get; set; }

        //public int ChallengeState { get; set; }

        public Guid? LatestReplyUserId { get; set; }

        [JsonIgnore]
        [ForeignKey("LatestReplyUserId")]
        public User LatestReplyUser { get; set; }
        public string ChallengeCode { get; set; }

        public int Code { get; set; }

       
        
        public bool IsClosed { get; set; }

        public DateTime? ClosedTime { get; set; }

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



        public QCChallengeCloseEnum CloseResonEnum { get; set;}

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

        public string ActionContent { get; set; } = string.Empty;
        
        public UserTypeEnum UserTypeEnum { get; set; }


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


        [JsonIgnore]
        //导航属性
        [ForeignKey("SubjectVisitId")]
        public SubjectVisit SubjectVisit { get; set; }

        [JsonIgnore]
        public List<QCChallengeDialog> DialogList { get; set; } = new List<QCChallengeDialog>();



        //public Guid QATrialTemplateId { get; set; }
        //public QATrialTemplate TrialTemplate { get; set; }

        //public virtual ICollection<QARecordTrialTemplateItem> QaTrialTemplateItemList { get; set; }

        //public virtual ICollection<QARecordTemplateItemDetail> QARecordTemplateItemDetailList { get; set; }

        //public QAQuestion()
        //{
        //    //存放医生关联  Title、等各种多选项
        //    QaTrialTemplateItemList = new HashSet<QARecordTrialTemplateItem>();

        //    QARecordTemplateItemDetailList= new HashSet<QARecordTemplateItemDetail>();
        //}



    }
}