ofdb_entities/
activity.rs

1use crate::{email::*, time::*};
2
3#[derive(Debug, Clone, PartialEq, Eq)]
4pub struct Activity {
5    pub at: Timestamp,
6    pub by: Option<EmailAddress>,
7}
8
9impl Activity {
10    pub fn now(by: Option<EmailAddress>) -> Self {
11        Self {
12            at: Timestamp::now(),
13            by,
14        }
15    }
16
17    pub fn anonymize(self) -> Self {
18        Self { by: None, ..self }
19    }
20}
21
22#[derive(Debug, Clone, PartialEq, Eq)]
23pub struct ActivityLog {
24    pub activity: Activity,
25    pub context: Option<String>,
26    pub comment: Option<String>,
27}