Skip to content

Backend: Complete notification delivery service (email + in-app) #196

@KuchiMercy

Description

@KuchiMercy

Summary

The Notification entity, NotificationPreference entity, and notifications module structure exist, but the actual delivery pipeline is not wired up. Many features across the platform depend on notifications being delivered — this is the foundational backend service that unblocks notification UX.

Requirements

  • Implement NotificationService with methods to create and deliver notifications
  • Wire up Nodemailer SMTP integration for email delivery (already in dependencies)
  • Create in-app notifications on all escrow lifecycle events:
    • ESCROW_FUNDED — notify all parties
    • MILESTONE_RELEASED — notify seller
    • DISPUTE_FILED — notify all parties + admins
    • DISPUTE_RESOLVED — notify all parties
    • ESCROW_EXPIRED — notify all parties
    • PARTY_INVITED — notify the invited party
    • CONDITION_MET — notify escrow creator
  • Respect NotificationPreference settings (email on/off, in-app on/off per event type)
  • Add endpoints: GET /notifications (list), PATCH /notifications/:id/read (mark read), GET /notifications/unread-count
  • Add a NotificationPreference CRUD endpoint for users to manage their settings

Acceptance Criteria

  • In-app notifications are created for all listed escrow events
  • Email notifications are sent via SMTP when enabled in user preferences
  • Users can fetch their notifications with pagination
  • Unread count endpoint returns accurate count
  • Mark as read updates the notification status
  • Notification preferences are respected (no delivery if user opted out)
  • Email delivery failures are logged but do not block in-app notification creation

Context

  • Notification entity: apps/backend/src/notifications/notification.entity.ts
  • Notification preference: apps/backend/src/notifications/notification-preference.entity.ts
  • Notifications module: apps/backend/src/notifications/notifications.module.ts
  • Nodemailer is already in package.json

Points: 150

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions