backbone-inventory 0.17.2

Inventory: stock ledger of record (SLE) + moving-average valuation; emits COGS/asset AccountingPost (Delivery/Receipt -> GL)
Documentation
//! Repository for LandedCost entities
//!
//! Generated by metaphor-schema. Do not edit manually.
//!
//! Thin newtype over `backbone_orm::GenericCrudRepository<LandedCost, backbone_orm::SoftDelete>`.
//! All standard CRUD methods are available via `Deref`.

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

use crate::domain::entity::LandedCost;

/// Table name for LandedCost entities
pub const TABLE_NAME: &str = "inventory.landed_costs";

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

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

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

backbone_core::impl_crud_repository!(LandedCostRepository, LandedCost, soft_delete);