Skip to main content

haste_repository/types/
subscription.rs

1use haste_jwt::{ProjectId, TenantId, VersionId};
2use serde::{Deserialize, Serialize};
3
4#[derive(sqlx::FromRow, Debug, Deserialize, Serialize)]
5pub struct Subscription {
6    pub id: String,
7    pub version_id: VersionId,
8    pub tenant: TenantId,
9    pub project: ProjectId,
10    pub status: String,
11    pub reason: String,
12    pub critieria: String,
13    // Where to send the notifications
14    pub channel_type: String,
15    pub channel_endpoint: Option<String>,
16    pub channel_payload: Option<String>,
17    pub channel_headers: Option<serde_json::Value>,
18
19    // Tracking fields
20    pub last_event_sequence: i64,
21}
22
23pub struct SubscriptionSearchClaims {}
24
25pub struct CreateSubscription {
26    pub id: String,
27    pub version_id: VersionId,
28    pub tenant: TenantId,
29    pub project: ProjectId,
30    pub status: String,
31    pub reason: String,
32    pub critieria: String,
33    // Where to send the notifications
34    pub channel_type: String,
35    pub channel_endpoint: Option<String>,
36    pub channel_payload: Option<String>,
37    pub channel_headers: Option<serde_json::Value>,
38}