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 PosPayment entity
//!
//! Generated by metaphor-schema. Do not edit manually.
//!
//! Returns an `EntityValidator<PosPayment>` pre-loaded with schema-derived
//! field rules. Extend in the `// <<< CUSTOM` zone.

use backbone_core::{EntityValidator, ValidationErrors, ValidationError};
use backbone_core::{NonNegative, OptionalNotBlank};
use crate::domain::entity::PosPayment;

/// Validator type alias for PosPayment entities.
pub type PosPaymentValidator = EntityValidator<PosPayment>;

/// Build a validator for PosPayment with all schema-defined field rules.
pub fn pos_payment_validator() -> PosPaymentValidator {
    EntityValidator::new()
        .rule(OptionalNotBlank::new("reference_no", |e: &PosPayment| e.reference_no.as_deref()))
    // <<< CUSTOM RULES
    // END CUSTOM RULES
}

// <<< CUSTOM
// END CUSTOM