Service Layer high complexity backend
3
Dependencies
0
Dependents
2
Entities
0
Integrations

Description

Async backend service that subscribes to domain events such as activity overdue, assignment dispatched, and certificate expiring, then evaluates active scenario templates to determine which notifications to enqueue. Runs fully asynchronously and non-blocking relative to the primary write path.

Feature: Notification Scenarios

scenario-event-evaluator

Sources & reasoning

Core runtime mechanism of the feature. Without this evaluator the scenario templates have no effect. Implementation notes require async non-blocking evaluation decoupled from the primary write path.

No source references — this artifact was included based on reasoning alone (see above).

Responsibilities

  • Subscribe to domain events via the event bus or post-save hooks on key entities
  • Match incoming events against active scenario templates for the triggering organization
  • Enqueue notification jobs for each matching template filtered by target role
  • Delegate variable resolution to the Template Variable Resolver before enqueuing

Interfaces

handleEvent(eventType, payload)
evaluateScenarios(orgId, eventType, context)
enqueueNotifications(matches)

Related Data Entities (2)

Data entities managed by this component