zugferd_code_lists/zugferd_2_3_3/
hybridconformance.rs

1#![allow(non_camel_case_types)]
2
3#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)]
5pub enum HybridConformance {
6    /// The included document uses a MINIMUM profile
7    ///
8    /// Only applicable in Factur-X/ZUGFeRD
9    ///
10    /// Not allowed in Germany from 2025-01-01
11    TheIncludedDocumentUsesAMinimumProfile,
12    /// The included document uses a Basic Without Lines profile
13    ///
14    /// Only applicable in Factur-X/ZUGFeRD
15    ///
16    /// Not allowed in Germany from 2025-01-01
17    TheIncludedDocumentUsesABasicWithoutLinesProfile,
18    /// The included document uses a Basic profile
19    ///
20    /// Applicable in Factur-X/ZUGFeRD and Order-X. For Factur-X/ZUGFeRD the BASIC profile is compliant to the EN16931.
21    TheIncludedDocumentUsesABasicProfile,
22    /// The included document uses a Comfort profile
23    ///
24    /// Only applicable in Order-X
25    TheIncludedDocumentUsesAComfortProfile,
26    /// The included document uses a EN 16931 profile
27    ///
28    /// Only applicable in Factur-X/ZUGFeRD. This profile is compliant to the EN16931.
29    TheIncludedDocumentUsesAEn16931Profile,
30    /// The included document uses a Comfort profile
31    ///
32    /// Applicable in Factur-X/ZUGFeRD and Order-X. For Factur-X/ZUGFeRD the EXTENDED profile is compliant to and conformant extension of the EN16931.
33    TheIncludedDocumentUsesAComfortProfile_Dup,
34    /// The included document uses an XRECHNUNG profile
35    ///
36    /// Only applicable in Factur-X/ZUGFeRD.
37    ///
38    /// Not applicable in France
39    TheIncludedDocumentUsesAnXrechnungProfile,
40}
41
42impl crate::Code for HybridConformance {
43    fn code(self) -> &'static str {
44        match self {
45            HybridConformance::TheIncludedDocumentUsesAMinimumProfile => "MINIMUM",
46            HybridConformance::TheIncludedDocumentUsesABasicWithoutLinesProfile => "BASIC WL",
47            HybridConformance::TheIncludedDocumentUsesABasicProfile => "BASIC",
48            HybridConformance::TheIncludedDocumentUsesAComfortProfile => "COMFORT",
49            HybridConformance::TheIncludedDocumentUsesAEn16931Profile => "EN 16931",
50            HybridConformance::TheIncludedDocumentUsesAComfortProfile_Dup => "EXTENDED",
51            HybridConformance::TheIncludedDocumentUsesAnXrechnungProfile => "XRECHNUNG",
52        }
53    }
54}
55
56impl crate::Description for HybridConformance {
57    fn description(self) -> &'static str {
58        match self {
59            HybridConformance::TheIncludedDocumentUsesAMinimumProfile => {
60                "The included document uses a MINIMUM profile"
61            }
62            HybridConformance::TheIncludedDocumentUsesABasicWithoutLinesProfile => {
63                "The included document uses a Basic Without Lines profile"
64            }
65            HybridConformance::TheIncludedDocumentUsesABasicProfile => {
66                "The included document uses a Basic profile"
67            }
68            HybridConformance::TheIncludedDocumentUsesAComfortProfile => {
69                "The included document uses a Comfort profile"
70            }
71            HybridConformance::TheIncludedDocumentUsesAEn16931Profile => {
72                "The included document uses a EN 16931 profile"
73            }
74            HybridConformance::TheIncludedDocumentUsesAComfortProfile_Dup => {
75                "The included document uses a Comfort profile"
76            }
77            HybridConformance::TheIncludedDocumentUsesAnXrechnungProfile => {
78                "The included document uses an XRECHNUNG profile"
79            }
80        }
81    }
82}
83
84impl crate::FromCode for HybridConformance {
85    fn from_code(code: &str) -> Option<Self>
86    where
87        Self: Sized,
88    {
89        match code {
90            "MINIMUM" => Some(HybridConformance::TheIncludedDocumentUsesAMinimumProfile),
91            "BASIC WL" => Some(HybridConformance::TheIncludedDocumentUsesABasicWithoutLinesProfile),
92            "BASIC" => Some(HybridConformance::TheIncludedDocumentUsesABasicProfile),
93            "COMFORT" => Some(HybridConformance::TheIncludedDocumentUsesAComfortProfile),
94            "EN 16931" => Some(HybridConformance::TheIncludedDocumentUsesAEn16931Profile),
95            "EXTENDED" => Some(HybridConformance::TheIncludedDocumentUsesAComfortProfile_Dup),
96            "XRECHNUNG" => Some(HybridConformance::TheIncludedDocumentUsesAnXrechnungProfile),
97            _ => None,
98        }
99    }
100}