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