From 5335f56c3fb8d47a413f1fa17fbf677dca2a976a Mon Sep 17 00:00:00 2001 From: Faucon <49079695+FauconSpartiate@users.noreply.github.com> Date: Sat, 6 Apr 2024 01:31:04 +0200 Subject: [PATCH] Reorder serialized data for better readability --- lib/calculations/subject.dart | 6 +++--- lib/calculations/term.dart | 2 +- lib/calculations/test.dart | 2 +- lib/calculations/year.dart | 12 ++++++------ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/calculations/subject.dart b/lib/calculations/subject.dart index d08ea7be..95e17caf 100644 --- a/lib/calculations/subject.dart +++ b/lib/calculations/subject.dart @@ -115,12 +115,12 @@ class Subject extends CalculationObject { } Map toJson() => { - "tests": tests, - "children": children, "name": name, "coefficient": weight, + "speakingWeight": speakingWeight, "bonus": bonus, "type": isGroup, - "speakingWeight": speakingWeight, + "children": children.toList(), + "tests": tests, }; } diff --git a/lib/calculations/term.dart b/lib/calculations/term.dart index a2fe7f3b..80e6e397 100644 --- a/lib/calculations/term.dart +++ b/lib/calculations/term.dart @@ -85,8 +85,8 @@ class Term extends CalculationObject { } Map toJson() => { - "subjects": subjects, "coefficient": weight, "isExam": isExam, + "subjects": subjects.toList(), }; } diff --git a/lib/calculations/test.dart b/lib/calculations/test.dart index e4d58240..a0428712 100644 --- a/lib/calculations/test.dart +++ b/lib/calculations/test.dart @@ -68,9 +68,9 @@ class Test extends CalculationObject { } Map toJson() => { + "name": name, "grade1": numerator, "grade2": denominator, - "name": name, "coefficient": weight, "isSpeaking": isSpeaking, "timestamp": timestamp, diff --git a/lib/calculations/year.dart b/lib/calculations/year.dart index 80e879fd..31004edc 100644 --- a/lib/calculations/year.dart +++ b/lib/calculations/year.dart @@ -240,17 +240,17 @@ class Year extends CalculationObject { } Map toJson() => { - "terms": terms, - "term_template": termTemplate, "name": name, + "term_count": termCount, + "max_grade": maxGrade, + "rounding_mode": roundingMode, + "round_to": roundTo, "validated_school_system": validatedSchoolSystem, "validated_lux_system": validatedLuxSystem, "validated_year": validatedYear, "validated_section": validatedSection, "validated_variant": validatedVariant, - "term_count": termCount, - "max_grade": maxGrade, - "rounding_mode": roundingMode, - "round_to": roundTo, + "terms": terms, + "term_template": termTemplate.toList(), }; }