added lesson

This commit is contained in:
vextrixes committed 2026-10-25 15:20:21 +01:00
1 parent 2503986cd2
commit 0c3e55c16b
3 files changed
+77 -1

No files matched your search

+70
View File
@@ -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<String>,
pub absences_groups: Vec<AbsencesGroup>,
pub hour_id: u8,
pub start: u16,
pub duration: u8,
pub hours: Vec<LessonHour>,
// "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<LessonStudentAbsence>,
pub absent_type_options: Vec<AbsentTypeOption>,
// "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,
}
+5
View File
@@ -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;