domain events: DomainEvent enum w/ ID-only variants

This commit is contained in:
2026-07-12 01:29:40 +02:00
parent 6d12ac4c5e
commit 87e7d85239
3 changed files with 126 additions and 24 deletions

View File

@@ -8,30 +8,7 @@
use async_trait::async_trait;
use crate::errors::DomainResult;
use crate::value_objects::ChannelId;
/// A domain event emitted by aggregate operations.
///
/// New variants will be added as the system grows. Downstream consumers
/// pattern-match and ignore unknown variants.
#[derive(Debug, Clone)]
#[non_exhaustive]
pub enum DomainEvent {
/// A new schedule was generated for a channel.
ScheduleGenerated {
channel_id: ChannelId,
generation: u32,
},
/// A library sync completed for a provider.
LibrarySyncCompleted {
provider_id: String,
items_found: u32,
},
/// A channel was created.
ChannelCreated { channel_id: ChannelId },
/// A channel was deleted.
ChannelDeleted { channel_id: ChannelId },
}
pub use crate::events::DomainEvent;
/// Port for publishing domain events.
///