use async_trait::async_trait;
use ferrox_errors::AppError;
#[async_trait]
pub trait Repository<Entity, Id> {
async fn find_by_id(&self, id: Id) -> Result<Option<Entity>, AppError>;
async fn find_all(&self) -> Result<Vec<Entity>, AppError>;
async fn insert(&self, entity: Entity) -> Result<Entity, AppError>;
async fn update(&self, id: Id, entity: Entity) -> Result<Entity, AppError>;
async fn delete(&self, id: Id) -> Result<(), AppError>;
}
pub fn setup() {
println!("ferrox-database-core initialized: Provides Repository traits.");
}