domain crate code quality cleanup

strip all comments, extract tests to tests/ dirs,
remove #[allow(clippy::...)], extract magic numbers to
constants, refactor schedule engine private methods to
use param structs, add Default impls, clippy.toml for
persistence constructors
This commit is contained in:
2026-07-12 04:02:12 +02:00
parent d650e2ba07
commit 98a54245b1
54 changed files with 1190 additions and 1942 deletions

View File

@@ -1,21 +1,12 @@
//! Application settings port.
//!
//! Key-value admin configuration (e.g. `library_sync_interval_hours`).
//! Small enough to keep as a single trait rather than CQRS split.
use async_trait::async_trait;
use crate::errors::DomainResult;
/// Port for general admin settings persistence (`app_settings` table).
#[async_trait]
pub trait AppSettingsRepository: Send + Sync {
/// Get a setting value by key. Returns `None` if not set.
async fn get(&self, key: &str) -> DomainResult<Option<String>>;
/// Set a setting value (upsert).
async fn set(&self, key: &str, value: &str) -> DomainResult<()>;
/// Get all settings as (key, value) pairs.
async fn get_all(&self) -> DomainResult<Vec<(String, String)>>;
}