import 'package:json_annotation/json_annotation.dart';

part 'job_report_knowledge_model.g.dart';

@JsonSerializable()
class JobReportKnowledgeModel extends Object {
  @JsonKey(name: 'schoolId')
  int schoolId;

  @JsonKey(name: 'schoolName')
  String schoolName;

  @JsonKey(name: 'gradeId')
  int gradeId;

  @JsonKey(name: 'gradeName')
  String gradeName;

  @JsonKey(name: 'className')
  String className;

  @JsonKey(name: 'rate')
  double rate;

  @JsonKey(name: 'ratio')
  String ratio;

  @JsonKey(name: 'noAnswerCount')
  int noAnswerCount;

  @JsonKey(name: 'studentReports')
  List<StudentReports> studentReports;

  JobReportKnowledgeModel(
    this.schoolId,
    this.schoolName,
    this.gradeId,
    this.gradeName,
    this.className,
    this.rate,
    this.ratio,
    this.noAnswerCount,
    this.studentReports,
  );

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

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

@JsonSerializable()
class StudentReports extends Object {
  @JsonKey(name: 'studentName')
  String studentName;

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

  StudentReports(
    this.studentName,
    this.pass,
  );

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

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