Skip to content

Notification system (in-app + email) #8

Description

@Martins0152

Description
Implement the /api/v1/notifications route group and a shared notificationService that other modules (donations, KYC, distributions) can call to create notifications, matching the Notification model.

Acceptance Criteria

  • notificationService.send(userId, type, title, message) creates a DB record and, if the user has email notifications enabled, sends an email via Nodemailer.
  • GET /, GET /unread-count, PATCH /:id/read, PATCH /read-all, DELETE /:id all work and are scoped to the authenticated user only (can't read/mark another user's notifications).
  • Email sending failure does not fail the underlying action that triggered it (e.g. a donation still confirms even if the email send fails) - log the error instead.
  • Tests cover creation, read/unread state, and the "email failure doesn't block core action" behavior.
  • Documented in openapi.yaml, including the specific POST /donation, POST /campaign-update, POST /distribution trigger endpoints.

Suggested reward: $25-$35

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendBackend/API workmediumModerate complexitynotificationsNotification system

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions