Skip to main content

Module format_validators

Module format_validators 

Source
Expand description

Format validation helpers for AHB 900-series conditions.

These validate the FORMAT of data element values (decimal places, numeric ranges, time patterns, ID formats, etc.). They operate on string values extracted from EDIFACT segments and return ConditionResult.

Re-exports§

pub use super::timezone::is_mesz_utc;
pub use super::timezone::is_mez_utc;

Functions§

validate_all_digits
Validate that a string contains only digits (positive integer check).
validate_artikel_pattern
Validate a dash-separated digit pattern like “n1-n2-n1-n3”.
validate_email
Validate email format: must contain both ‘@’ and ‘.’.
validate_exact_length
Validate exact character length.
validate_hhmm_equals
Validate that a DTM value’s HHMM portion equals the expected value.
validate_hhmm_range
Validate that a DTM value’s HHMM portion is within a range (inclusive).
validate_malo_id
Validate Marktlokations-ID (MaLo-ID): exactly 11 digits.
validate_malo_or_zahlpunkt
Validate either MaLo-ID or Zahlpunktbezeichnung format.
validate_max_decimal_places
Validate that a numeric string has at most max decimal places.
validate_max_integer_digits
Validate that a numeric string has at most max integer digits (before decimal point).
validate_max_length
Validate maximum character length.
validate_mmddhhmm_equals
Validate that a DTM value’s MMDDHHMM portion equals the expected value.
validate_numeric
Validate a numeric value against a comparison.
validate_phone
Validate phone format: must start with ‘+’ followed by only digits.
validate_sr_id
Validate Steuerbare-Ressource-ID (SR-ID): same format as MaLo-ID (11 digits, Luhn check).
validate_timezone_utc
Validate that a DTM value’s timezone portion is “+00” (UTC).
validate_tr_id
Validate Transaktionsreferenz-ID (TR-ID): 1-35 alphanumeric characters.
validate_zahlpunkt
Validate Zahlpunktbezeichnung: exactly 33 alphanumeric characters.