

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

namespace IRaCIS.Core.Domain.Models
{
	///<summary>
	///阅片期设置  只会设计到所有人 或者某个Site  针对全局
	///</summary>
	[Table("ReadingPeriodSet")]
	public class ReadingPeriodSet : Entity, IAuditAdd, IAuditUpdate, ISoftDelete
	{

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

		public Guid TrialReadingCriterionId { get; set; }

		/// <summary>
		/// 阅片期名称
		/// </summary>
		public string ReadingPeriodName { get; set; }

		/// <summary>
		/// 阅片范围
		/// </summary>
		public ReadingScopeEnum ReadingScope { get; set; }

		/// <summary>
		/// 截止日期
		/// </summary>
		public DateTime? ExpirationDate { get; set; }

		/// <summary>
		/// 截止访视
		/// </summary>
		public decimal? ExpirationVisitNum { get; set; }

		/// <summary>
		/// 访视计划ID
		/// </summary>
		public Guid? VisitStageId { get; set; }

		[JsonIgnore]
		/// <summary>
		/// 访视模板
		/// </summary>
		[ForeignKey("VisitStageId")]
		public VisitStage VisitStage { get; set; }
    
	    /// <summary>
	    /// 是否生效
	    /// </summary>
	    public ReadingPeriodStatus IsTakeEffect { get; set; }

		/// <summary>
		/// 生效时间
		/// </summary>
		public DateTime? EffectOfTime { get; set; }

		/// <summary>
		/// 创建时间
		/// </summary>
		public DateTime CreateTime { get; set; }

		/// <summary>
		/// 创建人
		/// </summary>
		public Guid CreateUserId { get; set; }

		/// <summary>
		/// 是否为全局阅片
		/// </summary>
		public bool IsGlobal { get; set; }

		/// <summary>
		/// 阅片配置的类型
		/// </summary>
		public ReadingSetType ReadingSetType { get; set; }

		public Guid UpdateUserId { get; set; }
		
		public DateTime UpdateTime { get; set; }




		public bool IsDeleted { get; set; }

		public DateTime? DeletedTime { get; set; }

		public Guid? DeleteUserId { get; set; }

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


		/// <summary>
		/// 阅片期计划
		/// </summary>
		[JsonIgnore] 
		public List<ReadingPeriodPlan> ReadingPeriodPlanList { get; set; } = new List<ReadingPeriodPlan>();
	}

}
