backbone-pos 0.7.1

Point of sale — cashier session, ticket + multi-tender; orchestrates billing (revenue) + payment (settlement), posts no GL directly
Documentation
//! Repository for PosTable entities
//!
//! Generated by metaphor-schema. Do not edit manually.
//!
//! Thin newtype over `backbone_orm::GenericCrudRepository<PosTable, backbone_orm::SoftDelete>`.
//! All standard CRUD methods are available via `Deref`.

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

use crate::domain::entity::PosTable;

/// Table name for PosTable entities
pub const TABLE_NAME: &str = "pos.pos_tables";

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

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

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

backbone_core::impl_crud_repository!(PosTableRepository, PosTable, soft_delete);