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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
//! # wbci — the WBCI 2.0 provider switch, in Rust
//!
//! When a customer in Germany moves a fixed line to another provider, the two providers
//! agree on the switch over WBCI („WITA Based Carrier Interface", AK S&P) before any line is
//! touched: the gaining provider (**EKPauf**) sends a pre-agreement (*Vorabstimmung*), the
//! losing provider (**EKPabg**) answers with a binding date or a coded refusal, the gaining
//! provider announces whether it takes over the line, and either side may cancel or postpone
//! — all under working-day deadlines and § 59 TKG.
//!
//! This crate gives you that protocol as values, without I/O:
//!
//! | You want to… | Use |
//! |---|---|
//! | build a request or an answer | [`Vorabstimmung`], [`Storno`], [`Terminverschiebung`]; [`RuemVa::zustimmung`], [`Abbm::ablehnung`], [`Erlm`], [`AkmTr::uebernahme`], [`Teq::for_anfrage`] |
//! | write or read the XML | [`Payload::to_xml`], [`Payload::to_soap`], [`Payload::from_xml`] |
//! | know whether the peer will refuse it | [`Anfrage::issues_at`], [`Meldung::issues`] → [`Issue`] |
//! | know what is due when, and why | [`deadline`], [`Calendar`] |
//! | follow a switch through its life | [`Process`] |
//! | answer a pre-agreement as the losing provider | [`pruefung::check`] |
//! | look up a code | [`Meldungscode`] |
//! | test your gaining-provider side against a simulated losing provider | [`sim::Ekpabg`] |
//!
//! ## A switch in twenty lines
//!
//! ```
//! use wbci::*;
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let ekp = Ekp { auf: "DEU.EKP1".parse()?, abg: "DEU.EKP2".parse()? };
//! let va = Vorabstimmung {
//! id: VorabstimmungsId::allocate(&ekp.auf, 13)?, // DEU.EKP1.V000000013
//! kundenwunschtermin: "2027-01-15".parse()?,
//! endkunde: Kunde::person(Anrede::Frau, Some(Vorname::new("Erika")?), Nachname::new("Mustermann")?),
//! weitere_anschlussinhaber: vec![],
//! projekt: None,
//! fall: VorabstimmungsFall::KueOrn {
//! standort: Standort {
//! strassenname: Strassenname::new("Hauptstraße")?,
//! hausnummer: Hausnummer::new("12")?,
//! hausnummern_zusatz: None,
//! postleitzahl: Postleitzahl::new("10115")?,
//! ort: Ortsname::new("Berlin")?,
//! },
//! anschlussidentifikation: None,
//! },
//! ekp,
//! };
//!
//! // Will the peer accept it? Lead times count from when it is sent.
//! let sent: Timestamp = "2026-11-23T08:00:00Z".parse()?;
//! let anfrage = Anfrage::from(va.clone());
//! assert!(anfrage.issues_at(sent, &Calendar::wbci()).is_empty());
//!
//! // The XML for the peer.
//! let signatur = SignaturId { issuer: SignaturText::new("CN=Example CA")?, serial: SignaturText::new("4711")? };
//! let xml = Payload::AnfrageRequest { control: Control::new(sent, signatur), anfrage }.to_xml()?;
//! assert!(xml.contains("<VorabstimmungsId>DEU.EKP1.V000000013</VorabstimmungsId>"));
//!
//! // Follow it: once acknowledged, the answer is due within 3 working days.
//! let mut process = Process::new(Role::EkpAuf, va.clone(), Direction::Sent, sent)?;
//! process.apply(Direction::Received, sent, Teq::for_anfrage(&va.into(), Meldungscode::Ok))?;
//! let due = &process.deadlines()[0];
//! assert_eq!(due.to_string().split(" — ").next(), Some("EKPabg: by Do 26.11.2026 23:59"));
//! # Ok(())
//! # }
//! ```
//!
//! ## What is covered
//!
//! WBCI 2.0 (namespaces `http://www.vatm.de/wbci/v1/…`, `majorRelease` `02`), with the rules of
//! Anlage 1 „Spezifikation Vorabstimmung" V5.4.1 and the Arbeitshandbuch WBCI 2.10: all six
//! requests (`VA-KUE-MRN`, `VA-KUE-ORN`, `VA-RRNP`, `STR-AUF`, `STR-AEN` from either side,
//! `TVS-VA`), all six messages (`RUEM-VA`, `ABBM`, `ERLM`, `AKM-TR`, `ABBM-TR`, `TEQ`), the 36
//! published message codes, every deadline of Anlage 1 §2.5–§2.11.
//!
//! Not covered, by design: SOAP transport, WS-Security signing, TLS, persistence, the
//! search of your customer database (the [`pruefung`] check compares the record you found).
//! [`Payload::to_soap`] leaves the header
//! empty for your signer; [`Control::signatur`] names the certificate.
//!
//! ## Safety for untrusted input
//!
//! The reader refuses DTDs, resolves only the five predefined entities, bounds input size,
//! nesting, element count, text length and every repetition, and never panics. Values that
//! may be personal data print redacted in `Debug`; errors and issues never contain them.
//!
//! ## Interpretations
//!
//! Where the specifications leave room, this crate decides and says so: working days are
//! Monday to Friday without the nationwide public holidays ([`Calendar::wbci`]; the literal
//! „Mo – Fr" is [`Calendar::mon_fri`]); „24 Stunden (bezogen auf Arbeitstage)" counts 24
//! hours on working days only; the character set follows the schema's pattern.
//!
//! Guides, background and a glossary of the German terms:
//! <https://hupe1980.github.io/telco-interop/docs/wbci/>.
//!
//! Unofficial; not affiliated with or endorsed by the AK S&P, VATM or BUGLAS.
pub use Calendar;
pub use ;
pub use ;
pub use *;
pub use ;
pub use ;
pub use ;
pub use *;
pub use SignaturText;
pub use Timestamp;
pub use Date;
/// The README and the site's pages, compiled and run as doctests so they cannot drift.