0.6 rust重构01
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
#[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
|
||||
}
|
||||
Reference in New Issue
Block a user