from saitama_data.datasetup.models.base.schema import BaseSchema
from pandas_schema import Column, Schema
from pandas_schema.validation import CanConvertValidation


class TodaTeacherQesSchema(BaseSchema):
    column_type = {
        "age": float,
        "career": str,
        "career_school": float,
        "grade1": str,
        "grade2": str,
        "grade3": str,
        "grade4": str,
        "grade5": str,
        "grade6": str,
        "grade7": str,
        "grade8": str,
        "grade9": str,
        "job": str,
        "permission1": str,
        "permission2": str,
        "permission3": str,
        "position": str,
        "renban": float,
        "school_name": str,
        "school_name_now": str,
        "school_id": float,
        "sex": str,
        "subject": str,
        "t_class": float,  # 担当クラス
        "t_class_original": str,
        "t_grade": float, # 担当学年
        "t_grade_original": str,
        "t_q1": str,
        "t_q10": str,
        "t_q11": str,
        "t_q12": str,
        "t_q13": str,
        "t_q14": str,
        "t_q15": str,
        "t_q16": str,
        "t_q17": str,
        "t_q18": str,
        "t_q19": str,
        "t_q2": str,
        "t_q20": str,
        "t_q21": str,
        "t_q22": str,
        "t_q23": str,
        "t_q24": str,
        "t_q25": str,
        "t_q26": str,
        "t_q27": str,
        "t_q28": str,
        "t_q29": str,
        "t_q3": str,
        "t_q30": str,
        "t_q31": str,
        "t_q32": str,
        "t_q33": str,
        "t_q34": str,
        "t_q35": str,
        "t_q36": str,
        "t_q37": str,
        "t_q38": str,
        "t_q39": str,
        "t_q4": str,
        "t_q40": str,
        "t_q41": str,
        "t_q42": str,
        "t_q43": str,
        "t_q44": str,
        "t_q45": str,
        "t_q46": str,
        "t_q47": str,
        "t_q48": str,
        "t_q49": str,
        "t_q5": str,
        "t_q50": str,
        "t_q51": str,
        "t_q52": str,
        "t_q53": str,
        "t_q54": str,
        "t_q55": str,
        "t_q56": str,
        "t_q57": str,
        "t_q58": str,
        "t_q59": str,
        "t_q6": str,
        "t_q60": str,
        "t_q61": float,
        "t_q62": str,
        "t_q63": str,
        "t_q64": str,
        "t_q65": str,
        "t_q66": str,
        "t_q67": str,
        "t_q68": str,
        "t_q7": str,
        "t_q8": str,
        "t_q9": str,
        "teacher_id": float,
        "time_stamp": str,
        "year": int  # このyear定義は回答年度ではなく、回答のターゲット年度
    }

    schema = Schema([
        Column("age", [CanConvertValidation(float)]),
        Column("career", [CanConvertValidation(str)]),
        Column("career_school", [CanConvertValidation(float)]),
        Column("grade1", [CanConvertValidation(str)]),
        Column("grade2", [CanConvertValidation(str)]),
        Column("grade3", [CanConvertValidation(str)]),
        Column("grade4", [CanConvertValidation(str)]),
        Column("grade5", [CanConvertValidation(str)]),
        Column("grade6", [CanConvertValidation(str)]),
        Column("grade7", [CanConvertValidation(str)]),
        Column("grade8", [CanConvertValidation(str)]),
        Column("grade9", [CanConvertValidation(str)]),
        Column("job", [CanConvertValidation(str)]),
        Column("permission1", [CanConvertValidation(str)]),
        Column("permission2", [CanConvertValidation(str)]),
        Column("permission3", [CanConvertValidation(str)]),
        Column("position", [CanConvertValidation(str)]),
        Column("renban", [CanConvertValidation(float)]),
        Column("school_name", [CanConvertValidation(str)]),
        Column("school_name_now", [CanConvertValidation(str)]),
        Column("school_id", [CanConvertValidation(float)]),
        Column("sex", [CanConvertValidation(str)]),
        Column("subject", [CanConvertValidation(str)]),
        Column("t_class", [CanConvertValidation(float)]),
        Column("t_class_original", [CanConvertValidation(str)]),
        Column("t_grade", [CanConvertValidation(float)]),
        Column("t_grade_original", [CanConvertValidation(str)]),
        Column("t_q1", [CanConvertValidation(str)]),
        Column("t_q10", [CanConvertValidation(str)]),
        Column("t_q11", [CanConvertValidation(str)]),
        Column("t_q12", [CanConvertValidation(str)]),
        Column("t_q13", [CanConvertValidation(str)]),
        Column("t_q14", [CanConvertValidation(str)]),
        Column("t_q15", [CanConvertValidation(str)]),
        Column("t_q16", [CanConvertValidation(str)]),
        Column("t_q17", [CanConvertValidation(str)]),
        Column("t_q18", [CanConvertValidation(str)]),
        Column("t_q19", [CanConvertValidation(str)]),
        Column("t_q2", [CanConvertValidation(str)]),
        Column("t_q20", [CanConvertValidation(str)]),
        Column("t_q21", [CanConvertValidation(str)]),
        Column("t_q22", [CanConvertValidation(str)]),
        Column("t_q23", [CanConvertValidation(str)]),
        Column("t_q24", [CanConvertValidation(str)]),
        Column("t_q25", [CanConvertValidation(str)]),
        Column("t_q26", [CanConvertValidation(str)]),
        Column("t_q27", [CanConvertValidation(str)]),
        Column("t_q28", [CanConvertValidation(str)]),
        Column("t_q29", [CanConvertValidation(str)]),
        Column("t_q3", [CanConvertValidation(str)]),
        Column("t_q30", [CanConvertValidation(str)]),
        Column("t_q31", [CanConvertValidation(str)]),
        Column("t_q32", [CanConvertValidation(str)]),
        Column("t_q33", [CanConvertValidation(str)]),
        Column("t_q34", [CanConvertValidation(str)]),
        Column("t_q35", [CanConvertValidation(str)]),
        Column("t_q36", [CanConvertValidation(str)]),
        Column("t_q37", [CanConvertValidation(str)]),
        Column("t_q38", [CanConvertValidation(str)]),
        Column("t_q39", [CanConvertValidation(str)]),
        Column("t_q4", [CanConvertValidation(str)]),
        Column("t_q40", [CanConvertValidation(str)]),
        Column("t_q41", [CanConvertValidation(str)]),
        Column("t_q42", [CanConvertValidation(str)]),
        Column("t_q43", [CanConvertValidation(str)]),
        Column("t_q44", [CanConvertValidation(str)]),
        Column("t_q45", [CanConvertValidation(str)]),
        Column("t_q46", [CanConvertValidation(str)]),
        Column("t_q47", [CanConvertValidation(str)]),
        Column("t_q48", [CanConvertValidation(str)]),
        Column("t_q49", [CanConvertValidation(str)]),
        Column("t_q5", [CanConvertValidation(str)]),
        Column("t_q50", [CanConvertValidation(str)]),
        Column("t_q51", [CanConvertValidation(str)]),
        Column("t_q52", [CanConvertValidation(str)]),
        Column("t_q53", [CanConvertValidation(str)]),
        Column("t_q54", [CanConvertValidation(str)]),
        Column("t_q55", [CanConvertValidation(str)]),
        Column("t_q56", [CanConvertValidation(str)]),
        Column("t_q57", [CanConvertValidation(str)]),
        Column("t_q58", [CanConvertValidation(str)]),
        Column("t_q59", [CanConvertValidation(str)]),
        Column("t_q6", [CanConvertValidation(str)]),
        Column("t_q60", [CanConvertValidation(str)]),
        Column("t_q61", [CanConvertValidation(float)]),
        Column("t_q62", [CanConvertValidation(str)]),
        Column("t_q63", [CanConvertValidation(str)]),
        Column("t_q64", [CanConvertValidation(str)]),
        Column("t_q65", [CanConvertValidation(str)]),
        Column("t_q66", [CanConvertValidation(str)]),
        Column("t_q67", [CanConvertValidation(str)]),
        Column("t_q68", [CanConvertValidation(str)]),
        Column("t_q7", [CanConvertValidation(str)]),
        Column("t_q8", [CanConvertValidation(str)]),
        Column("t_q9", [CanConvertValidation(str)]),
        Column("teacher_id", [CanConvertValidation(float)]),
        Column("time_stamp", [CanConvertValidation(str)]),
        Column("year", [CanConvertValidation(int)])
    ])
    convert_list = column_type
