backbone-accounting 0.10.0

GL, journals, ledger, reconciliation (extracted from bersihir)
Documentation
//! Validator for PrintedCheck entity
//!
//! Generated by metaphor-schema. Do not edit manually.
//!
//! Returns an `EntityValidator<PrintedCheck>` pre-loaded with schema-derived
//! field rules. Extend in the `// <<< CUSTOM` zone.

use backbone_core::{EntityValidator, ValidationErrors, ValidationError};
use backbone_core::{OptionalNotBlank, RequiredString};
use crate::domain::entity::PrintedCheck;

/// Validator type alias for PrintedCheck entities.
pub type PrintedCheckValidator = EntityValidator<PrintedCheck>;

/// Build a validator for PrintedCheck with all schema-defined field rules.
pub fn printed_check_validator() -> PrintedCheckValidator {
    EntityValidator::new()
        .rule(OptionalNotBlank::new("payment_number", |e: &PrintedCheck| e.payment_number.as_deref()))
        .rule(RequiredString::new("check_number", |e: &PrintedCheck| &e.check_number))
        .rule(OptionalNotBlank::new("payee_name", |e: &PrintedCheck| e.payee_name.as_deref()))
        .rule(RequiredString::new("status", |e: &PrintedCheck| &e.status))
    // <<< CUSTOM RULES
    // END CUSTOM RULES
}

// <<< CUSTOM
// END CUSTOM