added substitutions endpoints

This commit is contained in:
vextrixes committed 2026-10-29 18:35:19 +01:00
1 parent 01607db3e4
commit 32b2d69a43
8 files changed
+60 -7

No files matched your search

+3 -5
View File
@@ -1,6 +1,6 @@
mod absence;
mod api_info;
mod attachment;
mod others;
//campaign
mod auth;
mod campaign;
@@ -24,7 +24,6 @@ mod user; //TODOS
//predictor
pub use absence::*;
pub use api_info::ApiInfo;
pub use attachment::AttachmentInfo;
pub use auth::*;
pub use campaign::Campaign;
@@ -37,6 +36,7 @@ pub use gdpr::{
};
pub use homework::*;
pub use marks::*;
pub use others::*;
pub use payments::*;
pub use semester::{
CertificateTerm, CertificateTerms, FinalMark, PedagogicalMeasure, PedagogicalMeasures,
@@ -46,9 +46,7 @@ pub use stdtype::{
Teacher, TeacherSet, TimetableStudent,
};
pub use subjects::*;
pub use substitutions::{
ChangeDisplayType, ChangeLessonInfo, SubstitutionChange, SubstitutionChangeType, Substitutions,
};
pub use substitutions::*;
pub use teaching::*;
pub use timetable::*;
pub use user::*;
File renamed without changes.
+15
View File
@@ -0,0 +1,15 @@
use std::marker::PhantomData;
use crate::{ApiInfo, Endpoint};
pub const API_V3_INFO_ENDPOINT: Endpoint<(), ApiInfo> = Endpoint::Get {
url: "/api/3",
auth: false,
_types: PhantomData,
};
pub const APIS_INFO_ENDPOINT: Endpoint<(), Vec<ApiInfo>> = Endpoint::Get {
url: "/api",
auth: false,
_types: PhantomData,
};
+5
View File
@@ -0,0 +1,5 @@
mod api_info;
mod endpoints;
pub use api_info::*;
pub use endpoints::*;
+15
View File
@@ -0,0 +1,15 @@
use std::marker::PhantomData;
use crate::{Endpoint, SubstitutionCycles, Substitutions};
pub const SUBSTITUTIONS_ENDPOINT: Endpoint<(), Substitutions> = Endpoint::Get {
url: "/api/3/substitutions",
auth: true,
_types: PhantomData,
};
pub const SUBSTITUTION_CYCLES_ENDPOINT: Endpoint<(), SubstitutionCycles> = Endpoint::Get {
url: "/api/3/substitutions/cycles",
auth: true,
_types: PhantomData,
};
+5
View File
@@ -0,0 +1,5 @@
mod endpoints;
mod substitutions;
pub use endpoints::*;
pub use substitutions::*;
@@ -53,3 +53,18 @@ pub struct ChangeLessonInfo {
subject_abbrev: Option<String>,
room_abbrev: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct SubstitutionCycles {
pub cycles_info: Option<Vec<DayCycleInfo>>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct DayCycleInfo {
pub date: DateTime<FixedOffset>,
pub code: Option<String>,
pub abbrev: Option<String>,
pub name: Option<String>,
}
+2 -2
View File
@@ -55,7 +55,7 @@
- [ ] /api/3/komens/messages/received/:messageId
- [x] /api/3/user
- [ ] /api/3/payments/regularpayments/detail/:paymentId
- [ ] /api/3/substitutions
- [x] /api/3/substitutions
- [ ] /api/3/marks/what-if
- [ ] /api/3/gdpr/commissioner/send-objection
- [ ] /api/3/gdpr/consents/person/new
@@ -108,7 +108,7 @@
- [ ] /api/3/gdpr/commissioners
- [ ] /api/3/classbook/:recordId
- [ ] /api/3/marking/marks/:atomId
- [ ] /api/3/substitutions/cycles
- [x] /api/3/substitutions/cycles
- [x] /api/3/logintoken
- [ ] /api/3/komens/message-types/edit/:messageId
- [ ] /api/3/payments/classfund/teacher/documents/:classId