added payment endpoints
This commit is contained in:
4 files changed
+219
-74
No files matched your search
@@ -0,0 +1,105 @@
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use crate::{
|
||||
ClassFundMonthly, ClassFundPaymentInfo, ClassFundSummary, ClassFundTeacherDocumentDetail,
|
||||
ClassFundTeacherDocumentsMonthly, ClassFundTeacherStudentsItem, ClassFundTeacherSummary,
|
||||
Endpoint, RegularPayment, RegularPaymentDetail, RegularPaymentsSummary, RegularPrescription,
|
||||
RegularPrescriptionDetail, RegularPrescriptionStudent, RegularPrescriptionStudentDetail,
|
||||
};
|
||||
|
||||
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,
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
mod endpoints;
|
||||
mod payments;
|
||||
|
||||
pub use endpoints::*;
|
||||
pub use payments::*;
|
||||
@@ -12,93 +12,101 @@ pub struct ClassfundSummary {
|
||||
#[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>,
|
||||
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 {
|
||||
description: Option<String>,
|
||||
date: DateTime<FixedOffset>,
|
||||
amount: f64,
|
||||
pub description: Option<String>,
|
||||
pub date: DateTime<FixedOffset>,
|
||||
pub amount: f64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct ClassFundSummary {
|
||||
student_name_with_class: Option<String>,
|
||||
balance: f64,
|
||||
spent: f64,
|
||||
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 {
|
||||
full_name_with_class: Option<String>,
|
||||
amount: f64,
|
||||
status: Option<String>, //Option<PaymentsTeacherStudentStatus>, enum "Active" "Canceled"
|
||||
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 {
|
||||
title: Option<String>,
|
||||
amount: f64,
|
||||
date: DateTime<FixedOffset>,
|
||||
student_count: i64,
|
||||
students: Option<Vec<ClassFundTeacherDocumentDetailStudent>>,
|
||||
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 {
|
||||
id: i64,
|
||||
title: Option<String>,
|
||||
date: DateTime<FixedOffset>,
|
||||
total_amount: f64,
|
||||
amount_per_student: f64,
|
||||
student_count: i64,
|
||||
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 {
|
||||
date: DateTime<FixedOffset>,
|
||||
monthly_balance: f64,
|
||||
items: Vec<ClassFundTeacherDocumentsItem>,
|
||||
pub date: DateTime<FixedOffset>,
|
||||
pub monthly_balance: f64,
|
||||
pub 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
|
||||
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 {
|
||||
abbrev: Option<String>,
|
||||
class_id: Option<String>,
|
||||
balance: f64,
|
||||
amount_to_pay: f64,
|
||||
debtors: i64,
|
||||
spent: f64,
|
||||
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 {
|
||||
teacher_name: Option<String>,
|
||||
allowed_classes: Option<Vec<ClassFundTeacherSummaryClass>>,
|
||||
pub teacher_name: Option<String>,
|
||||
pub allowed_classes: Option<Vec<ClassFundTeacherSummaryClass>>,
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -106,26 +114,26 @@ pub struct ClassFundTeacherSummary {
|
||||
#[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>,
|
||||
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 {
|
||||
payment_id: i64,
|
||||
title: Option<String>,
|
||||
due_date: DateTime<FixedOffset>,
|
||||
amount: f64,
|
||||
status: String, //r16 = <RegularPaymentStatus> "BeforeDueDate", "NotPaid", "Paid", "PartiallyPaid"
|
||||
original_amount: f64,
|
||||
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)]
|
||||
@@ -154,7 +162,7 @@ pub struct RegularPrescriptionDetail {
|
||||
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 state: RegularPrescription,
|
||||
pub due_date_max: DateTime<FixedOffset>,
|
||||
pub bank_account: Option<String>,
|
||||
pub specific_symbol: Option<i64>,
|
||||
@@ -187,7 +195,7 @@ pub struct RegularPrescriptionStudentDetail {
|
||||
pub title: Option<String>,
|
||||
pub balance: f64,
|
||||
pub total_regulation_amount: f64,
|
||||
pub status: String, //PaymentsTeacherStudentStatus, enum "Active" "Canceled"
|
||||
pub status: PaymentsTeacherStudentStatus,
|
||||
pub document_lines: Option<Vec<RegularPrescriptionDocumentLine>>,
|
||||
pub regulation_lines: Option<Vec<RegularPrescriptionRegulationLine>>,
|
||||
}
|
||||
@@ -200,7 +208,7 @@ pub struct RegularPrescriptionStudent {
|
||||
pub first_name: Option<String>,
|
||||
pub full_name: Option<String>,
|
||||
pub balance: f64,
|
||||
pub status: String, //PaymentsTeacherStudentStatus, enum "Active" "Canceled"
|
||||
pub status: PaymentsTeacherStudentStatus,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
@@ -211,7 +219,34 @@ pub struct RegularPrescription {
|
||||
pub payment_type_id: i64,
|
||||
pub payment_type_name: Option<String>,
|
||||
pub amount: f64,
|
||||
pub state: String, //PaymentsTeacherStudentStatus, enum "Active" "Canceled"
|
||||
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 PaymentsTeacherStudentStatus {
|
||||
Active,
|
||||
Canceled,
|
||||
}
|
||||
|
||||
#[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,
|
||||
}
|
||||
+13
-13
@@ -6,7 +6,7 @@
|
||||
- [ ] class book
|
||||
- [x] events
|
||||
- [x] auth
|
||||
- [ ] error
|
||||
- [ ] errors
|
||||
- [x] gdpr
|
||||
- [x] homeworks
|
||||
- [ ] komens
|
||||
@@ -31,17 +31,17 @@
|
||||
- [x] /api/3/marks
|
||||
- [x] /api/3/homeworks/:id/student-done/:finished
|
||||
- [ ] /api/3/marking/atoms/:atomId/headers
|
||||
- [ ] /api/3/payments/classfund/teacher/students/:classId
|
||||
- [x] /api/3/payments/classfund/teacher/students/:classId
|
||||
- [ ] /api/3/classbook/lessonTags
|
||||
- [ ] /api/3/komens/messages/rating/:messageId
|
||||
- [ ] /api/3/absence/student
|
||||
- [ ] /api/3/webmodule
|
||||
- [ ] /api/3/timetable/actual
|
||||
- [ ] /api/3/payments/classfund/teacher/document/detail/:documentId
|
||||
- [x] /api/3/payments/classfund/teacher/document/detail/:documentId
|
||||
- [ ] /api/3
|
||||
- [ ] /api/3/komens/attachment/:id
|
||||
- [x] /api/3/subjects/themes/:subjectId
|
||||
- [ ] /api/3/payments/classfund
|
||||
- [x] /api/3/payments/classfund
|
||||
- [ ] /api/3/gdpr/consents/person/child
|
||||
- [ ] /api/3/komens/concept/:conceptId
|
||||
- [ ] /api/3/marks/measures
|
||||
@@ -54,13 +54,13 @@
|
||||
- [ ] /api/3/komens/messages/apology/:messageId
|
||||
- [ ] /api/3/komens/messages/received/:messageId
|
||||
- [x] /api/3/user
|
||||
- [ ] /api/3/payments/regularpayments/detail/:paymentId
|
||||
- [x] /api/3/payments/regularpayments/detail/:paymentId
|
||||
- [x] /api/3/substitutions
|
||||
- [ ] /api/3/marks/what-if
|
||||
- [ ] /api/3/gdpr/commissioner/send-objection
|
||||
- [ ] /api/3/gdpr/consents/person/new
|
||||
- [ ] /api/3/lesson/:lessonId/absence
|
||||
- [ ] /api/3/payments/regularpayments/summary
|
||||
- [x] /api/3/payments/regularpayments/summary
|
||||
- [ ] /api/3/emergency/startemergency
|
||||
- [ ] /api/3/timetable/permanent/class/:classId
|
||||
- [ ] /api/3/gdpr/commissioner/send-report
|
||||
@@ -80,7 +80,7 @@
|
||||
- [ ] /api/3/login/:token
|
||||
- [ ] /api/3/komens/concepts
|
||||
- [ ] /api/3/komens/messages/received/unread
|
||||
- [ ] /api/3/payments/regularpayments/teacher/prescriptions/:prescriptionId
|
||||
- [x] /api/3/payments/regularpayments/teacher/prescriptions/:prescriptionId
|
||||
- [ ] /api/3/timetable/actual/class/:classId
|
||||
- [ ] /api/3/gdpr/consents/person
|
||||
- [ ] /api/3/komens/messages/unread
|
||||
@@ -93,11 +93,11 @@
|
||||
- [ ] /api/3/payments/regularpayments
|
||||
- [ ] /api/3/komens/messages/noticeboard/:messageId&
|
||||
- [ ] /api/3/komens/message-types/reply/:messageId
|
||||
- [ ] /api/3/payments/regularpayments/teacher/prescriptions
|
||||
- [x] /api/3/payments/regularpayments/teacher/prescriptions
|
||||
- [x] /api/3/marks/SetClassificationConfirmation
|
||||
- [x] /api/3/homeworks/count-actual
|
||||
- [ ] /api/3/gdpr/consent/:id/revoke-request
|
||||
- [ ] /api/3/payments/regularpayments/teacher/prescriptions/:prescriptionId/students/:studentId
|
||||
- [x] /api/3/payments/regularpayments/teacher/prescriptions/:prescriptionId/students/:studentId
|
||||
- [ ] /api/3/marking/atoms
|
||||
- [ ] /api/3/absence/canexcuse/:studentId
|
||||
- [ ] /api/3/komens/rating-templates
|
||||
@@ -111,17 +111,17 @@
|
||||
- [x] /api/3/substitutions/cycles
|
||||
- [x] /api/3/logintoken
|
||||
- [ ] /api/3/komens/message-types/edit/:messageId
|
||||
- [ ] /api/3/payments/classfund/teacher/documents/:classId
|
||||
- [ ] /api/3/payments/classfund/summary
|
||||
- [x] /api/3/payments/classfund/teacher/documents/:classId
|
||||
- [x] /api/3/payments/classfund/summary
|
||||
- [ ] /api/3/register-notification
|
||||
- [ ] /api/3/payments/classfund/paymentsinfo
|
||||
- [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
|
||||
- [ ] /api/3/payments/classfund/teacher/summary
|
||||
- [x] /api/3/payments/classfund/teacher/summary
|
||||
- [ ] /api/3/komens/messages/sent/:messageId
|
||||
- [x] /api/login
|
||||
- [x] /.well-known/openid-configuration
|
||||
Reference in new issue
Block a user