use anyhow::Result;
use sqlx::PgPool;
use crate::domain::entity::Mail;
pub const TABLE_NAME: &str = "messaging.mails";
pub struct MailRepository(
backbone_orm::GenericCrudRepository<Mail, backbone_orm::SoftDelete>,
);
impl std::ops::Deref for MailRepository {
type Target = backbone_orm::GenericCrudRepository<Mail, backbone_orm::SoftDelete>;
fn deref(&self) -> &Self::Target { &self.0 }
}
impl MailRepository {
pub fn new(pool: PgPool) -> Self {
Self(backbone_orm::GenericCrudRepository::new(pool, TABLE_NAME))
}
}
backbone_core::impl_crud_repository!(MailRepository, Mail, soft_delete);