telco-interop

S/PRI validation

Know before sending whether the network owner will refuse an S/PRI order or message: 34 cited rules with element path, source and the ABBM code it answers with.

Values are valid by construction: their types check every length, pattern and value list of the schema. Validation covers what types cannot — which business case has a Storno or a Terminverschiebung, an Auftragsklammer’s size, a Zeitfenster against the weekday, a follow-up order against its original, a code against the message type and business case.

use spri::*;

// The PV fixture asks for 2027-01-15. A Terminverschiebung that moves it earlier:
let mut tv = pv.clone();
tv.aenderungskennzeichen = Aenderungskennzeichen::Terminverschiebung;
tv.termin_neu = Some("2027-01-08".parse()?);

let issues = tv.issues_against(&pv);
assert_eq!(issues[0].rule, "spri.tv.earlier");
assert_eq!(issues[0].code, Some(Meldungscode::C1085));
println!("{}", issues[0]);
// error [spri.tv.earlier] auftrag/terminNeu: a PV cannot move earlier than 2027-01-15 after the positive pre-agreement (AH 2.9.5 §3.4) → 1085

// The date rules need the moment of sending and a calendar.
let late = pv.issues_at("2027-01-16T08:00:00Z".parse()?, &Calendar::werktage());
assert_eq!(late[0].rule, "spri.termin.past");

Every Issue has a severity (error: the network owner refuses it, or the specification says it must not be sent so; warning: advised against or likely a problem), a path in XML element names, a stable rule, a message, its source and, where the sources give one, the code of the ABBM the network owner answers with. Messages are not answered with an ABBM, so their issues carry no code. Issues never contain personal data: no name, address, number or free text.

CallChecks
Auftrag::issues()the order on its own
Auftrag::issues_at(now, &calendar)plus the requested date: of a standard order, or the new date of a Terminverschiebung
Auftrag::issues_against(&original)plus a Storno, Terminverschiebung or Reklamation against its order
Meldung::issues()a message against the code table
Teq::issues()a technical receipt

The rules🔗

Thirty-four rules; an issue’s rule field names one of them. (I) marks an interpretation.

Orders🔗

RuleChecksSourceCode
spri.aekz.stornono Storno in GET and SET (messages: nor KUE-LE)S/PRI 4.4 §6.2.1.2, §6.2.2.2; Anl. 7 EPK V.13 p.41007
spri.aekz.terminverschiebunga Terminverschiebung only in NEU, KUE-AG, LAE, PVS/PRI 4.4 §5.3.1.3, §6.1.3, §6.2.1.3, §6.2.2.31007
spri.termin-neu.only-tvterminNeu only with a Terminverschiebung (warning)XSD 4.00.03 AuftragType
spri.geschaeftsfallart.matchthe Geschäftsfallart belongs to the business case; PV also Bereitstellung (I)S/PRI 4.4 §4.1
spri.auftragsklammer.countan Auftragsklammer holds 1 to 20 ordersS/PRI 4.4 §4.3.3; AH 2.9.5 §3.7
spri.auftragsklammer.caseonly NEU, AEN-LMAE, LAE and PV are bracketedAH 2.9.5 §3.7; S/PRI 4.4 §4.3.3
spri.zeitfenster.weekdaythe Zeitfenster fits the weekday of the date (I: „Werktags“ = Monday to Saturday)AH 2.9.5 §3.3; XSD 4.00.03 ZeitfensterType1032
spri.kue-ag.wita-vertragsnummera KUE-AG with Vorabstimmungs-ID names the WITA contract number (warning, I)S/PRI 4.4 §5.2.1.4
spri.line-id.va-idthe LineID is not the Vorabstimmungs-ID (I)LineID V1.4 §3.1.38144
spri.termin.pastthe date is not before the day of sending (I: 1003 outside EST)AH 2.9.5 §6.4 (7014, 1003)7014, 1003
spri.termin.horizonthe date is at most 180 days ahead (warning)S/PRI 4.4 §2, §5.1.41003
spri.termin.working-daythe date is a working day of the calendar (warning)AH 2.9.5 §6.4 (0002)0002

Storno, Terminverschiebung, Reklamation🔗

RuleChecksSourceCode
spri.bezug.order-numberit repeats the original’s order numberS/PRI 4.4 §5.1.3, §5.1.4, §6.1.5
spri.bezug.caseit keeps the business caseS/PRI 4.4 §5.1.3, §5.1.4
spri.bezug.originalit refers to a standard orderAH 2.9.5 §3.4, §3.5
spri.bezug.repeateda new standard order does not reuse an order numberAH 2.9.5 §3.91013
spri.storno.identicala Storno is identical to the original but for the Änderungskennzeichen (warning)S/PRI 4.4 §5.1.3, §5.3.1.2, §6.1.2
spri.tv.identicala Terminverschiebung changes only the date, terminNeu, Anlage, Montageleistung, Seriennummer ONT and Vorabstimmungs-ID (warning)S/PRI 4.4 §5.1.4
spri.tv.new-dateit names a date other than the original’sS/PRI 4.4 §5.1.41085
spri.tv.earliera PV is not moved earlierAH 2.9.5 §3.41085
spri.tv.zeitfensterit keeps the ZeitfensterAH 2.9.5 §3.41085
spri.reklamation.identicala Reklamation changes only Anlage, contacts, date and Störungsbeschreibung (warning)S/PRI 4.4 §6.1.5

Messages and receipts🔗

RuleChecksSource
spri.code.unknownthe code is in the published list (warning: the online list adds codes)AH 2.9.5 §6.3; S/PRI 4.4 §11.2.4
spri.code.applicabilitythe code belongs to the message type and the business caseAH 2.9.5 §6.4
spri.code.13121312 only together with 1310 or 1311AH 2.9.5 §6.4
spri.code.freitext1312, 8600, 8601 carry a text of their own, not the placeholder (warning)AH 2.9.5 §6.4
spri.vzm.verzoegerungstermina VZM with 1576, 1580 or 1581 names the appointmentAH 2.9.5 §6.4
spri.abbm.erledigungsterminan ABBM 1006 or 1012 gives the open order’s date in wiedervorlagetermin (warning, I)AH 2.9.5 §6.4
spri.abbm.abgebender-provideran ABBM 0041 or 0042 names the losing providerAH 2.9.5 §6.4
spri.ruem-pv.antwortcode-missinga refusing RUEM-PV gives a reasonS/PRI 4.4 §5.5.1.1
spri.ruem-pv.antwortcode-knownthe reason is LnB, KVE, TAV, VnB or Vnv (I: ignoring case)S/PRI 4.4 §5.5.1.1; AH 2.9.5 §6.5
spri.ruem-pv.contradictiona consenting RUEM-PV carries no refusal reason (I)S/PRI 4.4 §5.5.1.1
spri.teq.codea receipt carries only OK, 0990, 0991, 0993, 0995, 0999AH 2.9.5 §6.4
spri.teq.mixeda receipt is either OK or an error, not both (I)S/PRI 4.4 §11.2.3.1

The rules the lifecycle also enforces — Storno and Terminverschiebung per business case, a new date, a PV not moved earlier, the refusal reasons — give the same verdict and the same code there. Ordering rules — a Storno before the QEB, a second open Terminverschiebung, the 36-hour window — need the order’s history and are the lifecycle’s job. Not checked: the Home-ID, which the AK S&P leaves to each network operator, and contractual lead times.

Edit this page on GitHub · Report a mistake · API reference on docs.rs