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

Description

Handles dispatch of push and in-app notifications to coordinators when a peer mentor's pause status is activated, lifted, or automatically changed due to certification expiry. Resolves the assigned coordinator for a given peer mentor and formats audience-appropriate messages.

Feature: Peer Mentor Pause & Status Management

pause-notification-service

Summaries

Timely, accurate notifications are the operational nervous system that keeps coordinators informed when peer mentor availability changes, whether through a voluntary pause, a return to active duty, or an automatic certification lapse. This shared service ensures coordinators receive the right message through the right channel — push for immediate awareness, in-app with a direct deep link for action — the moment a status change occurs. By eliminating the latency between a status event and coordinator awareness, the organization reduces the risk of participants going without support and enables faster, more confident reallocation decisions across the program.

Medium-complexity shared backend service that is a delivery prerequisite for both pause-management-service and certification-expiry-checker — both depend on it for coordinator alerting, so it must be implemented early in the backend delivery sequence. Push notification integration requires selecting and configuring a provider (FCM for Android, APNs for iOS) and coordinating device token registration with the mobile team. Message copy for different trigger reasons (voluntary pause vs. automated certification expiry) requires content review by the product or program team.

Deep link generation must be agreed with the mobile navigation team before implementation. Testing scope includes all four notification events, push delivery, in-app delivery, coordinator resolution logic, and message formatting for each trigger type.

Shared backend notification service consumed by pause-management-service and certification-expiry-checker. Core interfaces: notifyPauseActivated(mentorId, expectedReturnDate?), notifyPauseLifted(mentorId), notifyCertExpiry(mentorId, expiryDate), notifyCertExpiryReminder(mentorId, daysRemaining). resolveCoordinatorForMentor(mentorId) queries peer-mentor-status-repository to determine coordinator assignment before dispatch. formatNotificationPayload(event, context) produces channel-appropriate message copy that varies based on trigger reason — voluntary pause copy differs from automated expiry copy.

Sends both push (via FCM/APNs provider) and in-app notifications; in-app payloads include a deep link to the mentor detail screen. The service must be idempotent for retry scenarios triggered by the nightly scheduler in case of transient failures.

Responsibilities

  • Resolve coordinator assignment for a given peer mentor
  • Send push notification for pause activation and deactivation events
  • Send in-app notification with deep link to mentor detail
  • Format notification copy based on trigger reason (voluntary pause vs. cert expiry)

Interfaces

notifyPauseActivated(mentorId, expectedReturnDate?)
notifyPauseLifted(mentorId)
notifyCertExpiry(mentorId, expiryDate)
notifyCertExpiryReminder(mentorId, daysRemaining)
resolveCoordinatorForMentor(mentorId)
formatNotificationPayload(event, context)

Relationships

Dependencies (1)

Components this component depends on

Dependents (2)

Components that depend on this component

Used Integrations (1)

External integrations and APIs this component relies on

API Contract

View full contract →
REST /api/v1/pause-notifications 4 endpoints
POST /api/v1/pause-notifications/pause-activated Send notification when a mentor pause is activated
POST /api/v1/pause-notifications/pause-lifted Send notification when a mentor's pause is lifted
POST /api/v1/pause-notifications/cert-expiry Send notification that a mentor's certification has expired
POST /api/v1/pause-notifications/cert-expiry-reminder Send advance warning that a mentor's certification will expire soon