use luxid_core::error::Result;
use luxid_core::middleware::BoxFuture;
use sea_orm::ActiveModelTrait;
use crate::model::Record;
pub trait Hooks: Record {
type Active: ActiveModelTrait;
fn before_save(active: &mut Self::Active) -> BoxFuture<'_, Result<()>> {
let _ = active;
Box::pin(async { Ok(()) })
}
fn before_create(active: &mut Self::Active) -> BoxFuture<'_, Result<()>> {
let _ = active;
Box::pin(async { Ok(()) })
}
fn before_update(active: &mut Self::Active) -> BoxFuture<'_, Result<()>> {
let _ = active;
Box::pin(async { Ok(()) })
}
fn after_create(model: &Self) -> BoxFuture<'_, Result<()>> {
let _ = model;
Box::pin(async { Ok(()) })
}
fn after_update(model: &Self) -> BoxFuture<'_, Result<()>> {
let _ = model;
Box::pin(async { Ok(()) })
}
fn after_save(model: &Self) -> BoxFuture<'_, Result<()>> {
let _ = model;
Box::pin(async { Ok(()) })
}
}