use serde::Serialize; use uuid::Uuid; #[derive(Debug, Clone, Serialize, sqlx::FromRow)] pub struct Notification { pub id: String, pub kind: String, pub title: String, pub body: String, pub is_read: bool, pub created_at: String, } impl Notification { pub fn new(kind: &str, title: &str, body: &str) -> Self { Self { id: Uuid::new_v4().to_string(), kind: kind.to_string(), title: title.to_string(), body: body.to_string(), is_read: false, created_at: chrono::Utc::now().to_rfc3339(), } } }