diff --git a/src/lib.rs b/src/lib.rs index 28d17f2..1fb70d5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,6 +8,7 @@ mod marks; mod payments; mod stdtype; mod subjects; +mod substitutions; mod themes; mod user; @@ -18,8 +19,9 @@ pub use error::Error; pub use events::Events; pub use homework::{Homework, HomeworkListItem}; pub use marks::{Mark, Marks, SubjectMarks}; -pub use payments::{ClassfundPayments, ClassfundSummary, Payment, PaymentMonthlyData, AddBalance}; +pub use payments::{AddBalance, ClassfundPayments, ClassfundSummary, Payment, PaymentMonthlyData}; pub use stdtype::StdType; pub use subjects::{Subject, Subjects}; +pub use substitutions::{SubstitutionChange, Substitutions}; pub use themes::{Theme, Themes}; pub use user::{Module, User}; diff --git a/src/substitutions.rs b/src/substitutions.rs new file mode 100644 index 0000000..088c70e --- /dev/null +++ b/src/substitutions.rs @@ -0,0 +1,23 @@ +use chrono::{DateTime, Utc}; +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct Substitutions { + pub from: DateTime, + pub to: DateTime, + pub changes: Vec, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct SubstitutionChange { + pub change_subject: Option, //Unknown if string is the right type + pub day: DateTime, + pub hours: String, + pub change_type: String, + pub description: String, + pub time: String, + pub type_abbrev: Option, //Unknown if string is the right type, + pub type_name: Option, //Unknown if string is the right type +} diff --git a/tracker.md b/tracker.md index 11ab264..8fdecf8 100644 --- a/tracker.md +++ b/tracker.md @@ -11,7 +11,7 @@ - [ ] measures - [x] payments - [x] subjects -- [ ] substitutions +- [x] substitutions - [x] themes - [ ] timetable - [x] user