use crate::domain::EntityId;
use crate::domain_event::DomainEvent;
use crate::errors::ProjectionError;
use async_trait::async_trait;
use std::any::Any;
use std::fmt::Debug;
#[async_trait]
pub trait ProjectionRepository: Debug + Any + Send + Sync + 'static {
async fn apply_event(&mut self, aggregate_id: &EntityId, event: &dyn DomainEvent) -> Result<(), ProjectionError>;
async fn rebuild(&mut self, aggregate_id: &EntityId, stream: Vec<&dyn DomainEvent>) -> Result<(), ProjectionError>;
}
#[async_trait]
pub trait ProjectionDtoEventApplier: Debug + Any + Send + Sync + 'static {
async fn apply_event_to_dto(&mut self, event: &dyn DomainEvent) -> Result<(), ProjectionError>;
}