postmasterlib/dto/
lesson_plan_log.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
40
41
42
43
44
45
46
47
48
use crate::dto::GenericLetterDto;
use serde::{Deserialize, Serialize};

use crate::dto::user_minimal::UserMinimal;
use crate::enums::templates::Templates;

#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct LessonPlanLog {
    pub from: UserMinimal,
    pub to: UserMinimal,
    pub lesson_plan_name: String,
    pub approved: String,
    pub content_cd_compliant: String,
    pub equipment: EquipmentOrPsychology,
    pub psychology: EquipmentOrPsychology,
    pub sections: Vec<Section>,
}

impl GenericLetterDto for LessonPlanLog {
    fn get_template(&self) -> Templates {
        Templates::LessonPlanLog
    }

    fn get_to_user(&self) -> UserMinimal {
        self.to.clone()
    }

    fn get_from_user(&self) -> UserMinimal {
        self.from.clone()
    }
}

#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct EquipmentOrPsychology {
    pub reasonable: String,
    pub comment: String,
}

#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct Section {
    pub name: String,
    pub time_reasonable: String,
    pub approved: String,
    pub comment: String,
}