//--------------------------------------------------------------------
//     此代码由T4模板自动生成  byzhouhang 20210918
//	   生成时间 2022-01-05 09:17:10 
//     对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
//--------------------------------------------------------------------
using Newtonsoft.Json;
using System.ComponentModel.DataAnnotations;
namespace IRaCIS.Core.Application.Contracts
{
    ///  SystemDocumentView  列表视图模型 
    public class SystemDocumentView : SystemDocumentAddOrEdit
    {
        public string FullFilePath { get; set; } = string.Empty;
        public DateTime CreateTime { get; set; }
        public DateTime UpdateTime { get; set; }
        public string FileType { get; set; } = string.Empty;
        public List NeedConfirmedUserTypeList { get; set; } = new List();
    }
    public class UnionDocumentView : SystemDocumentAddOrEdit
    {
        public string FullFilePath { get; set; } = string.Empty;
        public DateTime CreateTime { get; set; }
        public DateTime UpdateTime { get; set; }
        public bool IsSystemDoc { get; set; }
        public string FileType { get; set; } = string.Empty;
    }
    public class TrialSignDocView : UnionDocumentWithConfirmInfoView
    {
        public string TrialCode { get; set; }
        public string ResearchProgramNo { get; set; }
        public string ExperimentName { get; set; }
    }
    public class UnionDocumentWithConfirmInfoView : UnionDocumentView
    {
        public DateTime? ConfirmTime { get; set; }
        public Guid? ConfirmUserId { get; set; }
        public bool IsConfirmed => ConfirmTime != null;
        public string UserName { get; set; } = string.Empty;
        public string RealName { get; set; } = string.Empty;
        public string DocTypeCode { get; set; }
        public List UserConfirmedUserTypeList => (DocNeedSignUserTypeList != null && IdentityUserTypeList != null) ? IdentityUserTypeList.Intersect(DocNeedSignUserTypeList).ToList() : new List();
        public IEnumerable IdentityUserTypeList { get; set; }
        public IEnumerable DocNeedSignUserTypeList { get; set; }
    }
    public class TrialUserDto
    {
        public Guid UserId { get; set; }
        public string UserName { get; set; } = string.Empty;
        public string RealName { get; set; } = string.Empty;
    }
    public class DocumentUnionWithUserStatView : UnionDocumentView
    {
        public int? DocumentUserCount { get; set; }
        public int? DocumentConfirmedUserCount { get; set; }
    }
    public class TrialUserUnionDocumentView
    {
        public Guid UserId { get; set; }
        public string UserTypeShortName { get; set; } = string.Empty;
        public string UserName { get; set; } = string.Empty;
        public string RealName { get; set; } = string.Empty;
        public int? SystemDocumentCount { get; set; }
        public int? TrialDocumentCount { get; set; }
        public int? TrialDocumentConfirmedCount { get; set; }
        public int? SystemDocumentConfirmedCount { get; set; }
        //public List DocumentList { get; set; }
    }
    ///SystemDocumentQuery  列表查询参数模型
    public class SystemDocumentQuery : PageInput
    {
        public bool? IsDeleted { get; set; }
        public Guid? SystemDocumentId { get; set; }
        public Guid? FileTypeId { get; set; }
        public string Name { get; set; } = string.Empty;
        public bool IsSigned { get; set; }
    }
    public class GetNextUnSignDocumentInDto
    {
        public Guid? TrialId { get; set; }
        public bool Asc { get; set; } = true;
        public string SortField { get; set; } = "";
    }
    public class TrialDocQuery : PageInput
    {
        public Guid? TrialId { get; set; }
        public Guid? FileTypeId { get; set; }
        public string TrialCode { get; set; } = string.Empty;
        public string Name { get; set; } = string.Empty;
        public bool IsSigned { get; set; }
    }
    public class TrialUserDocUnionQuery : PageInput
    {
        [NotDefault]
        public Guid TrialId { get; set; }
        public Guid? FileTypeId { get; set; }
        public string Name { get; set; } = string.Empty;
        public bool? IsSign { get; set; }
    }
    public class UserConfirmCommand
    {
        [NotDefault]
        public Guid DocumentId { get; set; }
        public bool isSystemDoc { get; set; }
        public string SignText { get; set; } = string.Empty;
    }
    public class DocumentTrialUnionQuery : TrialUserDocUnionQuery
    {
        public Guid? UserTypeId { get; set; }
        public Guid? UserId { get; set; }
        public bool? IsConfirmed { get; set; }
        public bool? IsDeleted { get; set; }
    }
    /// SystemDocumentAddOrEdit  列表查询参数模型
    public class SystemDocumentAddOrEdit
    {
        public Guid? Id { get; set; }
        public Guid FileTypeId { get; set; }
        public string Name { get; set; } = string.Empty;
        public string Path { get; set; } = string.Empty;
        public bool IsDeleted { get; set; }
        public int SignViewMinimumMinutes { get; set; }
        public DocUserSignType DocUserSignType { get; set; }
    }
    public class AddOrEditSystemDocument : SystemDocumentAddOrEdit
    {
        public List NeedConfirmedUserTypeIdList { get; set; } = new List();
    }
}