refactor: restructure domain crate by bounded context

This commit is contained in:
2026-05-31 04:44:48 +02:00
parent 2b62d1ec81
commit de93373b43
136 changed files with 2111 additions and 2096 deletions

View File

@@ -0,0 +1,31 @@
use domain::entities::{SidecarRecord, SyncStatus};
use domain::value_objects::{Checksum, SystemId};
#[test]
fn new_is_pending_write() {
let record = SidecarRecord::new(SystemId::new(), "/path/to/sidecar.xmp");
assert_eq!(record.sync_status, SyncStatus::PendingWrite);
assert!(record.last_synced_at.is_none());
assert!(record.last_known_file_hash.is_none());
}
#[test]
fn sync_lifecycle() {
let mut record = SidecarRecord::new(SystemId::new(), "/path/to/sidecar.xmp");
let hash = Checksum::new("a".repeat(64)).unwrap();
record.mark_synced(hash);
assert_eq!(record.sync_status, SyncStatus::InSync);
assert!(record.last_synced_at.is_some());
assert!(record.last_known_file_hash.is_some());
record.mark_pending_read();
assert_eq!(record.sync_status, SyncStatus::PendingRead);
record.mark_conflict();
assert_eq!(record.sync_status, SyncStatus::Conflict);
record.mark_error("disk full");
assert_eq!(record.sync_status, SyncStatus::Error);
assert_eq!(record.error_message.as_deref(), Some("disk full"));
}

View File

@@ -0,0 +1 @@
mod entities;