import 'package:json_annotation/json_annotation.dart';

part 'exam_records_all.g.dart';

@JsonSerializable()
class ExamRecordsAll extends Object {
  @JsonKey(name: 'Type')
  Type type;

  @JsonKey(name: 'Grade')
  Grade grade;

  @JsonKey(name: 'Subject')
  Subject subject;

  @JsonKey(name: 'TimePeriod')
  TimePeriod timePeriod;

  ExamRecordsAll(
    this.type,
    this.grade,
    this.subject,
    this.timePeriod,
  );

  factory ExamRecordsAll.fromJson(Map<String, dynamic> srcJson) =>
      _$ExamRecordsAllFromJson(srcJson);

  Map<String, dynamic> toJson() => _$ExamRecordsAllToJson(this);
}

@JsonSerializable()
class Type extends Object {
  @JsonKey(name: 'IsDisabled')
  bool isDisabled;

  @JsonKey(name: 'DefaultValue')
  String defaultValue;

  @JsonKey(name: 'ComboData')
  List<ComboData> comboData;

  Type(
    this.isDisabled,
    this.defaultValue,
    this.comboData,
  );

  factory Type.fromJson(Map<String, dynamic> srcJson) =>
      _$TypeFromJson(srcJson);

  Map<String, dynamic> toJson() => _$TypeToJson(this);
}

@JsonSerializable()
class ComboData extends Object {
  @JsonKey(name: 'Value')
  dynamic value;

  @JsonKey(name: 'Text')
  String text;

  @JsonKey(name: 'isCheck')
  bool isCheck;

  ComboData(this.value, this.text, {this.isCheck = false});

  factory ComboData.fromJson(Map<String, dynamic> srcJson) =>
      _$ComboDataFromJson(srcJson);

  Map<String, dynamic> toJson() => _$ComboDataToJson(this);
}

@JsonSerializable()
class Grade extends Object {
  @JsonKey(name: 'IsDisabled')
  bool isDisabled;

  @JsonKey(name: 'DefaultValue')
  String defaultValue;

  @JsonKey(name: 'ComboData')
  List<ComboData> comboData;

  Grade(
    this.isDisabled,
    this.defaultValue,
    this.comboData,
  );

  factory Grade.fromJson(Map<String, dynamic> srcJson) =>
      _$GradeFromJson(srcJson);

  Map<String, dynamic> toJson() => _$GradeToJson(this);
}

@JsonSerializable()
class Subject extends Object {
  @JsonKey(name: 'IsDisabled')
  bool isDisabled;

  @JsonKey(name: 'DefaultValue')
  String defaultValue;

  @JsonKey(name: 'ComboData')
  List<ComboData> comboData;

  Subject(
    this.isDisabled,
    this.defaultValue,
    this.comboData,
  );

  factory Subject.fromJson(Map<String, dynamic> srcJson) =>
      _$SubjectFromJson(srcJson);

  Map<String, dynamic> toJson() => _$SubjectToJson(this);
}

@JsonSerializable()
class TimePeriod extends Object {
  @JsonKey(name: 'IsDisabled')
  bool isDisabled;

  @JsonKey(name: 'DefaultValue')
  String defaultValue;

  @JsonKey(name: 'ComboData')
  List<ComboData> comboData;

  TimePeriod(
    this.isDisabled,
    this.defaultValue,
    this.comboData,
  );

  factory TimePeriod.fromJson(Map<String, dynamic> srcJson) =>
      _$TimePeriodFromJson(srcJson);

  Map<String, dynamic> toJson() => _$TimePeriodToJson(this);
}
