zugferd_code_lists/zugferd_2_3_3/
hybridconformance.rs

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