use crate::message;
use std::fmt;
pub trait IntegrationEvent: fmt::Debug + message::Message + Send + Sync + 'static {
fn id(&self) -> String;
fn event_type(&self) -> &'static str;
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SerializedIntegrationEvent {
pub id: String,
pub aggregate_id: String,
pub aggregate_type: String,
pub event_type: String,
pub payload: Vec<u8>,
}
#[allow(dead_code)]
impl SerializedIntegrationEvent {
pub fn new(id: String, aggregate_id: String, aggregate_type: String, event_type: String, payload: Vec<u8>) -> Self {
Self {
id,
aggregate_id,
aggregate_type,
event_type,
payload,
}
}
}