import 'package:json_annotation/json_annotation.dart';

part 'report_card.g.dart';


@JsonSerializable()
class ReportCard extends Object {

  @JsonKey(name: 'TotalCount')
  int totalCount;

  @JsonKey(name: 'Head')
  List<String> head;

  @JsonKey(name: 'Data')
  List<Data> data;

  ReportCard(this.totalCount,this.head,this.data,);

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

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

}


@JsonSerializable()
class Data extends Object {

  @JsonKey(name: 'SubjectDetails')
  List<SubjectDetails> subjectDetails;

  @JsonKey(name: 'ExamStudentId')
  String examStudentId;

  @JsonKey(name: 'ExamNo')
  String examNo;

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

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

  @JsonKey(name: 'TotalScore')
  double totalScore;

  @JsonKey(name: 'TotalRanking')
  int totalRanking;

  @JsonKey(name: 'TotalRankingChange')
  String totalRankingChange;

  @JsonKey(name: 'TotalGradeRanking')
  int totalGradeRanking;

  @JsonKey(name: 'TotalClassRanking')
  int totalClassRanking;

  Data(this.subjectDetails,this.examStudentId,this.examNo,this.name,this.className,this.totalScore,this.totalRanking,this.totalRankingChange,this.totalGradeRanking,this.totalClassRanking,);

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

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

}


@JsonSerializable()
class SubjectDetails extends Object {

  @JsonKey(name: 'Score')
  String score;

  @JsonKey(name: 'ExamSubjectId')
  int examSubjectId;

  @JsonKey(name: 'GradeRanking')
  String gradeRanking;

  @JsonKey(name: 'ClassRanking')
  String classRanking;

  SubjectDetails(this.score,this.examSubjectId,this.gradeRanking,this.classRanking,);

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

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

}


