Skip to main content

automapper_validation/generated/fv2610/
orders_conditions_fv2610.rs

1// <auto-generated>
2// Generated by automapper-generator generate-conditions
3// AHB: xml-migs-and-ahbs/FV2610/ORDERS_AHB_1_1b_Fehlerkorrektur_20260629.xml
4// Generated: 2026-04-22T18:13:18Z
5// Delegates unchanged conditions to OrdersConditionEvaluatorFV2604 (FV2604).
6// </auto-generated>
7
8#![allow(clippy::style, clippy::complexity)]
9
10#[allow(unused_imports)]
11use crate::eval::format_validators::*;
12use crate::eval::{ConditionEvaluator, ConditionResult, EvaluationContext};
13use crate::generated::fv2604::OrdersConditionEvaluatorFV2604;
14
15/// Condition evaluator for ORDERS FV2610.
16///
17/// Delegates to [`OrdersConditionEvaluatorFV2604`] for conditions whose AHB description is
18/// unchanged from that version. Local overrides: [75, 106, 110, 147, 148, 158, 159, 160, 162, 163, 169, 180, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 490, 491, 492, 493, 593, 594, 595].
19pub struct OrdersConditionEvaluatorFV2610 {
20    fallback: OrdersConditionEvaluatorFV2604,
21}
22
23impl Default for OrdersConditionEvaluatorFV2610 {
24    fn default() -> Self {
25        Self {
26            fallback: OrdersConditionEvaluatorFV2604::default(),
27        }
28    }
29}
30
31/// Condition IDs whose implementation differs from the fallback.
32const FV2610_OVERRIDES: &[u32] = &[
33    75, 106, 110, 147, 148, 158, 159, 160, 162, 163, 169, 180, 184, 185, 196, 197, 198, 199, 200,
34    201, 202, 203, 490, 491, 492, 493, 593, 594, 595,
35];
36
37impl ConditionEvaluator for OrdersConditionEvaluatorFV2610 {
38    fn message_type(&self) -> &str {
39        "ORDERS"
40    }
41
42    fn format_version(&self) -> &str {
43        "FV2610"
44    }
45
46    fn evaluate(&self, condition: u32, ctx: &EvaluationContext) -> ConditionResult {
47        match condition {
48            75 => self.evaluate_75(ctx),
49            106 => self.evaluate_106(ctx),
50            110 => self.evaluate_110(ctx),
51            147 => self.evaluate_147(ctx),
52            148 => self.evaluate_148(ctx),
53            169 => self.evaluate_169(ctx),
54            184 => self.evaluate_184(ctx),
55            185 => self.evaluate_185(ctx),
56            196 => self.evaluate_196(ctx),
57            197 => self.evaluate_197(ctx),
58            198 => self.evaluate_198(ctx),
59            199 => self.evaluate_199(ctx),
60            200 => self.evaluate_200(ctx),
61            201 => self.evaluate_201(ctx),
62            202 => self.evaluate_202(ctx),
63            203 => self.evaluate_203(ctx),
64            490 => self.evaluate_490(ctx),
65            491 => self.evaluate_491(ctx),
66            492 => self.evaluate_492(ctx),
67            493 => self.evaluate_493(ctx),
68            593 => self.evaluate_593(ctx),
69            594 => self.evaluate_594(ctx),
70            595 => self.evaluate_595(ctx),
71            163 => self.evaluate_163(ctx),
72            158 => self.evaluate_158(ctx),
73            159 => self.evaluate_159(ctx),
74            160 => self.evaluate_160(ctx),
75            162 => self.evaluate_162(ctx),
76            180 => self.evaluate_180(ctx),
77            other => self.fallback.evaluate(other, ctx),
78        }
79    }
80
81    fn is_external(&self, condition: u32) -> bool {
82        matches!(
83            condition,
84            75 | 184 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 492 | 493
85        ) || self.fallback.is_external(condition)
86    }
87
88    fn is_known(&self, condition: u32) -> bool {
89        FV2610_OVERRIDES.contains(&condition) || self.fallback.is_known(condition)
90    }
91}
92
93impl OrdersConditionEvaluatorFV2610 {
94    /// [75] Wenn für den erforderlichen Wert keine Zählzeit benötigt wird
95    /// EXTERNAL: Requires context from outside the message.
96    fn evaluate_75(&self, ctx: &EvaluationContext) -> ConditionResult {
97        ctx.external.evaluate("no_zaehlerzeit_required")
98    }
99
100    /// [106] Wenn IMD++Z60 (Abbestellung Messprodukt mit Zählzeitdefinition des LF) nicht vorhanden
101    fn evaluate_106(&self, ctx: &EvaluationContext) -> ConditionResult {
102        ctx.lacks_qualifier("IMD", 1, "Z60")
103    }
104
105    /// [110] Wenn DTM+163 (Beginn Zeitraum für Wertanfrage) vorhanden
106    fn evaluate_110(&self, ctx: &EvaluationContext) -> ConditionResult {
107        ctx.has_qualifier("DTM", 0, "163")
108    }
109
110    /// [147] Wenn im DE3155 in demselben COM der Code EM vorhanden ist
111    fn evaluate_147(&self, ctx: &EvaluationContext) -> ConditionResult {
112        ConditionResult::from(ctx.self_segment_value_equals("COM", 0, 1, "EM"))
113    }
114
115    /// [148] Wenn im DE3155 in demselben COM der Code TE / FX / AJ / AL vorhanden ist
116    fn evaluate_148(&self, ctx: &EvaluationContext) -> ConditionResult {
117        ConditionResult::from(
118            ctx.self_segment_value_equals("COM", 0, 1, "TE")
119                || ctx.self_segment_value_equals("COM", 0, 1, "FX")
120                || ctx.self_segment_value_equals("COM", 0, 1, "AJ")
121                || ctx.self_segment_value_equals("COM", 0, 1, "AL"),
122        )
123    }
124
125    /// [169] Wenn in SG29 LIN++Z19 (Erforderliches Produkt der Messlokation) in SG30 CCI (Zugeordnete Zählzeitdefinition) im DE7059 der Code Z39 (Code der Zählzeitdefinition) vorhanden ist
126    // REVIEW: SG29 is parent group with LIN entry where elements[1][0]=="Z19" (notation LIN++Z19 → elements[1]=Z19). SG30 is child group; CCI DE7059 (Property class code qualifier) is at elements[0][0]. Z39 = Code der Zählzeitdefinition. Confidence medium because exact nesting depth of SG29 within ORDERS hierarchy is not confirmed without MIG XML. (medium confidence)
127    fn evaluate_169(&self, ctx: &EvaluationContext) -> ConditionResult {
128        ctx.filtered_parent_child_has_qualifier(&["SG29"], "LIN", 1, "Z19", "SG30", "CCI", 0, "Z39")
129    }
130
131    /// [184] Wenn es sich in der Position (SG34 RFF+Z03 DE1154) die innerhalb dieser SG29 LIN bestellt wird, um die Bestellung des Geräteübernahmeangebotes eines Smartmeter-Gateways handelt.
132    /// EXTERNAL: Requires context from outside the message.
133    fn evaluate_184(&self, ctx: &EvaluationContext) -> ConditionResult {
134        ctx.external.evaluate("is_smgw_takeover_offer_order")
135    }
136
137    /// [185] Wenn FTX+Z29 (Endpunkt-Adresse (IP:Port)) vorhanden
138    fn evaluate_185(&self, ctx: &EvaluationContext) -> ConditionResult {
139        // HAND-EDITED: the SMGW's own FTX+Z29 — the certificate, WakeUp and
140        // APN FTX of its position (SG29) only, not of every position.
141        ctx.this_group_has_qualifier("FTX", 0, "Z29", &["SG29"])
142    }
143
144    /// [196] Zulässig sind ausschließlich Codes aus der Spalte „Code“ der Codeliste der Verwendungszwecke (Kapitel 2), sofern in derselben Zeile sowohl in der Spalte „Lokation/NeLo“ als auch in der ...
145    /// EXTERNAL: Requires context from outside the message.
146    fn evaluate_196(&self, ctx: &EvaluationContext) -> ConditionResult {
147        ctx.external.evaluate("valid_verwendungszweck_nb_lokation")
148    }
149
150    /// [197] Zulässig sind ausschließlich Codes aus der Spalte „Code“ der Codeliste der Verwendungszwecke (Kapitel 2), sofern in derselben Zeile sowohl in der Spalte „Lokation/NeLo“ als auch in der ...
151    /// EXTERNAL: Requires context from outside the message.
152    fn evaluate_197(&self, ctx: &EvaluationContext) -> ConditionResult {
153        ctx.external.evaluate("valid_verwendungszweck_lf_lokation")
154    }
155
156    /// [198] Zulässig sind ausschließlich Codes aus der Spalte „Code“ der Codeliste der Verwendungszwecke (Kapitel 2), sofern in derselben Zeile sowohl in der Spalte „Lokation/MaLo“ als auch in der ...
157    /// EXTERNAL: Requires context from outside the message.
158    fn evaluate_198(&self, ctx: &EvaluationContext) -> ConditionResult {
159        ctx.external.evaluate("verwendungszweck_malo_nb_valid")
160    }
161
162    /// [199] Zulässig sind ausschließlich Codes aus der Spalte „Code“ der Codeliste der Verwendungszwecke (Kapitel 2), sofern in derselben Zeile sowohl in der Spalte „Lokation/MaLo“ als auch in der ...
163    /// EXTERNAL: Requires context from outside the message.
164    fn evaluate_199(&self, ctx: &EvaluationContext) -> ConditionResult {
165        ctx.external.evaluate("verwendungszweck_malo_lf_valid")
166    }
167
168    /// [200] Zulässig sind ausschließlich Codes aus der Spalte „Code“ der Codeliste der Verwendungszwecke (Kapitel 2), sofern in derselben Zeile sowohl in der Spalte „Lokation/MaLo“ als auch in der ...
169    /// EXTERNAL: Requires context from outside the message.
170    fn evaluate_200(&self, ctx: &EvaluationContext) -> ConditionResult {
171        ctx.external.evaluate("verwendungszweck_malo_uenb_valid")
172    }
173
174    /// [201] Zulässig sind ausschließlich Codes aus der Spalte „Code“ der Codeliste der Verwendungszwecke (Kapitel 2), sofern in derselben Zeile sowohl in der Spalte „Lokation/Tranche“ als auch in d...
175    /// EXTERNAL: Requires context from outside the message.
176    fn evaluate_201(&self, ctx: &EvaluationContext) -> ConditionResult {
177        ctx.external.evaluate("verwendungszweck_tranche_nb_valid")
178    }
179
180    /// [202] Zulässig sind ausschließlich Codes aus der Spalte „Code“ der Codeliste der Verwendungszwecke (Kapitel 2), sofern in derselben Zeile sowohl in der Spalte „Lokation/Tranche“ als auch in d...
181    /// EXTERNAL: Requires context from outside the message.
182    fn evaluate_202(&self, ctx: &EvaluationContext) -> ConditionResult {
183        ctx.external.evaluate("verwendungszweck_tranche_lf_valid")
184    }
185
186    /// [203] Zulässig sind ausschließlich Codes aus der Spalte „Code“ der Codeliste der Verwendungszwecke (Kapitel 2), sofern in derselben Zeile sowohl in der Spalte „Lokation/Tranche“ als auch in d...
187    /// EXTERNAL: Requires context from outside the message.
188    fn evaluate_203(&self, ctx: &EvaluationContext) -> ConditionResult {
189        ctx.external.evaluate("verwendungszweck_tranche_uenb_valid")
190    }
191
192    /// [490] Wenn Wert in diesem DE, an der Stelle CCYYMMDDHHMM ein Zeitpunkt aus dem angegeben Zeitraum der Tabelle Kapitel 3.5 „Übersicht gesetzliche deutsche Sommerzeit (MESZ)“ der Spalten: „Sommerzei...
193    fn evaluate_490(&self, ctx: &EvaluationContext) -> ConditionResult {
194        ctx.format_check("DTM", 0, 1, is_mesz_utc)
195    }
196
197    /// [491] Wenn Wert in diesem DE, an der Stelle CCYYMMDDHHMM ein Zeitpunkt aus dem angegeben Zeitraum der Tabelle Kapitel 3.6 „Übersicht gesetzliche deutsche Zeit (MEZ)“ der Spalten: „Winterzeit (MEZ)...
198    fn evaluate_491(&self, ctx: &EvaluationContext) -> ConditionResult {
199        ctx.format_check("DTM", 0, 1, is_mez_utc)
200    }
201
202    /// [492] Wenn MP-ID in NAD+MR aus Sparte Strom
203    /// EXTERNAL: Requires context from outside the message.
204    fn evaluate_492(&self, ctx: &EvaluationContext) -> ConditionResult {
205        ctx.external.evaluate("nad_mr_is_strom_sector")
206    }
207
208    /// [493] Wenn MP-ID in NAD+MR aus Sparte Gas
209    /// EXTERNAL: Requires context from outside the message.
210    fn evaluate_493(&self, ctx: &EvaluationContext) -> ConditionResult {
211        ctx.external.evaluate("nad_mr_is_gas_sector")
212    }
213
214    /// [593] Hinweis: Daten des MSBN
215    fn evaluate_593(&self, _ctx: &EvaluationContext) -> ConditionResult {
216        // Hinweis: Daten des MSBN — informational note, always applies
217        ConditionResult::True
218    }
219
220    /// [594] Hinweis: Wenn die Aufteilung der Tranche prozentual erfolgt.
221    fn evaluate_594(&self, _ctx: &EvaluationContext) -> ConditionResult {
222        // Hinweis: Wenn die Aufteilung der Tranche prozentual erfolgt — informational note, always applies
223        ConditionResult::True
224    }
225
226    /// [595] Hinweis: Wenn die Aufteilung auf Basis eines Aufteilungsfaktors wie z.B. der installierten Leistung auf Basis der Technischen Ressourcen erfolgt. Da die Berechnungsformel (UTILTS) derzeit nur für ...
227    fn evaluate_595(&self, _ctx: &EvaluationContext) -> ConditionResult {
228        // Hinweis: Aufteilung auf Basis eines Aufteilungsfaktors (installierte Leistung, Technische Ressourcen) — informational note, always applies
229        ConditionResult::True
230    }
231
232    /// [163] Wenn innerhalb der Nachricht in einem PIA+5 (Erforderliches Produkt der Marktlokation / Erforderliches Produkt der Tranc...
233    // PIA: element 0 is 4347, elements 1–5 are the C212 composites; DE7143 is component 1.
234    fn evaluate_163(&self, ctx: &EvaluationContext) -> ConditionResult {
235        let found = ctx
236            .find_segments_with_qualifier("PIA", 0, "5")
237            .iter()
238            .any(|s| {
239                s.elements
240                    .get(4)
241                    .and_then(|c212| c212.get(1))
242                    .is_some_and(|code| !code.is_empty() && code != "V15")
243            });
244        ConditionResult::from(found)
245    }
246
247    /// [158] Es sind nur die Produkt-Codes erlaubt, die in der Codeliste der Konfigurationen im Kapitel 6.2 "Produkte zur Bestellung einer Änderung von Abrechnungsdaten" genannt sind.
248    fn evaluate_158(&self, ctx: &EvaluationContext) -> ConditionResult {
249        // HAND-EDITED: Codeliste der Konfigurationen 1.4, Kapitel 6.2 (embedded); FV2604 reads 1.3c.
250        crate::eval::abrechnungsdaten::product_is_listed(
251            ctx,
252            crate::eval::abrechnungsdaten::Edition::V1_4,
253        )
254    }
255
256    /// [159] Wenn in derselben SG29 LIN im PIA+5 (Erforderliches Produkt Abrechnungsdaten) DE7140 ein Produkt-Code genannt ist, der in der Codeliste der Konfigurationen im Kapitel 6.2 "Produkte zur Bestellung e...
257    fn evaluate_159(&self, ctx: &EvaluationContext) -> ConditionResult {
258        // HAND-EDITED: Codeliste der Konfigurationen 1.4, Kapitel 6.2 (embedded); FV2604 reads 1.3c.
259        crate::eval::abrechnungsdaten::has_property_codes(
260            ctx,
261            crate::eval::abrechnungsdaten::Edition::V1_4,
262        )
263    }
264
265    /// [160] Es sind nur die Codes der Produkteigenschaft zu dem in derselben SG29 LIN im PIA+5 (Erforderliches Produkt Abrechnungsdaten) DE7140 erlaubt, die in der Codeliste der Konfigurationen im Kapitel 6.2 ...
266    fn evaluate_160(&self, ctx: &EvaluationContext) -> ConditionResult {
267        // HAND-EDITED: Codeliste der Konfigurationen 1.4, Kapitel 6.2 (embedded); FV2604 reads 1.3c.
268        crate::eval::abrechnungsdaten::property_code_allowed(
269            ctx,
270            crate::eval::abrechnungsdaten::Edition::V1_4,
271        )
272    }
273
274    /// [162] Es ist nur der Wertebereich erlaubt, der zu dem in derselben SG29 LIN im PIA+5 (Erforderliches Produkt Abrechnungsdaten) DE7140 genannten Produkt, das in der Codeliste der Konfigurationen im Kapite...
275    fn evaluate_162(&self, ctx: &EvaluationContext) -> ConditionResult {
276        // HAND-EDITED: Codeliste der Konfigurationen 1.4, Kapitel 6.2 (embedded); FV2604 reads 1.3c.
277        crate::eval::abrechnungsdaten::wertedetails_value_fits(
278            ctx,
279            crate::eval::abrechnungsdaten::Edition::V1_4,
280        )
281    }
282
283    /// [180] Wenn in derselben SG29 LIN im PIA+5 (Erforderliches Produkt Abrechnungsdaten) DE7140 ein Produkt-Code genannt ist der in der Codeliste der Konfigurationen im Kapitel 6.2 "Produkte zur Bestellung ei...
284    fn evaluate_180(&self, ctx: &EvaluationContext) -> ConditionResult {
285        // HAND-EDITED: Codeliste der Konfigurationen 1.4, Kapitel 6.2 (embedded); FV2604 reads 1.3c.
286        crate::eval::abrechnungsdaten::has_wertedetails(
287            ctx,
288            crate::eval::abrechnungsdaten::Edition::V1_4,
289        )
290    }
291}