You've already forked pages
forked from didirus/AstralRinth
* Redo dependencies, add rejection reasons, make notifications more readable * Fix errors, add dependency route, finish PR * Fix clippy errors
31 lines
839 B
Rust
31 lines
839 B
Rust
use super::ids::Base62Id;
|
|
use super::users::UserId;
|
|
use chrono::{DateTime, Utc};
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
|
#[serde(from = "Base62Id")]
|
|
#[serde(into = "Base62Id")]
|
|
pub struct NotificationId(pub u64);
|
|
|
|
#[derive(Serialize, Deserialize)]
|
|
pub struct Notification {
|
|
pub id: NotificationId,
|
|
pub user_id: UserId,
|
|
#[serde(rename = "type")]
|
|
pub type_: Option<String>,
|
|
pub title: String,
|
|
pub text: String,
|
|
pub link: String,
|
|
pub read: bool,
|
|
pub created: DateTime<Utc>,
|
|
pub actions: Vec<NotificationAction>,
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize)]
|
|
pub struct NotificationAction {
|
|
pub title: String,
|
|
/// The route to call when this notification action is called. Formatted HTTP Method, route
|
|
pub action_route: (String, String),
|
|
}
|