energy_api/spec_version.rs
1//! Specification versions implemented by this crate.
2//!
3//! Each constant identifies the OpenAPI / AsyncAPI document version that the
4//! corresponding module implements. All four EDI-Energy API-Webdienste are
5//! currently at version **1.0.0** — the only tag in either spec repository.
6//!
7//! The electricity specs live in `github.com/EDI-Energy/api-electricity`; the
8//! Verzeichnisdienst is a **separate** repository,
9//! `github.com/EDI-Energy/api-directory-service`.
10//!
11//! See [`RELEASE_2_0_0_STATUS`] for why 2.0.0 is tracked but not implemented.
12//!
13//! Use these constants in server implementations to populate
14//! `ApiRecord::major_version` when self-registering at the
15//! Verzeichnisdienst (the directory expects an `i32` `majorVersion` field
16//! whose value is `1` for all current specs).
17//!
18//! ```rust
19//! use energy_api::spec_version;
20//!
21//! assert_eq!(spec_version::DIRECTORY_SERVICE, "1.0.0");
22//! assert_eq!(spec_version::DIRECTORY_WEBSOCKET, "1.0.0");
23//! assert_eq!(spec_version::CONTROL_MEASURES, "1.0.0");
24//! assert_eq!(spec_version::MALO_IDENT, "1.0.0");
25//! ```
26
27/// `directoryServiceV1.yaml` — EDI-Energy Verzeichnisdienst REST API.
28pub const DIRECTORY_SERVICE: &str = "1.0.0";
29
30/// `webSocketV1.yaml` — EDI-Energy Verzeichnisdienst WebSocket subscription API.
31pub const DIRECTORY_WEBSOCKET: &str = "1.0.0";
32
33/// `controlMeasuresV1.yaml` — EDI-Energy Control Measures API.
34///
35/// **Note:** the Control Measures spec currently omits a `/v1` URL prefix
36/// (unlike the other APIs); the path layout is `/[Post]/steuerbefehl/<action>/`.
37pub const CONTROL_MEASURES: &str = "1.0.0";
38
39/// `maloIdentV1.yaml` — EDI-Energy MaLo Identification API.
40pub const MALO_IDENT: &str = "1.0.0";
41
42/// The `majorVersion` field value for all current specs as expected by the
43/// Verzeichnisdienst (`ApiRecord::major_version: i32`).
44pub const MAJOR: i32 = 1;
45
46// ── Release 2.0.0 — tracked, deliberately not implemented ────────────────────
47
48/// Why this crate targets 1.0.0 and not the announced 2.0.0.
49///
50/// Mitteilung Nr. 55 (02.02.2026) put **API-Webdienste Strom Release 2.0.0** out
51/// for consultation with a target date of 01.10.2026. **Mitteilung Nr. 56**
52/// (01.04.2026) then excluded it, verbatim:
53///
54/// > Die im Release 2.0.0 zur Konsultation gestellten Anpassungen an den
55/// > API-Webdiensten sind nicht Bestandteil dieser Veröffentlichung.
56///
57/// Only **API Guideline 1.0b** binds on 01.10.2026. In the spec repository
58/// (`github.com/EDI-Energy/api-electricity`) the only tag is **`1.0.0`**; the
59/// 2.0.0 material lives solely on the `2026-07-31-consultation` branch, which
60/// is still moving. BNetzA's own link to a `2.0.0` release tag returns 404.
61///
62/// Implementing against it now would be rework against an unfrozen contract.
63pub const RELEASE_2_0_0_STATUS: &str =
64 "deferred by Mitteilung Nr. 56; consultation branch only, no 2.0.0 tag";
65
66/// What 2.0.0 actually changes, from the consultation branch.
67///
68/// It is **not** a decomposition of MaLo-Ident: `maloIdentV2.yaml` keeps all
69/// three operations. The changes are:
70///
71/// 1. **Modularisation** — a shared `schema/` library referenced by relative
72/// `$ref`, replacing the self-contained single-file specs of 1.x.
73/// 2. **Six new process APIs** alongside maloIdent — `locationBundle`,
74/// `calculationFormula`, `countingTime`, `powerCurve`, `switchingTime`,
75/// `complaintDefinition`.
76/// 3. **Property renames** in `identificationParameterId`:
77/// `maloId` → `marketLocationId`, `tranchenIds` → `marketTranchesIds`,
78/// `meloIds` → `meterLocationsIds`. The *component* stays `maloId`.
79/// [`crate::models::electricity`] implements the **1.x** names, pinned by a
80/// wire-contract test.
81/// 4. English operation paths (`/controlMeasure/configuration/v2`) replacing the
82/// German ones (`/[Post]/steuerbefehl/konfiguration/`).
83/// 5. An expanded error set (415/422/429/503/504) and `testFlag` / `referenceId`
84/// headers per the API Guideline.
85pub const RELEASE_2_0_0_SCOPE: &str =
86 "modularised schema/ library + 6 new process APIs + identificationParameterId renames";