Service Layer high complexity backend
2
Dependencies
3
Dependents
11
Entities
0
Integrations

Description

Server-side service responsible for constructing notification payloads and dispatching them via the Push Notification Gateway abstraction layer. Handles routing logic per notification scenario (assignment dispatch, activity reminder, event update, coordinator alert), selects target device tokens from the repository, and records delivery metadata.

Feature: Push Notifications

push-notification-service

Responsibilities

  • Build notification payloads for each notification scenario type
  • Retrieve target device tokens for a given user or user group
  • Dispatch notifications via the Push Notification Gateway (APNs / FCM)
  • Persist notification records to the notifications table for inbox display
  • Handle delivery failures and implement retry logic

Interfaces

sendToUser(userId: string, payload: NotificationPayload) → Promise<void>
sendToUsers(userIds: string[], payload: NotificationPayload) → Promise<void>
buildPayload(scenario: NotificationScenario, data: Record<string, unknown>) → NotificationPayload
recordDelivery(userId: string, payload: NotificationPayload, status: string) → Promise<void>

Relationships

Dependencies (2)

Components this component depends on

Dependents (3)

Components that depend on this component