// <auto-generated>
// Generated by automapper-generator generate-conditions
// AHB: xml-migs-and-ahbs/FV2510/PARTIN_AHB_1_0e_20241001.xml
// Generated: 2026-03-12T10:51:21Z
// </auto-generated>
#[allow(unused_imports)]
use crate::eval::format_validators::*;
use crate::eval::{ConditionEvaluator, ConditionResult, EvaluationContext};
/// Generated condition evaluator for PARTIN FV2510.
pub struct PartinConditionEvaluatorFV2510 {
// External condition IDs that require runtime context.
external_conditions: std::collections::HashSet<u32>,
}
impl Default for PartinConditionEvaluatorFV2510 {
fn default() -> Self {
let mut external_conditions = std::collections::HashSet::new();
external_conditions.insert(1);
external_conditions.insert(2);
external_conditions.insert(4);
external_conditions.insert(5);
external_conditions.insert(17);
external_conditions.insert(18);
external_conditions.insert(19);
external_conditions.insert(20);
external_conditions.insert(21);
external_conditions.insert(22);
external_conditions.insert(23);
external_conditions.insert(24);
external_conditions.insert(25);
external_conditions.insert(26);
external_conditions.insert(35);
external_conditions.insert(36);
Self {
external_conditions,
}
}
}
impl ConditionEvaluator for PartinConditionEvaluatorFV2510 {
fn message_type(&self) -> &str {
"PARTIN"
}
fn format_version(&self) -> &str {
"FV2510"
}
fn evaluate(&self, condition: u32, ctx: &EvaluationContext) -> ConditionResult {
match condition {
1 => self.evaluate_1(ctx),
2 => self.evaluate_2(ctx),
3 => self.evaluate_3(ctx),
4 => self.evaluate_4(ctx),
5 => self.evaluate_5(ctx),
6 => self.evaluate_6(ctx),
7 => self.evaluate_7(ctx),
8 => self.evaluate_8(ctx),
10 => self.evaluate_10(ctx),
11 => self.evaluate_11(ctx),
12 => self.evaluate_12(ctx),
13 => self.evaluate_13(ctx),
14 => self.evaluate_14(ctx),
15 => self.evaluate_15(ctx),
16 => self.evaluate_16(ctx),
17 => self.evaluate_17(ctx),
18 => self.evaluate_18(ctx),
19 => self.evaluate_19(ctx),
20 => self.evaluate_20(ctx),
21 => self.evaluate_21(ctx),
22 => self.evaluate_22(ctx),
23 => self.evaluate_23(ctx),
24 => self.evaluate_24(ctx),
25 => self.evaluate_25(ctx),
26 => self.evaluate_26(ctx),
27 => self.evaluate_27(ctx),
28 => self.evaluate_28(ctx),
29 => self.evaluate_29(ctx),
30 => self.evaluate_30(ctx),
31 => self.evaluate_31(ctx),
32 => self.evaluate_32(ctx),
33 => self.evaluate_33(ctx),
34 => self.evaluate_34(ctx),
35 => self.evaluate_35(ctx),
36 => self.evaluate_36(ctx),
490 => self.evaluate_490(ctx),
491 => self.evaluate_491(ctx),
494 => self.evaluate_494(ctx),
500 => self.evaluate_500(ctx),
501 => self.evaluate_501(ctx),
502 => self.evaluate_502(ctx),
503 => self.evaluate_503(ctx),
504 => self.evaluate_504(ctx),
505 => self.evaluate_505(ctx),
506 => self.evaluate_506(ctx),
508 => self.evaluate_508(ctx),
908 => self.evaluate_908(ctx),
931 => self.evaluate_931(ctx),
932 => self.evaluate_932(ctx),
933 => self.evaluate_933(ctx),
939 => self.evaluate_939(ctx),
940 => self.evaluate_940(ctx),
_ => ConditionResult::Unknown,
}
}
fn is_external(&self, condition: u32) -> bool {
self.external_conditions.contains(&condition)
}
fn is_known(&self, condition: u32) -> bool {
matches!(
condition,
1 | 2
| 3
| 4
| 5
| 6
| 7
| 8
| 10
| 11
| 12
| 13
| 14
| 15
| 16
| 17
| 18
| 19
| 20
| 21
| 22
| 23
| 24
| 25
| 26
| 27
| 28
| 29
| 30
| 31
| 32
| 33
| 34
| 35
| 36
| 490
| 491
| 494
| 500
| 501
| 502
| 503
| 504
| 505
| 506
| 508
| 908
| 931
| 932
| 933
| 939
| 940
)
}
}
impl PartinConditionEvaluatorFV2510 {
/// [1] Nur MP-ID aus Sparte Strom
/// EXTERNAL: Requires context from outside the message.
fn evaluate_1(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("mp_id_is_strom")
}
/// [2] Wenn der Code im DE3207 in der "EDI@Energy Codeliste der europäischen Ländercodes" in der Spalte "PLZ vorhanden" ein "X" enthält
/// EXTERNAL: Requires context from outside the message.
fn evaluate_2(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("country_has_postal_code")
}
/// [4] Wenn Vorgängerversion vorhanden
/// EXTERNAL: Requires context from outside the message.
fn evaluate_4(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("predecessor_version_exists")
}
/// [3] wenn vorhanden
fn evaluate_3(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: wenn vorhanden — informational annotation indicating the element is conditional/optional; always applies when evaluated
ConditionResult::True
}
/// [5] Wenn MP-ID in SG2 NAD+MR (Nachrichtenempfänger) in der Rolle LF
/// EXTERNAL: Requires context from outside the message.
fn evaluate_5(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("recipient_is_lf")
}
/// [6] wenn im DE3155 im demselben COM der Code EM vorhanden ist
fn evaluate_6(&self, ctx: &EvaluationContext) -> ConditionResult {
let coms = ctx.find_segments("COM");
if coms.is_empty() {
return ConditionResult::Unknown;
}
ConditionResult::from(coms.iter().any(|s| {
s.elements
.first()
.and_then(|e| e.get(1))
.is_some_and(|v| v == "EM")
}))
}
/// [7] wenn im DE3155 im demselben COM der Code TE / FX / AJ / AL vorhanden ist
fn evaluate_7(&self, ctx: &EvaluationContext) -> ConditionResult {
let coms = ctx.find_segments("COM");
if coms.is_empty() {
return ConditionResult::Unknown;
}
ConditionResult::from(coms.iter().any(|s| {
s.elements
.first()
.and_then(|e| e.get(1))
.is_some_and(|v| matches!(v.as_str(), "TE" | "FX" | "AJ" | "AL"))
}))
}
/// [8] wenn im DE3155 im demselben COM der Code TE / FX vorhanden ist
fn evaluate_8(&self, ctx: &EvaluationContext) -> ConditionResult {
let coms = ctx.find_segments("COM");
if coms.is_empty() {
return ConditionResult::Unknown;
}
ConditionResult::from(coms.iter().any(|s| {
s.elements
.first()
.and_then(|e| e.get(1))
.is_some_and(|v| matches!(v.as_str(), "TE" | "FX"))
}))
}
/// [10] Wenn BGM DE1373 = 11 (Dokument nicht verfügbar) nicht vorhanden
fn evaluate_10(&self, ctx: &EvaluationContext) -> ConditionResult {
match ctx.find_segment("BGM") {
None => ConditionResult::False, // segment absent → condition not applicable
Some(bgm) => ConditionResult::from(
bgm.elements
.get(4)
.and_then(|e| e.first())
.map(|v| v != "11")
.unwrap_or(true),
),
}
}
/// [11] Wenn SG4 NAD+SU (Lieferant) DE3207 mit Code „DE“ vorhanden
fn evaluate_11(&self, ctx: &EvaluationContext) -> ConditionResult {
let nads = ctx.find_segments_with_qualifier("NAD", 0, "SU");
match nads.first() {
None => ConditionResult::False, // segment absent → condition not applicable
Some(nad) => ConditionResult::from(
nad.elements
.get(8)
.and_then(|e| e.first())
.is_some_and(|v| v == "DE"),
),
}
}
/// [12] Wenn SG4 NAD+DDM (Netzbetreiber) DE3207 mit Code „DE“ vorhanden
fn evaluate_12(&self, ctx: &EvaluationContext) -> ConditionResult {
let nads = ctx.find_segments_with_qualifier("NAD", 0, "DDM");
match nads.first() {
None => ConditionResult::False, // segment absent → condition not applicable
Some(nad) => ConditionResult::from(
nad.elements
.get(8)
.and_then(|e| e.first())
.is_some_and(|v| v == "DE"),
),
}
}
/// [13] Wenn SG4 NAD+DEB (Messstellenbetreiber) DE3207 mit Code „DE“ vorhanden
fn evaluate_13(&self, ctx: &EvaluationContext) -> ConditionResult {
let nads = ctx.find_segments_with_qualifier("NAD", 0, "DEB");
match nads.first() {
None => ConditionResult::False, // segment absent → condition not applicable
Some(nad) => ConditionResult::from(
nad.elements
.get(8)
.and_then(|e| e.first())
.is_some_and(|v| v == "DE"),
),
}
}
/// [14] Wenn SG4 NAD+SU (Lieferant) DE3207 der Code „DE“ nicht vorhanden
fn evaluate_14(&self, ctx: &EvaluationContext) -> ConditionResult {
let nads = ctx.find_segments_with_qualifier("NAD", 0, "SU");
match nads.first() {
None => ConditionResult::False, // segment absent → condition not applicable
Some(nad) => ConditionResult::from(
nad.elements
.get(8)
.and_then(|e| e.first())
.map(|v| v != "DE")
.unwrap_or(true),
),
}
}
/// [15] Wenn SG4 NAD+DDM (Netzbetreiber) DE3207 der Code „DE“ nicht vorhanden
fn evaluate_15(&self, ctx: &EvaluationContext) -> ConditionResult {
let nads = ctx.find_segments_with_qualifier("NAD", 0, "DDM");
match nads.first() {
None => ConditionResult::False, // segment absent → condition not applicable
Some(nad) => ConditionResult::from(
nad.elements
.get(8)
.and_then(|e| e.first())
.map(|v| v != "DE")
.unwrap_or(true),
),
}
}
/// [16] Wenn SG4 NAD+DEB (Messstellenbetreiber) DE3207 der Code „DE“ nicht vorhanden
fn evaluate_16(&self, ctx: &EvaluationContext) -> ConditionResult {
let nads = ctx.find_segments_with_qualifier("NAD", 0, "DEB");
match nads.first() {
None => ConditionResult::False, // segment absent → condition not applicable
Some(nad) => ConditionResult::from(
nad.elements
.get(8)
.and_then(|e| e.first())
.map(|v| v != "DE")
.unwrap_or(true),
),
}
}
/// [17] Wenn MP-ID in SG2 NAD+MR (Nachrichtenempfänger) in der Rolle LF/NB/MSB
/// EXTERNAL: Requires context from outside the message.
fn evaluate_17(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("recipient_is_lf_nb_msb")
}
/// [18] Wenn MP-ID in SG2 NAD+MR (Nachrichtenempfänger) in der Rolle LF/MSB
/// EXTERNAL: Requires context from outside the message.
fn evaluate_18(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("recipient_is_lf_msb")
}
/// [19] Wenn MP-ID in SG2 NAD+MR (Nachrichtenempfänger) in der Rolle LF/MSB/NB/ÜNB
/// EXTERNAL: Requires context from outside the message.
fn evaluate_19(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("recipient_is_lf_msb_nb_uenb")
}
/// [20] Wenn MP-ID in SG2 NAD+MR (Nachrichtenempfänger) in der Rolle LF/MSB/ÜNB
/// EXTERNAL: Requires context from outside the message.
fn evaluate_20(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("recipient_is_lf_msb_uenb")
}
/// [21] Wenn MP-ID in SG2 NAD+MR (Nachrichtenempfänger) in der Rolle LF/NB/ESA
/// EXTERNAL: Requires context from outside the message.
fn evaluate_21(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("recipient_is_lf_nb_esa")
}
/// [22] Wenn MP-ID in SG2 NAD+MR (Nachrichtenempfänger) in der Rolle MSB
/// EXTERNAL: Requires context from outside the message.
fn evaluate_22(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("recipient_is_msb")
}
/// [23] Wenn MP-ID in SG2 NAD+MR (Nachrichtenempfänger) in der Rolle NB/ÜNB
/// EXTERNAL: Requires context from outside the message.
fn evaluate_23(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("recipient_is_nb_uenb")
}
/// [24] Wenn MP-ID in SG2 NAD+MR (Nachrichtenempfänger) in der Rolle NB/LF/MSB/ESA
/// EXTERNAL: Requires context from outside the message.
fn evaluate_24(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("recipient_is_nb_lf_msb_esa")
}
/// [25] Wenn MP-ID in SG2 NAD+MR (Nachrichtenempfänger) in der Rolle NB
/// EXTERNAL: Requires context from outside the message.
fn evaluate_25(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("recipient_is_nb")
}
/// [26] Wenn MP-ID in SG2 NAD+MR (Nachrichtenempfänger) in der Rolle NB/LF/BKV/BIKO
/// EXTERNAL: Requires context from outside the message.
fn evaluate_26(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("recipient_is_nb_lf_bkv_biko")
}
/// [27] Wenn SG4 NAD+Z31 (Übertragungsnetzbetreiber) DE3207 mit Code „DE“ vorhanden
fn evaluate_27(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualified_value("NAD", 0, "Z31", 8, 0, &["DE"])
}
/// [28] Wenn SG4 NAD+Z34 (Bilanzkoordinator) DE3207 mit Code „DE“ vorhanden
fn evaluate_28(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualified_value("NAD", 0, "Z34", 8, 0, &["DE"])
}
/// [29] Wenn SG4 NAD+Z35 (Bilanzkreisverantwortlicher) DE3207 mit Code „DE“ vorhanden
fn evaluate_29(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualified_value("NAD", 0, "Z35", 8, 0, &["DE"])
}
/// [30] Wenn SG4 NAD+Z36 (Energieserviceanbieter) DE3207 mit Code „DE“ vorhanden
fn evaluate_30(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.has_qualified_value("NAD", 0, "Z36", 8, 0, &["DE"])
}
/// [31] Wenn SG4 NAD+Z31 (Übertragungsnetzbetreiber) DE3207 mit Code „DE“ nicht vorhanden
fn evaluate_31(&self, ctx: &EvaluationContext) -> ConditionResult {
match ctx.has_qualified_value("NAD", 0, "Z31", 8, 0, &["DE"]) {
ConditionResult::True => ConditionResult::False,
ConditionResult::False => ConditionResult::True,
ConditionResult::Unknown => ConditionResult::Unknown,
}
}
/// [32] Wenn SG4 NAD+Z34 (Bilanzkoordinator) DE3207 mit Code „DE“ nicht vorhanden
fn evaluate_32(&self, ctx: &EvaluationContext) -> ConditionResult {
let nads = ctx.find_segments_with_qualifier("NAD", 0, "Z34");
if nads.is_empty() {
return ConditionResult::True;
}
let has_de = nads.iter().any(|s| {
s.elements
.get(8)
.and_then(|e| e.first())
.is_some_and(|v| v == "DE")
});
ConditionResult::from(!has_de)
}
/// [33] Wenn SG4 NAD+Z35 (Bilanzkreisverantwortlicher) DE3207 mit Code „DE“ nicht vorhanden
fn evaluate_33(&self, ctx: &EvaluationContext) -> ConditionResult {
let nads = ctx.find_segments_with_qualifier("NAD", 0, "Z35");
if nads.is_empty() {
return ConditionResult::True;
}
let has_de = nads.iter().any(|s| {
s.elements
.get(8)
.and_then(|e| e.first())
.is_some_and(|v| v == "DE")
});
ConditionResult::from(!has_de)
}
/// [34] Wenn SG4 NAD+Z36 (Energieserviceanbieter) DE3207 mit Code „DE“ nicht vorhanden
fn evaluate_34(&self, ctx: &EvaluationContext) -> ConditionResult {
let nads = ctx.find_segments_with_qualifier("NAD", 0, "Z36");
if nads.is_empty() {
return ConditionResult::True;
}
let has_de = nads.iter().any(|s| {
s.elements
.get(8)
.and_then(|e| e.first())
.is_some_and(|v| v == "DE")
});
ConditionResult::from(!has_de)
}
/// [35] Wenn MP-ID in SG2 NAD+MR (Nachrichtenempfänger) in der Rolle ÜNB
/// EXTERNAL: Requires context from outside the message.
fn evaluate_35(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("recipient_is_uenb")
}
/// [36] Wenn MP-ID in SG2 NAD+MR (Nachrichtenempfänger) in der Rolle BKV
/// EXTERNAL: Requires context from outside the message.
fn evaluate_36(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.external.evaluate("recipient_is_bkv")
}
/// [490] wenn Wert in diesem DE, an der Stelle CCYYMMDD ein Datum aus dem angegeben Zeitraum der Tabelle Kapitel 3.5 „Prozesszeitpunkt bei MESZ mit UTC“ ist
fn evaluate_490(&self, ctx: &EvaluationContext) -> ConditionResult {
// wenn Wert in diesem DE an Stelle CCYYMMDD ein Datum aus Tabelle Kapitel 3.5 'Prozesszeitpunkt bei MESZ mit UTC' ist
let dtm_segs = ctx.find_segments("DTM");
match dtm_segs
.first()
.and_then(|s| s.elements.first())
.and_then(|e| e.get(1))
{
Some(val) => is_mesz_utc(val),
None => ConditionResult::False, // segment absent → condition not applicable
}
}
/// [491] wenn Wert in diesem DE, an der Stelle CCYYMMDD ein Datum aus dem angegeben Zeitraum der Tabelle Kapitel 3.6 „Prozesszeitpunkt bei MEZ mit UTC“ ist
fn evaluate_491(&self, ctx: &EvaluationContext) -> ConditionResult {
let dtm_segs = ctx.find_segments("DTM");
match dtm_segs
.first()
.and_then(|s| s.elements.first())
.and_then(|e| e.get(1))
{
Some(val) => is_mez_utc(val),
None => ConditionResult::False, // segment absent → condition not applicable
}
}
/// [494] Das hier genannte Datum muss der Zeitpunkt sein, zu dem das Dokument erstellt wurde, oder ein Zeitpunkt, der davor liegt.
// REVIEW: This condition states the referenced date must be the document creation timestamp or earlier. Verifying this would require knowing the actual document creation time as an external reference point, which is not present in the EDIFACT message itself. The phrasing describes a semantic constraint on the field's value origin rather than a checkable boolean predicate from message content. Treated as an always-true informational annotation similar to a Hinweis, since the field by definition carries the value the sender chose as the document date. (medium confidence)
fn evaluate_494(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Das hier genannte Datum muss der Zeitpunkt sein, zu dem das Dokument erstellt wurde, oder ein Zeitpunkt, der davor liegt.
// This is a semantic annotation about what the date field must represent (document creation time or earlier).
// It cannot be evaluated as a boolean predicate from the EDIFACT message content alone.
ConditionResult::True
}
/// [500] Hinweis: Es kann der Firmenname eines Dienstleisters oder die identische Firmenbezeichnung aus SG4 NAD+SU / DDM / DEB / Z31 / Z34 / Z35 / Z36 eingetragen werden.
fn evaluate_500(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Es kann der Firmenname eines Dienstleisters oder die identische Firmenbezeichnung aus SG4 NAD+SU / DDM / DEB / Z31 / Z34 / Z35 / Z36 eingetragen werden.
// Informational note about allowed name values — always applies.
ConditionResult::True
}
/// [501] Hinweis: Es darf kein Name einer natürlichen Person übermittelt werden, stattdessen ist die organisatorische Einheit im Unternehmen zu nennen.
fn evaluate_501(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Es darf kein Name einer natürlichen Person übermittelt werden, stattdessen ist die organisatorische Einheit im Unternehmen zu nennen.
// Informational note about data privacy — no natural person names, use organisational unit — always applies.
ConditionResult::True
}
/// [502] Hinweis: Es darf nur eine Information im DE3148 übermittelt werden
fn evaluate_502(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Es darf nur eine Information im DE3148 übermittelt werden.
// Informational note about cardinality of DE3148 — only one value may be transmitted — always applies.
ConditionResult::True
}
/// [503] Hinweis: Angabe erfolgt in gesetzlicher deutscher Zeit
fn evaluate_503(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Angabe erfolgt in gesetzlicher deutscher Zeit — informational note, always applies
ConditionResult::True
}
/// [504] Hinweis: Es ist mindestens die Umsatzsteuer- bzw. Steuernummer zu nennen, die in der INVOIC genutzt wird.
fn evaluate_504(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Es ist mindestens die Umsatzsteuer- bzw. Steuernummer zu nennen — informational note, always applies
ConditionResult::True
}
/// [505] Wenn eine Vorgängerversion (RFF+ACW) angegeben ist, so muss der Wert in diesem DE1056 mindestens um 1 höher sein, als der Wert aus DE1056 der Vorgängerversion (RFF+ACW).
// REVIEW: When RFF+ACW (predecessor version) is present, compare DE1056 (elements[0][3]) of RFF+AGK (current version) against DE1056 of RFF+ACW. Condition is True when current version is at least 1 higher than predecessor. Returns False when no ACW present (condition does not apply), Unknown if version numbers cannot be parsed. (medium confidence)
fn evaluate_505(&self, ctx: &EvaluationContext) -> ConditionResult {
let acw_segments = ctx.find_segments_with_qualifier("RFF", 0, "ACW");
if acw_segments.is_empty() {
return ConditionResult::False;
}
let agk_segments = ctx.find_segments_with_qualifier("RFF", 0, "AGK");
let current_version = agk_segments
.first()
.and_then(|s| s.elements.first())
.and_then(|e| e.get(3))
.and_then(|v| v.parse::<i64>().ok());
let predecessor_version = acw_segments
.first()
.and_then(|s| s.elements.first())
.and_then(|e| e.get(3))
.and_then(|v| v.parse::<i64>().ok());
match (current_version, predecessor_version) {
(Some(cur), Some(pred)) => ConditionResult::from(cur >= pred + 1),
_ => ConditionResult::Unknown,
}
}
/// [506] Hinweis: Das Datenelement ist so zu füllen, dass sein Inhalt den Vorgaben des USt.-Gesetzes genügt, so dass der Empfänger diese Daten in einer INVOIC nutzen kann.
fn evaluate_506(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Das Datenelement ist so zu füllen, dass sein Inhalt den Vorgaben des USt.-Gesetzes genügt — informational note, always applies
ConditionResult::True
}
/// [508] Hinweis: Der LF in seiner Funktion als Grund- und Ersatzversorger muss den NB, in deren Netzgebiet der LF als Grund- und Ersatzversorger ist, einen Bilanzkreis für verbrauchende Marktlokationen ü...
fn evaluate_508(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Der LF als Grund- und Ersatzversorger muss dem NB einen Bilanzkreis übermitteln — informational note, always applies
ConditionResult::True
}
/// [908] Format: Mögliche Werte: 1 bis n
fn evaluate_908(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Format: Mögliche Werte: 1 bis n — informational cardinality note, always applies
ConditionResult::True
}
/// [931] Format: ZZZ = +00
fn evaluate_931(&self, ctx: &EvaluationContext) -> ConditionResult {
// Format: ZZZ = +00 — DTM timezone must be UTC
let dtm_segs = ctx.find_segments("DTM");
match dtm_segs
.first()
.and_then(|s| s.elements.first())
.and_then(|e| e.get(1))
{
Some(val) => validate_timezone_utc(val),
None => ConditionResult::False, // segment absent → condition not applicable
}
}
/// [932] Format: HHMM = 2200
fn evaluate_932(&self, ctx: &EvaluationContext) -> ConditionResult {
// Format: HHMM = 2200 — time portion of DTM value must be 2200
let dtm_segs = ctx.find_segments("DTM");
match dtm_segs
.first()
.and_then(|s| s.elements.first())
.and_then(|e| e.get(1))
{
Some(val) => validate_hhmm_equals(val, "2200"),
None => ConditionResult::False, // segment absent → condition not applicable
}
}
/// [933] Format: HHMM = 2300
fn evaluate_933(&self, ctx: &EvaluationContext) -> ConditionResult {
// Format: HHMM = 2300 — time portion of DTM value must be 2300
let dtm_segs = ctx.find_segments("DTM");
match dtm_segs
.first()
.and_then(|s| s.elements.first())
.and_then(|e| e.get(1))
{
Some(val) => validate_hhmm_equals(val, "2300"),
None => ConditionResult::False, // segment absent → condition not applicable
}
}
/// [939] Format: Die Zeichenkette muss die Zeichen @ und . enthalten
fn evaluate_939(&self, ctx: &EvaluationContext) -> ConditionResult {
// Format: string must contain @ and . — email address validation
let segs = ctx.find_segments("COM");
match segs
.first()
.and_then(|s| s.elements.first())
.and_then(|e| e.first())
{
Some(val) => validate_email(val),
None => ConditionResult::False, // segment absent → condition not applicable
}
}
/// [940] Format: Die Zeichenkette muss mit dem Zeichen + beginnen und danach dürfen nur noch Ziffern folgen
fn evaluate_940(&self, ctx: &EvaluationContext) -> ConditionResult {
// Format: string must start with + followed only by digits — phone number validation
let segs = ctx.find_segments("COM");
match segs
.first()
.and_then(|s| s.elements.first())
.and_then(|e| e.first())
{
Some(val) => validate_phone(val),
None => ConditionResult::False, // segment absent → condition not applicable
}
}
}