Merge pull request #2 from vextrixes/endpoints

Endpoints
This commit is contained in:
vextrixes authored and GitHub committed 2026-11-01 02:59:43 +01:00
commit ca8c203852
94 files changed
+1548 -776

No files matched your search

-35
View File
@@ -1,35 +0,0 @@
use chrono::FixedOffset;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct StudentAbsenceOverviewResponse {
pub percentage_threshold: f64, //TODO: cutom type (u8)
pub absences: Vec<AbsenceDay>,
pub absences_per_subject: Option<Vec<SubjectAbsence>>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct AbsenceDay {
pub date: chrono::DateTime<FixedOffset>,
pub unsolved: u16,
pub ok: u16,
pub missed: u16,
pub late: u16,
pub soon: u16,
pub school: u16,
pub distance_teaching: u16,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct SubjectAbsence {
pub subject_name: String,
pub lessons_count: u16,
pub base: u16,
pub late: u16,
pub soon: u16,
pub school: u16,
pub distance_teaching: u16,
}
+17
View File
@@ -0,0 +1,17 @@
use crate::{AbsentType, StdTypeAbbrevNullable};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Absence {
pub minutes: i64,
pub absent_type: AbsentType,
pub hour_id: String,
pub start: i64,
pub duration: i64,
pub hour_index: Option<i64>,
pub absent_kind_id: Option<String>,
pub notice: Option<String>,
pub student_id: Option<String>,
pub subject: Option<StdTypeAbbrevNullable>,
}
+15
View File
@@ -0,0 +1,15 @@
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct AbsenceDay {
pub date: DateTime<FixedOffset>,
pub unsolved: u16,
pub ok: u16,
pub missed: u16,
pub late: u16,
pub soon: u16,
pub school: u16,
pub distance_teaching: u16,
}
+10
View File
@@ -0,0 +1,10 @@
use crate::Absence;
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct AbsenceDayResponse {
pub date: DateTime<FixedOffset>,
pub absences: Vec<Absence>,
}
+10
View File
@@ -0,0 +1,10 @@
use crate::{AbsenceDay, SubjectAbsence};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct AbsenceOverviewResponse {
pub percentage_threshold: f64, //TODO: cutom type (u8)
pub absences: Vec<AbsenceDay>,
pub absences_per_subject: Option<Vec<SubjectAbsence>>,
}
+18
View File
@@ -0,0 +1,18 @@
use crate::AbsentType;
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct AbsenceRecord {
pub minutes: i64,
pub absent_type: AbsentType,
pub hour_id: Option<String>,
pub date: DateTime<FixedOffset>,
pub start: i64,
pub duration: i64,
pub absent_kind_id: Option<String>,
pub notice: Option<String>,
pub student_id: Option<String>,
pub apology_id: Option<String>,
}
+13
View File
@@ -0,0 +1,13 @@
use crate::{AbsentType, StdType};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct AbsenceTypeOption {
pub absent_type: AbsentType,
pub absent_kind_enabled: bool,
pub absent_kind_required: bool,
pub absent_note_enabled: bool,
pub next_absent_type: AbsentType,
pub absent_kinds: Vec<StdType>,
}
+14
View File
@@ -0,0 +1,14 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub enum AbsentType {
Absent,
AbsentLate,
AbsentMiss,
AbsentOk,
AbsentSchool,
AbsentSoon,
DistanceTeaching,
NoAbsent,
}
+34
View File
@@ -0,0 +1,34 @@
use crate::{
AbsenceOverviewResponse, ContentType, Endpoint, ExcuseAbsenceResponse,
StudentTimetableAbsenceResponse,
};
use std::marker::PhantomData;
pub const CAN_STUDENT_EXCUSE_ABSENCE_ENDPOINT: Endpoint<bool, ()> = Endpoint::Get {
url: "/api/3/absence/canexcuse/{studentId}",
auth: true,
_types: PhantomData,
};
pub const GET_STUDENT_ABSENCE_ENDPOINT: Endpoint<AbsenceOverviewResponse, ()> = Endpoint::Get {
url: "/api/3/absence/student",
auth: true,
_types: PhantomData,
};
pub const GET_STUDENT_TIMETABLE_WITH_ABSENCES_ENDPOINT: Endpoint<
StudentTimetableAbsenceResponse,
(),
> = Endpoint::Get {
url: "/api/3/timetable/student/{studentId}",
auth: true,
_types: PhantomData,
};
pub const EXCUSE_KOMENS_ABSENCE_ENDPOINT: Endpoint<ExcuseAbsenceResponse, ()> = Endpoint::Put {
//TODO unknown behaviour (and request type) // probably absenceRecord or AbsenceRecordWithSubject
url: "/api/3/absence",
auth: true,
content_type: ContentType::Json,
_types: PhantomData,
};
+9
View File
@@ -0,0 +1,9 @@
use crate::{AbsenceRecord, Hour};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ExcuseAbsenceResponse {
pub absences: Vec<AbsenceRecord>,
pub hours: Vec<Hour>,
}
+23
View File
@@ -0,0 +1,23 @@
mod absence;
mod absence_day;
mod absence_day_response;
mod absence_overview_response;
mod absence_record;
mod absence_type_option;
mod absent_type;
mod endpoints;
mod excuse_absence_response;
mod student_timetable_absence_response;
mod subject_absence;
pub use absence::*;
pub use absence_day::*;
pub use absence_day_response::*;
pub use absence_overview_response::*;
pub use absence_record::*;
pub use absence_type_option::*;
pub use absent_type::*;
pub use endpoints::*;
pub use excuse_absence_response::*;
pub use student_timetable_absence_response::*;
pub use subject_absence::*;
@@ -0,0 +1,10 @@
use crate::{AbsenceDayResponse, AbsenceTypeOption, StdTypeNullable};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct StudentTimetableAbsenceResponse {
pub student: Option<StdTypeNullable>,
pub days: Vec<AbsenceDayResponse>,
pub absent_type_options: Vec<AbsenceTypeOption>,
}
+13
View File
@@ -0,0 +1,13 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct SubjectAbsence {
pub subject_name: String,
pub lessons_count: u16,
pub base: u16,
pub late: u16,
pub soon: u16,
pub school: u16,
pub distance_teaching: u16,
}
+21
View File
@@ -0,0 +1,21 @@
use crate::{ContentType, Endpoint, LoginSuccess, OpenIdDiscovery, auth::login::LoginRequest};
use std::marker::PhantomData;
pub const LOGIN_ENDPOINT: Endpoint<LoginSuccess, LoginRequest> = Endpoint::Post {
url: "/api/login",
auth: false,
content_type: ContentType::Urlencoded,
_types: PhantomData,
};
pub const OPEN_ID_DISCOVERY_ENDPOINT: Endpoint<OpenIdDiscovery, ()> = Endpoint::Get {
url: "/.well-known/openid-configuration",
auth: false,
_types: PhantomData,
};
pub const LOGIN_TOKEN_ENDPOINT: Endpoint<String, ()> = Endpoint::Get {
url: "/api/3/logintoken",
auth: true,
_types: PhantomData,
};
+9
View File
@@ -15,6 +15,15 @@ pub struct LoginSuccess {
pub app_version: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)] // TODO: evaluate removing or changing debug here
#[serde(rename_all = "snake_case")]
pub struct LoginRequest {
pub client_id: String,
pub grant_type: String,
pub username: String,
pub password: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum TokenType {
+5 -3
View File
@@ -1,7 +1,9 @@
mod endpoints;
mod login;
mod open_id_discovery;
mod user_jwt_claim;
pub use login::{LoginSuccess, TokenType};
pub use open_id_discovery::OpenIdDiscovery;
pub use user_jwt_claim::UserJwtClaim;
pub use endpoints::*;
pub use login::*;
pub use open_id_discovery::*;
pub use user_jwt_claim::*;
+27
View File
@@ -0,0 +1,27 @@
use std::marker::PhantomData;
pub enum Endpoint<Response, Request> {
//TODO: better url handling. (defining api version/is base url used/query/url params)
Get {
url: &'static str,
auth: bool,
_types: PhantomData<fn() -> (Response, Request)>,
},
Post {
url: &'static str,
auth: bool,
content_type: ContentType,
_types: PhantomData<fn() -> (Response, Request)>,
},
Put {
url: &'static str,
auth: bool,
content_type: ContentType,
_types: PhantomData<fn() -> (Response, Request)>,
},
}
pub enum ContentType {
Urlencoded,
Json,
}
-24
View File
@@ -1,24 +0,0 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Error {
pub message: String,
pub model_state: ModelState,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ModelState {
#[serde(rename = "$type")]
pub type_name: String,
#[serde(rename = "from")]
pub from: StringArray,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StringArray {
#[serde(rename = "$type")]
pub type_name: String,
#[serde(rename = "$values")]
pub values: Vec<String>,
}
-38
View File
@@ -1,38 +0,0 @@
use crate::{Room, RoomSet, SchoolClass, SchoolClassSet, StdType, Student, Teacher, TeacherSet};
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Events {
pub events: Vec<Event>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Event {
pub id: String,
pub title: String,
pub description: String,
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<FixedOffset>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct EventTime {
pub whole_day: bool,
pub start_time: Option<DateTime<FixedOffset>>,
pub end_time: Option<DateTime<FixedOffset>>,
}
pub type EventType = StdType;
+14
View File
@@ -0,0 +1,14 @@
use crate::{Endpoint, Events};
use std::marker::PhantomData;
pub const EVENTS_ENDPOINT: Endpoint<Events, ()> = Endpoint::Get {
url: "/api/3/events",
auth: true,
_types: PhantomData,
};
pub const MY_EVENTS_ENDPOINT: Endpoint<Events, ()> = Endpoint::Get {
url: "/api/3/events/my",
auth: true,
_types: PhantomData,
};
+28
View File
@@ -0,0 +1,28 @@
use crate::{EventTime, StdType};
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Event {
pub id: String,
pub title: String,
pub description: String,
pub event_type: StdType,
pub times: Vec<EventTime>,
pub classes: Vec<StdType>,
pub class_sets: Vec<StdType>,
pub teachers: Vec<StdType>,
pub teacher_sets: Vec<StdType>,
pub rooms: Vec<StdType>,
pub room_sets: Vec<StdType>,
pub students: Vec<StdType>,
pub note: Option<String>,
pub date_changed: DateTime<FixedOffset>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Events {
pub events: Vec<Event>,
}
+10
View File
@@ -0,0 +1,10 @@
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct EventTime {
pub whole_day: bool,
pub start_time: Option<DateTime<FixedOffset>>,
pub end_time: Option<DateTime<FixedOffset>>,
}
+7
View File
@@ -0,0 +1,7 @@
mod endpoints;
mod event;
mod event_time;
pub use endpoints::*;
pub use event::*;
pub use event_time::*;
-72
View File
@@ -1,72 +0,0 @@
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
use crate::UserType;
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct GdprCommissioners {
pub commissioners: Vec<GdprCommissioner>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct GdprCommissioner {
pub id: String,
pub name: String,
pub mobile: String,
pub phone: String,
pub email: 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: UserType,
pub person_id: String,
pub created: DateTime<FixedOffset>,
pub validity: GdprValidity,
pub valid_from: DateTime<FixedOffset>,
pub state: GdprConsentState,
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 = "camelCase")]
pub enum GdprValidity {
EndOfStudy,
EndOfStudyPlusYears,
ToAppeal,
Unknown,
Validity,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum GdprConsentState {
Agreed,
Cancelled,
Disagreed,
Expired,
NewConsent,
RevokeRequested,
Revoked,
Unknown,
}
#[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,
}
+62
View File
@@ -0,0 +1,62 @@
use crate::{ContentType, Endpoint, GdprCommissioners, GdprConsents};
use std::marker::PhantomData;
pub const SEND_GDPR_OBJECTION_ENDPOINT: Endpoint<(), String> = Endpoint::Post {
url: "/api/3/gdpr/commissioner/send-objection",
auth: true,
content_type: ContentType::Json,
_types: PhantomData,
};
pub const GDPR_CONSENT_REVOKE_ENDPOINT: Endpoint<(), ()> = Endpoint::Put {
url: "/api/3/gdpr/consent/{id}/revoke-request",
auth: true,
content_type: ContentType::Json,
_types: PhantomData,
};
pub const GDPR_CONSENT_AGREE_ENDPOINT: Endpoint<(), ()> = Endpoint::Put {
url: "/api/3/gdpr/consent/{id}/agree",
auth: true,
content_type: ContentType::Json,
_types: PhantomData,
};
pub const GDPR_CONSENT_DISAGREE_ENDPOINT: Endpoint<(), ()> = Endpoint::Put {
url: "/api/3/gdpr/consent/{id}/disagree",
auth: true,
content_type: ContentType::Json,
_types: PhantomData,
};
pub const GDPR_CONSENTS_COUNT_ENDPOINT: Endpoint<i64, ()> = Endpoint::Get {
url: "/api/3/gdpr/consents/person/new",
auth: true,
_types: PhantomData,
};
pub const SEND_GDPR_REPORT_ENDPOINT: Endpoint<(), ()> = Endpoint::Post {
// unknown request type
url: "/api/3/gdpr/commissioner/send-report",
auth: true,
content_type: ContentType::Json,
_types: PhantomData,
};
pub const GET_GDPR_COMMISSIONERS_ENDPOINT: Endpoint<GdprCommissioners, ()> = Endpoint::Get {
url: "/api/3/gdpr/commissioners",
auth: true,
_types: PhantomData,
};
pub const GET_GDPR_CHILD_CONSENTS_ENDPOINT: Endpoint<GdprConsents, ()> = Endpoint::Get {
url: "/api/3/gdpr/consents/person/child",
auth: true,
_types: PhantomData,
};
pub const GET_GDPR_CONSENTS_ENDPOINT: Endpoint<GdprConsents, ()> = Endpoint::Get {
url: "/api/3/gdpr/consents/person",
auth: true,
_types: PhantomData,
};
+19
View File
@@ -0,0 +1,19 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct GdprCommissioner {
pub id: String,
pub name: String,
pub mobile: String,
pub phone: String,
pub email: String,
pub web: Option<String>,
pub data_box: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct GdprCommissioners {
pub commissioners: Vec<GdprCommissioner>,
}
+28
View File
@@ -0,0 +1,28 @@
use crate::{GdprConsentRights, GdprConsentState, GdprValidity, UserType};
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct GdprConsent {
pub id: i64,
pub person_type: UserType,
pub person_id: String,
pub created: DateTime<FixedOffset>,
pub validity: GdprValidity,
pub valid_from: DateTime<FixedOffset>,
pub state: GdprConsentState,
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 GdprConsents {
pub person_consents: Vec<GdprConsent>,
}
+9
View File
@@ -0,0 +1,9 @@
use serde::{Deserialize, Serialize};
#[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,
}
+14
View File
@@ -0,0 +1,14 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum GdprConsentState {
Agreed,
Cancelled,
Disagreed,
Expired,
NewConsent,
RevokeRequested,
Revoked,
Unknown,
}
+11
View File
@@ -0,0 +1,11 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum GdprValidity {
EndOfStudy,
EndOfStudyPlusYears,
ToAppeal,
Unknown,
Validity,
}
+13
View File
@@ -0,0 +1,13 @@
mod endpoints;
mod gdpr_commissioner;
mod gdpr_consent;
mod gdpr_consent_rights;
mod gdpr_consent_state;
mod gdpr_validity;
pub use endpoints::*;
pub use gdpr_commissioner::*;
pub use gdpr_consent::*;
pub use gdpr_consent_rights::*;
pub use gdpr_consent_state::*;
pub use gdpr_validity::*;
+23
View File
@@ -0,0 +1,23 @@
use crate::{Endpoint, Homeworks};
use std::marker::PhantomData;
pub const HOMEWORKS_COUNT_ENDPOINT: Endpoint<i64, ()> = Endpoint::Get {
url: "/api/3/homeworks/count-actual",
auth: true,
_types: PhantomData,
};
/// ID = homework ID (String)
/// finished = homework state (bool)
pub const HOMEWORK_DONE_ENDPOINT: Endpoint<bool, ()> = Endpoint::Get {
url: "/api/3/homeworks/{id}/student-done/{finished}",
auth: true,
_types: PhantomData,
};
/// Query 'from' and 'to' (Datetime)
pub const HOMEWORKS_ENDPOINT: Endpoint<Homeworks, ()> = Endpoint::Get {
url: "/api/3/homeworks",
auth: true,
_types: PhantomData,
};
+12 -13
View File
@@ -1,17 +1,10 @@
use crate::{AttachmentInfo, StdType};
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
use crate::{AttachmentInfo, StdType};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct HomeworkList {
pub homeworks: Vec<HomeworkListItem>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct HomeworkListItem {
pub struct Homework {
#[serde(rename = "ID")]
pub id: String,
pub date_start: DateTime<FixedOffset>,
@@ -22,10 +15,16 @@ pub struct HomeworkListItem {
pub closed: bool,
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 class: StdType,
pub group: StdType,
pub subject: StdType,
pub teacher: StdType,
pub attachments: Vec<AttachmentInfo>,
pub finished: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Homeworks {
pub homeworks: Vec<Homework>,
}
+5
View File
@@ -0,0 +1,5 @@
mod endpoints;
mod homeworks;
pub use endpoints::*;
pub use homeworks::*;
+15 -29
View File
@@ -1,10 +1,8 @@
mod absence;
mod api_info;
mod attachment;
mod others;
//campaign
mod auth;
mod campaign;
mod error;
mod endpoints;
mod events;
mod gdpr;
//komens
@@ -18,35 +16,23 @@ mod subjects;
mod substitutions;
mod teaching;
mod timetable;
mod user; //TODOS
mod user;
//webmodules
//predictor
pub use absence::{AbsenceDay, StudentAbsenceOverviewResponse, SubjectAbsence};
pub use api_info::ApiInfo;
pub use attachment::AttachmentInfo;
pub use absence::*;
pub use auth::*;
pub use campaign::Campaign;
pub use error::{Error, ModelState, StringArray};
pub use events::{Event, EventTime, EventType, Events};
pub use gdpr::{
GdprCommissioner, GdprCommissioners, GdprConsent, GdprConsentRights, GdprConsentState,
GdprValidity,
};
pub use homework::{HomeworkList, HomeworkListItem};
pub use marks::{Mark, MarkConfirmationStatus, Marks, SubjectMarks};
pub use endpoints::*;
pub use events::*;
pub use gdpr::*;
pub use homework::*;
pub use marks::*;
pub use others::*;
pub use payments::*;
pub use semester::{
CertificateTerm, CertificateTerms, FinalMark, PedagogicalMeasure, PedagogicalMeasures,
};
pub use stdtype::{
Room, RoomSet, SchoolClass, SchoolClassSet, StdClassGroup, StdType, StdTypeNullable, Student,
Teacher, TeacherSet, TimetableStudent,
};
pub use subjects::{Subject, Subjects};
pub use substitutions::{
ChangeDisplayType, ChangeLessonInfo, SubstitutionChange, SubstitutionChangeType, Substitutions,
};
pub use teaching::{Lesson, Teaching, TeachingTheme};
pub use semester::*;
pub use stdtype::*;
pub use subjects::*;
pub use substitutions::*;
pub use teaching::*;
pub use timetable::*;
pub use user::*;
+21
View File
@@ -0,0 +1,21 @@
use crate::{ContentType, Endpoint, Marks};
use std::marker::PhantomData;
pub const CONFIRM_MARKS_ENDPOINT: Endpoint<(), Vec<String>> = Endpoint::Post {
url: "/api/3/marks/SetClassificationConfirmation",
auth: true,
content_type: ContentType::Json,
_types: PhantomData,
};
pub const COUNT_NEW_MARKS_ENDPOINT: Endpoint<i64, ()> = Endpoint::Get {
url: "/api/3/marks/count-new",
auth: true,
_types: PhantomData,
};
pub const MARKS_ENDPOINT: Endpoint<Marks, ()> = Endpoint::Get {
url: "/api/3/marks",
auth: true,
_types: PhantomData,
};
+2 -31
View File
@@ -1,33 +1,13 @@
use crate::MarkConfirmationStatus;
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
use crate::StdType;
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Marks {
pub subjects: Vec<SubjectMarks>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct SubjectMarks {
pub marks: Vec<Mark>,
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<FixedOffset>,
pub edit_date: DateTime<FixedOffset>,
pub is_invalid_date: Option<bool>,
pub is_invalid_date: bool,
pub teacher_id: Option<String>,
pub subject_id: String,
pub is_new: bool,
@@ -49,12 +29,3 @@ pub struct Mark {
pub confirmed_by: Option<String>,
pub verbal_evaluation: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum MarkConfirmationStatus {
Confirmed,
DoesNotRequireConfirmation,
Unconfirmed,
UnconfirmedAfterChange,
}
+10
View File
@@ -0,0 +1,10 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum MarkConfirmationStatus {
Confirmed,
DoesNotRequireConfirmation,
Unconfirmed,
UnconfirmedAfterChange,
}
+9
View File
@@ -0,0 +1,9 @@
mod endpoints;
mod mark;
mod mark_confirmation_status;
mod subject_marks;
pub use endpoints::*;
pub use mark::*;
pub use mark_confirmation_status::*;
pub use subject_marks::*;
+21
View File
@@ -0,0 +1,21 @@
use crate::{Mark, StdType};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct SubjectMarks {
pub marks: Vec<Mark>,
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 Marks {
pub subjects: Vec<SubjectMarks>,
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
+14
View File
@@ -0,0 +1,14 @@
use crate::{ApiInfo, Endpoint};
use std::marker::PhantomData;
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,
};
+9
View File
@@ -0,0 +1,9 @@
mod api_info;
mod attachment;
mod campaign;
mod endpoints;
pub use api_info::*;
pub use attachment::*;
pub use campaign::*;
pub use endpoints::*;
-217
View File
@@ -1,217 +0,0 @@
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassfundSummary {
pub student_name_with_class: Option<String>,
pub balance: f64,
pub spent: f64,
}
#[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>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassFundRecord {
description: Option<String>,
date: DateTime<FixedOffset>,
amount: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassFundSummary {
student_name_with_class: Option<String>,
balance: f64,
spent: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassFundTeacherDocumentDetailStudent {
full_name_with_class: Option<String>,
amount: f64,
status: Option<String>, //Option<PaymentsTeacherStudentStatus>, enum "Active" "Canceled"
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassFundTeacherDocumentDetail {
title: Option<String>,
amount: f64,
date: DateTime<FixedOffset>,
student_count: i64,
students: Option<Vec<ClassFundTeacherDocumentDetailStudent>>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassFundTeacherDocumentsItem {
id: i64,
title: Option<String>,
date: DateTime<FixedOffset>,
total_amount: f64,
amount_per_student: f64,
student_count: i64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassFundTeacherDocumentsMonthly {
date: DateTime<FixedOffset>,
monthly_balance: f64,
items: Vec<ClassFundTeacherDocumentsItem>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassFundTeacherStudentsItem {
variable_symbol: i64,
name: Option<String>,
registration_number: Option<i64>,
balance: f64,
status: String, //PaymentsTeacherStudentStatus, enum "Active" "Canceled
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
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 {
teacher_name: Option<String>,
allowed_classes: Option<Vec<ClassFundTeacherSummaryClass>>,
}
//------------------------------------------------------------------------------------------------------------------------------------------------------------
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RegularPaymentDetail {
title: Option<String>,
due_date: DateTime<FixedOffset>,
amount: f64,
original_amount: f64,
status: String, //r16 = <RegularPaymentStatus> "BeforeDueDate", "NotPaid", "Paid", "PartiallyPaid"
bank_account: Option<String>,
variable_symbol: Option<i64>,
specific_symbol: Option<i64>,
message: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RegularPayment {
payment_id: i64,
title: Option<String>,
due_date: DateTime<FixedOffset>,
amount: f64,
status: String, //r16 = <RegularPaymentStatus> "BeforeDueDate", "NotPaid", "Paid", "PartiallyPaid"
original_amount: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RegularPaymentsSummary {
pub balance: f64,
pub paid: f64,
pub amount_scheduled: f64,
pub student_name_with_class: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RegularPrescriptionDetailItem {
pub due_date: DateTime<FixedOffset>,
pub title: Option<String>,
pub amount: f64,
pub advance_notice_date: DateTime<FixedOffset>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RegularPrescriptionDetail {
pub id: i64,
pub title: Option<String>,
pub payment_type_id: i64,
pub payment_type_name: Option<String>,
pub amount: f64,
pub state: String, //r16 = <RegularPrescriptionState> "Paid", "PaidNotActive","unknown","Unpaid", "UnpaidNotActive"
pub due_date_max: DateTime<FixedOffset>,
pub bank_account: Option<String>,
pub specific_symbol: Option<i64>,
pub items: Option<Vec<RegularPrescriptionDetailItem>>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RegularPrescriptionDocumentLine {
pub date: DateTime<FixedOffset>,
pub title: Option<String>,
pub amount: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RegularPrescriptionRegulationLine {
pub due_date: DateTime<FixedOffset>,
pub title: Option<String>,
pub amount: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RegularPrescriptionStudentDetail {
pub id: i64,
pub last_name: Option<String>,
pub first_name: Option<String>,
pub full_name: Option<String>,
pub title: Option<String>,
pub balance: f64,
pub total_regulation_amount: f64,
pub status: String, //PaymentsTeacherStudentStatus, enum "Active" "Canceled"
pub document_lines: Option<Vec<RegularPrescriptionDocumentLine>>,
pub regulation_lines: Option<Vec<RegularPrescriptionRegulationLine>>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RegularPrescriptionStudent {
pub id: i64,
pub last_name: Option<String>,
pub first_name: Option<String>,
pub full_name: Option<String>,
pub balance: f64,
pub status: String, //PaymentsTeacherStudentStatus, enum "Active" "Canceled"
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RegularPrescription {
pub id: i64,
pub title: Option<String>,
pub payment_type_id: i64,
pub payment_type_name: Option<String>,
pub amount: f64,
pub state: String, //PaymentsTeacherStudentStatus, enum "Active" "Canceled"
pub due_date_max: Option<DateTime<FixedOffset>>,
pub students_count: i64,
}
+112
View File
@@ -0,0 +1,112 @@
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
use crate::PaymentsTeacherStudentStatus;
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassfundSummary {
pub student_name_with_class: Option<String>,
pub balance: f64,
pub spent: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassFundPaymentInfo {
pub instructions: Option<String>,
pub bank_account: Option<String>,
pub variable_symbol: Option<i64>,
pub specific_symbol: i64,
pub amount: f64,
pub message: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassFundMonthly {
pub date: DateTime<FixedOffset>,
pub monthly_balance: f64,
pub items: Vec<ClassFundRecord>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassFundRecord {
pub description: Option<String>,
pub date: DateTime<FixedOffset>,
pub amount: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassFundSummary {
pub student_name_with_class: Option<String>,
pub balance: f64,
pub spent: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassFundTeacherDocumentDetailStudent {
pub full_name_with_class: Option<String>,
pub amount: f64,
pub status: Option<PaymentsTeacherStudentStatus>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassFundTeacherDocumentDetail {
pub title: Option<String>,
pub amount: f64,
pub date: DateTime<FixedOffset>,
pub student_count: i64,
pub students: Option<Vec<ClassFundTeacherDocumentDetailStudent>>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassFundTeacherDocumentsItem {
pub id: i64,
pub title: Option<String>,
pub date: DateTime<FixedOffset>,
pub total_amount: f64,
pub amount_per_student: f64,
pub student_count: i64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassFundTeacherDocumentsMonthly {
pub date: DateTime<FixedOffset>,
pub monthly_balance: f64,
pub items: Vec<ClassFundTeacherDocumentsItem>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassFundTeacherStudentsItem {
pub variable_symbol: i64,
pub name: Option<String>,
pub registration_number: Option<i64>,
pub balance: f64,
pub status: PaymentsTeacherStudentStatus,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassFundTeacherSummaryClass {
pub abbrev: Option<String>,
pub class_id: Option<String>,
pub balance: f64,
pub amount_to_pay: f64,
pub debtors: i64,
pub spent: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ClassFundTeacherSummary {
pub teacher_name: Option<String>,
pub allowed_classes: Option<Vec<ClassFundTeacherSummaryClass>>,
}
+8
View File
@@ -0,0 +1,8 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub enum PaymentsTeacherStudentStatus {
Active,
Canceled,
}
+104
View File
@@ -0,0 +1,104 @@
use crate::{
ClassFundMonthly, ClassFundPaymentInfo, ClassFundSummary, ClassFundTeacherDocumentDetail,
ClassFundTeacherDocumentsMonthly, ClassFundTeacherStudentsItem, ClassFundTeacherSummary,
Endpoint, RegularPayment, RegularPaymentDetail, RegularPaymentsSummary, RegularPrescription,
RegularPrescriptionDetail, RegularPrescriptionStudent, RegularPrescriptionStudentDetail,
};
use std::marker::PhantomData;
pub const CLASS_FUND_PAYMENT_INFO_ENDPOINT: Endpoint<ClassFundPaymentInfo, ()> = Endpoint::Get {
url: "/api/3/payments/classfund/paymentsinfo",
auth: true,
_types: PhantomData,
};
pub const REGULAR_PAYMENTS_INFO_ENDPOINT: Endpoint<Vec<RegularPayment>, ()> = Endpoint::Get {
url: "/api/3/payments/regularpayments",
auth: true,
_types: PhantomData,
};
pub const REGULAR_PAYMENTS_SUMMARY_ENDPOINT: Endpoint<RegularPaymentsSummary, ()> = Endpoint::Get {
url: "/api/3/payments/regularpayments/summary",
auth: true,
_types: PhantomData,
};
pub const CLASS_FUND_INFO_ENDPOINT: Endpoint<Vec<ClassFundMonthly>, ()> = Endpoint::Get {
url: "/api/3/payments/classfund",
auth: true,
_types: PhantomData,
};
pub const CLASS_FUND_SUMMARY_ENDPOINT: Endpoint<ClassFundSummary, ()> = Endpoint::Get {
url: "/api/3/payments/classfund/summary",
auth: true,
_types: PhantomData,
};
pub const REGULAR_PAYMENT_DETAIL_ENDPOINT: Endpoint<RegularPaymentDetail, ()> = Endpoint::Get {
url: "/api/3/payments/regularpayments/detail/{paymentId}",
auth: true,
_types: PhantomData,
};
pub const CLASS_FUND_TEACHER_DOCUMENT_DETAIL_ENDPOINT: Endpoint<
ClassFundTeacherDocumentDetail,
(),
> = Endpoint::Get {
url: "/api/3/payments/classfund/teacher/document/detail/{documentId}",
auth: true,
_types: PhantomData,
};
pub const REGULAR_PRESCRIPTIONS_ENDPOINT: Endpoint<Vec<RegularPrescription>, ()> = Endpoint::Get {
url: "/api/3/payments/regularpayments/teacher/prescriptions",
auth: true,
_types: PhantomData,
};
pub const CLASS_FUND_TEACHER_STUDENTS_ENDPOINT: Endpoint<Vec<ClassFundTeacherStudentsItem>, ()> =
Endpoint::Get {
url: "/api/3/payments/classfund/teacher/students/{classId}",
auth: true,
_types: PhantomData,
};
pub const CLASS_FUND_TEACHER_DOCUMENTS_ENDPOINT: Endpoint<
Vec<ClassFundTeacherDocumentsMonthly>,
(),
> = Endpoint::Get {
url: "/api/3/payments/classfund/teacher/documents/{classId}",
auth: true,
_types: PhantomData,
};
pub const CLASS_FUND_TEACHER_SUMMARY_ENDPOINT: Endpoint<ClassFundTeacherSummary, ()> =
Endpoint::Get {
url: "/api/3/payments/classfund/teacher/summary",
auth: true,
_types: PhantomData,
};
pub const REGULAR_PRESCRIPTION_DETAIL_ENDPOINT: Endpoint<RegularPrescriptionDetail, ()> =
Endpoint::Get {
url: "/api/3/payments/regularpayments/teacher/prescriptions/{prescriptionId}",
auth: true,
_types: PhantomData,
};
pub const REGULAR_PRESCRIPTION_STUDENT_DETAIL_ENDPOINT: Endpoint<
RegularPrescriptionStudentDetail,
(),
> = Endpoint::Get {
url: "/api/3/payments/regularpayments/teacher/prescriptions/{prescriptionId}/students/{studentId}",
auth: true,
_types: PhantomData,
};
pub const REGULAR_PRESCRIPTION_STUDENTS_ENDPOINT: Endpoint<Vec<RegularPrescriptionStudent>, ()> =
Endpoint::Get {
url: "/api/3/payments/regularpayments/teacher/prescriptions/{prescriptionId}/students",
auth: true,
_types: PhantomData,
};
+9
View File
@@ -0,0 +1,9 @@
mod class_fund;
mod common;
mod endpoints;
mod regular_payments;
pub use class_fund::*;
pub use common::*;
pub use endpoints::*;
pub use regular_payments::*;
+137
View File
@@ -0,0 +1,137 @@
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
use crate::PaymentsTeacherStudentStatus;
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RegularPaymentDetail {
pub title: Option<String>,
pub due_date: DateTime<FixedOffset>,
pub amount: f64,
pub original_amount: f64,
pub status: RegularPaymentStatus,
pub bank_account: Option<String>,
pub variable_symbol: Option<i64>,
pub specific_symbol: Option<i64>,
pub message: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RegularPayment {
pub payment_id: i64,
pub title: Option<String>,
pub due_date: DateTime<FixedOffset>,
pub amount: f64,
pub status: RegularPaymentStatus,
pub original_amount: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RegularPaymentsSummary {
pub balance: f64,
pub paid: f64,
pub amount_scheduled: f64,
pub student_name_with_class: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RegularPrescriptionDetailItem {
pub due_date: DateTime<FixedOffset>,
pub title: Option<String>,
pub amount: f64,
pub advance_notice_date: DateTime<FixedOffset>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RegularPrescriptionDetail {
pub id: i64,
pub title: Option<String>,
pub payment_type_id: i64,
pub payment_type_name: Option<String>,
pub amount: f64,
pub state: RegularPrescriptionState,
pub due_date_max: DateTime<FixedOffset>,
pub bank_account: Option<String>,
pub specific_symbol: Option<i64>,
pub items: Option<Vec<RegularPrescriptionDetailItem>>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RegularPrescriptionDocumentLine {
pub date: DateTime<FixedOffset>,
pub title: Option<String>,
pub amount: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RegularPrescriptionRegulationLine {
pub due_date: DateTime<FixedOffset>,
pub title: Option<String>,
pub amount: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RegularPrescriptionStudentDetail {
pub id: i64,
pub last_name: Option<String>,
pub first_name: Option<String>,
pub full_name: Option<String>,
pub title: Option<String>,
pub balance: f64,
pub total_regulation_amount: f64,
pub status: PaymentsTeacherStudentStatus,
pub document_lines: Option<Vec<RegularPrescriptionDocumentLine>>,
pub regulation_lines: Option<Vec<RegularPrescriptionRegulationLine>>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RegularPrescriptionStudent {
pub id: i64,
pub last_name: Option<String>,
pub first_name: Option<String>,
pub full_name: Option<String>,
pub balance: f64,
pub status: PaymentsTeacherStudentStatus,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RegularPrescription {
pub id: i64,
pub title: Option<String>,
pub payment_type_id: i64,
pub payment_type_name: Option<String>,
pub amount: f64,
pub state: PaymentsTeacherStudentStatus,
pub due_date_max: Option<DateTime<FixedOffset>>,
pub students_count: i64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub enum RegularPaymentStatus {
BeforeDueDate,
NotPaid,
Paid,
PartiallyPaid,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub enum RegularPrescriptionState {
Paid,
PaidNotActive,
#[serde(rename = "unknown")]
Unknown,
Unpaid,
UnpaidNotActive,
}
@@ -1,14 +1,7 @@
use crate::{FinalMark, StdTypeNullable};
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
use crate::StdTypeNullable;
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct CertificateTerms {
pub certificate_terms: Vec<CertificateTerm>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct CertificateTerm {
@@ -31,29 +24,6 @@ pub struct CertificateTerm {
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct FinalMark {
pub mark_date: DateTime<FixedOffset>,
pub edit_date: DateTime<FixedOffset>,
pub mark_text: String,
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>,
pub struct CertificateTerms {
pub certificate_terms: Vec<CertificateTerm>,
}
+14
View File
@@ -0,0 +1,14 @@
use crate::{CertificateTerms, Endpoint, PedagogicalMeasures};
use std::marker::PhantomData;
pub const GET_CERTIFICATE_TERMS_ENDPOINT: Endpoint<CertificateTerms, ()> = Endpoint::Get {
url: "/api/3/marks/final",
auth: true,
_types: PhantomData,
};
pub const GET_PEDAGOGICAL_MEASURES_ENDPOINT: Endpoint<PedagogicalMeasures, ()> = Endpoint::Get {
url: "/api/3/marks/measures",
auth: true,
_types: PhantomData,
};
+12
View File
@@ -0,0 +1,12 @@
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct FinalMark {
pub mark_date: DateTime<FixedOffset>,
pub edit_date: DateTime<FixedOffset>,
pub mark_text: String,
pub subject_id: String,
pub id: String,
}
+9
View File
@@ -0,0 +1,9 @@
mod certificate_term;
mod endpoints;
mod final_mark;
mod pedagogical_measure;
pub use certificate_term::*;
pub use endpoints::*;
pub use final_mark::*;
pub use pedagogical_measure::*;
+21
View File
@@ -0,0 +1,21 @@
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct PedagogicalMeasures {
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<FixedOffset>,
pub type_id: String,
pub text: String,
pub actual_grade: Option<i64>,
pub actual_grade_name: Option<String>,
}
+1 -17
View File
@@ -16,25 +16,9 @@ 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 TimetableStudent {
pub struct StdTypeAbbrevNullable {
pub id: String,
pub abbrev: Option<String>,
pub name: String,
+8
View File
@@ -0,0 +1,8 @@
use crate::{Endpoint, Subjects};
use std::marker::PhantomData;
pub const SUBJECTS_ENDPOINT: Endpoint<Subjects, ()> = Endpoint::Get {
url: "/api/3/subjects",
auth: true,
_types: PhantomData,
};
+5
View File
@@ -0,0 +1,5 @@
mod endpoints;
mod subject;
pub use endpoints::*;
pub use subject::*;
+6 -6
View File
@@ -1,11 +1,5 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Subjects {
pub subjects: Vec<Subject>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Subject {
@@ -21,3 +15,9 @@ pub struct Subject {
pub teacher_home_phone: Option<String>,
pub teacher_mobile_phone: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Subjects {
pub subjects: Vec<Subject>,
}
-55
View File
@@ -1,55 +0,0 @@
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
use crate::{AtomType, Subject};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Substitutions {
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<Subject>,
pub day: DateTime<FixedOffset>,
pub hours: String,
pub change_type: SubstitutionChangeType,
pub description: String,
pub time: String,
pub change_lesson_info: Option<ChangeLessonInfo>,
pub change_display_type: Option<ChangeDisplayType>,
pub atom_type: Option<AtomType>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub enum SubstitutionChangeType {
Absence,
Added,
Canceled,
NoChange,
Removed,
RoomChanged,
Substitution,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub enum ChangeDisplayType {
OriginalTeacher,
SubstituteTeacher,
}
#[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>,
}
+8
View File
@@ -0,0 +1,8 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub enum ChangeDisplayType {
OriginalTeacher,
SubstituteTeacher,
}
+11
View File
@@ -0,0 +1,11 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ChangeLessonInfo {
pub class_abbrev: Option<String>,
pub group_abbrev: Option<String>,
pub is_class_group: Option<bool>,
pub subject_abbrev: Option<String>,
pub room_abbrev: Option<String>,
}
+17
View File
@@ -0,0 +1,17 @@
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
#[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>,
}
+14
View File
@@ -0,0 +1,14 @@
use crate::{Endpoint, SubstitutionCycles, Substitutions};
use std::marker::PhantomData;
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,
};
+15
View File
@@ -0,0 +1,15 @@
mod change_display_type;
mod change_lesson_info;
mod day_cycle_info;
mod endpoints;
mod substitution_change;
mod substitution_change_type;
mod substitutions;
pub use change_display_type::*;
pub use change_lesson_info::*;
pub use day_cycle_info::*;
pub use endpoints::*;
pub use substitution_change::*;
pub use substitution_change_type::*;
pub use substitutions::*;
+17
View File
@@ -0,0 +1,17 @@
use crate::{AtomType, ChangeDisplayType, ChangeLessonInfo, Subject, SubstitutionChangeType};
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct SubstitutionChange {
pub change_subject: Option<Subject>,
pub day: DateTime<FixedOffset>,
pub hours: String,
pub change_type: SubstitutionChangeType,
pub description: String,
pub time: String,
pub change_lesson_info: Option<ChangeLessonInfo>,
pub change_display_type: Option<ChangeDisplayType>,
pub atom_type: Option<AtomType>,
}
@@ -0,0 +1,13 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub enum SubstitutionChangeType {
Absence,
Added,
Canceled,
NoChange,
Removed,
RoomChanged,
Substitution,
}
+11
View File
@@ -0,0 +1,11 @@
use crate::SubstitutionChange;
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Substitutions {
pub from: DateTime<FixedOffset>,
pub to: DateTime<FixedOffset>,
pub changes: Vec<SubstitutionChange>,
}
-39
View File
@@ -1,39 +0,0 @@
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>,
}
+9
View File
@@ -0,0 +1,9 @@
use crate::{Endpoint, Teaching};
use std::marker::PhantomData;
/// Subject ID = String
pub const TEACHING_ENDPOINT: Endpoint<Teaching, ()> = Endpoint::Get {
url: "/api/3/subjects/themes/{subjectId}",
auth: true,
_types: PhantomData,
};
+7
View File
@@ -0,0 +1,7 @@
mod endpoints;
mod teaching;
mod teaching_theme;
pub use endpoints::*;
pub use teaching::*;
pub use teaching_theme::*;
+9
View File
@@ -0,0 +1,9 @@
use crate::{Subject, TeachingTheme};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Teaching {
pub subject: Subject,
pub themes: Vec<TeachingTheme>,
}
+14
View File
@@ -0,0 +1,14 @@
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
#[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>,
}
-157
View File
@@ -1,157 +0,0 @@
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
use crate::{Room, StdType, Student, Teacher};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Timetable {
pub hours: Vec<Hour>,
pub days: Vec<Day>,
pub classes: Vec<StdType>,
pub groups: Vec<Group>,
pub subjects: Vec<StdType>,
pub rooms: Vec<Room>,
pub teachers: Vec<Teacher>,
pub cycles: Vec<StdType>,
pub students: Vec<Student>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct TimetableChange {
pub day: DateTime<FixedOffset>,
pub hours: String,
pub changetype: Changetype,
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<AtomType>,
pub start: Option<i64>,
pub duration: Option<i64>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub enum Changetype {
Absence,
Added,
Canceled,
NoChange,
Removed,
RoomChanged,
Substitution,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub enum AtomType {
Hour,
Pause,
TimeBlock,
}
#[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: LessonRelease,
pub start: Option<i64>,
pub duration: Option<i64>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub enum LessonRelease {
NoChange,
Released,
}
#[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>,
}
+18
View File
@@ -0,0 +1,18 @@
use serde::{Deserialize, Serialize};
use crate::TimetableChange;
#[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>,
}
+9
View File
@@ -0,0 +1,9 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Assistant {
pub id: String,
pub is_present: bool,
pub student_id: String,
}
+27
View File
@@ -0,0 +1,27 @@
use serde::{Deserialize, Serialize};
use crate::{Assistant, HomeworkInfo, LessonRelease, PlannedClassification, TimetableChange};
#[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>,
#[serde(rename = "PlannedClasification")]
pub planned_classification: Option<PlannedClassification>,
pub week_theme: Option<String>,
pub lesson_release: LessonRelease,
pub start: Option<i64>,
pub duration: Option<i64>,
}
+9
View File
@@ -0,0 +1,9 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub enum AtomType {
Hour,
Pause,
TimeBlock,
}
+13
View File
@@ -0,0 +1,13 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub enum Changetype {
Absence,
Added,
Canceled,
NoChange,
Removed,
RoomChanged,
Substitution,
}
+15
View File
@@ -0,0 +1,15 @@
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
use crate::{AssistanceAtom, Atom};
#[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>,
}
+26
View File
@@ -0,0 +1,26 @@
use crate::{Endpoint, Timetable};
use std::marker::PhantomData;
pub const PERMAMENT_TIMETABLE_ENDPOINT: Endpoint<Timetable, ()> = Endpoint::Get {
url: "/api/3/timetable/permanent",
auth: true,
_types: PhantomData,
};
pub const PERMAMENT_TIMETABLE_CLASS_ENDPOINT: Endpoint<Timetable, ()> = Endpoint::Get {
url: "/api/3/timetable/permanent/class/{classId}",
auth: true,
_types: PhantomData,
};
pub const WEEK_TIMETABLE_ENDPOINT: Endpoint<Timetable, ()> = Endpoint::Get {
url: "/api/3/timetable/actual",
auth: true,
_types: PhantomData,
};
pub const WEEK_TIMETABLE_CLASS_ENDPOINT: Endpoint<Timetable, ()> = Endpoint::Get {
url: "/api/3/timetable/actual/class/{classId}",
auth: true,
_types: PhantomData,
};
+8
View File
@@ -0,0 +1,8 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct HomeworkInfo {
pub id: String,
pub text: String,
}
+12
View File
@@ -0,0 +1,12 @@
use serde::{Deserialize, Serialize};
#[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>,
}
+8
View File
@@ -0,0 +1,8 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub enum LessonRelease {
NoChange,
Released,
}
+29
View File
@@ -0,0 +1,29 @@
mod assistance_atom;
mod assistant;
mod atom;
mod atom_type;
mod change_type;
mod day;
mod endpoints;
mod homework_info;
mod hour;
mod lesson_release;
mod planned_classification;
mod timetable;
mod timetable_change;
mod timetable_group;
pub use assistance_atom::*;
pub use assistant::*;
pub use atom::*;
pub use atom_type::*;
pub use change_type::*;
pub use day::*;
pub use endpoints::*;
pub use homework_info::*;
pub use hour::*;
pub use lesson_release::*;
pub use planned_classification::*;
pub use timetable::*;
pub use timetable_change::*;
pub use timetable_group::*;
+7
View File
@@ -0,0 +1,7 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct PlannedClassification {
pub description: Option<String>,
}
+16
View File
@@ -0,0 +1,16 @@
use crate::{Day, Group, Hour, StdType};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Timetable {
pub hours: Vec<Hour>,
pub days: Vec<Day>,
pub classes: Vec<StdType>,
pub groups: Vec<Group>,
pub subjects: Vec<StdType>,
pub rooms: Vec<StdType>,
pub teachers: Vec<StdType>,
pub cycles: Vec<StdType>,
pub students: Vec<StdType>,
}
+20
View File
@@ -0,0 +1,20 @@
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
use crate::{AtomType, Changetype, StdType};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct TimetableChange {
pub day: DateTime<FixedOffset>,
pub hours: String,
pub changetype: Changetype,
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<AtomType>,
pub start: Option<i64>,
pub duration: Option<i64>,
}
+10
View File
@@ -0,0 +1,10 @@
use serde::{Deserialize, Serialize};
#[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>,
}
+14
View File
@@ -0,0 +1,14 @@
use crate::{Endpoint, UserInfo};
use std::marker::PhantomData;
pub const USER_INFO_ENDPOINT: Endpoint<UserInfo, ()> = Endpoint::Get {
url: "/api/3/user",
auth: true,
_types: PhantomData,
};
pub const STUDENT_AT_SCHOOL_ENDPOINT: Endpoint<bool, ()> = Endpoint::Get {
url: "/api/3/user/student-at-school",
auth: true,
_types: PhantomData,
};
+2
View File
@@ -1,7 +1,9 @@
mod endpoints;
mod modules;
mod setting_modules;
mod user_info;
pub use endpoints::*;
pub use modules::*;
pub use setting_modules::*;
pub use user_info::*;
+4 -5
View File
@@ -1,15 +1,14 @@
use crate::{Module, StdType, user::ModulesSetting};
use serde::{Deserialize, Serialize};
use crate::{Module, SchoolClass, user::ModulesSetting};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct UserInfo {
#[serde(rename = "UserUID")]
pub user_uid: String,
pub campaign_category_code: String,
pub class: Option<SchoolClass>,
pub teacher_classes: Option<Vec<SchoolClass>>,
pub class: Option<StdType>,
pub teacher_classes: Option<Vec<StdType>>,
pub full_name: Option<String>,
pub school_organization_name: Option<String>,
pub school_type: Option<SchoolType>,
@@ -35,7 +34,7 @@ pub enum UserType {
#[serde(rename_all = "PascalCase")]
pub struct UserInfoStudent {
pub full_name: String,
pub class: SchoolClass,
pub class: StdType,
pub school_type: SchoolType,
pub study_year: Option<i64>,
}
+103 -2
View File
@@ -6,7 +6,7 @@
- [ ] class book
- [x] events
- [x] auth
- [ ] error
- [ ] errors
- [x] gdpr
- [x] homeworks
- [ ] komens
@@ -24,4 +24,105 @@
- [ ] OpenApi schema generation
- [ ] documentation
- [ ] tests
- [ ] constructors
- [ ] constructors
# Endpoints
- [ ] /api/3/komens/message/:messageId/mark-as-read
- [x] /api/3/marks
- [x] /api/3/homeworks/:id/student-done/:finished
- [ ] /api/3/marking/atoms/:atomId/headers
- [x] /api/3/payments/classfund/teacher/students/:classId
- [ ] /api/3/classbook/lessonTags
- [ ] /api/3/komens/messages/rating/:messageId
- [x] /api/3/absence/student
- [ ] /api/3/webmodule
- [x] /api/3/timetable/actual
- [x] /api/3/payments/classfund/teacher/document/detail/:documentId
- [x] /api/3
- [ ] /api/3/komens/attachment/:id
- [x] /api/3/subjects/themes/:subjectId
- [x] /api/3/payments/classfund
- [x] /api/3/gdpr/consents/person/child
- [ ] /api/3/komens/concept/:conceptId
- [x] /api/3/marks/measures
- [ ] /api/3/unregister-user-notification
- [x] /api/3/gdpr/consent/:id/agree
- [x] /api/3/marks/count-new
- [ ] /api/3/komens/concept
- [x] /api/3/timetable/permanent
- [ ] /api/3/komens/messages/noticeboard
- [ ] /api/3/komens/messages/apology/:messageId
- [ ] /api/3/komens/messages/received/:messageId
- [x] /api/3/user
- [x] /api/3/payments/regularpayments/detail/:paymentId
- [x] /api/3/substitutions
- [ ] /api/3/marks/what-if
- [x] /api/3/gdpr/commissioner/send-objection
- [x] /api/3/gdpr/consents/person/new
- [ ] /api/3/lesson/:lessonId/absence
- [x] /api/3/payments/regularpayments/summary
- [ ] /api/3/emergency/startemergency
- [x] /api/3/timetable/permanent/class/:classId
- [x] /api/3/gdpr/commissioner/send-report
- [ ] /api/3/komens/message/:messageId/mark-as-unhidden
- [ ] /api/3/lesson/:lessonId/studentsTimetable
- [x] /api/3/marks/final
- [x] /api/3/timetable/student/:studentId
- [ ] /api/3/marking/atom/:atomId/headerOptions
- [x] /api/3/gdpr/consent/:id/disagree
- [ ] /api/3/komens/messages/sent
- [ ] /api/3/emergency/configuration
- [ ] /api/3/komens/message
- [ ] /api/3/komens/message/:messageId/mark-as-hidden
- [ ] /api/3/lesson/:lessonId/past
- [ ] /api/3/komens/attachment
- [ ] /api/3/komens/messages/received
- [ ] /api/3/login/:token
- [ ] /api/3/komens/concepts
- [ ] /api/3/komens/messages/received/unread
- [x] /api/3/payments/regularpayments/teacher/prescriptions/:prescriptionId
- [x] /api/3/timetable/actual/class/:classId
- [ ] /api/3/gdpr/consents/person
- [ ] /api/3/komens/messages/unread
- [x] /api/3/absence
- [ ] /api/3/komens/message/:messageId/mark-as-confirmed
- [ ] /api/3/komens/messages/apology
- [x] /api/3/events
- [ ] /api/3/komens/concepts/count
- [x] /api/3/payments/regularpayments/teacher/prescriptions/:prescriptionId/students
- [x] /api/3/payments/regularpayments
- [ ] /api/3/komens/messages/noticeboard/:messageId&
- [ ] /api/3/komens/message-types/reply/:messageId
- [x] /api/3/payments/regularpayments/teacher/prescriptions
- [x] /api/3/marks/SetClassificationConfirmation
- [x] /api/3/homeworks/count-actual
- [x] /api/3/gdpr/consent/:id/revoke-request
- [x] /api/3/payments/regularpayments/teacher/prescriptions/:prescriptionId/students/:studentId
- [ ] /api/3/marking/atoms
- [x] /api/3/absence/canexcuse/:studentId
- [ ] /api/3/komens/rating-templates
- [ ] /api/3/emergency/participantsselection
- [ ] /api/3/komens/messages/noticeboard/unread
- [ ] /api/3/komens/message-types
- [x] /api/3/events/my
- [x] /api/3/gdpr/commissioners
- [ ] /api/3/classbook/:recordId
- [ ] /api/3/marking/marks/:atomId
- [x] /api/3/substitutions/cycles
- [x] /api/3/logintoken
- [ ] /api/3/komens/message-types/edit/:messageId
- [x] /api/3/payments/classfund/teacher/documents/:classId
- [x] /api/3/payments/classfund/summary
- [ ] /api/3/register-notification
- [x] /api/3/payments/classfund/paymentsinfo
- [ ] /api/3/komens/messages/rating
- [ ] /api/3/komens/message/:messageId
- [x] /api/3/homeworks
- [x] /api/3/subjects
- [ ] /api/3/classbook
- [x] /api/3/user/student-at-school
- [x] /api/3/payments/classfund/teacher/summary
- [ ] /api/3/komens/messages/sent/:messageId
- [x] /api/login
- [x] /.well-known/openid-configuration
- [x] /api