zugferd_code_lists/zugferd_2_3_3/
fiscalid.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 FiscalID {
7    /// Fiscal number
8    FiscalNumber,
9}
10
11impl crate::Code for FiscalID {
12    fn code(self) -> &'static str {
13        match self {
14            FiscalID::FiscalNumber => "FC",
15        }
16    }
17}
18
19impl crate::Description for FiscalID {
20    fn description(self) -> &'static str {
21        match self {
22            FiscalID::FiscalNumber => "Fiscal number",
23        }
24    }
25}
26
27impl crate::FromCode for FiscalID {
28    fn from_code(code: &str) -> Option<Self>
29    where
30        Self: Sized,
31    {
32        match code {
33            "FC" => Some(FiscalID::FiscalNumber),
34            _ => None,
35        }
36    }
37}