zugferd_code_lists/zugferd_2_3_2/
hybridconformance.rs

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