diff --git a/src/payments.rs b/src/payments.rs index 758b8c7..9ba726b 100644 --- a/src/payments.rs +++ b/src/payments.rs @@ -1,43 +1,218 @@ -use chrono::{DateTime, Utc}; +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: String, + pub student_name_with_class: Option, pub balance: f64, pub spent: f64, } #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "PascalCase")] -pub struct ClassfundPayments { - pub monthly_data: Vec, +pub struct ClassFundPaymentInfo { + instructions: Option, + bank_account: Option, + variable_symbol: Option, + specific_symbol: i64, + amount: f64, + message: Option, } #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "PascalCase")] -pub struct PaymentMonthlyData { - pub date: DateTime, - pub monthly_balance: i64, - pub items: Vec, +pub struct ClassFundRecord { + description: Option, + date: DateTime, + amount: f64, } #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "PascalCase")] -pub struct Payment { - pub description: String, - pub date: DateTime, - pub amount: i64, +pub struct ClassFundSummary { + student_name_with_class: Option, + balance: f64, + spent: f64 } #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "PascalCase")] -pub struct AddBalance { - pub instructions: String, - pub bank_account: String, - pub variable_symbol: u32, - pub specific_symbol: u32, - pub amount: i64, - pub message: String, +pub struct ClassFundTeacherDocumentDetailStudent { + full_name_with_class: Option, + amount: f64, + status: Option //Option, enum "Active" "Canceled" } + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct ClassFundTeacherDocumentDetail{ + title: Option, + amount: f64, + date: DateTime, + student_count: i64, + students: Option>, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct ClassFundTeacherDocumentsItem{ + id: i64, + title: Option, + date: DateTime, + total_amount: f64, + amount_per_student: f64, + student_count: i64, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct ClassFundTeacherDocumentsMonthly{ + date: DateTime, + monthly_balance: f64, + items: Vec, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct ClassFundTeacherStudentsItem{ + variable_symbol: i64, + name: Option, + registration_number: Option, + balance: f64, + status: String//PaymentsTeacherStudentStatus, enum "Active" "Canceled +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct ClassFundTeacherSummaryClass{ + abbrev: Option, + class_id: Option, + 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, + allowed_classes: Option>, +} + +//------------------------------------------------------------------------------------------------------------------------------------------------------------ + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct RegularPaymentDetail{ + title: Option, + due_date: DateTime, + amount: f64, + original_amount: f64, + status: String, //r16 = "BeforeDueDate", "NotPaid", "Paid", "PartiallyPaid" + bank_account: Option, + variable_symbol: Option, + specific_symbol: Option, + message: Option, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct RegularPayment{ + payment_id: i64, + title: Option, + due_date: DateTime, + amount: f64, + status: String, //r16 = "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, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct RegularPrescriptionDetailItem { + pub due_date: DateTime, + pub title: Option, + pub amount: f64, + pub advance_notice_date: DateTime, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct RegularPrescriptionDetail { + pub id: i64, + pub title: Option, + pub payment_type_id: i64, + pub payment_type_name: Option, + pub amount: f64, + pub state: String, //r16 = "Paid", "PaidNotActive","unknown","Unpaid", "UnpaidNotActive" + pub due_date_max: DateTime, + pub bank_account: Option, + pub specific_symbol: Option, + pub items: Option>, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct RegularPrescriptionDocumentLine { + pub date: DateTime, + pub title: Option, + pub amount: f64, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct RegularPrescriptionRegulationLine { + pub due_date: DateTime, + pub title: Option, + pub amount: f64, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct RegularPrescriptionStudentDetail { + pub id: i64, + pub last_name: Option, + pub first_name: Option, + pub full_name: Option, + pub title: Option, + pub balance: f64, + pub total_regulation_amount: f64, + pub status: String, //PaymentsTeacherStudentStatus, enum "Active" "Canceled" + pub document_lines: Option>, + pub regulation_lines: Option>, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct RegularPrescriptionStudent { + pub id: i64, + pub last_name: Option, + pub first_name: Option, + pub full_name: Option, + 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, + pub payment_type_id: i64, + pub payment_type_name: Option, + pub amount: f64, + pub state: String, //PaymentsTeacherStudentStatus, enum "Active" "Canceled" + pub due_date_max: Option>, + pub students_count: i64, +} \ No newline at end of file diff --git a/src/semester.rs b/src/semester.rs new file mode 100644 index 0000000..5c7aa12 --- /dev/null +++ b/src/semester.rs @@ -0,0 +1,41 @@ +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, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct CertificateTerm { + pub final_marks: Option>, + pub subjects: Option>, + pub grade_name: String, + pub grade: i64, + pub year_in_school: i64, + pub school_year: String, + pub semester: String, + pub semester_name: String, + pub repeated: bool, + pub closed: bool, + pub achievement_text: Option, + pub absent_hours: Option, + pub not_excused_hours: Option, + pub marks_average: Option, + pub certificate_date: Option>, + +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct FinalMark { + pub mark_date: DateTime, + pub edit_date: DateTime, + pub mark_text: String, + pub subject_id: String, + pub id: String, +} diff --git a/src/stdtype.rs b/src/stdtype.rs index e1cca1c..04cb17a 100644 --- a/src/stdtype.rs +++ b/src/stdtype.rs @@ -8,6 +8,23 @@ pub struct StdType { pub name: String, } +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct StdTypeNullable { + pub id: Option, + pub abbrev: Option, + pub name: Option, +} + + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct SchoolClass { + pub id: String, + pub abbrev: String, + pub name: String, +} + #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "PascalCase")] pub struct StdClassGroup { @@ -16,3 +33,51 @@ pub struct StdClassGroup { pub abbrev: String, pub name: String, } + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct SchoolClassSet { + pub id: String, + pub abbrev: String, + pub name: String, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct Teacher { + pub id: String, + pub abbrev: String, + pub name: String, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct TeacherSet{ + pub id: String, + pub abbrev: String, + pub name: String, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct Room{ + pub id: String, + pub abbrev: String, + pub name: String, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct RoomSet{ + pub id: String, + pub abbrev: String, + pub name: String, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct Student{ + pub id: String, + pub abbrev: String, + pub name: String, +} \ No newline at end of file