using MadRunFabric.Common;
using MongoDB.Bson.Serialization.Attributes;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace MadRunFabric.Model.CallCenterApi
{
    /// <summary>
    /// 通话记录
    /// </summary>
    [BsonIgnoreExtraElements]
    public class mw_call_records : IBaseModel<string>
    {
        /// <summary>
        /// id
        /// </summary>
        [Key]
        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string id { get; set; }
        /// <summary>
        /// 通话唯一ID
        /// </summary>
        public string unique_id { get; set; }
        /// <summary>
        /// 号码
        /// </summary>
        public string callnumber { get; set; }
        /// <summary>
        /// 分配的坐席Code
        /// </summary>
        public string agent_code { get; set; }

        
        /// <summary>
        /// 分配的坐席分机号
        /// </summary>
        public string agent_extnumber { get; set; }
        /// <summary>
        /// 分配的坐席中继号
        /// </summary>
        public string agent_trunknumber { get; set; }
        /// <summary>
        /// 呼叫类型：0呼入，1呼出
        /// </summary>
        public int calltype { get; set; } = 0;
        /// <summary>
        /// 呼叫状态：0未接通，1已接通
        /// </summary>
        public int callstate { get; set; } = 0;
        /// <summary>
        /// 处理方式 0IVR处理 1骚扰电话 2自助服务 3转值班电话 4留言 5呼损 6人工处理
        /// </summary>
        public int dealtype { get; set; } = 0;
        /// <summary>
        /// 操作类型 0分机呼入1ivr呼入2转移3三方通话
        /// </summary>
        public int opttype { get; set; } = 0;
        /// <summary>
        /// ivr中选择的按键值
        /// </summary>
        public string bussinesstype { get; set; }
        /// <summary>
        /// 呼叫开始时间
        /// </summary>
        public DateTime begintime { get; set; }
        /// <summary>
        /// ivr开始时间
        /// </summary>
        public DateTime begintime_ivr { get; set; }
        /// <summary>
        /// ivr结束时间
        /// </summary>
        public DateTime endtime_ivr { get; set; }
        /// <summary>
        /// 排队开始时间
        /// </summary>
        public DateTime begintime_queue { get; set; }
        /// <summary>
        /// 排队结束时间
        /// </summary>
        public DateTime endtime_queue { get; set; }
        /// <summary>
        /// 振铃开始时间
        /// </summary>
        public DateTime begintime_ring { get; set; }
        /// <summary>
        /// 振铃结束时间
        /// </summary>
        public DateTime endtime_ring { get; set; }
        /// <summary>
        /// 通话开始时间
        /// </summary>
        public DateTime begintime_talk { get; set; }
        /// <summary>
        /// 通话结束时间
        /// </summary>
        public DateTime endtime_talk { get; set; }
        /// <summary>
        /// 挂机时间
        /// </summary>
        public DateTime endtime { get; set; }
        /// <summary>
        /// IVR时长
        /// </summary>
        public int longs_ivr { get; set; }
        /// <summary>
        /// 排队时长
        /// </summary>
        public int longs_queue { get; set; }
        /// <summary>
        /// 振铃时长
        /// </summary>
        public int longs_ring { get; set; }
        /// <summary>
        /// 通话时长
        /// </summary>
        public int longs_talk { get; set; }
        /// <summary>
        /// 总时长
        /// </summary>
        public int longs { get; set; }
        #region
        /// <summary>
        /// 转移/三方通话 状态：0失败，1成功
        /// </summary>
        public int turnstate { get; set; }
        /// <summary>
        /// 转移/三方通话 开始时间
        /// </summary>
        public DateTime begintime_opt { get; set; }
        /// <summary>
        /// 转移/三方通话 通话开始时间
        /// </summary>
        public DateTime begintime_talk_opt { get; set; }
        /// <summary>
        /// 转移/三方通话 通话结束时间
        /// </summary>
        public DateTime end_talk_opt { get; set; }
        /// <summary>
        /// 转移/三方通话 被叫坐席
        /// </summary>
        public string agent_code_turn { get; set; }
        /// <summary>
        /// 转移/三方通话 被叫分机号
        /// </summary>
        public string agent_extnumber_turn { get; set; }
        #endregion
        /// <summary>
        /// 满意度评价
        /// </summary>
        public int evaluation { get; set; }
        /// <summary>
        /// 录音路径
        /// </summary>
        public string FilePath { get; set; }
        /// <summary>
        /// 外呼类型 0拨号外呼 1回访外呼
        /// </summary>
        public int callopttype { get; set; }
        /// <summary>
        /// 回访id
        /// </summary>
        public string taskid { get; set; }
        /// <summary>
        /// 回访电话id
        /// </summary>
        public string taskphoneid { get; set; }

        /// <summary>
        /// 是否转过文字
        /// </summary>
        public int istranslate { get; set; } = 0;
        /// <summary>
        /// 录音转的文字
        /// </summary>
        public string recordscontent { get; set; }

        /// <summary>
        /// 电话所属省份
        /// </summary>
        public string province { get; set; }

        /// <summary>
        /// 电话所属城市
        /// </summary>
        public string city { get; set; }
    }
    /// <summary>
    /// 呼叫类型：0呼入，1呼出
    /// </summary>
    public enum enumcalltype
    {
        /// <summary>
        /// 0呼入
        /// </summary>
        callin = 0,
        /// <summary>
        /// 1呼出
        /// </summary>
        callout = 1,
    }
    /// <summary>
    /// 操作类型 0分机呼入 1ivr呼入 2转移 3三方通话 4转值班电话
    /// </summary>
    public enum enumopttype
    {
        /// <summary>
        /// 0正常
        /// </summary>
        extin = 0,
        /// <summary>
        /// ivr呼入
        /// </summary>
        ivrin = 1,
        /// <summary>
        /// 2转移
        /// </summary>
        transfer = 2,
        /// <summary>
        /// 3三方通话
        /// </summary>
        conference = 3,
        /// <summary>
        /// 4转值班电话
        /// </summary>
        onduty = 4,
    }
    /// <summary>
    /// 呼叫状态：0未接通，1已接通
    /// </summary>
    public enum enumcallstate
    {
        /// <summary>
        /// 0未接通
        /// </summary>
        unconnected = 0,
        /// <summary>
        /// 1已接通
        /// </summary>
        connected = 1
    }
    /// <summary>
    /// 0IVR处理 1骚扰电话 2自助服务 3转值班电话 4留言 5呼损 6人工处理
    /// </summary>
    public enum enumdealtype
    {
        /// <summary>
        /// 0IVR处理
        /// </summary>
        ivr = 0,
        /// <summary>
        /// 1骚扰电话
        /// </summary>
        black = 1,
        /// <summary>
        /// 2自助服务
        /// </summary>
        selfhelp = 2,
        /// <summary>
        /// 3转值班电话
        /// </summary>
        dutyphone = 3,
        /// <summary>
        /// 4留言
        /// </summary>
        leavewords = 4,
        /// <summary>
        /// 5呼损
        /// </summary>
        loss = 5,
        /// <summary>
        /// 6人工处理
        /// </summary>
        agent = 6
    }
}
