Skip to main content

hypercall_db/types/
notifications.rs

1//! Notification feed domain types.
2//!
3//! Persisted notification rows and inputs for the in-app notification feed.
4
5use chrono::{DateTime, Utc};
6use serde::{Deserialize, Serialize};
7
8/// A persisted notification row.
9#[derive(Debug, Clone, Serialize, Deserialize)]
10pub struct NotificationRecord {
11    pub id: i64,
12    pub wallet_address: String,
13    pub notification_type: String,
14    pub payload: Vec<u8>,
15    pub read_at: Option<DateTime<Utc>>,
16    pub created_at: DateTime<Utc>,
17}
18
19/// Input for inserting a new notification.
20#[derive(Debug, Clone)]
21pub struct NewNotificationInput {
22    pub wallet_address: String,
23    pub notification_type: String,
24    pub payload: Vec<u8>,
25}