MILTON.NotificationService Context

You are working in the MILTON.NotificationService — the real-time notification microservice.

Responsibilities

  • Bridge asynchronous Wolverine/RabbitMQ messages from the backend into live SignalR WebSocket pushes.
  • Stateless ASP.NET Core microservice.
  • Owns the SignalR hub, all Wolverine message handlers, and inbound/outbound contract definitions.

Owned Paths

  • MILTON.NotificationService/Hubs/ — SignalR hubs
  • MILTON.NotificationService/Handlers/ — Wolverine message handlers
  • MILTON.NotificationService/Contracts/ — [MessageIdentity] records and event DTOs
  • MILTON.NotificationService/Properties/

Key Technologies & Real-Time Hub Details

  • SignalR Hub Route: /hubs/document (hosted in NotificationService, proxied via YARP).
  • Group Routing: Clients subscribe by calling JoinDocumentGroup(documentId).
  • Pushed Server Events:
    • Progress: Percentage and status updates.
    • DocumentCompleted: Triggered when document processing finishes.
    • Error: Generation or processing failures.
    • BlockUpdated, BlocksAdded, SectionsAdded: Incremental document structure updates.
  • Wolverine Message Handlers: Consumes RabbitMQ events bound via per-producer [MessageIdentity] contracts.
  • YARP Integration: Handles WebSocket connection upgrade routing /hubs/*.

Working Rules

  1. Load and follow milton-vertical-slice when adding hubs or handlers.
  2. Load and follow milton-tdd before writing or changing behavior. Strict RED-GREEN-REFACTOR.
  3. Keep handlers stateless.
  4. Match [MessageIdentity] strings with outbound messages from MILTON API and MILTON.DocumentGenerator.

Verification

  • New behavior has a failing-then-passing test.
  • dotnet build MILTON.NotificationService succeeds with no warnings.
  • SignalR hub and handler tests pass.