1
2
3
4
5
6
7
8
9
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// <auto-generated>
// Generated by automapper-generator generate-conditions
// AHB: xml-migs-and-ahbs/FV2610/PARTIN_AHB_1_1_20260401.xml
// Generated: 2026-04-22T17:58:11Z
// Delegates unchanged conditions to PartinConditionEvaluatorFV2604 (FV2604).
// </auto-generated>
#![allow(clippy::style, clippy::complexity)]
#[allow(unused_imports)]
use crate::eval::format_validators::*;
use crate::eval::{ConditionEvaluator, ConditionResult, EvaluationContext};
use crate::generated::fv2604::PartinConditionEvaluatorFV2604;
/// Condition evaluator for PARTIN FV2610.
///
/// Delegates to [`PartinConditionEvaluatorFV2604`] for conditions whose AHB description is
/// unchanged from that version. Local overrides: [51, 509].
pub struct PartinConditionEvaluatorFV2610 {
fallback: PartinConditionEvaluatorFV2604,
}
impl Default for PartinConditionEvaluatorFV2610 {
fn default() -> Self {
Self {
fallback: PartinConditionEvaluatorFV2604::default(),
}
}
}
/// Condition IDs whose implementation differs from the fallback.
const FV2610_OVERRIDES: &[u32] = &[51, 509];
impl ConditionEvaluator for PartinConditionEvaluatorFV2610 {
fn message_type(&self) -> &str {
"PARTIN"
}
fn format_version(&self) -> &str {
"FV2610"
}
fn evaluate(&self, condition: u32, ctx: &EvaluationContext) -> ConditionResult {
match condition {
51 => self.evaluate_51(ctx),
509 => self.evaluate_509(ctx),
other => self.fallback.evaluate(other, ctx),
}
}
fn is_external(&self, condition: u32) -> bool {
self.fallback.is_external(condition)
}
fn is_known(&self, condition: u32) -> bool {
FV2610_OVERRIDES.contains(&condition) || self.fallback.is_known(condition)
}
}
impl PartinConditionEvaluatorFV2610 {
/// [51] Wenn DTM+137 (Nachrichtendatum) im DE2380 ≤ 202812312300?+00
fn evaluate_51(&self, ctx: &EvaluationContext) -> ConditionResult {
ctx.dtm_le("137", "202812312300")
}
/// [509] Hinweis: Falls die Umsatzsteuer- bzw. Steuernummer in einem bilateral ausgetauschten Dokument (z.B. Wiederverkäufernachweis eines LF) ausgetauscht wurde, ist zwingend diese ohne Veränderungen (z....
fn evaluate_509(&self, _ctx: &EvaluationContext) -> ConditionResult {
// Hinweis: Falls die Umsatzsteuer- bzw. Steuernummer in einem bilateral ausgetauschten Dokument (z.B. Wiederverkäufernachweis eines LF) ausgetauscht wurde, ist zwingend diese ohne Veränderungen zu nutzen.
ConditionResult::True
}
}