domain: add Processing entities and ports (Job, JobBatch, Plugin, Pipeline)

This commit is contained in:
2026-05-31 03:35:41 +02:00
parent ee79be0351
commit b67e595280
14 changed files with 454 additions and 18 deletions

View File

@@ -0,0 +1,31 @@
use domain::entities::{BatchStatus, JobBatch};
#[test]
fn completes_when_all_done() {
let mut batch = JobBatch::new("scan", 3);
batch.record_completion();
batch.record_completion();
batch.record_completion();
assert_eq!(batch.status, BatchStatus::Completed);
}
#[test]
fn completes_with_errors() {
let mut batch = JobBatch::new("scan", 3);
batch.record_completion();
batch.record_failure();
batch.record_completion();
assert_eq!(batch.status, BatchStatus::CompletedWithErrors);
}
#[test]
fn progress_tracking() {
let mut batch = JobBatch::new("scan", 4);
assert_eq!(batch.progress_percent(), 0.0);
batch.record_completion();
assert_eq!(batch.progress_percent(), 25.0);
batch.record_completion();
assert_eq!(batch.progress_percent(), 50.0);
}