import 'package:json_annotation/json_annotation.dart';
import 'package:uuid/uuid.dart';

part 'job_report_join_class.g.dart';

@JsonSerializable()
class JobReportJoinClass extends Object {
  @JsonKey(name: 'uniqueId')
  String? uniqueId;

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

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

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

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

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

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

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

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

  JobReportJoinClass(this.schoolId, this.schoolName, this.gradeId, this.gradeName, this.graduationYear, this.className,
      this.toBeSubmitCount, this.submitCount,
      [this.uniqueId]) {
    if (uniqueId == null) uniqueId = Uuid().v1();
  }

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

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