domain: add domain errors, events, and services module scaffold

This commit is contained in:
2026-05-31 03:16:40 +02:00
parent 3571c94bec
commit aa432e6594
10 changed files with 74 additions and 4 deletions

View File

@@ -1 +1,2 @@
mod events;
mod value_objects;

View File

@@ -0,0 +1,14 @@
use domain::events::DomainEvent;
use domain::value_objects::{DateTimeStamp, SystemId};
#[test]
fn asset_ingested_serde_roundtrip() {
let event = DomainEvent::AssetIngested {
asset_id: SystemId::new(),
owner_user_id: SystemId::new(),
timestamp: DateTimeStamp::now(),
};
let json = serde_json::to_string(&event).unwrap();
let back: DomainEvent = serde_json::from_str(&json).unwrap();
assert!(matches!(back, DomainEvent::AssetIngested { .. }));
}