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

namespace MadRunFabric.Model
{
    /// <summary>
    /// 排班管理 - 省三院
    /// </summary>
    [BsonIgnoreExtraElements]
    public class Sys_ClassGroup_User_Map : IBaseModel<string>
    {
        /// <summary>
        /// id
        /// </summary>
        [Key]
        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string id { get; set; }
        /// <summary>
        /// 项目id
        /// </summary>
        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string projectid { get; set; }
        /// <summary>
        /// 用户账号
        /// </summary>
        public string usercode { get; set; }
        ///// <summary>
        ///// 班别代码
        ///// </summary>
        //public string groupcode { get; set; }
        /// <summary>
        /// 时间
        /// </summary>
        public string date { get; set; }
        /// <summary>
        /// 出勤状态(1正常 2休息 3请假)
        /// </summary>
        public int isstatus { get; set; } = 2;
        /// <summary>
        /// 绑定班别
        /// </summary>
        public List<ClassGroupList> classgroupList { get; set; }
        /// <summary>
        /// 是否参与计划
        /// </summary>
        public bool isjoin { get; set; } = false;
        /// <summary>
        /// 计划名称
        /// </summary>
        public List<DistriPlanList> distri_planList { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string remark { get; set; }

        /// <summary>
        /// 添加人工号 ------------------------------------------------
        /// </summary>
        public string createby { get; set; }
        /// <summary>
        /// 添加人名字
        /// </summary>
        public string createbyname { 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 deleteby { get; set; }
        /// <summary>
        /// 删除日期
        /// </summary>
        public DateTime? deletetime { get; set; }
    }

    #region 绑定班别 - 字段 model
    /// <summary>
    /// 绑定班别
    /// </summary>
    public class ClassGroupList
    {
        /// <summary>
        /// 班别代码
        /// </summary>
        public string code { get; set; }
        /// <summary>
        /// 班别名称
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// 绑定角色（岗位）
        /// </summary>
        public List<ClassGroupRoleList> roleList { get; set; }
    }
    /// <summary>
    /// 计划list
    /// </summary>
    public class DistriPlanList
    {
        /// <summary>
        /// 计划名称
        /// </summary>
        //[BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
        public string planid { get; set; }
        /// <summary>
        /// 计划名称
        /// </summary>
        public string planname { get; set; }
    }
    #endregion

    /// <summary>
    /// 出勤状态(1正常 2休息 3请假)
    /// </summary>
    public enum EnumClassGroupUserIsStatus
    {
        [Description("正常")]
        正常 = 1,
        [Description("休息")]
        休息 = 2,
        [Description("请假")]
        请假 = 3
    }

}
