Skip to main content

Crate mako_events

Crate mako_events 

Source
Expand description

Compile-time catalog of every CloudEvents type used across the mako workspace.

One pub const per event type, organized in bounded-context modules. Emitters and subscribers reference these constants instead of inline string literals, so a rename is a one-line change and drift between producer and consumer is a compile error rather than a silent mismatch.

§Conventions

  • Every type starts with de. and is entirely lowercase (CloudEvents §3.1 recommends lowercase reverse-DNS types).
  • Segments are separated by ., and a multi-word segment joins its words with - — never _. German domain nouns keep their established spelling (participles like beliefert, compound nouns like nb-contract). segments_use_hyphen_not_underscore enforces this.
  • A namespace names its facts in one language. de.vertrag.* is German throughout (gekuendigt, preisgarantie-hinterlegt); de.mako.*, de.gabi.* and de.accounting.* are technical or English-domain and stay English. german_namespaces_use_german_participles enforces the German set. This is about the participle, not the noun — and it does not mean .updated and .geaendert are interchangeable: in de.markt.* they name different facts (any master-data write vs. a regulated GPKE Stammdatenänderung carrying its patch).
  • ⚠ phantom: in a doc comment means no service in this workspace emits this type. That is the whole claim, and it is the one unreferenced_constants_are_marked_phantom checks. It says nothing about whether anything subscribes: some phantoms are subscriptions placed ahead of their emitter, others are neither emitted nor consumed, and each constant’s own doc comment says which and why. A phantom is a recorded gap, not a promise — an external consumer may match on it, but this platform will not make it fire.

Glob subscription patterns (e.g. de.mako.* in agentd trigger configs) are not part of this catalog — only concrete types are. The canonical pattern matcher every subscription mechanism uses is matches().

§Scope (why mako-events, not mako-common)

This crate deliberately stays a single-purpose leaf: constants and logic about CloudEvents types (the catalog, the naming convention, the pattern matcher) and nothing else. A general mako-common/mako-core grab-bag would become a dependency magnet — every crate depends on it, every change rebuilds the workspace, and unrelated helpers accrete without an owner. Shared logic already has purpose-named homes: domain runtime in mako-engine, service framework in mako-service, master-data types in mako-markt. New shared code goes to the crate whose purpose it serves; a new purpose gets a new purpose-named crate.

Modules§

accounting
FI-CA subledger events (de.accounting.*), emitted by accountingd.
agent
Agent runtime events (de.agent.*), emitted by agentd.
billing
Billing events (de.billing.*), emitted by billingd.
eeg
EEG/KWKG settlement events (de.eeg.*), emitted by einsd.
gabi
GaBi Gas balancing events (de.gabi.*), defined in mako-gabi-gas.
invoic
INVOIC receipt/payment events (de.invoic.*), emitted by invoicd.
mabis
MaBiS Summenzeitreihe submission events (de.mabis.*), emitted by mabis-syncd.
mako
Core MaKo process lifecycle + EDIFACT transport events (de.mako.*).
markt
Market master-data events (de.markt.*), emitted by marktd.
messwert
Meter-reading / energy-data events (de.messwert.*), emitted by edmd.
netzbilanz
MaBiS/Netzbilanzierung INVOIC events (de.netzbilanz.*), emitted by netzbilanzd.
obs
Process-observability events (de.obs.*).
sperr
Sperr/Entsperr execution events (de.sperr.*), emitted by sperrd.
tarif
Product & tariff catalog events (de.tarif.*), emitted by productd.
vertrag
Contract lifecycle events (de.vertrag.*), emitted by vertragd.
vpp
Virtual-power-plant events (de.vpp.*).

Functions§

all
Every concrete CloudEvents type in the catalog.
matches
The canonical event-type pattern matcher, shared by every subscription mechanism in the workspace (marktd webhook subscriptions, agentd trigger patterns).