feat(notifications): add bulk read/unread endpoints (#1388) - #1492
Merged
Olowodarey merged 1 commit intoJul 29, 2026
Merged
Conversation
- Add POST /notifications/bulk/read to mark a list of notifications as read - Add POST /notifications/bulk/unread to mark a list as unread - Add POST /notifications/unread-all to mark all notifications as unread - Update POST /notifications/read-all to return unreadCount instead of updated - All operations are idempotent and scoped to the authenticated user - Add BulkUpdateDto with validation for notification IDs - Add comprehensive unit tests covering bulk, mark-all, scoping, and idempotency for both read and unread operations
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@iyanumajekodunmi756 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #1388 — Bulk Notification Read/Unread Endpoints.
Users can now mark lists of notifications (or all notifications) as read or unread in a single request, eliminating N+1 round-trips caused by marking notifications one at a time.
Changes
New Endpoints
PATCH/notifications/bulk/readPATCH/notifications/bulk/unreadPATCH/notifications/unread-allModified Endpoints
PATCH/notifications/read-all{ unreadCount: 0 }instead of{ updated: N }Design Decisions
JwtAuthGuardand filtered byuser.stellar_address— users can only modify their own notificationsread-all,unread-all,bulk/read,bulk/unread) are defined before the parameterized:id/readroute to prevent NestJS from incorrectly matchingbulkas an:idparameternotificationIdsarray is a graceful no-op (no DB call made)BulkUpdateDtovalidates that all IDs are positive integers usingclass-validatordecoratorsFiles Changed
backend/src/notifications/dto/bulk-update.dto.tsnotificationIds: number[]backend/src/notifications/notifications.service.tsmarkAllAsUnread,markMultipleAsUnread; updatedmarkAllAsRead&markMultipleAsReadto return{ unreadCount }backend/src/notifications/notifications.controller.tsbackend/src/notifications/notifications.service.spec.tsbackend/src/notifications/notifications.controller.spec.tsAcceptance Criteria
Test Results
No regressions. All existing notification tests continue to pass.
API Examples
Bulk mark as read
Response (200):
{ unreadCount: 5 }Bulk mark as unread
Response (200):
{ unreadCount: 7 }Mark all as unread
Response (200):
{ unreadCount: 12 }Closes #1388