Compare commits

10 Commits
Author SHA1 Message Date
vextrixes 636415e14a added cargo clippy to CI
Rust / build (push) Failing after 3s
2026-11-01 20:41:28 +01:00
vextrixes ba5d74d898 added webmodules 2026-11-01 16:46:50 +01:00
vextrixes eab1110c75 Update class_fund.rs 2026-11-01 03:26:33 +01:00
vextrixes ab5d8c0339 updated the readme 2026-11-01 03:18:07 +01:00
vextrixes 88668c3b9d added a readme 2026-11-01 03:17:07 +01:00
vextrixes ca8c203852 Merge pull request #2 from vextrixes/endpoints
Endpoints
2026-11-01 02:59:43 +01:00
vextrixes 5430902782 fixes 2026-11-01 02:56:42 +01:00
vextrixesandCopilot Autofix powered by AI 1f79570c70 Fix endpoint declaration for CLASS_FUND_TEACHER_DOCUMENTS
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-11-01 02:47:27 +01:00
vextrixesandCopilot Autofix powered by AI 4ff2abd485 Fix endpoint declaration for teacher document detail
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-11-01 02:46:59 +01:00
vextrixes b4e4b03e67 refactors 2026-11-01 02:36:22 +01:00
48 changed files with 522 additions and 384 deletions

No files matched your search

