large changes

This commit is contained in:
vextrixes committed 2026-10-27 21:39:14 +01:00
1 parent 092fd94abf
commit 9560daf027
21 files changed
+387 -497

No files matched your search

+6 -6
View File
@@ -1,18 +1,18 @@
use chrono::Utc;
use chrono::FixedOffset;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Absence {
pub struct StudentAbsenceOverviewResponse {
pub percentage_threshold: f64, //TODO: cutom type (u8)
pub absences: Vec<AbsenceListItem>,
pub absences_per_subject: Vec<SubjectAbsence>,
pub absences: Vec<AbsenceDay>,
pub absences_per_subject: Option<Vec<SubjectAbsence>>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct AbsenceListItem {
pub date: chrono::DateTime<Utc>,
pub struct AbsenceDay {
pub date: chrono::DateTime<FixedOffset>,
pub unsolved: u16,
pub ok: u16,
pub missed: u16,
+1 -1
View File
@@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Attachment {
pub struct AttachmentInfo {
pub id: String,
pub name: String,
pub r#type: String,
+17 -15
View File
@@ -1,5 +1,5 @@
use crate::StdType;
use chrono::{DateTime, Utc};
use crate::{Room, RoomSet, SchoolClass, SchoolClassSet, StdType, Student, Teacher, TeacherSet};
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -14,23 +14,25 @@ pub struct Event {
pub id: String,
pub title: String,
pub description: String,
pub times: Vec<Time>,
pub event_type: StdType,
pub classes: Vec<StdType>,
//class_sets: unknown
pub teachers: Vec<StdType>,
// teacher_sets: Vec<StdType>?
pub rooms: Vec<StdType>,
//room_sets: unknown
pub students: Vec<StdType>,
pub event_type: EventType,
pub times: Vec<EventTime>,
pub classes: Vec<SchoolClass>,
pub class_sets: Vec<SchoolClassSet>,
pub teachers: Vec<Teacher>,
pub teacher_sets: Vec<TeacherSet>,
pub rooms: Vec<Room>,
pub room_sets: Vec<RoomSet>,
pub students: Vec<Student>,
pub note: Option<String>,
pub date_changed: DateTime<Utc>,
pub date_changed: DateTime<FixedOffset>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Time {
pub struct EventTime {
pub whole_day: bool,
pub start_time: DateTime<Utc>,
pub end_time: DateTime<Utc>,
pub start_time: Option<DateTime<FixedOffset>>,
pub end_time: Option<DateTime<FixedOffset>>,
}
pub type EventType = StdType;
+33 -5
View File
@@ -1,19 +1,47 @@
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct GDPRcommissioners {
pub commissioners: Vec<GDPRcommissioner>,
pub struct GdprCommissioners {
pub commissioners: Vec<GdprCommissioner>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct GDPRcommissioner {
pub struct GdprCommissioner {
pub id: String,
pub name: String,
pub mobile: String,
pub phone: String,
pub email: String,
pub web: String,
pub data_box: String,
pub web: Option<String>,
pub data_box: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct GdprConsent {
pub id: i64,
pub person_type: String, //UserType Enum "controller","parents","student","teacher"
pub person_id: String,
pub created: DateTime<FixedOffset>,
pub validity: String, //enum "endOfStudy","endOfStudyPlusYears","toAppeal","unknown", "validity"
pub valid_from: DateTime<FixedOffset>,
pub state: String, //Enum ConsentState "agreed", "cancelled", "disagreed", "expired", "newConsent", "revokeRequested", "revoked", "unknown"
pub title: Option<String>,
pub personal_data: Option<String>,
pub usage_purpose: Option<String>,
pub valid_to: Option<DateTime<FixedOffset>>,
pub valid_years: Option<i64>,
pub rights: Option<GdprConsentRights>,
pub body: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct GdprConsentRights {
pub can_agree: bool,
pub can_disagree: bool,
pub can_revoke_request: bool,
}
+13 -13
View File
@@ -1,11 +1,11 @@
use chrono::{DateTime, Utc};
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
use crate::{Attachment, StdType};
use crate::{AttachmentInfo, StdType};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Homework {
pub struct HomeworkList {
pub homeworks: Vec<HomeworkListItem>,
}
@@ -14,18 +14,18 @@ pub struct Homework {
pub struct HomeworkListItem {
#[serde(rename = "ID")]
pub id: String,
pub date_start: DateTime<Utc>,
pub date_end: DateTime<Utc>,
pub date_start: DateTime<FixedOffset>,
pub date_end: DateTime<FixedOffset>,
pub content: String,
pub notice: String,
pub notice: Option<String>,
pub done: bool,
pub closed: bool,
pub electronic: bool,
pub hour: u8,
pub class: StdType,
pub group: StdType,
pub subject: StdType,
pub teacher: StdType,
pub attachments: Vec<Attachment>,
pub electronic: bool, //check existance
pub hour: i64,
pub class: StdType, //HomeworkSchoolClass
pub group: StdType, //HomeworkSchoolGroup
pub subject: StdType, //HomeworkSchoolSubject
pub teacher: StdType, //HomeworkTeacher
pub attachments: Vec<AttachmentInfo>,
pub finished: bool,
}
-73
View File
@@ -1,73 +0,0 @@
use serde::{Deserialize, Serialize};
use crate::{StdClassGroup, StdType};
#[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>,
pub group: StdClassGroup,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct LessonStudentAbsence {
pub student: LessonStudentInfo,
// "Absences": [], unknown
pub student_released: bool,
pub school_event_ids: Option<Vec<String>>
}
#[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,
pub absent_kinds: Vec<StdType>,
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,
}
+28 -26
View File
@@ -1,42 +1,44 @@
mod absence;
mod api_info;
mod attachment;
//campaign
mod error;
mod events;
mod gdpr;
mod homework;
mod lesson;
//komens
mod homework; //TDOS
//marking
mod marks;
mod measures;
mod payments;
mod semester;
mod stdtype;
mod subjects;
mod substitutions;
mod themes;
mod teaching;
mod timetable;
mod user;
mod webmodules;
mod what_if;
mod user; //TODOS
//webmodules
//predictor
pub use absence::{Absence, AbsenceListItem, SubjectAbsence};
pub use absence::{AbsenceDay, StudentAbsenceOverviewResponse, SubjectAbsence};
pub use api_info::ApiInfo;
pub use attachment::Attachment;
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 attachment::AttachmentInfo;
pub use error::{Error, ModelState, StringArray};
pub use events::{Event, EventTime, EventType, Events};
pub use gdpr::{GdprCommissioner, GdprCommissioners, GdprConsent, GdprConsentRights};
pub use homework::{HomeworkList, HomeworkListItem};
pub use marks::{Mark, Marks, SubjectMarks};
pub use payments::*;
pub use semester::{
CertificateTerm, CertificateTerms, FinalMark, PedagogicalMeasure, PedagogicalMeasures,
};
pub use stdtype::*;
pub use stdtype::{
Room, RoomSet, SchoolClass, SchoolClassSet, StdClassGroup, StdType, StdTypeNullable, Student,
Teacher, TeacherSet, TimetableStudent,
};
pub use marks::{Mark, Marks, SubjectMarks, MarksFinal, CertificateTerm, FinalMark};
pub use measures::{Measures, PedagogicalMeasure};
pub use payments::{AddBalance, ClassfundPayments, ClassfundSummary, Payment, PaymentMonthlyData};
pub use stdtype::{StdClassGroup, StdType};
pub use subjects::{Subject, Subjects};
pub use substitutions::{SubstitutionChange, Substitutions};
pub use themes::{Theme, Themes};
pub use timetable::{Timetable, TimetableAtom, TimetableChange, TimetableDay, TimetableHour};
pub use user::{Module, User};
pub use webmodules::{Webmodule, Webmodules};
pub use what_if::{WhatIfResult, WhatIfResultMark, WhatIfStartingEnvironmentMark};
pub use substitutions::{ChangeLessonInfo, SubstitutionChange, Substitutions};
pub use teaching::{Lesson, Teaching, TeachingTheme};
pub use timetable::*;
pub use user::{Module, UserInfo, UserInfoStudent};
+24 -57
View File
@@ -1,4 +1,4 @@
use chrono::{DateTime, Utc};
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
use crate::StdType;
@@ -13,72 +13,39 @@ pub struct Marks {
#[serde(rename_all = "PascalCase")]
pub struct SubjectMarks {
pub marks: Vec<Mark>,
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,
pub subject: StdType,
pub average_text: Option<String>,
pub temporary_mark: Option<String>,
pub subject_note: Option<String>,
pub temporary_mark_note: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Mark {
pub mark_date: DateTime<Utc>,
pub edit_date: DateTime<Utc>,
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 mark_date: DateTime<FixedOffset>,
pub edit_date: DateTime<FixedOffset>,
pub is_invalid_date: Option<bool>,
pub teacher_id: Option<String>,
pub subject_id: String,
pub is_new: bool,
pub is_points: bool,
pub calculated_mark_text: String,
//ClassRankText:null,
pub id: String,
pub points_text: String,
pub max_points: u16,
pub confirmed_when: Option<DateTime<Utc>>,
pub max_points: i64,
pub is_predictor_mark: bool,
pub mark_confirmation_state: String, // Option<MarkConfirmationStatus> enum "Confirmed", "DoesNotRequireConfirmation","Unconfirmed", "UnconfirmedAfterChange"
pub caption: Option<String>,
pub theme: Option<String>,
pub mark_text: Option<String>,
pub r#type: Option<String>,
pub type_note: Option<String>,
pub weight: Option<i64>,
pub class_rank_text: Option<String>,
pub id: Option<String>,
pub points_text: Option<String>,
pub confirmed_when: Option<DateTime<FixedOffset>>,
pub confirmed_by: Option<String>,
pub mark_confirmation_state: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct MarksFinal {
pub certificate_terms: Vec<CertificateTerm>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct CertificateTerm {
pub final_marks: Vec<FinalMark>,
pub subjects: StdType,
pub grade_name: String,
pub grade: u8,
pub year_in_school: u8,
pub school_year: String,
pub semester: String,
pub semester_name: String,
pub repeated: bool,
pub closed: bool,
pub achievement_text: String,
pub marks_average: f64,
pub absent_hours: u16,
pub not_excused_hours: u16,
pub certificate_date: DateTime<Utc>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct FinalMark {
pub mark_date: DateTime<Utc>,
pub edit_date: DateTime<Utc>,
pub mark_text: String,
pub subject_id: String,
pub id: String,
pub verbal_evaluation: Option<String>,
}
-19
View File
@@ -1,19 +0,0 @@
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Measures {
pub pedagogical_measures: Vec<PedagogicalMeasure>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct PedagogicalMeasure {
pub school_year: String,
pub semester: String,
pub type_label: String,
pub date: DateTime<Utc>,
pub type_id: String,
pub text: String,
}
+19 -20
View File
@@ -12,12 +12,12 @@ pub struct ClassfundSummary {
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassFundPaymentInfo {
instructions: Option<String>,
bank_account: Option<String>,
variable_symbol: Option<i64>,
specific_symbol: i64,
amount: f64,
message: Option<String>,
instructions: Option<String>,
bank_account: Option<String>,
variable_symbol: Option<i64>,
specific_symbol: i64,
amount: f64,
message: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -33,7 +33,7 @@ pub struct ClassFundRecord {
pub struct ClassFundSummary {
student_name_with_class: Option<String>,
balance: f64,
spent: f64
spent: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -41,12 +41,12 @@ pub struct ClassFundSummary {
pub struct ClassFundTeacherDocumentDetailStudent {
full_name_with_class: Option<String>,
amount: f64,
status: Option<String> //Option<PaymentsTeacherStudentStatus>, enum "Active" "Canceled"
status: Option<String>, //Option<PaymentsTeacherStudentStatus>, enum "Active" "Canceled"
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassFundTeacherDocumentDetail{
pub struct ClassFundTeacherDocumentDetail {
title: Option<String>,
amount: f64,
date: DateTime<FixedOffset>,
@@ -56,7 +56,7 @@ pub struct ClassFundTeacherDocumentDetail{
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassFundTeacherDocumentsItem{
pub struct ClassFundTeacherDocumentsItem {
id: i64,
title: Option<String>,
date: DateTime<FixedOffset>,
@@ -67,7 +67,7 @@ pub struct ClassFundTeacherDocumentsItem{
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassFundTeacherDocumentsMonthly{
pub struct ClassFundTeacherDocumentsMonthly {
date: DateTime<FixedOffset>,
monthly_balance: f64,
items: Vec<ClassFundTeacherDocumentsItem>,
@@ -75,29 +75,28 @@ pub struct ClassFundTeacherDocumentsMonthly{
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassFundTeacherStudentsItem{
pub struct ClassFundTeacherStudentsItem {
variable_symbol: i64,
name: Option<String>,
registration_number: Option<i64>,
balance: f64,
status: String//PaymentsTeacherStudentStatus, enum "Active" "Canceled
status: String, //PaymentsTeacherStudentStatus, enum "Active" "Canceled
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassFundTeacherSummaryClass{
pub struct ClassFundTeacherSummaryClass {
abbrev: Option<String>,
class_id: Option<String>,
balance: f64,
amount_to_pay: f64,
debtors: i64,
spent: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassFundTeacherSummary{
pub struct ClassFundTeacherSummary {
teacher_name: Option<String>,
allowed_classes: Option<Vec<ClassFundTeacherSummaryClass>>,
}
@@ -106,7 +105,7 @@ pub struct ClassFundTeacherSummary{
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RegularPaymentDetail{
pub struct RegularPaymentDetail {
title: Option<String>,
due_date: DateTime<FixedOffset>,
amount: f64,
@@ -120,7 +119,7 @@ pub struct RegularPaymentDetail{
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RegularPayment{
pub struct RegularPayment {
payment_id: i64,
title: Option<String>,
due_date: DateTime<FixedOffset>,
@@ -131,7 +130,7 @@ pub struct RegularPayment{
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RegularPaymentsSummary{
pub struct RegularPaymentsSummary {
pub balance: f64,
pub paid: f64,
pub amount_scheduled: f64,
@@ -215,4 +214,4 @@ pub struct RegularPrescription {
pub state: String, //PaymentsTeacherStudentStatus, enum "Active" "Canceled"
pub due_date_max: Option<DateTime<FixedOffset>>,
pub students_count: i64,
}
}
+20 -2
View File
@@ -1,7 +1,7 @@
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
use crate::{StdTypeNullable};
use crate::StdTypeNullable;
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
@@ -27,7 +27,6 @@ pub struct CertificateTerm {
pub not_excused_hours: Option<i64>,
pub marks_average: Option<f64>,
pub certificate_date: Option<DateTime<FixedOffset>>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -39,3 +38,22 @@ pub struct FinalMark {
pub subject_id: String,
pub id: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct PedagogicalMeasure {
pub pedagogical_measures: Vec<PedagogicalMeasure>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct PedagogicalMeasures {
pub school_year: String,
pub semester: String,
pub type_label: String,
pub date: DateTime<FixedOffset>,
pub type_id: String,
pub text: String,
pub actual_grade: Option<i64>,
pub actual_grade_name: Option<String>,
}
+17 -59
View File
@@ -16,68 +16,26 @@ pub struct StdTypeNullable {
pub name: Option<String>,
}
pub type SchoolClass = StdType;
pub type StdClassGroup = StdType;
pub type SchoolClassSet = StdType;
pub type Teacher = StdType;
pub type TeacherSet = StdType;
pub type Room = StdType;
pub type RoomSet = StdType;
pub type Student = StdType;
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct SchoolClass {
pub struct TimetableStudent {
pub id: String,
pub abbrev: String,
pub abbrev: Option<String>,
pub name: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct StdClassGroup {
pub class_id: String,
pub id: String,
pub abbrev: String,
pub name: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct SchoolClassSet {
pub id: String,
pub abbrev: String,
pub name: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Teacher {
pub id: String,
pub abbrev: String,
pub name: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct TeacherSet{
pub id: String,
pub abbrev: String,
pub name: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Room{
pub id: String,
pub abbrev: String,
pub name: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RoomSet{
pub id: String,
pub abbrev: String,
pub name: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Student{
pub id: String,
pub abbrev: String,
pub name: String,
}
+5 -5
View File
@@ -15,9 +15,9 @@ pub struct Subject {
pub teacher_id: String,
pub teacher_name: String,
pub teacher_abbrev: String,
pub teacher_email: String,
pub teacher_web: String,
// TeacherSchoolPhone:option<>,
// TeacherHomePhone:option<>,
// TeacherMobilePhone:option<>
pub teacher_email: Option<String>,
pub teacher_web: Option<String>,
pub teacher_school_phone: Option<String>,
pub teacher_home_phone: Option<String>,
pub teacher_mobile_phone: Option<String>,
}
+21 -8
View File
@@ -1,23 +1,36 @@
use chrono::{DateTime, Utc};
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
use crate::Subject;
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Substitutions {
pub from: DateTime<Utc>,
pub to: DateTime<Utc>,
pub from: DateTime<FixedOffset>,
pub to: DateTime<FixedOffset>,
pub changes: Vec<SubstitutionChange>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct SubstitutionChange {
pub change_subject: Option<String>, //Unknown if string is the right type
pub day: DateTime<Utc>,
pub change_subject: Option<Subject>,
pub day: DateTime<FixedOffset>,
pub hours: String,
pub change_type: String,
pub change_type: String, //enum "Absence", "Added", "Canceled", "NoChange", "Removed", "RoomChanged", "Substitution"
pub description: String,
pub time: String,
pub type_abbrev: Option<String>, //Unknown if string is the right type,
pub type_name: Option<String>, //Unknown if string is the right type
pub change_lesson_info: Option<ChangeLessonInfo>,
pub change_display_type: Option<String>, //enum "OriginalTeacher", "SubstituteTeacher"
pub atom_type: Option<String>, //enum "Hour","Pause", "TimeBlock"
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ChangeLessonInfo {
class_abbrev: Option<String>,
group_abbrev: Option<String>,
is_class_group: Option<bool>,
subject_abbrev: Option<String>,
room_abbrev: Option<String>,
}
+39
View File
@@ -0,0 +1,39 @@
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
use crate::Subject;
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Teaching {
pub subject: Subject,
pub themes: Vec<TeachingTheme>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct TeachingTheme {
pub date: DateTime<FixedOffset>,
pub theme: String,
pub note: String,
pub lesson_label: String,
pub hour_caption: Option<String>,
pub start: Option<u16>,
pub duration: Option<u16>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Lesson {
pub subject_id: String,
pub subject_name: String,
pub subject_abbrev: String,
pub teacher_id: String,
pub teacher_name: String,
pub teacher_abbrev: String,
pub teacher_email: Option<String>,
pub teacher_web: Option<String>,
pub teacher_school_phone: Option<String>,
pub teacher_home_phone: Option<String>,
pub teacher_mobile_phone: Option<String>,
}
-20
View File
@@ -1,20 +0,0 @@
use crate::StdType;
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Themes {
pub subject: StdType,
pub themes: Vec<Theme>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Theme {
pub date: DateTime<Utc>,
pub theme: String,
pub note: String,
pub hour_caption: String,
pub lesson_label: String,
}
+110 -43
View File
@@ -1,63 +1,130 @@
use chrono::{DateTime, Utc};
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
use crate::{StdClassGroup, StdType};
use crate::{Room, StdType, Student, Teacher};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Timetable {
pub hours: Vec<TimetableHour>,
pub days: Vec<TimetableDay>,
pub hours: Vec<Hour>,
pub days: Vec<Day>,
pub classes: Vec<StdType>,
pub groups: Vec<StdClassGroup>,
pub groups: Vec<Group>,
pub subjects: Vec<StdType>,
pub teachers: Vec<StdType>,
pub rooms: Vec<StdType>,
pub rooms: Vec<Room>,
pub teachers: Vec<Teacher>,
pub cycles: Vec<StdType>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct TimetableHour {
pub id: u8,
pub caption: String,
pub begin_time: String,
pub end_time: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct TimetableDay {
pub atoms: Vec<TimetableAtom>,
pub day_of_week: u8,
pub date: DateTime<Utc>,
pub day_description: String,
pub day_type: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct TimetableAtom {
pub hour_id: u8,
pub group_ids: Vec<String>,
pub subject_id: Option<String>,
pub teacher_id: Option<String>,
pub room_id: Option<String>,
pub cycle_ids: Vec<String>,
pub change: Option<TimetableChange>,
pub homework_ids: Vec<String>,
pub theme: Option<String>,
pub students: Vec<Student>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct TimetableChange {
pub change_subject: Option<String>,
pub day: DateTime<Utc>,
pub day: DateTime<FixedOffset>,
pub hours: String,
pub change_type: String,
pub changetype: String, //enum "Absence", "Added", "Canceled","NoChange", "Removed", "RoomChanged", "Substitution"
pub description: String,
pub time: String,
pub change_subject: Option<StdType>,
pub type_abbrev: Option<String>,
pub type_name: Option<String>,
pub atom_type: Option<String>, // enum "Hour", "Pause", "TimeBlock"
pub start: Option<i64>,
pub duration: Option<i64>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct PlannedClassification {
pub description: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct HomeworkInfo {
pub id: String,
pub text: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Group {
pub class_id: Option<String>,
pub id: String,
pub abbre: Option<String>,
pub name: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Day {
pub atoms: Vec<Atom>,
pub day_of_week: i64,
pub date: DateTime<FixedOffset>,
pub day_description: String,
pub day_type: DateTime<FixedOffset>,
pub assistance_atoms: Vec<AssistanceAtom>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Atom {
pub hour_id: i64,
pub group_ids: Vec<String>,
pub subject_id: Option<String>,
pub teacher_id: Option<String>,
pub room_id: Option<String>,
pub is_last_room_lesson: bool,
pub cycle_ids: Vec<String>,
pub homeworks: Vec<HomeworkInfo>,
pub homework_ids: Vec<String>,
pub change: Option<TimetableChange>,
pub theme: Option<String>,
pub assistants: Vec<Assistant>,
pub notice: Option<String>,
pub planned_clasification: Option<PlannedClasification>,
pub week_theme: Option<String>,
pub lesson_release: String, //enum LessonRelease: "NoChange", "Released"
pub start: Option<i64>,
pub duration: Option<i64>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Assistant {
pub id: String,
pub is_present: bool,
pub student_id: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct AssistanceAtom {
pub hour_id: i64,
pub start: i64,
pub duration: i64,
pub class_id: Option<String>,
pub group_id: Option<String>,
pub subject_id: Option<String>,
pub teacher_id: Option<String>,
pub room_id: Option<String>,
pub student_id: Option<String>,
pub change: Option<TimetableChange>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct PlannedClasification {
pub description: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Hour {
pub id: i64,
pub caption: String,
pub begin_time: String,
pub end_time: String,
pub start: Option<i64>,
pub duration: Option<i64>,
}
+17 -17
View File
@@ -2,40 +2,40 @@ use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::collections::HashMap;
use crate::StdType;
use crate::SchoolClass;
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct User {
pub struct UserInfo {
#[serde(rename = "UserUID")]
pub user_uid: String,
pub campaign_category_code: String,
pub class: StdType,
// TeacherClasses: Option<> TODO unknown
pub full_name: String,
pub school_organization_name: String,
pub class: SchoolClass, //check nullable
pub teacher_classes: Option<Vec<SchoolClass>>,
pub full_name: String, //check nullable
pub school_organization_name: Option<String>,
pub school_type: Option<String>,
pub user_type: String,
pub user_type: String, //Enum "controller", "parents", "student", "teacher"
pub user_type_text: String,
pub study_year: u8,
pub study_year: Option<i64>,
pub enabled_modules: Vec<Module>,
pub setting_modules: HashMap<String, Value>,
pub full_user_name: String,
pub students: Vec<Student>,
pub setting_modules: HashMap<String, Value>, // TODO: Setting Module
pub full_user_name: Option<String>,
pub students: Vec<UserInfoStudent>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Module {
pub module: String,
pub rights: Vec<String>,
pub module: String, //Make an Enum "absence", "accesssystem", "application", "campaign", "classbook", "emergency", "events", "gdpr", "homeworks", "komens", "marking", "marks", "payments", "semester", "subjects", "substitutions", "teaching", "timetable", "unknown", "user_account", "web_based"
pub rights: Vec<String>, //Make enum "CanAccessEmergency", "CanBeEmergencyParticipant", "CanConfirmClassification", "CanExcuseAbsence", "CanManageEmergencies", "CanOverseeEmergencyParticipants", "ClassFundEnabled", "ClassFundPaymentsEnabled", "EditClassBook", "EditMarks", "PredictMarks", "RegularPaymentsEnabled", "SendAttachments", "SendMessageAsDirector", "SendMessages", "ShowAbsence", "ShowAbsencePercentage", "ShowApologyMessages", "ShowCampaign", "ShowChildConsents", "ShowClassBook", "ShowClassFundDetails", "ShowCommissioners", "ShowEvents", "ShowFinalMarks", "ShowHomeworks", "ShowManners", "ShowMarking", "ShowMarks", "ShowNoticeBoardMessages", "ShowOwnConsents", "ShowRatingDetails", "ShowRatingMessage", "ShowReceivedMessages", "ShowSentMessages", "ShowSubjectThemes", "ShowSubjects", "ShowSubstitutions", "ShowTimetable", "Unknown"
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Student {
pub struct UserInfoStudent {
pub full_name: String,
pub class: Vec<StdType>,
pub school_type: String,
pub study_year: u8,
pub class: Vec<SchoolClass>,
pub school_type: String, //Enum "BasicArtSchool","BasicPracticalSchool","BasicSchool","BasicSpecialSchool","BoardingHouse","ChildrensHome","Club","Conservatory","EconomicSection","Gymnasium","HigerProfessionalSchool","Kindergarten","OtherSchool","OtherType","PracticalSchool","SchoolCanteen","SchoolClub","SchoolService","SecondarySchool","SecondaryVocationalSchool","SportGymnasium","SuperiorOrganization","TechnicalSchool","University","Unknown","VocationalSchool"
pub study_year: Option<i64>,
}
-17
View File
@@ -1,17 +0,0 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Webmodules {
pub web_modules: Vec<Webmodule>,
pub dashboard: Webmodule,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Webmodule {
pub icon_id: Option<String>,
// "SubMenu":null, unknown type
pub url: Option<String>,
pub name: Option<String>,
}
-49
View File
@@ -1,49 +0,0 @@
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use crate::StdType;
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct WhatIfStartingEnvironmentMark {
pub id: String,
pub mark_text: String,
pub weight: u8,
pub max_points: u16,
pub subject_id: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct WhatIfResult {
pub marks: Vec<WhatIfResultMark>,
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<Utc>,
pub edit_date: DateTime<Utc>,
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,
pub class_rank_text: String,
pub id: String,
pub points_text: String,
pub max_points: u16,
}