aboutsummaryrefslogtreecommitdiff
path: root/src/infrastructure/persistence/models.rs
blob: dc39e94ea14f4fd5b7b95f80bf5d0625d699efeb (plain)
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
49
50
51
52
53
use sqlx::FromRow;

#[derive(Debug, FromRow)]
pub struct CalendarModel {
    pub id: String,
    pub name: String,
    pub description: Option<String>,
    pub is_archived: i64,
    pub created_at: String,
    pub updated_at: String,
}

#[derive(Debug, FromRow)]
pub struct EventModel {
    pub id: String,
    pub calendar_id: String,
    pub title: String,
    pub description: Option<String>,
    pub starts_at: String,
    pub ends_at: String,
    pub color: i64,
    pub is_all_day: i64,
    pub is_cancelled: i64,
    pub created_at: String,
    pub updated_at: String,
}

#[derive(Debug, FromRow)]
pub struct RecurrenceModel {
    pub id: String,
    pub calendar_id: String,
    pub title: String,
    pub description: Option<String>,
    pub starts_at: String,
    pub ends_at: String,
    pub frequency: String,
    pub interval: i64,
    pub until: Option<String>,
    pub color: i64,
    pub is_all_day: i64,
    pub is_cancelled: i64,
    pub created_at: String,
    pub updated_at: String,
}

#[derive(Debug, FromRow)]
pub struct RecurrenceExceptionModel {
    pub recurrence_id: String,
    pub original_starts_at: String,
    pub new_starts_at: Option<String>,
    pub new_ends_at: Option<String>,
    pub is_cancelled: i64,
}