automapper_validation/generated/fv2610/quotes_conditions_fv2610.rs
1// <auto-generated>
2// Generated by automapper-generator generate-conditions
3// AHB: xml-migs-and-ahbs/FV2610/QUOTES_AHB_1_1a_20260401.xml
4// Generated: 2026-04-22T18:07:36Z
5// Delegates unchanged conditions to QuotesConditionEvaluatorFV2510 (FV2510).
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::fv2510::QuotesConditionEvaluatorFV2510;
14
15/// Condition evaluator for QUOTES FV2610.
16///
17/// Delegates to [`QuotesConditionEvaluatorFV2510`] for conditions whose AHB description is
18/// unchanged from that version. Local overrides: [2060, 2061, 2062, 2063, 2064].
19pub struct QuotesConditionEvaluatorFV2610 {
20 fallback: QuotesConditionEvaluatorFV2510,
21}
22
23impl Default for QuotesConditionEvaluatorFV2610 {
24 fn default() -> Self {
25 Self {
26 fallback: QuotesConditionEvaluatorFV2510::default(),
27 }
28 }
29}
30
31/// Condition IDs whose implementation differs from the fallback.
32const FV2610_OVERRIDES: &[u32] = &[2060, 2061, 2062, 2063, 2064];
33
34impl ConditionEvaluator for QuotesConditionEvaluatorFV2610 {
35 fn message_type(&self) -> &str {
36 "QUOTES"
37 }
38
39 fn format_version(&self) -> &str {
40 "FV2610"
41 }
42
43 fn evaluate(&self, condition: u32, ctx: &EvaluationContext) -> ConditionResult {
44 match condition {
45 2060 => self.evaluate_2060(ctx),
46 2061 => self.evaluate_2061(ctx),
47 2062 => self.evaluate_2062(ctx),
48 2063 => self.evaluate_2063(ctx),
49 2064 => self.evaluate_2064(ctx),
50 other => self.fallback.evaluate(other, ctx),
51 }
52 }
53
54 fn is_external(&self, condition: u32) -> bool {
55 self.fallback.is_external(condition)
56 }
57
58 fn is_known(&self, condition: u32) -> bool {
59 FV2610_OVERRIDES.contains(&condition) || self.fallback.is_known(condition)
60 }
61}
62
63impl QuotesConditionEvaluatorFV2610 {
64 /// [2060] Pro Nachricht ist die SG27 LIN+Z64 (Erforderliches Produkt Schaltzeitdefinitionen) maximal einmal anzugeben.
65 // REVIEW: Cardinality constraint: SG27 LIN+Z64 (Erforderliches Produkt Schaltzeitdefinitionen) may appear at most once per message. LIN+Z64 puts Z64 at elements[0][0]; count_qualified_in_group with elem=0 checks that. Returns True (constraint satisfied) when count ≤ 1, False when violated. Zero occurrences also satisfies the constraint. (medium confidence)
66 fn evaluate_2060(&self, ctx: &EvaluationContext) -> ConditionResult {
67 ConditionResult::from(ctx.count_qualified_in_group("LIN", 0, "Z64", &["SG27"]) <= 1)
68 }
69
70 /// [2061] Pro Nachricht ist die SG27 LIN++Z65 (Erforderliches Produkt Leistungskurvendefinitionen) maximal einmal anzugeben.
71 // REVIEW: Cardinality constraint: SG27 LIN++Z65 (Leistungskurvendefinitionen) may appear at most once. The double-plus notation means element 0 is empty and Z65 is at elements[1][0]; count_qualified_in_group with elem=1 matches that position. (medium confidence)
72 fn evaluate_2061(&self, ctx: &EvaluationContext) -> ConditionResult {
73 ConditionResult::from(ctx.count_qualified_in_group("LIN", 1, "Z65", &["SG27"]) <= 1)
74 }
75
76 /// [2062] Pro Nachricht ist die SG27 LIN++Z66 (Erforderliches Produkt Ad-hoc-Steuerkanal) maximal einmal anzugeben.
77 // REVIEW: Cardinality constraint: SG27 LIN++Z66 (Ad-hoc-Steuerkanal) may appear at most once. LIN++Z66 places Z66 at elements[1][0]; count_qualified_in_group with elem=1 checks that position across all SG27 instances. (medium confidence)
78 fn evaluate_2062(&self, ctx: &EvaluationContext) -> ConditionResult {
79 ConditionResult::from(ctx.count_qualified_in_group("LIN", 1, "Z66", &["SG27"]) <= 1)
80 }
81
82 /// [2063] Pro Nachricht ist die SG27 LIN++Z67 (Erforderliches Messprodukt für Werte nach Typ 2 aus Backend) maximal einmal anzugeben.
83 // REVIEW: Cardinality constraint: SG27 LIN++Z67 (Messprodukt für Werte nach Typ 2 aus Backend) may appear at most once. LIN++Z67 places Z67 at elements[1][0]; count_qualified_in_group with elem=1 checks that position. (medium confidence)
84 fn evaluate_2063(&self, ctx: &EvaluationContext) -> ConditionResult {
85 ConditionResult::from(ctx.count_qualified_in_group("LIN", 1, "Z67", &["SG27"]) <= 1)
86 }
87
88 /// [2064] Pro Nachricht ist die SG27 LIN++Z68 (Erforderliches Produkt Konfigurationserlaubnis für Werte nach Typ 2 aus SMGW) maximal einmal anzugeben.
89 // REVIEW: Cardinality constraint: SG27 LIN++Z68 (Konfigurationserlaubnis für Werte nach Typ 2 aus SMGW) may appear at most once. LIN++Z68 places Z68 at elements[1][0]; count_qualified_in_group with elem=1 checks that position. (medium confidence)
90 fn evaluate_2064(&self, ctx: &EvaluationContext) -> ConditionResult {
91 ConditionResult::from(ctx.count_qualified_in_group("LIN", 1, "Z68", &["SG27"]) <= 1)
92 }
93}