using Hotline.Share.Enums.CallCenter;
using SqlSugar;
using XF.Domain.Repository;

namespace Hotline.CallCenter.Calls
{
    public class WexCallRecord:CreationEntity
    {
        /// <summary>
        /// 通话记录ID（外部主键）
        /// </summary>
        public string CallId { get; set; }


        /// <summary>
        /// 电话方向
        /// </summary>
        public ECallDirection Direction { get; set; }

        /// <summary>
        /// 应答分机号
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string TelNo { get; set; }

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

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

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

        /// <summary>
        /// 号码归属地
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string AreaName { get; set; }

        /// <summary>
        /// 进入IVR时间
        /// </summary>
        public DateTime? InIvrTime { get; set; }


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


        /// <summary>
        /// 进入队列时间
        /// </summary>
        public DateTime? InQueueTime { get; set; }

        
        /// <summary>
        /// 离开队列时间
        /// </summary>
        public DateTime? OutQueueTime { get; set; }

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

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

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

        /// <summary>
        /// 振铃时长
        /// </summary>
        public int RingTimes { get; set; }

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

        /// <summary>
        /// 挂断时间
        /// </summary>
        public DateTime? ByeTime { get; set; }

        /// <summary>
        /// 通话时长
        /// </summary>
        public int TalkTime { get; set; }

        /// <summary>
        /// 录音播放路径（呼出）
        /// </summary>
        public string? RecordUrl { get; set; }

        /// <summary>
        /// 录音本地路径（呼出）
        /// </summary>
        public string? RecordName { get; set; }

        /// <summary>
        /// 录音相对路径（呼出）
        /// </summary>
        public string? SourceRecord { get; set; }

        /// <summary>
        /// 录音播放地址（呼入）
        /// </summary>
        public string? OtherRecordUrl { get; set; }

        /// <summary>
        /// 录音本地路径（呼入）
        /// </summary>
        public string? OtherRecordName { get; set; }

        /// <summary>
        /// 录音相对路径（呼入）
        /// </summary>
        public string? OtherSourceRecord { get; set; }
        
        /// <summary>
        /// 通话结果
        /// </summary>
        public EOnState OnState { get; set; }


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

        /// <summary>
        /// 成功or失败
        /// </summary>
        public string Result { get; set; }


        /// <summary>
        /// 评价结果
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string EvaluateResult { get; set; }

        /// <summary>
        /// 中继线
        /// </summary>
        public string TrunkLine { get; set; }

    }
}
