From ee9db9865eca51b34b799df9cb52a29cb981f233 Mon Sep 17 00:00:00 2001 From: vextrixes <113197359+vextrixes@users.noreply.github.com> Date: Sun, 25 Oct 2026 14:46:36 +0100 Subject: [PATCH] added what if --- src/lib.rs | 2 ++ src/what_if.rs | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ tracker.md | 2 +- 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 src/what_if.rs diff --git a/src/lib.rs b/src/lib.rs index ebd3012..64f1c6c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -12,6 +12,7 @@ mod subjects; mod substitutions; mod themes; mod user; +mod what_if; pub use absence::{Absence, AbsenceListItem, SubjectAbsence}; pub use api_info::ApiInfo; @@ -27,3 +28,4 @@ pub use subjects::{Subject, Subjects}; pub use substitutions::{SubstitutionChange, Substitutions}; pub use themes::{Theme, Themes}; pub use user::{Module, User}; +pub use what_if::{WhatIfResult, WhatIfResultMark, WhatIfStartingEnviromentMark}; diff --git a/src/what_if.rs b/src/what_if.rs new file mode 100644 index 0000000..5b9a9d3 --- /dev/null +++ b/src/what_if.rs @@ -0,0 +1,49 @@ +use chrono::{DateTime, Utc}; +use serde::{Deserialize, Serialize}; + +use crate::StdType; + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct WhatIfStartingEnviromentMark { + id: String, + mark_text: String, + weight: u8, + max_points: u16, + subject_id: String, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct WhatIfResult { + pub marks: Vec, + pub subject: StdType, + pub average_text: String, + pub temporary_mark: String, + pub subject_note: String, + pub temporary_mark_note: String, + pub points_only: bool, + pub mark_prediction_enabled: bool, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct WhatIfResultMark { + pub mark_date: DateTime, + pub edit_date: DateTime, + pub caption: String, + pub theme: String, + pub mark_text: String, + pub teacher_id: String, + pub r#type: String, + pub type_note: String, + pub weight: u8, + pub subject_id: String, + pub is_new: bool, + pub is_points: bool, + pub calculated_mark_text: String, + //ClassRankText: Option unknown, + pub id: String, + pub points_text: String, + pub max_points: u16, +} diff --git a/tracker.md b/tracker.md index 709fd70..f83ea3b 100644 --- a/tracker.md +++ b/tracker.md @@ -17,4 +17,4 @@ - [x] user - [x] user SettingModules - [ ] web -- [ ] what if \ No newline at end of file +- [x] what if \ No newline at end of file