using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Hotline.Orders;
using Hotline.Share.Enums.CallCenter;
using SqlSugar;
using XF.Domain.Repository;

namespace Hotline.CallCenter.Calls
{
    /// <summary>
    /// 本地通话记录
    /// </summary>
    [SugarIndex("index_call_callid", nameof(CallNative.CallNo), OrderByType.Asc)]
    public class CallNative : CreationSoftDeleteEntity
    {
        /// <summary>
        /// 通话记录编号
        /// </summary>
        [SugarColumn(ColumnDescription = "通话记录编号")]
        public string CallNo { get; set; }

        /// <summary>
        /// 通话方向
        /// </summary>
        [SugarColumn(ColumnDescription = "通话方向")]
        public ECallDirection Direction { get; set; }

        /// <summary>
        /// 主叫
        /// </summary>
        [SugarColumn(ColumnDescription = "主叫号码")]
        public string FromNo { get; set; }

        /// <summary>
        /// 被叫
        /// </summary>
        [SugarColumn(ColumnDescription = "被叫号码")]
        public string ToNo { get; set; }

        /// <summary>
        /// 响应分机号
        /// </summary>
        [SugarColumn(ColumnDescription = "响应分机号")]
        public string TelNo { get; set; }

        /// <summary>
        /// 挂断方
        /// </summary>
        [SugarColumn(ColumnDescription = "挂断方")]
        public EEndBy? EndBy { get; set; }

        /// <summary>
        /// IVR开始时间
        /// </summary>
        [SugarColumn(ColumnDescription = "IVR开始时间")]
        public DateTime? BeginIvrTime { get; set; }

        /// <summary>
        /// IVR结束时间
        /// </summary>
        [SugarColumn(ColumnDescription = "IVR结束时间")]
        public DateTime? EndIvrTime { get; set; }

        /// <summary>
        /// 开始等待时间
        /// </summary>
        [SugarColumn(ColumnDescription = "开始等待时间")]
        public DateTime? BeginQueueTime { get; set; }

        /// <summary>
        /// 结束等待时间
        /// 兴唐没值
        /// </summary>
        [SugarColumn(ColumnDescription = "结束等待时间")]
        public DateTime? EndQueueTime { get; set; }

        /// <summary>
        /// 开始振铃时间
        /// </summary>
        [SugarColumn(ColumnDescription = "开始振铃时间")]
        public DateTime? BeginRingTime { get; set; }

        /// <summary>
        /// 结束振铃时间
        /// </summary>
        [SugarColumn(ColumnDescription = "结束振铃时间")]
        public DateTime? EndRingTime { get; set; }

        /// <summary>
        /// 接听时间
        /// </summary>
        [SugarColumn(ColumnDescription = "接听时间")]
        public DateTime? AnsweredTime { get; set; }

        /// <summary>
        /// 挂机时间
        /// </summary>
        [SugarColumn(ColumnDescription = "挂机时间")]
        public DateTime EndTime { get; set; }

        /// <summary>
        /// 分机组id(技能组Id)
        /// </summary>
        [SugarColumn(ColumnDescription = "分机组ID")]
        public string? GroupId { get; set; }

        /// <summary>
        /// 工号
        /// </summary>
        [SugarColumn(ColumnDescription = "工号")]
        public string? StaffNo { get; set; }

        /// <summary>
        /// 话务员id
        /// </summary>
        [SugarColumn(ColumnDescription = "话务员ID")]
        public string? UserId { get; set; }

        /// <summary>
        /// 话务员姓名
        /// </summary>
        [SugarColumn(ColumnDescription = "话务员姓名")]
        public string? UserName { get; set; }

        /// <summary>
        /// 评分
        /// </summary>
        [SugarColumn(ColumnDescription = "评分")]
        public int Score { get; set; }

        /// <summary>
        /// 通话时长(秒)
        /// </summary>
        [SugarColumn(ColumnDescription = "通话时长(秒)")]
        public int Duration { get; set; }

        /// <summary>
        /// 响铃时长（秒）
        /// </summary>
        [SugarColumn(ColumnDescription = "响铃时长（秒）")]
        public int RingDuration { get; set; }

        /// <summary>
        /// 等待时长
        /// </summary>
        [SugarColumn(ColumnDescription = "等待时长")]
        public int WaitDuration { get; set; }

        /// <summary>
        /// 通话录音
        /// </summary>
        [SugarColumn(ColumnDescription = "通话录音")]
        public string AudioFile { get; set; }

        /// <summary>
        /// 电话回复内容
        /// </summary>
        [SugarColumn(ColumnDescription = "电话回复内容")]
        public string? ReplyTxt { get; set; }

        /// <summary>
        /// 转接分机号
        /// </summary>
        [SugarColumn(ColumnDescription = "转接分机号")]
        public string? AgentTransferNumber { get; set; }

        /// <summary>
        /// 呼叫状态
        /// </summary>
        [SugarColumn(ColumnDescription = "呼叫状态")]
        public ECallState? CallState { get; set; }

        /// <summary>
        /// 软删除
        /// </summary>
        [SugarColumn(ColumnDescription = "软删除", DefaultValue = "f")]
        public bool IsDeleted { get; set; }

        /// <summary>
        /// 通话类型，黑白名单
        /// </summary>
        public ECallIdentity? CallIdentity {  get; set; }
    }
}
