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


namespace TEAMModelOS.SDK.Models
{
    /// <summary>
    /// 教师作业活动
    /// </summary>    
    public class TeacherWork : CosmosEntity
    {
        public TeacherWork() {
            pk = "TeacherWork";
            classes = new List<string>();
            stuLists = new List<string>();
            tchLists = new List<string>();
        }
        /// <summary> 
        ///发布层级 类型 school  teacher
        /// </summary>

        /// <summary>
        /// 学校编码或教室tmdid
        /// </summary>
        [Required(ErrorMessage = "owner 必须设置")]
        public string owner { get; set; }
      
        public string school { get; set; }
        /// <summary>
        /// 作业名称
        /// </summary>
        [Required(ErrorMessage = "name 必须设置")]
        public string name { get; set; }
        /// <summary>
        ///  作业内容
        /// </summary>
        public string description { get; set; }
        /// <summary>
        /// 创建者的id 
        /// </summary>
        [Required(ErrorMessage = "creatorId 必须设置")]
        public string creatorId { get; set; }
        // public int year { get; set; }
        /// <summary>
        /// pending 待发布|going 已发布|finish 已结束
        /// </summary>
        //[Required(ErrorMessage = "progress 必须设置")]
        public string progress { get; set; }
        public string scope { get; set; }

        //public List<string> tmdids { get; set; } = new List<string>();
        /// <summary>
        ///  行政班  
        /// </summary>
        public List<string> classes { get; set; } = new List<string>();
        /// <summary>
        /// 学生名单（包含自定义个人学生名单，学校教学班）
        /// </summary>
        public List<string> stuLists { get; set; } = new List<string>();
        /// <summary>
        /// 教研组名单
        /// </summary>
        public List<string> tchLists { get; set; } = new List<string>();
        /// <summary>
        /// student 学生名单类型    research 教研组名单
        /// </summary>
        public string targetType { get; set; }
        /// <summary>
        /// 发布对象全部信息。由前端操作，用于前端回显发布对象的格式。
        /// </summary>
        public List<JsonElement> targets { get; set; } = new List<JsonElement>();
        /// <summary>
        ///class行政班/teach教学班
        /// </summary>
        //public string classType { get; set; }
        /// <summary>
        /// 开始时间
        /// </summary>
        public long startTime { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        public long endTime { get; set; }
        public long createTime { get; set; } // 作业发布时间
        /// <summary>
        /// 更新时间
        /// </summary>
        public long updateTime { get; set; }
        public string  blob { get; set; }
        /// <summary>
        /// TTL删除改变状态使用
        /// </summary>
        public int? status { get; set; } = 0;
        public long? size { get; set; } = 0;
        public string areaId { get; set; }
        public List<Submits> teachers { get; set; } = new List<Submits>();
    }
    public class Submits {
        public string id { get; set; }
        //public string name { get; set; }
        //记录作业上传内容
        public string hw { get; set; }
        public long hwTime { get; set; }
    }
}
