using Hotline.Share.Enums.CallCenter;
using Hotline.Share.Requests;
using XF.Utility.EnumExtensions;

namespace Hotline.Share.Dtos.CallCenter
{
    /// <summary>
    /// 申请
    /// </summary>
    public class TelRestApplyAddDto
    {
        /// <summary>
        /// 分机号（冗余）
        /// </summary>
        public string TelNo { get; set; }

        /// <summary>
        /// 小休原因
        /// </summary>
        public Kv Reason { get; set; }
    }

    /// <summary>
    /// 审批
    /// </summary>
    public class TelRestApplyAuditDto
    {
        /// <summary>
        /// 数据Id
        /// </summary>
        public List<string> Ids{ get; set; }

        /// <summary>
        /// 审批原因
        /// </summary>
        public string AuditOpinion { get; set; }

        /// <summary>
        /// 是否通过
        /// </summary>
        public bool IsPass { get; set; }
    }

    public record TelRestApplyRequestDto : PagedKeywordRequest
    {
        /// <summary>
        /// 0:待审批  1:已审批
        /// </summary>
        public int Type { get; set; }

        /// <summary>
        /// 申请人
        /// </summary>
        public string ApplyUserName { get; set; }

        /// <summary>
        /// 申请时间
        /// </summary>
        public DateTime? ApplyStartTime { get; set; }
        public DateTime? ApplyEndTime { get; set; }

        /// <summary>
        /// 小休原因
        /// </summary>
        public string ReasonId { get; set; }

        /// <summary>
        /// 审核状态
        /// </summary>
        public ETelRestAuditStatus? AuditStatus { get; set; }

        /// <summary>
        /// 审核人
        /// </summary>
        public string? AuditUserName { get; set; }

        /// <summary>
        /// 审核时间
        /// </summary>
        public DateTime? AuditStartTime { get; set; }
        /// <summary>
        /// 审核时间
        /// </summary>
        public DateTime? AuditEndTime { get; set; }
    }

    /// <summary>
    /// 列表数据
    /// </summary>
    public class TelRestApplyListDto
    {
        public string Id { get; set; }

        /// <summary>
        /// 申请人
        /// </summary>
        public string ApplyUserName { get; set; }

        /// <summary>
        /// 申请时间
        /// </summary>
        public DateTime? ApplyTime { get; set; }

        public string Reason { get; set; }

        public string ReasonId { get; set; }

        /// <summary>
        /// 审核人
        /// </summary>
        public string? AuditUserName { get; set; }
        public string? AuditUserId { get; set; }

        /// <summary>
        /// 审核部门
        /// </summary>
        public string? AuditOrgName { get; set; }
        public string? AuditOrgId { get; set; }

        /// <summary>
        /// 审核时间
        /// </summary>
        public DateTime? AuditTime { get; set; }

        /// <summary>
        /// 审核意见
        /// </summary>
        public string? AuditOpinion { get; set; }

        /// <summary>
        /// 审核状态
        /// </summary>
        public ETelRestAuditStatus AuditStatus { get; set; }

        /// <summary>
        /// 审核状态
        /// </summary>
        public string AuditStatusText => AuditStatus.GetDescription();
    }
}
