Files
mnote/rust/crates/event-log/src/rules.rs
T

11 lines
320 B
Rust
Raw Normal View History

2026-04-14 13:22:29 +08:00
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct EventGenerationRule {
pub command_succeeded: bool,
pub changed_domain_state: bool,
pub rolled_back: bool,
}
pub fn should_emit_domain_event(rule: &EventGenerationRule) -> bool {
rule.command_succeeded && rule.changed_domain_state && !rule.rolled_back
}