postmasterlib/dto/
transaction_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
use serde::{Deserialize, Serialize};

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

#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct TransactionLog {
    pub from: UserMinimal,
    pub to: UserMinimal,
    pub transaction: String,
    pub action: String,
    pub extra: String,
}


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

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

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