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