1
use chrono::{DateTime, Utc};
2
use serde::{Deserialize, Serialize};
3

            
4
756
#[derive(Debug, Serialize, Deserialize, Clone)]
5
pub struct ReviewType {
6
    pub name: String,
7
    pub organization: String,
8
    pub emails: Vec<String>,
9
}
10

            
11
129
#[derive(Debug, Serialize, Deserialize, Default, Clone)]
12
pub struct ReviewRequest {
13
    pub date: DateTime<Utc>,
14
    pub projectname: String,
15
    pub name: String,
16
    pub phone: Option<String>,
17
    pub email: String,
18
    pub programme: String,
19
    pub summary: String,
20
    pub www: String,
21
    pub i18n: bool,
22
    pub licensing: bool,
23
    pub testing: bool,
24
    pub community: bool,
25
    pub a11y: bool,
26
    pub packaging: bool,
27
    pub diversity: bool,
28
    pub standards: bool,
29
    pub security: bool,
30
    pub governance: bool,
31
    #[serde(default)]
32
    pub uxtesting: bool,
33
    #[serde(default)]
34
    pub technicalwriting: bool,
35
    pub comments: String,
36
}
37

            
38
impl ReviewRequest {
39
    pub fn remove_personal_information(&mut self) {
40
        self.name.clear();
41
        self.email.clear();
42
        self.phone = None;
43
        // these fields are cleared to be on the safe side
44
        self.summary.clear();
45
        self.comments.clear();
46
    }
47
}
48

            
49
fn bool_true() -> bool {
50
    true
51
}
52

            
53
#[derive(Debug, Serialize, Deserialize, Default, Clone)]
54
pub struct Rejection {
55
    pub date: DateTime<Utc>,
56
    pub creator: String,
57
    pub request: String,
58
    pub review_type: String,
59
    pub rejection_comment: String,
60
    #[serde(default = "bool_true")]
61
    pub send_mail: bool,
62
}
63

            
64
#[derive(Debug, Serialize, Deserialize, Clone)]
65
pub struct Task {
66
    pub date: DateTime<Utc>,
67
    pub creator: String,
68
    pub request: String,
69
    pub review_type: String,
70
    pub assigned_organization: String,
71
    pub assignment_comment: String,
72
}
73

            
74
#[derive(Debug, Serialize, Deserialize, Clone)]
75
pub struct Report {
76
    pub date: DateTime<Utc>,
77
    pub creator: String,
78
    pub task: String,
79
    pub message: String,
80
    pub filename: Option<String>,
81
    pub fileid: Option<String>,
82
    pub rate_euros_per_hour: Option<f32>,
83
    pub time_spent_hours: Option<f32>,
84
}