Bounded Context: Approvals
Aggregate Root: NotificationRule
Module: Ums.Domain.Approvals.NotificationRule
Status: Production
NotificationRule defines a notification configuration that specifies the communication channel and recipient for a notification event. It is a tenant-scoped, independent aggregate that can be referenced by DocumentType entities but manages its own lifecycle.
NotificationRule is modelled as an Aggregate Root (not an Owned Entity of DocumentType). This allows a single notification rule to be independently managed, activated, or deactivated without going through a parent document type, and enables reuse of notification configurations across multiple document types.
NotificationRule owns its own lifecycle. It does not depend on DocumentType to be created, deactivated, or deleted.
Active ──Deactivate()──► Inactive
Recipient must be a non-empty string.Channel must be a valid NotificationChannel value.TenantId must be provided and valid.None. NotificationRule has no owned child entities.
| Method | State Precondition | Description |
|---|---|---|
Create(tenantId, channel, recipient, createdBy) |
— | Creates a new notification rule. |
Deactivate(updatedBy) |
Must be Active | Deactivates the rule. |
UpdateRecipient(newRecipient, updatedBy) |
Any state | Updates the notification recipient. |
| Code | Trigger |
|---|---|
approvals.rule_already_inactive |
Deactivate() when already inactive |
value_object.property_required |
Create() with empty recipient |
| Name | Type | Description |
|---|---|---|
NotificationRuleId |
GUID-based ID | Aggregate identifier |
TenantId |
GUID-based ID | Tenant scope |
NotificationChannel |
Enum | Email, SMS, WebPortal, etc. |
TextValueObject |
String wrapper | Recipient address/identifier |
None registered yet. Event raising to be added when notification dispatch is implemented.
| Back to Approvals BC Index | Consistency Rules |