Skip to content

feat: implement stubbed NotificationsService methods (#1002) - #1098

Open
Chinonso-Peter wants to merge 1 commit into
rinafcode:mainfrom
Chinonso-Peter:feat/implement-notifications-service-stubs
Open

feat: implement stubbed NotificationsService methods (#1002)#1098
Chinonso-Peter wants to merge 1 commit into
rinafcode:mainfrom
Chinonso-Peter:feat/implement-notifications-service-stubs

Conversation

@Chinonso-Peter

@Chinonso-Peter Chinonso-Peter commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements all stubbed methods in NotificationsService and adds the missing unsubscribe method to PreferencesService, making the notifications API fully functional.

Changes

src/notifications/notifications.service.ts

  • create - persists a notification with DTO-provided fields
  • send - persists + dispatches through all enabled channels via PreferencesService
  • sendTemplated - renders template via NotificationTemplateService, respects unsubscribed event types, dispatches through enabled channels
  • markRead - ownership check + persists isRead/readAt
  • markManyRead - bulk ownership check + bulk UPDATE
  • unsubscribe - delegates to PreferencesService (global or per-event-type)
  • Replaced all _dto: any parameter types with proper DTOs

src/notifications/preferences/preferences.service.ts

  • Added unsubscribe(userId, eventType) method: sets globalUnsubscribe for all or eventFrequency[eventType] = never

Acceptance Criteria

  • Creating a notification then listing returns the created record
  • Marking a notification read persists and is reflected on the next read
  • Unsubscribing from an event type suppresses subsequent delivery for that type
  • No method in the service returns a hardcoded empty value
  • No _dto: any signatures remain

Closes #1002

Implement create, send, sendTemplated, findForUser, markRead,
markManyRead, and unsubscribe with real logic backed by TypeORM
repositories and PreferencesService.

- create: persist notification with DTO-provided fields
- send: persist + dispatch through all enabled channels via PreferencesService
- sendTemplated: render template, respect unsubscribed event types, dispatch
- findForUser: paginated query (already existed, kept as-is)
- markRead: ownership check + persist isRead/readAt
- markManyRead: bulk ownership check + bulk UPDATE
- unsubscribe: delegates to PreferencesService (global or per-event-type)
- Add unsubscribe method to PreferencesService
- Remove all _dto: any signatures in favour of typed DTOs
@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@Chinonso-Peter Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Chinonso-Peter

Copy link
Copy Markdown
Contributor Author

@RUKAYAT-CODER review

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Well done on the job done so far!
Kindly resolve conflict and fix workflow to pass

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement the stubbed NotificationsService methods backing the live notifications API

2 participants