backbone-pos 0.7.0

Point of sale — cashier session, ticket + multi-tender; orchestrates billing (revenue) + payment (settlement), posts no GL directly
Documentation
//! Validator for PosInvoice entity
//!
//! Generated by metaphor-schema. Do not edit manually.
//!
//! Returns an `EntityValidator<PosInvoice>` pre-loaded with schema-derived
//! field rules. Extend in the `// <<< CUSTOM` zone.

use backbone_core::{EntityValidator, ValidationErrors, ValidationError};
use backbone_core::{NonNegative, RequiredString};
use crate::domain::entity::PosInvoice;

/// Validator type alias for PosInvoice entities.
pub type PosInvoiceValidator = EntityValidator<PosInvoice>;

/// Build a validator for PosInvoice with all schema-defined field rules.
pub fn pos_invoice_validator() -> PosInvoiceValidator {
    EntityValidator::new()
        .rule(RequiredString::new("receipt_number", |e: &PosInvoice| &e.receipt_number))
    // <<< CUSTOM RULES
    // END CUSTOM RULES
}

// <<< CUSTOM
// END CUSTOM