backbone-accounting 0.18.1

GL, journals, ledger, reconciliation (extracted from bersihir)
Documentation
//! Repository for Account entities
//!
//! Generated by metaphor-schema. Do not edit manually.
//!
//! Thin newtype over `backbone_orm::GenericCrudRepository<Account, backbone_orm::SoftDelete>`.
//! All standard CRUD methods are available via `Deref`.

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

use crate::domain::entity::Account;

/// Table name for Account entities
pub const TABLE_NAME: &str = "accounting.accounts";

/// Repository for Account entities.
///
/// All standard CRUD, soft-delete, pagination, and bulk methods are
/// provided automatically via `Deref` to `backbone_orm::GenericCrudRepository`.
pub struct AccountRepository(
    backbone_orm::GenericCrudRepository<Account, backbone_orm::SoftDelete>,
);

impl std::ops::Deref for AccountRepository {
    type Target = backbone_orm::GenericCrudRepository<Account, backbone_orm::SoftDelete>;
    fn deref(&self) -> &Self::Target { &self.0 }
}

impl AccountRepository {
    /// Create a new repository instance.
    pub fn new(pool: PgPool) -> Self {
        Self(backbone_orm::GenericCrudRepository::new(pool, TABLE_NAME))
    }
}

backbone_core::impl_crud_repository!(AccountRepository, Account, soft_delete);