refactor(application): strip comments, DRY ownership check + parse_content_type

This commit is contained in:
2026-07-12 04:10:58 +02:00
parent 98a54245b1
commit 9dcd169689
62 changed files with 56 additions and 203 deletions

View File

@@ -5,10 +5,6 @@ use domain::{DomainError, DomainResult};
use super::commands::RestoreSnapshotCommand;
use super::deps::ConfigSnapshotDeps;
/// Restore a channel's config from a snapshot.
///
/// Flow: find snapshot -> find channel -> snapshot current config (backup) ->
/// apply snapshot config to channel -> save channel -> return updated channel.
pub async fn execute(
deps: &ConfigSnapshotDeps,
cmd: RestoreSnapshotCommand,
@@ -30,12 +26,10 @@ pub async fn execute(
.await?
.ok_or(DomainError::ChannelNotFound(cmd.channel_id))?;
// Auto-snapshot the current config before overwriting
deps.channel_command
.save_config_snapshot(channel_id, channel.schedule_config(), None)
.await?;
// Apply the snapshot's config
channel.set_schedule_config(snapshot.config().clone());
deps.channel_command.save(&channel).await?;