user fixes

This commit is contained in:
vextrixes committed 2026-10-28 15:57:23 +01:00
1 parent 4f50e7abd5
commit e020e52f0f
3 files changed
+47 -2

No files matched your search

+21
View File
@@ -3,26 +3,47 @@ use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "Module")]
pub enum Module {
#[serde(rename_all="PascalCase")]
Absence { rights: Vec<AbsenceRights> },
#[serde(rename_all="PascalCase")]
AccessSystem { rights: Vec<AccessSystemRights> },
#[serde(rename_all="PascalCase")]
Application { rights: Vec<ApplicationRights> },
#[serde(rename_all="PascalCase")]
Campaign { rights: Vec<CampaignRights> },
#[serde(rename_all="PascalCase")]
Classbook { rights: Vec<ClassbookRights> },
#[serde(rename_all="PascalCase")]
Emergency { rights: Vec<EmergencyRights> },
#[serde(rename_all="PascalCase")]
Events { rights: Vec<EventsRights> },
#[serde(rename_all="PascalCase")]
Gdpr { rights: Vec<GdprRights> },
#[serde(rename_all="PascalCase")]
Homeworks { rights: Vec<HomeworksRights> },
#[serde(rename_all="PascalCase")]
Komens { rights: Vec<KomensRights> },
#[serde(rename_all="PascalCase")]
Marking { rights: Vec<MarkingRights> },
#[serde(rename_all="PascalCase")]
Marks { rights: Vec<MarksRights> },
#[serde(rename_all="PascalCase")]
Payments { rights: Vec<PaymentsRights> },
#[serde(rename_all="PascalCase")]
Semester { rights: Vec<SemesterRights> },
#[serde(rename_all="PascalCase")]
Subjects { rights: Vec<SubjectsRights> },
#[serde(rename_all="PascalCase")]
Substitutions { rights: Vec<SubstitutionsRights> },
#[serde(rename_all="PascalCase")]
Teaching { rights: Vec<TeachingRights> },
#[serde(rename_all="PascalCase")]
Timetable { rights: Vec<TimetableRights> },
#[serde(rename_all="PascalCase")]
Unknown { rights: Vec<UnknownRights> },
#[serde(rename_all="PascalCase")]
UserAccount { rights: Vec<UserAccountRights> },
#[serde(rename_all="PascalCase")]
WebBased { rights: Vec<WebBasedRights> },
}
+24
View File
@@ -15,6 +15,8 @@ pub struct ModulesSetting {
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct CommonModuleSettings {
#[serde(rename = "$type")]
pub r#type: ModulesSettingType,
pub actual_semester: ActualSemester,
pub actual_school_year: Option<ActualSchoolYear>,
}
@@ -39,6 +41,8 @@ pub struct ActualSchoolYear {
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct KomensModuleSettings {
#[serde(rename = "$type")]
pub r#type: ModulesSettingType,
pub upload_folder_verified: bool,
pub current_school_year_start_date: DateTime<FixedOffset>,
}
@@ -46,6 +50,8 @@ pub struct KomensModuleSettings {
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct MarkinModuleSettings {
#[serde(rename = "$type")]
pub r#type: ModulesSettingType,
pub required_classification_confirmation: bool,
pub classification_confirmation_classes_list: Vec<String>,
pub classification_confirmation_notification: bool,
@@ -55,6 +61,8 @@ pub struct MarkinModuleSettings {
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct TimetableModuleSettings {
#[serde(rename = "$type")]
pub r#type: ModulesSettingType,
pub display_type: TimetableDisplayType,
pub header_type: TimetableHeaderType,
pub days_definition: Vec<TimetableSettingsDayDefinition>,
@@ -96,6 +104,8 @@ pub struct TimetableSettingsHourDefinition {
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassbookModuleSettings {
#[serde(rename = "$type")]
pub r#type: ModulesSettingType,
pub absence_calculation_type: AbsenceCalculationType,
pub absence_calculation_period: ActualSemester,
}
@@ -110,7 +120,21 @@ pub enum AbsenceCalculationType {
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct EmergencyModuleSettings {
#[serde(rename = "$type")]
pub r#type: ModulesSettingType,
pub firestore_db_name: String,
pub emergency_server_url: String,
pub is_sms_licensed: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub enum ModulesSettingType {
KomensModuleSettings,
MarksModuleSettings,
TimetableModuleSettings,
HomeworksModuleSettings,
ClassBookModuleSettings,
CommonModuleSettings,
EmergencyModuleSettings,
}
+2 -2
View File
@@ -12,7 +12,7 @@ pub struct UserInfo {
pub teacher_classes: Option<Vec<SchoolClass>>,
pub full_name: Option<String>,
pub school_organization_name: Option<String>,
pub school_type: Option<String>,
pub school_type: Option<SchoolType>,
pub user_type: UserType,
pub user_type_text: String,
pub study_year: Option<i64>,
@@ -35,7 +35,7 @@ pub enum UserType {
#[serde(rename_all = "PascalCase")]
pub struct UserInfoStudent {
pub full_name: String,
pub class: Vec<SchoolClass>,
pub class: SchoolClass,
pub school_type: SchoolType,
pub study_year: Option<i64>,
}