+2
View File
@@ -22,5 +22,7 @@ jobs:
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose --all-features
- name: Run clippy
run: cargo clippy --verbose --all-features
- name: Run tests
run: cargo test --verbose --all-features
+13
View File
@@ -0,0 +1,13 @@
# bakalari-types
### cz🇨🇿
Rustové typy pro práci s daty z API Bakalářů.
Tato crate poskytuje modely a definice koncových bodů pro oblasti, jako jsou autentizace, docházka, události, domácí úkoly, známky, platby, předměty, suplování, výuka, rozvrhy a údaje o uživatelích. Jde o knihovnu typů; neobsahuje HTTP klienta.
---
### en🇬🇧
Rust types for working with data from the Bakaláři API.
The crate provides models and endpoint definitions for areas such as authentication, attendance, events, homework, marks, payments, subjects, substitutions, teaching, timetables, and user data. It is a types library; it does not provide an HTTP client.
+5 -5
View File
@@ -15,13 +15,13 @@ pub struct LoginSuccess {
pub app_version: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize)] // TODO: evaluate removing or changing debug here
#[serde(rename_all = "snake_case")]
pub struct LoginRequest {
client_id: String,
grant_type: String,
username: String,
password: String,
pub client_id: String,
pub grant_type: String,
pub username: String,
pub password: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
+2 -2
View File
@@ -1,4 +1,4 @@
use crate::{Endpoint, HomeworkList};
use crate::{Endpoint, Homeworks};
use std::marker::PhantomData;
pub const HOMEWORKS_COUNT_ENDPOINT: Endpoint<i64, ()> = Endpoint::Get {
@@ -16,7 +16,7 @@ pub const HOMEWORK_DONE_ENDPOINT: Endpoint<bool, ()> = Endpoint::Get {
};
/// Query 'from' and 'to' (Datetime)
pub const HOMEWORKS_ENDPOINT: Endpoint<HomeworkList, ()> = Endpoint::Get {
pub const HOMEWORKS_ENDPOINT: Endpoint<Homeworks, ()> = Endpoint::Get {
url: "/api/3/homeworks",
auth: true,
_types: PhantomData,
+3 -3
View File
@@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct HomeworkItem {
pub struct Homework {
#[serde(rename = "ID")]
pub id: String,
pub date_start: DateTime<FixedOffset>,
@@ -25,6 +25,6 @@ pub struct HomeworkItem {
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct HomeworkList {
pub homeworks: Vec<HomeworkItem>,
pub struct Homeworks {
pub homeworks: Vec<Homework>,
}
+7 -6
View File
@@ -1,14 +1,11 @@
mod absence;
mod others;
//campaign
mod auth;
mod endpoints;
mod events;
mod gdpr;
//komens
mod homework; //TDOS
//marking
mod homework;
mod marks;
mod others;
mod payments;
mod semester;
mod stdtype;
@@ -17,7 +14,10 @@ mod substitutions;
mod teaching;
mod timetable;
mod user;
//webmodules
mod webmodules;
//campaign
//marking
//komens
//predictor
pub use absence::*;
@@ -36,3 +36,4 @@ pub use substitutions::*;
pub use teaching::*;
pub use timetable::*;
pub use user::*;
pub use webmodules::*;
+1 -1
View File
@@ -1,4 +1,4 @@
pub use serde::{Deserialize, Serialize};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
+104
View File
@@ -0,0 +1,104 @@
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
use crate::PaymentsTeacherStudentStatus;
#[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,
}
+3 -3
View File
@@ -43,8 +43,8 @@ pub const REGULAR_PAYMENT_DETAIL_ENDPOINT: Endpoint<RegularPaymentDetail, ()> =
};
pub const CLASS_FUND_TEACHER_DOCUMENT_DETAIL_ENDPOINT: Endpoint<
(),
ClassFundTeacherDocumentDetail,
(),
> = Endpoint::Get {
url: "/api/3/payments/classfund/teacher/document/detail/{documentId}",
auth: true,
@@ -65,8 +65,8 @@ pub const CLASS_FUND_TEACHER_STUDENTS_ENDPOINT: Endpoint<Vec<ClassFundTeacherStu
};
pub const CLASS_FUND_TEACHER_DOCUMENTS_ENDPOINT: Endpoint<
(),
Vec<ClassFundTeacherDocumentsMonthly>,
(),
> = Endpoint::Get {
url: "/api/3/payments/classfund/teacher/documents/{classId}",
auth: true,
@@ -88,8 +88,8 @@ pub const REGULAR_PRESCRIPTION_DETAIL_ENDPOINT: Endpoint<RegularPrescriptionDeta
};
pub const REGULAR_PRESCRIPTION_STUDENT_DETAIL_ENDPOINT: Endpoint<
(),
RegularPrescriptionStudentDetail,
(),
> = Endpoint::Get {
url: "/api/3/payments/regularpayments/teacher/prescriptions/{prescriptionId}/students/{studentId}",
auth: true,
+6 -2
View File
@@ -1,5 +1,9 @@
mod class_fund;
mod common;
mod endpoints;
mod payments;
mod regular_payments;
pub use class_fund::*;
pub use common::*;
pub use endpoints::*;
pub use payments::*;
pub use regular_payments::*;
@@ -1,115 +1,7 @@
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 {
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>>,
}
//------------------------------------------------------------------------------------------------------------------------------------------------------------
use crate::PaymentsTeacherStudentStatus;
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
@@ -162,7 +54,7 @@ pub struct RegularPrescriptionDetail {
pub payment_type_id: i64,
pub payment_type_name: Option<String>,
pub amount: f64,
pub state: RegularPrescription,
pub state: RegularPrescriptionState,
pub due_date_max: DateTime<FixedOffset>,
pub bank_account: Option<String>,
pub specific_symbol: Option<i64>,
@@ -224,13 +116,6 @@ pub struct RegularPrescription {
pub students_count: i64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub enum PaymentsTeacherStudentStatus {
Active,
Canceled,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub enum RegularPaymentStatus {
+2 -2
View File
@@ -3,13 +3,13 @@ use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct PedagogicalMeasure {
pub struct PedagogicalMeasures {
pub pedagogical_measures: Vec<PedagogicalMeasure>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct PedagogicalMeasures {
pub struct PedagogicalMeasure {
pub school_year: String,
pub semester: String,
pub type_label: String,
+2 -2
View File
@@ -1,5 +1,5 @@
mod endpoints;
mod subject_types;
mod subject;
pub use endpoints::*;
pub use subject_types::*;
pub use subject::*;
@@ -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>,
}
+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>,
}
+10
View File
@@ -1,5 +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,
}
+1 -59
View File
@@ -1,4 +1,4 @@
use crate::{AtomType, Subject};
use crate::SubstitutionChange;
use chrono::{DateTime, FixedOffset};
use serde::{Deserialize, Serialize};
@@ -9,61 +9,3 @@ pub struct Substitutions {
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>,
}
#[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
View File
@@ -1,5 +1,7 @@
mod endpoints;
mod teaching;
mod teaching_theme;
pub use endpoints::*;
pub use teaching::*;
pub use teaching_theme::*;
+1 -30
View File
@@ -1,5 +1,4 @@
use crate::Subject;
use chrono::{DateTime, FixedOffset};
use crate::{Subject, TeachingTheme};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -8,31 +7,3 @@ 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>,
}
+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>,
}
+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>,
}
+2 -2
View File
@@ -1,13 +1,13 @@
use crate::{Endpoint, Timetable};
use std::marker::PhantomData;
pub const PERNAMENT_TIMETABLE_ENDPOINT: Endpoint<Timetable, ()> = Endpoint::Get {
pub const PERMAMENT_TIMETABLE_ENDPOINT: Endpoint<Timetable, ()> = Endpoint::Get {
url: "/api/3/timetable/permanent",
auth: true,
_types: PhantomData,
};
pub const PERNAMENT_TIMETABLE_CLASS_ENDPOINT: Endpoint<Timetable, ()> = Endpoint::Get {
pub const PERMAMENT_TIMETABLE_CLASS_ENDPOINT: Endpoint<Timetable, ()> = Endpoint::Get {
url: "/api/3/timetable/permanent/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,
}
+24
View File
@@ -1,5 +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>,
}
+1 -141
View File
@@ -1,5 +1,4 @@
use crate::StdType;
use chrono::{DateTime, FixedOffset};
use crate::{Day, Group, Hour, StdType};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -15,142 +14,3 @@ pub struct Timetable {
pub cycles: Vec<StdType>,
pub students: Vec<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>,
}
#[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>,
}
+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>,
}
+8
View File
@@ -0,0 +1,8 @@
use crate::{Endpoint, WebModulesResponse};
use std::marker::PhantomData;
pub const WEBMODULES_ENDPOINT: Endpoint<WebModulesResponse, ()> = Endpoint::Get {
url: "/api/3/webmodule",
auth: true,
_types: PhantomData,
};
+13
View File
@@ -0,0 +1,13 @@
mod endpoints;
mod web_module;
mod web_module_dashboard;
mod web_module_icon;
mod web_module_sub_menu;
mod web_modules_response;
pub use endpoints::*;
pub use web_module::*;
pub use web_module_dashboard::*;
pub use web_module_icon::*;
pub use web_module_sub_menu::*;
pub use web_modules_response::*;
+12
View File
@@ -0,0 +1,12 @@
use serde::{Deserialize, Serialize};
use crate::{WebModuleIcon, WebModuleSubMenu};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct WebModule {
pub icon_id: WebModuleIcon,
pub url: Option<String>,
pub name: String,
pub sub_menu: Vec<WebModuleSubMenu>,
}
+12
View File
@@ -0,0 +1,12 @@
use serde::{Deserialize, Serialize};
use crate::{WebModuleIcon, WebModuleSubMenu};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct WebModuleDashboard {
pub icon_id: WebModuleIcon,
pub url: String,
pub name: Option<String>,
pub sub_menu: Vec<WebModuleSubMenu>,
}
+13
View File
@@ -0,0 +1,13 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum WebModuleIcon {
Akademie,
Ankety,
Dokumenty,
Druzina,
Potvrzeni,
VyukoveZdroje,
WebovyModul,
}
+8
View File
@@ -0,0 +1,8 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct WebModuleSubMenu {
pub url: String,
pub name: String,
}
+10
View File
@@ -0,0 +1,10 @@
use serde::{Deserialize, Serialize};
use crate::{WebModule, WebModuleDashboard};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct WebModulesResponse {
pub web_modules: Vec<WebModule>,
pub dashboard: WebModuleDashboard,
}
+3 -3
View File
@@ -1,6 +1,6 @@
# implementations
- [ ] absence
- [x] absence
- [x] campaign
- [ ] campaign error
- [ ] class book
@@ -17,7 +17,7 @@
- [x] substitutions
- [x] teaching
- [x] timetable
- [ ] webmodules
- [x] webmodules
- [x] user
# Features
@@ -35,7 +35,7 @@
- [ ] /api/3/classbook/lessonTags
- [ ] /api/3/komens/messages/rating/:messageId
- [x] /api/3/absence/student
- [ ] /api/3/webmodule
- [x] /api/3/webmodule
- [x] /api/3/timetable/actual
- [x] /api/3/payments/classfund/teacher/document/detail/:documentId
- [x] /api/3