Skip to main content

hypercall_db/types/
push.rs

1//! Push subscription domain types.
2//!
3//! Web Push endpoint, keys, and per-subscription notification preferences.
4
5use chrono::{DateTime, Utc};
6use serde::{Deserialize, Serialize};
7
8/// A persisted push subscription row.
9#[derive(Debug, Clone, Serialize, Deserialize)]
10pub struct PushSubscriptionRecord {
11    pub id: i64,
12    pub wallet_address: String,
13    pub endpoint: String,
14    pub auth_key: String,
15    pub p256dh_key: String,
16    pub preferences: serde_json::Value,
17    pub created_at: DateTime<Utc>,
18}
19
20/// Input for inserting or upserting a push subscription.
21#[derive(Debug, Clone)]
22pub struct UpsertPushSubscriptionInput {
23    pub wallet_address: String,
24    pub endpoint: String,
25    pub auth_key: String,
26    pub p256dh_key: String,
27    pub preferences: serde_json::Value,
28}