using Hotline.Share.Enums.CallCenter;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XF.Utility.EnumExtensions;

namespace Hotline.Share.Dtos.CallCenter
{
    public class CallNativeDto
    {
        public string Id { get; set; }

        /// <summary>
        /// 通话记录编号（呼叫中心）
        /// </summary>
        public string CallNo { get; set; }

        public ECallDirection Direction { get; set; }
        public string DirectionText => Direction.GetDescription();

        /// <summary>
        /// 主叫
        /// </summary>
        public string FromNo { get; set; }

        /// <summary>
        /// 被叫
        /// </summary>
        public string ToNo { get; set; }

        /// <summary>
        /// 响应分机号
        /// </summary>
        public string? TelNo { get; set; }

        /// <summary>
        /// 挂断方
        /// </summary>
        public EEndBy? EndBy { get; set; }

        public string? EndByText => EndBy?.GetDescription() ?? string.Empty;

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

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

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

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

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

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

        /// <summary>
        /// 接听时间
        /// </summary>
        public DateTime? AnsweredTime { get; set; }

        /// <summary>
        /// 挂机时间
        /// </summary>
        public DateTime EndTime { get; set; }

        /// <summary>
        /// 分机组id(技能组Id)
        /// </summary>
        public string? GroupId { get; set; }

        /// <summary>
        /// 工号
        /// </summary>
        public string? StaffNo { get; set; }

        /// <summary>
        /// 话务员id
        /// </summary>
        public string? UserId { get; set; }

        /// <summary>
        /// 话务员姓名
        /// </summary>
        public string? UserName { get; set; }

        /// <summary>
        /// 评分
        /// </summary>
        public int Score { get; set; }

        /// <summary>
        /// 通话时长(秒)
        /// </summary>
        public int Duration { get; set; }

        /// <summary>
        /// 响铃时长（秒）
        /// </summary>
        public int RingDuration { get; set; }

        /// <summary>
        /// 等待时长
        /// </summary>
        public int WaitDuration { get; set; }

        /// <summary>
        /// 通话录音
        /// </summary>
        public string AudioFile { get; set; }

        public string? OrderId { get; set; }

        public string? OrderNo { get; set; }

        public string? Title { get; set; }

        /// <summary>
        /// 通话状态
        /// </summary>
        public ECallState? CallState { get; set; }

        /// <summary>
        /// 通话状态
        /// </summary>
        public string? CallStateTxt => CallState != null ? CallState.GetDescription() : "";

        /// <summary>
        /// 是否回访
        /// </summary>
        public bool IsVisit { get; set; } = false;

        /// <summary>
        /// 是否工单
        /// </summary>
        public bool IsOrder { get; set; } = false;
    }
}