1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
//! Which edition of EN 16931-1 a profile is a usage specification of.
//!
//! # Why this is a value and not a type parameter
//!
//! The obvious alternatives both fail. Two crates — `en16931-2017` and
//! `en16931-2026` — give you two incompatible `Invoice` types, two copies of the
//! validation engine, and a downstream explosion: `xrechnung` would have to
//! depend on both and expose both. `Invoice<E: Edition>` infects every signature
//! in the ecosystem for a difference that is, in the model, a handful of
//! `Option` fields.
//!
//! What makes one model safe is that **the 2026 revision is additive**. CEN
//! cannot delete a business term without invalidating every deployed CIUS, so
//! what :2026 does is add terms and *tighten cardinalities* on terms that
//! already exist. Tightening a cardinality is a rule change, not a model change:
//! the field is already `Option`, and the rule says it must be `Some`.
//!
//! So the model is the superset, and the edition is a property of the
//! **profile** — because a profile is what a document declares in BT-24, and
//! every deployed usage specification pins exactly one edition.
//!
//! # What is deliberately not here yet
//!
//! The design notes specifies a rule to go with this:
//!
//! ```text
//! EN-EDITION-01 (fatal): a business term introduced in a later edition than the
//! target profile's edition shall not be populated.
//! ```
//!
//! It is **not implemented**, and the reason is not effort. That rule needs a
//! map from business term to introducing edition, and building one requires the
//! EN 16931-1:2026 normative text. This crate's `spec/` holds the 2017+A1
//! English text and nothing else, so any such map would be reconstructed from
//! memory — which is precisely the mistake The design notes records, where two
//! specification identifiers were written from plausibility and then reasoned
//! from.
//!
//! [`Edition::En2026`] therefore exists as a classification a profile can carry,
//! and carries **no term assignments**. When the text is in hand, the term map
//! and `EN-EDITION-01` land together.
use fmt;
/// An edition of EN 16931-1.
///
/// `#[non_exhaustive]`: CEN will publish more, and a downstream `match` should
/// not break when they do.