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,10 +1,10 @@
use std::sync::Arc;
use domain::{
entities::{Job, JobBatch},
errors::DomainError,
ports::{JobBatchRepository, JobRepository},
value_objects::SystemId,
};
use std::sync::Arc;
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ReportBatchProgressQuery {
@@ -24,11 +24,20 @@ pub struct ReportBatchProgressHandler {
impl ReportBatchProgressHandler {
pub fn new(batch_repo: Arc<dyn JobBatchRepository>, job_repo: Arc<dyn JobRepository>) -> Self {
Self { batch_repo, job_repo }
Self {
batch_repo,
job_repo,
}
}
pub async fn execute(&self, query: ReportBatchProgressQuery) -> Result<BatchProgress, DomainError> {
let batch = self.batch_repo.find_by_id(&query.batch_id).await?
pub async fn execute(
&self,
query: ReportBatchProgressQuery,
) -> Result<BatchProgress, DomainError> {
let batch = self
.batch_repo
.find_by_id(&query.batch_id)
.await?
.ok_or_else(|| DomainError::NotFound(format!("Batch {} not found", query.batch_id)))?;
let jobs = self.job_repo.find_by_batch(&query.batch_id).await?;
Ok(BatchProgress { batch, jobs })