fix: align code with spec

This commit is contained in:
2026-04-03 15:53:48 +02:00
parent 95c97bce33
commit 897577a369
10 changed files with 141 additions and 20 deletions

View File

@@ -10,20 +10,44 @@ pub struct GeneratedFileHash {
pub updated_at: i64,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum NotificationEntity {
Post,
Media,
Script,
Template,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum NotificationAction {
Created,
Updated,
Deleted,
}
/// Notification for CLI-to-app synchronization.
/// Matches the `db_notifications` table.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DbNotification {
pub id: i64,
pub entity: String,
pub entity_type: NotificationEntity,
pub entity_id: String,
pub action: String,
pub action: NotificationAction,
pub from_cli: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub seen_at: Option<i64>,
pub created_at: i64,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum SshMode {
Scp,
Rsync,
}
/// Publishing preferences stored in meta/publishing.json.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PublishingPreferences {
@@ -33,6 +57,5 @@ pub struct PublishingPreferences {
pub ssh_user: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub ssh_remote_path: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub ssh_mode: Option<String>,
pub ssh_mode: SshMode,
}