From 0c3e55c16bac664f400aa38374986e2ce9fa3ad6 Mon Sep 17 00:00:00 2001 From: vextrixes <113197359+vextrixes@users.noreply.github.com> Date: Sun, 25 Oct 2026 15:20:21 +0100 Subject: [PATCH] added lesson --- src/lesson.rs | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++ src/lib.rs | 5 ++++ tracker.md | 3 ++- 3 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 src/lesson.rs diff --git a/src/lesson.rs b/src/lesson.rs new file mode 100644 index 0000000..d810187 --- /dev/null +++ b/src/lesson.rs @@ -0,0 +1,70 @@ +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct LessonAbsence { + pub lesson_id: String, + //ClassBookRecordId: unknown probably Option, + pub absences_groups: Vec, + pub hour_id: u8, + pub start: u16, + pub duration: u8, + pub hours: Vec, + // "SchoolEvents": [] +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct LessonHour { + pub id: u8, + pub caption: String, + pub begin_time: String, + pub end_time: String, + pub start: u16, + pub duration: u8, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct AbsencesGroup { + pub students_absences: Vec, + pub absent_type_options: Vec, + // "Group": {"ClassId": "1A", "Id": "AA", "Abbrev": "1.A", "Name": "1.A"} +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct LessonStudentAbsence { + pub student: LessonStudentInfo, + // "Absences": [], unknown + pub student_released: bool, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct LessonStudentInfo { + pub is_adult: bool, + pub registration_number: u32, + pub id: String, + pub abbrev: String, + pub name: String, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct AbsentTypeOption { + pub absent_type: String, + pub absent_kind_enabled: bool, + pub absent_kind_required: bool, + pub absent_note_enabled: bool, + // AbsentKinds: [], unknown + pub next_absent_type: String, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct LessonLastTheme { + pub lesson_id: String, + pub last_theme: String, + pub next_label: String, +} diff --git a/src/lib.rs b/src/lib.rs index aee0de6..2d9e545 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,6 +5,7 @@ mod error; mod events; mod gdpr; mod homework; +mod lesson; mod marks; mod payments; mod stdtype; @@ -21,6 +22,10 @@ pub use error::Error; pub use events::{Event, Events, Time}; pub use gdpr::{GDPRcommissioner, GDPRcommissioners}; pub use homework::{Homework, HomeworkListItem}; +pub use lesson::{ + AbsencesGroup, AbsentTypeOption, LessonAbsence, LessonHour, LessonLastTheme, + LessonStudentAbsence, LessonStudentInfo, +}; pub use marks::{Mark, Marks, SubjectMarks}; pub use payments::{AddBalance, ClassfundPayments, ClassfundSummary, Payment, PaymentMonthlyData}; pub use stdtype::StdType; diff --git a/tracker.md b/tracker.md index f83ea3b..0d4a53b 100644 --- a/tracker.md +++ b/tracker.md @@ -6,7 +6,8 @@ - [x] GDPR - [x] Homework - [ ] komens -- [ ] lesson +- [x] lesson +- [ ] lesson studentsTimetable - [x] marks - [ ] measures - [x] payments