Skip to main content

iso20022_warn_invalid_fields

Function iso20022_warn_invalid_fields 

Source
pub fn iso20022_warn_invalid_fields(
    entity: &Iso20022Entity,
    page_label: &str,
) -> usize
Expand description

Walks every IBAN/BIC inside an entity and emits log::warn! for anything that fails validation. The page_label is included in the warning so site authors can locate the offending page.

Returns the count of validation warnings emitted — useful for asserting in tests.

§Examples

use ssg::seo::jsonld::iso20022::{BankAccount, Iso20022Entity, warn_invalid_fields};
let e = Iso20022Entity::BankAccount(BankAccount {
    iban: Some("INVALID".into()),
    ..BankAccount::default()
});
assert_eq!(warn_invalid_fields(&e, "page.md"), 1);