Buchung funktioniert email anfänglich
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use chrono::NaiveDateTime;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
pub type IdType = i64;
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct Teacher {
|
||||
pub id: IdType,
|
||||
pub ansprache: String,
|
||||
pub last_name: String,
|
||||
pub subject_id: IdType,
|
||||
}
|
||||
|
||||
pub type Teachers = Vec<Teacher>;
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct Subject {
|
||||
pub id: IdType,
|
||||
pub name: String,
|
||||
}
|
||||
pub type Subjects = Vec<Subject>;
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct Appointment {
|
||||
pub id: IdType,
|
||||
pub teacher_id: IdType,
|
||||
pub slot_id: IdType,
|
||||
}
|
||||
#[derive(Debug, Deserialize, Serialize, Clone)]
|
||||
pub struct PlannedAppointment {
|
||||
pub teacher_id: IdType,
|
||||
pub slot_id: IdType,
|
||||
}
|
||||
|
||||
pub type AppointmentSlots = HashMap<IdType, AppointmentSlot>;
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct AppointmentSlot {
|
||||
pub id: IdType,
|
||||
pub start_time: NaiveDateTime,
|
||||
pub end_time: NaiveDateTime,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct OccupiedSlot {
|
||||
pub id: IdType,
|
||||
pub teacher_id: IdType,
|
||||
pub slot_id: IdType,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, Hash, Clone, Copy, Eq, PartialEq)]
|
||||
pub struct SlotId {
|
||||
pub teacher_id: IdType,
|
||||
pub slot_id: IdType,
|
||||
}
|
||||
|
||||
impl SlotId {
|
||||
pub fn new(teacher: IdType, slot: IdType) -> Self {
|
||||
Self {
|
||||
teacher_id: teacher,
|
||||
slot_id: slot,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub enum RequestState {
|
||||
Success,
|
||||
Message(String),
|
||||
Error,
|
||||
}
|
||||
Reference in New Issue
Block a user