using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
using TEAMModelOS.SDK.Context.Attributes.Azure;

namespace TEAMModelOS.SDK.Models
{
    /// <summary>
    /// 课程
    /// </summary>    
    public class Course : CosmosEntity
    {
        public Course()
        {
            pk = "Course";
            subject = new SubjectSimple();
            period = new PeriodSimple();
            schedule = new List<Schedule>();
        }
        /// <summary>
        /// 课程名称
        /// </summary>
        [Required(ErrorMessage = "{0} 必须填写")]
        public string name { get; set; }
        /// <summary>
        /// 课程编码
        /// </summary>
       /* [Required(ErrorMessage = "{0} 必须填写")]
        public string courseCode { get; set; }*/
        ///// <summary>
        ///// 学期编码
        ///// </summary>
        //public string semesterCode { get; set; }
        /// <summary>
        /// 科目编码
        /// </summary>
        public SubjectSimple subject { get; set; }
        /// <summary>
        /// 学段编码
        /// </summary>
        public PeriodSimple period { get; set; }
        /// <summary>
        /// 任课教师范围
        /// </summary>
        //public List<Teachers> teachers { get; set; }
        public string scope { get; set; }
        //public string notice { get; set; }
        public List<Schedule> schedule { get; set; }
        //public List<Customize> classes { get; set; }
        public string no { get; set; }
        ///新增字段
        /// <summary>
        /// 创建者的id 
        /// </summary>
        [Required(ErrorMessage = "creatorId 必须设置")]
        public string creatorId { get; set; }
        /// <summary>
        /// 学校编码或教师tmdid
        /// </summary>
        [Required(ErrorMessage = "school 必须设置")]
        public string school { get; set; }

    }

    public class Schedule
    {
        /// <summary>
        /// 教室
        /// </summary>
        public string room { get; set; }
        /// <summary>
        /// 班级名单id
        /// </summary>
        public string classId { get; set; }
        public string teacherId { get; set; }
        /// <summary>
        /// 自定义名单
        /// </summary>
        public string stulist { get; set; }
        public List<timeInfo> time { get; set; } = new List<timeInfo>();
        public string notice { get; set; }

    }

    public class Customize
    {
        public string id { get; set; }
        public string name { get; set; }
        public Teachers teacher { get; set; } = new Teachers();
        public string scope { get; set; }
        public string code { get; set; }

    }
    public class timeInfo
    {
        public string id { get; set; }
        public string week { get; set; }
        //public string start { get; set; }
        //public string end { get; set; }
    }
    public class PeriodSimple
    {

        public string id { get; set; }
        public string name { get; set; }
    }
    public class SubjectSimple
    {

        public string id { get; set; }
        public string name { get; set; }
    }
/*    public class Info
    {

        public string id { get; set; }
        public string name { get; set; }
    }*/
    public class Teachers
    {
        public string id { get; set; }
        public string name { get; set; }
    }
}
