Developer Guide
Subdomain type: Supporting · Grounded in: User Stories AL-1 through AL-5
This page describes the design-time model of the Alerting context. Delivery mechanics and concrete APIs are left as decisions for whoever builds this model.
The context owns everything about delivering alerts to people. Its defining design decision is to separate two concerns that are easy to conflate: where a principal can be reached, and what a principal wants to hear about.
| Term | Meaning in this context |
|---|---|
| Delivery Channel | A single device or endpoint an alert can be pushed to. |
| Alert Preference | A principal’s per-domain choices about which kinds of alert to receive. |
| Alert Type | A category of alert (for example, a temperature alert). |
| Recipient | A principal eligible to receive a given alert, within a domain. |
We model the context as two separate aggregate roots so that the two concerns can change independently — a principal can revoke a device without losing their choices, and change their choices without touching their devices.
classDiagram
class DeliveryChannel {
<<Aggregate Root>>
+principal
+endpoint
+DeliveryKeys keys
}
class DeliveryKeys {
<<Value Object>>
+keyMaterial
}
class AlertPreference {
<<Aggregate Root>>
+principal
+domainName
+TypePreference[] preferences
}
class TypePreference {
<<Value Object>>
+AlertType type
+subscribed
}
DeliveryChannel "1" *-- "1" DeliveryKeys : secured by
AlertPreference "1" *-- "many" TypePreference : holdsAlertType is modelled as an extensible set. We expect to start with a small number of types and add more, so the model is built to grow rather than fixed to today’s list.Each aggregate carries one immutable, identity-less value object. DeliveryKeys is the key material that lets a Delivery Channel be reached securely — it belongs to its channel and nowhere else. A TypePreference is a single (alert type, subscribed?) choice held inside an Alert Preference. Neither has meaning on its own, so both are modelled as value objects their aggregate replaces rather than tracks by identity.
The context is downstream of two others and feeds the platform’s real-time flow. The interaction is drawn generically — the concrete trigger and delivery details are implementation decisions.
sequenceDiagram
participant Src as Reading source
participant Al as Alerting
participant BM as Building Management
participant U as Users
Src->>Al: a reading worth alerting on
Note over Al: decide whether it crosses an alert threshold
Al->>BM: which domains is this building in?
BM-->>Al: domain names
Note over Al: select recipients who opted in
Al->>U: deliver the alert| Relationship | Pattern |
|---|---|
| Consumes identity from Identity & Access | Conformist (reads the identity token, never reshapes it) |
| Resolves a building’s domains from Building Management | Customer / Supplier, translated into this context’s own terms |
| Emits alerts into the real-time flow | Domain Event published to the platform |
Resolving a building’s domains from another context, rather than storing its own copy, keeps this context’s model focused on delivery and intent and leaves the structural truth where it belongs — and is exactly what story AL-5 relies on to keep tenants from seeing each other’s incidents.