backbone-mailing 0.6.0

Email marketing — mass-mail engine: audiences, subscriptions, hand-set mailing lifecycle, seeded A/B testing, per-recipient traces, cycle-44 bridge targets (Odoo mass_mailing port)
//! Repository for OptOutReason entities
//!
//! Generated by metaphor-schema. Do not edit manually.
//!
//! Thin newtype over `backbone_orm::GenericCrudRepository<OptOutReason, backbone_orm::SoftDelete>`.
//! All standard CRUD methods are available via `Deref`.

use anyhow::Result;
use sqlx::PgPool;

use crate::domain::entity::OptOutReason;

/// Table name for OptOutReason entities
pub const TABLE_NAME: &str = "mailing.mailing_opt_out_reasons";

/// Repository for OptOutReason entities.
///
/// All standard CRUD, soft-delete, pagination, and bulk methods are
/// provided automatically via `Deref` to `backbone_orm::GenericCrudRepository`.
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 {
    /// Create a new repository instance.
    pub fn new(pool: PgPool) -> Self {
        Self(backbone_orm::GenericCrudRepository::new(pool, TABLE_NAME))
    }
}

backbone_core::impl_crud_repository!(OptOutReasonRepository, OptOutReason, soft_delete);