use serde::{Deserialize, Serialize};
use tritools::time::unix_epoch_timestamp;
use super::{reactions::AssetType, id::Id};

#[derive(Serialize, Deserialize)]
pub struct AuditLogEntry {
    pub id: Id,
    pub created: u128,
    pub moderator: Id,
    pub content: String,
}

impl AuditLogEntry {
    /// Create a new [`AuditLogEntry`].
    pub fn new(moderator: Id, content: String) -> Self {
        Self {
            id: Id::new(),
            created: unix_epoch_timestamp(),
            moderator,
            content,
        }
    }
}

#[derive(Serialize, Deserialize)]
pub struct Report {
    pub id: Id,
    pub created: u128,
    pub owner: Id,
    pub content: String,
    pub asset: Id,
    pub asset_type: AssetType,
}

impl Report {
    /// Create a new [`Report`].
    pub fn new(owner: Id, content: String, asset: Id, asset_type: AssetType) -> Self {
        Self {
            id: Id::new(),
            created: unix_epoch_timestamp(),
            owner,
            content,
            asset,
            asset_type,
        }
    }
}
