schedulelib/dto/
generated_schedule_request.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use common::enums::subject::Subject;
use serde::{Deserialize, Serialize};
use uuid::Uuid;

use crate::dto::subgroup_request::SubgroupRequest;

#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct GeneratedScheduleRequest {
    pub organization: Uuid,
    pub name: String,
    pub study_period: Uuid,
    pub syllabus: Uuid,
    pub include_saturday: bool,
    pub include_shortened_day: bool,
    pub beginning_melody: Uuid,
    pub ending_melody: Uuid,
    pub big_breaks_after_lesson: i32,
    pub big_breaks_length: i32,
    pub breaks_length: i32,
    pub lesson_length: i32,
    pub number_of_lessons: i32,
    pub shift_after_lesson: i32,
    pub shift_length: i32,
    pub allocations: Vec<AllocationSettings>,
    pub start_of_classes: i32,
}

#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct AllocationSettings {
    pub altroom: Option<Vec<Uuid>>,
    pub room: Option<Vec<Uuid>>,
    pub class_id: Uuid,
    pub hours: i32,
    pub id: Uuid,
    pub subject: Subject,
    pub groups: Option<Vec<SubgroupRequest>>,
}