Service Layer medium complexity Shared Component backend
0
Dependencies
1
Dependents
3
Entities
0
Integrations

Description

Service responsible for delivering push and in-app notifications to coordinators when a peer mentor changes status. Resolves the correct coordinator(s) for a given mentor's chapter and dispatches notifications via the configured channel. Shared with other features that require coordinator-directed alerts.

Feature: Peer Mentor Pause & Reactivation

coordinator-notification-service

Summaries

The Coordinator Notification Service ensures that coordinators are never left uninformed when a peer mentor's availability changes. Real-time push and in-app notifications allow coordinators to respond immediately — reassigning work, following up with a mentor who has paused, or updating program plans — rather than discovering gaps hours or days later. Because this service is shared across multiple features that require coordinator-directed alerts, the organization gains a consistent, maintainable notification capability without duplicating logic. This reduces operational risk, improves coordinator responsiveness, and protects the quality of support delivered to program participants across all chapters.

A medium-complexity backend service with no external service dependencies at the interface level, but with implicit dependencies on the push notification platform and in-app notification infrastructure being configured and available. As a shared component, its delivery timeline affects every feature that requires coordinator alerts — coordinate with all consuming teams to agree on the interface contract early. Testing requirements include unit tests for recipient resolution, push and in-app dispatch, and message formatting, plus integration tests against the notification platform. Deployment requires backend infrastructure provisioning for the notification channel.

Treat this as a foundational shared service and prioritize its delivery to unblock dependent features.

Exposes four methods: `notifyCoordinatorsOfStatusChange(mentorId, newStatus, reason?)`, `getCoordinatorsForMentor(mentorId)`, `sendPushNotification(recipients, title, body)`, and `sendInAppNotification(recipients, payload)`. Runs exclusively in the backend execution context. Recipient resolution queries the chapter-coordinator mapping from the `user_role` and `peer_mentor` data models — ensure this query is indexed for performance at scale. Push and in-app dispatch should be implemented as separate, independently retriable operations so that a push platform outage does not suppress in-app notifications.

As a shared service, version its interface carefully; breaking changes affect all consumers. Message formatting should be centralized in a private method to ensure consistency across all status change scenarios and simplify future copy updates.

Responsibilities

  • Resolve coordinator recipients for a given mentor and chapter
  • Send push notification and in-app notification on mentor status change
  • Format notification message with context (mentor name, status, reason)

Interfaces

notifyCoordinatorsOfStatusChange(mentorId: String, newStatus: MentorStatus, reason: String?): Future<void>
getCoordinatorsForMentor(mentorId: String): Future<List<Coordinator>>
sendPushNotification(recipients: List<String>, title: String, body: String): Future<void>
sendInAppNotification(recipients: List<String>, payload: NotificationPayload): Future<void>

Relationships

Dependents (1)

Components that depend on this component

Related Data Entities (3)

Data entities managed by this component

API Contract

View full contract →
REST /api/v1/notifications 8 endpoints
GET /api/v1/notifications List notifications with optional filters
GET /api/v1/notifications/:id Get a single notification
POST /api/v1/notifications Create and dispatch a notification to one or more recipients
PUT /api/v1/notifications/:id Update a notification (e.g. mark as read)
DELETE /api/v1/notifications/:id Delete a notification record
POST /api/v1/notifications/push Send push notification to a list of recipients
+2 more