Skip to content

Feat/event - #326

Merged
dDevAhmed merged 19 commits into
DigiNodes:mainfrom
nafiuishaaq:feat/event
Jul 29, 2026
Merged

Feat/event#326
dDevAhmed merged 19 commits into
DigiNodes:mainfrom
nafiuishaaq:feat/event

Conversation

@nafiuishaaq

Copy link
Copy Markdown
Contributor

Key Changes Made:

  1. Added Internal Notification Controller (src/notifications/controllers/internal-notification.controller.ts)

    • Secured with ServiceAuthGuard - only accessible to internal services with valid service tokens
    • Exposes /internal/notifications/process-event endpoint that accepts protocol events
    • Uses the existing processIncomingEvent method from the main NotificationsService
  2. Updated Existing Notifications Module (src/notifications/notifications.module.ts)

    • Added the new InternalNotificationController to the controllers array
    • Maintains full compatibility with all existing notification functionality
  3. Cleaned Up Duplicate Files

    • Removed the redundant notification module and services I initially created since there was already a comprehensive implementation
    • Ensured all functionality is properly integrated into the existing codebase

The New Endpoint:

POST /internal/notifications/process-event

Accepts events in the format:

{
  eventType: string;        // e.g., "claim.created", "security.alert"
  source: string;           // Service name sending the event
  timestamp: Date;          // When the event occurred
  payload: Record<string, any>; // Event-specific data
  recipientIds: string[];   // List of users to notify
}

This endpoint automatically:

  • Maps event types to notification categories
  • Generates human-readable titles and messages
  • Checks user notification preferences before sending
  • Queues notifications for delivery through enabled channels (in-app, WebSocket, email, push, webhook)
  • Tracks delivery status with retries for reliability
  • Records metrics for monitoring

The integration maintains all existing functionality while adding the requested internal service endpoint for cross-service communication.

closes #280

@dDevAhmed
dDevAhmed merged commit 41bf0e1 into DigiNodes:main Jul 29, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BE-014 — Implement Notification & Event Delivery Service

2 participants