using Hotline.Share.Dtos.FlowEngine;
using Hotline.Share.Enums.Push;
using Hotline.Share.Requests;
using XF.Utility.EnumExtensions;

namespace Hotline.Share.Dtos.Push
{
    /// <summary>
    /// 
    /// </summary>
    public record MessagePagedDto : PagedKeywordRequest
    {
        /// <summary>
        /// 推送业务类型
        /// </summary>
        public EPushBusiness? PushBusiness { get; set; }

        /// <summary>
        /// 发送状态
        /// </summary>
        public ESendState? Status { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime? CreationStartTime { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime? CreationEndTime { get; set; }

        /// <summary>
        /// 电话号码
        /// </summary>
        public string? TelNumber { get; set; }

        /// <summary>
        /// 接收人
        /// </summary>
        public string? UserName { get; set; }

        /// <summary>
        /// 发送人
        /// </summary>
        public string? SendName { get; set; }

        /// <summary>
        /// 发送部门
        /// </summary>
        public string? SendOrg { get; set;}

        /// <summary>
        /// 发送内容
        /// </summary>
        public string? SendContent { get; set;}

        /// <summary>
        /// 是否有回复
        /// </summary>
        public bool? IsSmsReply { get; set;}
    }


    public class AddBatchSmsTaskDto
    {
        /// <summary>
        /// 任务名称
        /// </summary>
        public string TaskName { get; set; }

        /// <summary>
        /// 计划发送时间
        /// </summary>
        public DateTime PlanSendTime { get; set; }

        /// <summary>
        /// 短信内容
        /// </summary>
        public string Content { get; set; }

        /// <summary>
        /// 明细
        /// </summary>
        public List<AddBatchSmsTaskDetailDto> BatchSmsTaskDetail { get; set; }
    }

    public class AddBatchSmsTaskDetailDto
    {
        public string Name { get; set; }

        public string PhoneNum { get; set; }
    }

    public record BatchSmsTaskReq: PagedRequest
    {
        public string? TaskName { get; set; }

        public ESmsTaskState? State { get; set; }

        public DateTime? StateTime { get; set; }

        public DateTime? EndTime { get; set; }

    }

    public record BatchSmsTaskDetailListReq:PagedRequest
    {
        public string Id { get; set; }

        public string? Name { get; set; }

        public string? PhoneNum { get; set; }
    }

    public class BatchSmsTaskRep
    {
        /// <summary>
        /// 主键
        /// </summary>
        public string Id { get; set; }
        /// <summary>
        /// 任务名称
        /// </summary>
        public string TaskName { get; set; }

        /// <summary>
        /// 短信内容
        /// </summary>
        public string Content { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        public ESmsTaskState SmsTaskState { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        public string SmsTaskStateText => SmsTaskState.GetDescription();
        /// <summary>
        /// 短信总量
        /// </summary>
        public int SmsCount { get; set; }
        /// <summary>
        /// 计划发送时间
        /// </summary>
        public DateTime PlanSendTime { get; set; }
        /// <summary>
        /// 创建人
        /// </summary>
        public string? CreatorName { get; set; }
        /// <summary>
        /// 创建部门
        /// </summary>
        public string? CreatorOrgName { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreationTime { get; set; }
    }

    public class PublishBatchSmsTaskDto
    {
        public string TaskId { get; set; }
    }

    public class PublishLeaderSMSDto
    {
        public PublishLeaderSMSDto()
        {
            
        }

        public PublishLeaderSMSDto(string orderId, string dicDataName, string dicDataValue)
        {
            OrderId = orderId;
            TelNumber = dicDataValue;
            Name = dicDataName;
        }

        /// <summary>
        /// 工单Id
        /// </summary>
        public string OrderId { get; set; }

        /// <summary>
        /// 接收手机号码
        /// </summary>
        public string TelNumber { get; set; }

        /// <summary>
        /// 接收人
        /// </summary>
        public string Name { get; set; }
    }
}
