using SqlSugar;

namespace XingTang.Sdk;

[SugarTable("call_cti_trafficlist")]
public class XingtangCall
{
    [SugarColumn(IsPrimaryKey = true)]
    public int Id { get; set; }

    /// <summary>
    /// 客户id
    /// </summary>
    public string CustomerId { get; set; }

    public string CallGuid { get; set; }

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

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

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

    /// <summary>
    /// 分机号
    /// </summary>
    public string Ext { get; set; }

    /// <summary>
    /// 0：呼入，1：呼出
    /// </summary>
    public int CallType { get; set; }

    /// <summary>
    /// 呼叫开始时间
    /// </summary>
    public DateTime CallStartTime { get; set; }

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

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

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

    /// <summary>
    /// 时长
    /// </summary>
    public int Duration { get; set; }

    /// <summary>
    /// 录音文件
    /// </summary>
    public string AudioFile { get; set; }

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

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

    /// <summary>
    /// 呼叫状态 0: 留言; 1: 队列等待超时; 2: 坐席振铃超时; 3: 未接; 4: 满意度; 5: 通话; 6: IVR; 7: 振铃挂机; 8: 分机互打挂机; 9: ASR交互;
    /// </summary>
    public int CallState { get; set; }

    /// <summary>
    /// 呼出通道号
    /// </summary>
    [SugarColumn(ColumnName = "callout_channel")]
    public int CallOutChannel { get; set; }

    /// <summary>
    /// 呼入通道号
    /// </summary>
    [SugarColumn(ColumnName = "callin_channel")]
    public int CallInChannel { get; set; }

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

    /// <summary>
    /// 出队列时间
    /// </summary>
    public DateTime? DequeueTime { get; set; }

    public string? CompanyId { get; set; }

    public int? SkillId { get; set; }
    public int? MeetingId { get; set; }

    /// <summary>
    /// 挂机原因
    /// </summary>
    public string? Cause { get; set; }

    /// <summary>
    /// 挂机方
    /// </summary>
    public string? Disposition { get; set; }

    /// <summary>
    /// 原主叫
    /// </summary>
    public string? OrgCaller { get; set; }

    /// <summary>
    /// 黑名单
    /// </summary>
    public int? BlackList { get; set; }

    /// <summary>
    /// 白名单
    /// </summary>
    public int? WhiteList { get; set; }

    #region 未启用

    public int? MutiCall { get; set; }
    public int? CallForword { get; set; }
    public DateTime? RingStartTime { get; set; }

    /// <summary>
    /// 转接号码
    /// </summary>
    [SugarColumn(ColumnName = "trans_called")]
    public string? TransCalled { get; set; }

    public int? UserListId { get; set; }

    public int? Score { get; set; }
    public string? MarkRemark { get; set; }
    public string? MarkUserId { get; set; }
    public DateTime? MarkDate { get; set; }
    public int? MarkState { get; set; }
    public int? IsAssign { get; set; }
    public int? ResultKey { get; set; }
    public int? Direction { get; set; }
    #endregion

    #region 自建

    public bool IsSync { get; set; }

    public int Tries { get; set; }

    [SugarColumn(IsEnableUpdateVersionValidation = true)]
    public string Ver { get; set; }

    #endregion
}

/*
开始响铃时间: 振铃时间
结束响铃时间: 接听时间
 */