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
use crate::{email::*, time::*};

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Activity {
    pub at: TimestampMs,
    pub by: Option<Email>,
}

impl Activity {
    pub fn now(by: Option<Email>) -> Self {
        Self {
            at: TimestampMs::now(),
            by,
        }
    }

    pub fn anonymize(self) -> Self {
        Self { by: None, ..self }
    }
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ActivityLog {
    pub activity: Activity,
    pub context: Option<String>,
    pub comment: Option<String>,
}