2025-04-01 23:16:09 -04:00
|
|
|
use serde::{Deserialize, Serialize};
|
2025-05-06 16:13:48 -04:00
|
|
|
use tetratto_shared::{snow::Snowflake, unix_epoch_timestamp};
|
2025-04-01 23:16:09 -04:00
|
|
|
|
|
|
|
use super::reactions::AssetType;
|
|
|
|
|
|
|
|
#[derive(Serialize, Deserialize)]
|
|
|
|
pub struct AuditLogEntry {
|
|
|
|
pub id: usize,
|
|
|
|
pub created: usize,
|
|
|
|
pub moderator: usize,
|
|
|
|
pub content: String,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl AuditLogEntry {
|
|
|
|
/// Create a new [`AuditLogEntry`].
|
|
|
|
pub fn new(moderator: usize, content: String) -> Self {
|
|
|
|
Self {
|
2025-05-06 16:13:48 -04:00
|
|
|
id: Snowflake::new().to_string().parse::<usize>().unwrap(),
|
2025-06-14 20:26:54 -04:00
|
|
|
created: unix_epoch_timestamp(),
|
2025-04-01 23:16:09 -04:00
|
|
|
moderator,
|
|
|
|
content,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Serialize, Deserialize)]
|
|
|
|
pub struct Report {
|
|
|
|
pub id: usize,
|
|
|
|
pub created: usize,
|
|
|
|
pub owner: usize,
|
|
|
|
pub content: String,
|
|
|
|
pub asset: usize,
|
|
|
|
pub asset_type: AssetType,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Report {
|
|
|
|
/// Create a new [`Report`].
|
|
|
|
pub fn new(owner: usize, content: String, asset: usize, asset_type: AssetType) -> Self {
|
|
|
|
Self {
|
2025-05-06 16:13:48 -04:00
|
|
|
id: Snowflake::new().to_string().parse::<usize>().unwrap(),
|
2025-06-14 20:26:54 -04:00
|
|
|
created: unix_epoch_timestamp(),
|
2025-04-01 23:16:09 -04:00
|
|
|
owner,
|
|
|
|
content,
|
|
|
|
asset,
|
|
|
|
asset_type,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|