11 lines
320 B
Rust
11 lines
320 B
Rust
#[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
|
||
|
|
}
|