style: cargo fmt --all

This commit is contained in:
2026-05-31 05:31:42 +02:00
parent 4b31a0f74b
commit c2ebca0da0
138 changed files with 2422 additions and 1164 deletions

View File

@@ -1,11 +1,11 @@
use std::sync::Arc;
use domain::{
entities::UsageType,
errors::DomainError,
ports::{QuotaRepository, UsageLedgerRepository},
storage::services::{check_quota, QuotaCheckResult},
storage::services::{QuotaCheckResult, check_quota},
value_objects::SystemId,
};
use std::sync::Arc;
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct CheckQuotaQuery {
@@ -24,7 +24,10 @@ impl CheckQuotaHandler {
quota_repo: Arc<dyn QuotaRepository>,
ledger_repo: Arc<dyn UsageLedgerRepository>,
) -> Self {
Self { quota_repo, ledger_repo }
Self {
quota_repo,
ledger_repo,
}
}
pub async fn execute(&self, query: CheckQuotaQuery) -> Result<QuotaCheckResult, DomainError> {
@@ -39,7 +42,15 @@ impl CheckQuotaHandler {
});
};
let current = self.ledger_repo.sum_usage(&query.user_id, query.usage_type, None).await?;
Ok(check_quota(&quota, query.usage_type, current, query.requested_amount))
let current = self
.ledger_repo
.sum_usage(&query.user_id, query.usage_type, None)
.await?;
Ok(check_quota(
&quota,
query.usage_type,
current,
query.requested_amount,
))
}
}