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

@@ -1,4 +1,3 @@
/// Insert or update a provider configuration.
pub struct UpsertProviderCommand {
pub id: String,
pub provider_type: String,
@@ -6,7 +5,6 @@ pub struct UpsertProviderCommand {
pub enabled: bool,
}
/// Delete a provider configuration.
pub struct DeleteProviderCommand {
pub id: String,
}

View File

@@ -3,7 +3,6 @@ use domain::DomainResult;
use super::commands::DeleteProviderCommand;
use super::deps::ProviderDeps;
/// Delete a provider configuration by ID.
pub async fn execute(deps: &ProviderDeps, cmd: DeleteProviderCommand) -> DomainResult<()> {
deps.provider_config_command.delete(&cmd.id).await
}

View File

@@ -2,7 +2,6 @@ use std::sync::Arc;
use domain::ports::{ProviderConfigCommand, ProviderConfigQuery};
/// Dependencies for provider config use cases.
pub struct ProviderDeps {
pub provider_config_command: Arc<dyn ProviderConfigCommand>,
pub provider_config_query: Arc<dyn ProviderConfigQuery>,

View File

@@ -4,7 +4,6 @@ use domain::DomainResult;
use super::deps::ProviderDeps;
use super::queries::GetProviderQuery;
/// Get a provider configuration by ID.
pub async fn execute(
deps: &ProviderDeps,
query: GetProviderQuery,

View File

@@ -4,7 +4,6 @@ use domain::DomainResult;
use super::deps::ProviderDeps;
use super::queries::ListProvidersQuery;
/// List all provider configurations.
pub async fn execute(
deps: &ProviderDeps,
_query: ListProvidersQuery,

View File

@@ -1,7 +1,5 @@
/// List all provider configurations.
pub struct ListProvidersQuery;
/// Get a provider configuration by ID.
pub struct GetProviderQuery {
pub id: String,
}

View File

@@ -4,7 +4,6 @@ use domain::DomainResult;
use super::commands::UpsertProviderCommand;
use super::deps::ProviderDeps;
/// Insert or update a provider configuration.
pub async fn execute(deps: &ProviderDeps, cmd: UpsertProviderCommand) -> DomainResult<()> {
let row = ProviderConfigRow::from_persistence(
cmd.id,