package cn.teammodel.model.entity.school;

import cn.teammodel.model.entity.BaseItem;
import com.azure.spring.data.cosmos.core.mapping.Container;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.List;

@EqualsAndHashCode(callSuper = true)
@Container(containerName = "School")
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class School extends BaseItem {
    /**
    * 学校名字
    */
    private String name;
    private String schoolCode;
    private String region;
    private String province;
    private String city;
    private String dist;
    private String areaId;
    private Integer size;
    private Integer tsize;
    private String address;
    private String picture;
    private TimeZone timeZone;
    private Integer type;
    private String standard;
    private Integer hpappraise;
    private Integer scale;
    private Edition edition;
    private long createTime;
    private boolean isinit;
    private boolean openLessonRecord;
    //private Module[] modules;
    private String pk;
    private List<Period> period;
    private List<Campus> campuses;

    @Data
    public static class Period {
        private List<Major> majors;
        private List<String> grades;
        private List<Subject> subjects;
        private List<Semester> semesters;
        private List<Semester> timetable;
        private String name;
        private String id;
        private String gradeCount;
        private String semesterCount;
        private String subjectCount;
        private String campusId;
        private Analysis analysis;
        // 学段类型
        private String periodType;
    }

    @Data
    public static class Major {
        private String id;
        private String name;
    }
    @Data
    public static class Timetable {
        private String id;
        private String label;
        private String time;
        // todo: 待补充
        //private String weeklies;
    }
    @Data
    public static class Analysis {
        private List<Type> type;
        private Integer income;
        private Integer eugenics;
        private Integer touch;
    }
    @Data
    public static class Type {
        private String id;
        private String name;
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class Subject {
        private String id;
        private String name;
        private Integer type;
        private String bindId;
    }


    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class Semester {
        private String id;
        private String name;
        /**
         * start = 1 则代表一年开始的学期
         */
        private Integer start;
        /**
         * 开始的月份
         */
        private Integer month;
        /**
         * 开始的日
         */
        private Integer day;
    }

    @Data
    public static class Campus {
        private String name;
        private String id;

    }
    @Data
    public static class TimeZone {
        private String label;
        private String value;
    }

    @Data
    public static class Edition {
        private Integer current;
        private Integer record;
        private String scaleVersion;
    }
}
