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

namespace MadRunFabric.Model.WorkOrderApi
{
    /// <summary>
    /// 工单处理 轨迹表 - 售后管理系统
    /// </summary>
    public class Bus_Msg_List : IBaseModel<string>
    {
        /// <summary>
        /// id
        /// </summary>
        [Key]
        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string id { get; set; }
        /// <summary>
        /// 工单编号
        /// </summary>
        public string ordercode { get; set; }
        /// <summary>
        /// 工单状态:0创建，1待处理，9完成  （暂时不用：0创建，1待接单，2催办，3转派，9完成）
        /// </summary>
        public int state { get; set; } = 0;
        /// <summary>
        /// 内容
        /// </summary>
        public string detail { get; set; }


        /// <summary>
        /// 创建人工号
        /// </summary>
        public string createuser { get; set; }
        /// <summary>
        /// 创建人姓名
        /// </summary>
        public string createusername { get; set; }
        ///// <summary>
        ///// 创建部门id
        ///// </summary>
        //[BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        //public string createdeptid { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime createtime { get; set; } = DateTime.Now;
        /// <summary>
        /// 是否删除（0正常1删除）
        /// </summary>
        public int isdelete { get; set; } = 0;
        /// <summary>
        /// 删除用户
        /// </summary>
        public string deleteuser { get; set; }
        /// <summary>
        /// 删除时间
        /// </summary>
        public DateTime? deletetime { get; set; }
    }

    /// <summary>
    /// 工单状态:0未处理，1已处理
    /// </summary>
    public enum EnumOrderItemType
    {
        /// <summary>
        /// 0创建工单
        /// </summary>
        create = 0,
        /// <summary>
        /// 1未处理
        /// </summary>
        deal = 1,
        /// <summary>
        /// 2已指派
        /// </summary>
        appoint = 2,
        /// <summary>
        /// 3已接单
        /// </summary>
        accept = 3,
        /// <summary>
        /// 9已处理
        /// </summary>
        complete = 9,
    }
}
