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

namespace MadRunFabric.Model
{
    /// <summary>
    /// 工单记录
    /// </summary>
    public class Bus_Order_Base : IBaseModel<string>
    {
        /// <summary>
        /// id
        /// </summary>
        [Key]
        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string id { get; set; }
        /// <summary>
        /// 工单编号
        /// </summary>
        public string ordercode { get; set; }
        /// <summary>
        /// 通话唯一ID
        /// </summary>
        public string unique_id { get; set; }
        /// <summary>
        /// 通话记录id
        /// </summary>
        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string callrecordid { get; set; }
        /// <summary>
        /// 语音留言id
        /// </summary>
        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string leaverecordid { get; set; }
        /// <summary>
        /// 姓名
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// 号码
        /// </summary>
        public string phone { get; set; }
        /// <summary>
        /// 性别
        /// </summary>
        public string sex { get; set; }
        /// <summary>
        /// 省code
        /// </summary>
        public string province { get; set; }
        /// <summary>
        /// 市code
        /// </summary>
        public string city { get; set; }
        /// <summary>
        /// 地址
        /// </summary>
        public string address { get; set; }
        /// <summary>
        /// 来源id
        /// </summary>
        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string sourceid { get; set; }
        /// <summary>
        /// 类型id
        /// </summary>
        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string typeid { get; set; }
        /// <summary>
        /// 部门id
        /// </summary>
        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string deptid { get; set; }
        /// <summary>
        /// 标题
        /// </summary>
        public string title { get; set; }
        /// <summary>
        /// 内容
        /// </summary>
        public string content { get; set; }
        /// <summary>
        /// 附件
        /// </summary>
        public List<FileBaseModel> files { get; set; }
        /// <summary>
        /// 工单状态:0未处理，1已处理
        /// </summary>
        public int state { get; set; } = 0;
        /// <summary>
        /// 处理部门id
        /// </summary>
        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string dealdeptid { get; set; }
        /// <summary>
        /// 处理时间
        /// </summary>
        public DateTime? dealtime { get; set; }
        /// <summary>
        /// 处理人工号
        /// </summary>
        public string dealuser { get; set; }
        /// <summary>
        /// 处理人姓名
        /// </summary>
        public string dealusername { get; set; }
        /// <summary>
        /// 处理结果
        /// </summary>
        public string result { get; set; }
        /// <summary>
        /// 处理结果附件
        /// </summary>
        public List<FileBaseModel> resultfiles { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime createtime { get; set; }
        /// <summary>
        /// 创建人工号
        /// </summary>
        public string createuser { get; set; }
        /// <summary>
        /// 创建人姓名
        /// </summary>
        public string createusername { get; set; }
        /// <summary>
        /// 是否删除
        /// </summary>
        public int isdelete { get; set; }
        /// <summary>
        /// 删除用户
        /// </summary>
        public string deleteuser { get; set; }
        /// <summary>
        /// 删除时间
        /// </summary>
        public DateTime? deletetime { get; set; }
    }
    /// <summary>
    /// 工单状态:0未处理，1已处理
    /// </summary>
    public enum EnumOrderType
    {
        /// <summary>
        /// 0未处理
        /// </summary>
        create = 0,
        /// <summary>
        /// 1已处理
        /// </summary>
        deal = 1,
    }
}
