From 8e25cd2391b3834b732fd86d5bba3f5e945ee8fe Mon Sep 17 00:00:00 2001 From: hunteraraujo Date: Thu, 14 Sep 2023 20:01:05 -0700 Subject: [PATCH] Add ReportRequestBody model with JSON serialization This commit introduces a new Dart class, `ReportRequestBody`, which represents the request body for generating reports in the `BenchmarkService`. The class includes a `toJson` method for easy serialization to JSON format. - `category`: Specifies the category of the report (e.g., "coding"). - `tests`: A list of tests to be included in the report. --- .../benchmark_service/report_request_body.dart | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 frontend/lib/models/benchmark_service/report_request_body.dart diff --git a/frontend/lib/models/benchmark_service/report_request_body.dart b/frontend/lib/models/benchmark_service/report_request_body.dart new file mode 100644 index 00000000..3cda0995 --- /dev/null +++ b/frontend/lib/models/benchmark_service/report_request_body.dart @@ -0,0 +1,13 @@ +class ReportRequestBody { + final String category; + final List tests; + + ReportRequestBody({required this.category, required this.tests}); + + Map toJson() { + return { + 'category': category, + 'tests': tests, + }; + } +}