using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
using System.Text.Json.Serialization;
using TEAMModelOS.SDK.Context.Attributes.Azure;
using TEAMModelOS.SDK.DI;

namespace TEAMModelOS.SDK.Models
{    
    public class CoursePlan : CosmosEntity
    {
        public CoursePlan(){
            classes = new List<CourseClass>();
        }

        [Required(ErrorMessage = "课程ID必须设置")]
      //  public string courseId { get; set; }
        public List<CourseClass> classes { get; set; }
        public string notice { get; set; }
       
        /// <summary>
        /// 助教
        /// </summary>
        public List<Assistant> assistant { get; set; }
        /// <summary>
        /// 学期代码
        /// </summary>
        public string semesterCode { get; set; }
    }


    public class CourseClass {
        public CourseClass() {
            groups = new List<GroupStudent>();
            courseTimes = new List<CourseTime>();

        }
        public string classroomCode { get; set; }
        /// <summary>
        /// 学生分组
        /// </summary>
        public List<GroupStudent> groups { get; set; }
        /// <summary>
        /// 课程时间安排
        /// </summary>
        public List<CourseTime> courseTimes { get; set; }
    }
    public class Assistant { 
        /// <summary>
        /// 助教 醍摩豆id
        /// </summary>
        public string TEAMModelId { get; set; }
    }
    public class CourseTime {
        /// <summary>
        /// 课时名称 第几节课 课间操等
        /// </summary>
        [Required(ErrorMessage = "{0}必须设置")]
        public string label { get; set; }
        /// <summary>
        /// 上课时间段 08:00-08:45
        /// </summary>
        [Required(ErrorMessage = "{0}必须设置")]
        public string time { get; set; }
        /// <summary>
        /// 按周期或特定时间
        /// </summary>
        [Required(ErrorMessage = "{0}必须设置")]
        public int type { get; set; } = 0;
        /// <summary>
        /// 星期几（星期英文简称）或某一个确定的日期
        /// </summary>
        [Required(ErrorMessage = "{0}必须设置")]
        public string day { get; set; }
        public bool isnew = false;
    }
   
    public class GroupStudent
    {
        public int seatNo { get; set; }
        public string groupCode { get; set; }
        public string groupName { get; set; }
        public string studentId { get; set; }
    }
}
