using System.ComponentModel;
using Hotline.Share.Enums.CallCenter;
using SqlSugar;
using XF.Domain.Entities;
using XF.Domain.Repository;

namespace Hotline.CallCenter.Calls
{
    /// <summary>
    /// 通话记录报告
    /// </summary>
    [Description("通话记录报告")]
    public class CallRecord : CreationEntity
    {
        /// <summary>
        /// 通话记录ID
        /// </summary>
        [SugarColumn(IsNullable = true,ColumnDescription = "通话记录ID")]
        public string CallId { get; set; }

        /// <summary>
        /// CdrId
        /// </summary>
        [SugarColumn(ColumnDescription = "CdrID")]
        public string CdrId { get; set; }
        /// <summary>
        /// MAC地址
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "MAC地址")]
        public string? MAC { get; set; }

        /// <summary>
        /// 通话唯一标识
        /// </summary>
        [SugarColumn(ColumnDescription = "通话唯一标识（短期内唯一）")]
        public string CDRCallId { get; set; }

        /// <summary>
        /// 去电会话临时ID
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "去电会话临时ID")]
        public string? OuterId { get; set; }

        /// <summary>
        /// 来电会话临时ID
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "来电会话临时ID")]
        public string? VisitorId { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        [SugarColumn(ColumnDescription = "开始时间")]
        public string TimeStart { get; set; }


        [SugarColumn(IsNullable = true, ColumnDescription = "分机组")]
        public string? Group { get; set; }

        /// <summary>
        /// 通话方式
        /// </summary>
        [SugarColumn(ColumnDescription = "通话方式")]
        public ECDRType Type { get; set; }
        /// <summary>
        /// 接通方式
        /// </summary>
        [SugarColumn(ColumnDescription = "接通方式")]
        public ECDRRoute Route { get; set; }

        /// <summary>
        /// 主叫号码
        /// </summary>
        [SugarColumn(ColumnDescription = "主叫号码")]
        public string CPN { get; set; }
        /// <summary>
        /// 被叫号码
        /// </summary>
        [SugarColumn(ColumnDescription = "被叫号码")]
        public string CDPN { get; set; }
        /// <summary>
        /// 结束时间
        /// </summary>
        [SugarColumn(ColumnDescription = "结束时间")]
        public string TimeEnd { get; set; }
        /// <summary>
        /// 通话时长
        /// </summary>
        [SugarColumn(ColumnDescription = "通话时长")]
        public string Duration { get; set; }
        /// <summary>
        /// 该路通话所经过的中继号码
        /// </summary>
        [SugarColumn(IsNullable = true,ColumnDescription = "该路通话所经过的中继号码")]
        public string TrunkNumber { get; set; }
        /// <summary>
        /// 录音文件的相对保存路径
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "录音文件的相对保存路径")]
        public string? Recording { get; set; }
        /// <summary>
        /// 编码方式
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "编码方式")]
        public string? RecCodec { get; set; }

        /// <summary>
        /// 用户ID
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "用户ID")]
        public string UserId { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "用户名")]
        public string? UserName { get; set; }
    }
}
