Skip to content

[REFACTOR] Create unified NotificationService interface #232

@aniebietafia

Description

@aniebietafia

Problem

The application handles user notifications in an ad-hoc, siloed manner:

  • Push notifications are sent via NotificationController.java.
  • SMS is handled by smsservice.
  • Emails are orchestrated by EmailOrchestratorService.

There is no common notification layer that allows sending a notification to a user using their preferred channel (email, SMS, or push).

Proposed Solution

Create a unified NotificationService interface. This service acts as a single gateway for dispatching notifications, resolving user preferences at runtime to determine whether to route via email, SMS, push notifications, or all.

User Stories

  • As a system event, I want to trigger a single dispatch call notificationService.send(userId, alert) and let the system resolve user channel choices automatically.

Acceptance Criteria

  • Interface NotificationService is defined.
  • A dispatcher class routes message requests based on user preferences.
  • Code redundancy across notification layers is minimized.

Tasks

  • Define the unified interface.
  • Implement the dispatcher routing logic.
  • Integrate user preference lookup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions