pub mod command_log;
pub mod domain_event;
pub mod rules;

pub use command_log::{CommandLogRecord, CommandLogStatus};
pub use domain_event::{DomainEventRecord, EventGenerationOutcome, EventStatus};
pub use rules::{should_emit_domain_event, EventGenerationRule};

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn failed_command_does_not_emit_success_event() {
        let should_emit = should_emit_domain_event(&EventGenerationRule {
            command_succeeded: false,
            changed_domain_state: false,
            rolled_back: false,
        });

        assert!(!should_emit);
    }
}
