feat: init
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
use crate::models::common::{NotificationType, Priority, TargetType};
|
||||
use crate::models::json_types::{NotificationMetadata, TypedJson};
|
||||
use chrono::{DateTime, Utc};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use uuid::Uuid;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, sqlx::FromRow)]
|
||||
pub struct Notification {
|
||||
pub id: Uuid,
|
||||
pub user_id: Uuid,
|
||||
pub actor_id: Option<Uuid>,
|
||||
pub workspace_id: Option<Uuid>,
|
||||
pub repo_id: Option<Uuid>,
|
||||
pub issue_id: Option<Uuid>,
|
||||
pub pull_request_id: Option<Uuid>,
|
||||
pub channel_id: Option<Uuid>,
|
||||
pub message_id: Option<Uuid>,
|
||||
pub notification_type: NotificationType,
|
||||
pub title: String,
|
||||
pub body: Option<String>,
|
||||
pub target_type: Option<TargetType>,
|
||||
pub target_id: Option<Uuid>,
|
||||
pub action_url: Option<String>,
|
||||
pub priority: Priority,
|
||||
pub read_at: Option<DateTime<Utc>>,
|
||||
pub dismissed_at: Option<DateTime<Utc>>,
|
||||
pub metadata: Option<TypedJson<NotificationMetadata>>,
|
||||
pub created_at: DateTime<Utc>,
|
||||
pub updated_at: DateTime<Utc>,
|
||||
pub deleted_at: Option<DateTime<Utc>>,
|
||||
}
|
||||
Reference in New Issue
Block a user