refactor(application): strip comments, DRY ownership check + parse_content_type
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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>,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
/// List all provider configurations.
|
||||
pub struct ListProvidersQuery;
|
||||
|
||||
/// Get a provider configuration by ID.
|
||||
pub struct GetProviderQuery {
|
||||
pub id: String,
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user