//--------------------------------------------------------------------
//     此代码由T4模板自动生成  byzhouhang 20210918
//	   生成时间 2022-10-20 11:52:31 
//     对此文件的更改可能会导致不正确的行为，并且如果重新生成代码，这些更改将会丢失。
//--------------------------------------------------------------------
using System;
using IRaCIS.Core.Domain.Share;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Newtonsoft.Json;

namespace IRaCIS.Core.Application.ViewModel
{
    /// <summary> TrialEmailNoticeConfigView  列表视图模型 </summary>
    public class TrialEmailNoticeConfigView : TrialEmailNoticeConfigAddOrEdit
    {

        public Guid UpdateUserId { get; set; }

        public DateTime UpdateTime { get; set; }

        public DateTime CreateTime { get; set; }

        public Guid CreateUserId { get; set; }


        public List<EmailUserInfoDto> TrialEmailNoticeUserList { get; set; }


        public new List<UserTypeEnum> ToUserTypeList => TrialEmailNoticeUserList.Where(t => t.EmailUserType == EmailUserType.To).Select(t => t.UserType).ToList();
        public new List<UserTypeEnum> CopyUserTypeList => TrialEmailNoticeUserList.Where(t => t.EmailUserType == EmailUserType.Copy).Select(t => t.UserType).ToList();


    }


    public  class EmailUserInfoDto
    {

        public Guid TrialEmailNoticeConfigId { get; set; }


        public EmailUserType EmailUserType { get; set; }



        public UserTypeEnum UserType { get; set; }
    }




    ///<summary>TrialEmailNoticeConfigQuery  列表查询参数模型</summary>
    public class TrialEmailNoticeConfigQuery
    {
        [NotDefault]
        public Guid TrialId { get; set; }

        public CommonDocumentBusinessScenario? BusinessScenarioEnum { get; set; }

        public CriterionType? CriterionTypeEnum { get; set; }

    }

    ///<summary> TrialEmailNoticeConfigAddOrEdit  列表查询参数模型</summary>
    public class TrialEmailNoticeConfigAddOrEdit
    {
        public Guid? Id { get; set; }

        public CommonDocumentBusinessScenario BusinessScenarioEnum { get; set; }

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

        public Guid TrialId { get; set; }

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

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

        public int SMTPServerPort { get; set; } 

        public CriterionType CriterionTypeEnum { get; set; }

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

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


        public List<UserTypeEnum> ToUserTypeList { get; set; }
        public List<UserTypeEnum> CopyUserTypeList { get; set; }



        public bool IsUrgent { get; set; }

        public bool IsAutoSend { get; set; }


        public bool IsReturnRequired { get; set; }

        public string FilePath { get; set; } = string.Empty;
        public string FileName { get; set; } = string.Empty;


    }


}


