pub struct TenantId(/* private fields */);Expand description
Scopes all streams and events to a single market participant or deployment tenant.
Implementations§
Source§impl TenantId
impl TenantId
Sourcepub fn from_party_id(party_id: &str) -> Self
pub fn from_party_id(party_id: &str) -> Self
Derive a deterministic TenantId from a GLN or other opaque operator
identifier string using UUID v5 (SHA-1 hash in a fixed namespace).
This allows the production binary (makod) to accept a GLN from the
Derive a deterministic TenantId from a market-participant identifier
(GLN, BDEW code, EIC, or any opaque operator string) using UUID v5
(SHA-1 hash in a fixed namespace).
This allows the production binary (makod) to accept a BDEW code or
GLN from the CLI and produce a stable TenantId that is consistent
across process restarts, without requiring that the identifier already
be a UUID.
The accepted identifier formats are:
- BDEW code (13-digit, agency
"293") — most common in German MaKo - GLN (13-digit GS1, agency
"9") — global GS1 scheme, rare in MaKo - EIC (16-char ENTSO-E, agency
"305") — used by TSOs / Regelzonen - Any other opaque string used as
--tenant-id
The namespace UUID is fixed and private to this crate:
7e4a6b1c-2d3e-5f60-8a9b-0c1d2e3f4a5b (arbitrary, registered once).
§Example
use mako_engine::ids::TenantId;
// BDEW-issued market participant code (agency 293)
let id = TenantId::from_party_id("9900123456789");
assert_eq!(id, TenantId::from_party_id("9900123456789"));
assert_ne!(id, TenantId::from_party_id("9900357000004"));
// EIC code (ENTSO-E, agency 305) — e.g. for a TSO
let tso = TenantId::from_party_id("10XDE-EON-NETZ--I");
assert_ne!(id, tso);