Skip to content

[BE-57] Implement per-user notification preferences — control channels per event type #930

Description

@yusuftomilola

Overview

Users should control which notifications they receive and through which channel. A user who handles checkouts daily may not want an email every time — just an in-app ping. This settings layer sits between the notification dispatcher (BE-56) and the actual delivery.

Context

  • Depends on BE-55 and BE-56 (notification infrastructure)
  • Preferences should default to all-enabled so new users get all notifications out of the box
  • The notification preferences UI is built in FE-29

Acceptance Criteria

  • Create NotificationPreference entity: id, userId, eventType (NotificationEvent from BE-56), emailEnabled (boolean, default true), inAppEnabled (boolean, default true), updatedAt
  • GET /users/me/notification-preferences — returns all event types with current preference settings. If no record exists for an event type, return the default (both enabled)
  • PUT /users/me/notification-preferences body: [{ eventType, emailEnabled, inAppEnabled }] — upserts all preferences in a single request
  • Modify NotificationDispatchService from BE-56 to check preferences before dispatching: await preferenceService.shouldSend(userId, eventType, channel)
  • POST /users/me/notification-preferences/reset — resets all preferences to default (all enabled)

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions