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