Skip to content

Add database-backed notification system #79

Description

@Akatenvictor

What

Add a user notification system with database-backed notifications for events like royalty payouts, song approvals, and marketplace sales.

Why

Users currently have no way to know when important events happen on their account. Notifications improve engagement and ensure artists stay informed about earnings and activity.

Scope

  • In: Notification entity, NotificationService, notification endpoints, event trigger hooks
  • Out: Push notifications, email notification preferences, notification grouping

Acceptance Criteria

  • Notification entity with fields: userId, type, message, read status, createdAt
  • GET /api/notifications returns user's notifications paginated
  • PUT /api/notifications/:id/read marks notification as read
  • POST /api/notifications/read-all marks all as read
  • NotificationService.create() method for programmatic notification creation
  • Notifications auto-generated for: royalty payout, song status change, marketplace sale

Technical Context

  • New Notification entity in src/entities/
  • NotificationService in src/services/
  • NotificationController in src/controllers/
  • Database migration required
  • Hook into RoyaltyPayoutService and MarketplaceService for event triggers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions