Purav fix bell notification for meetings - #1677
Merged
one-community merged 31 commits intoJul 26, 2026
Merged
Conversation
…ication_for_meetings
36 tasks
…ersions in package.json and package-lock.json
…r ID validation and streamline participant and organizer ID checks
…GNRest into Gopika_Fix_Bell_notification_for_meetings
kzou55
requested changes
Jul 7, 2026
kzou55
left a comment
There was a problem hiding this comment.
Hi Purav,
I ran and tested the PR alongside its associated frontend.
Verified
- Can schedule meetings
- Can mark meetings as read
- Gets notification if meeting is within 3 days
- Bell notification works
- Invalid inputs are sent back the appropriate error message
Testing
-
Getting meetings within a date range
-
Getting calendar invite
-
Scenario 1 - Bell appears for participant
- Scheduling a meeting using admin account for
- Get the meetings for the participant
-
Scenario 2 - Notification clears after viewing
-
Scenario 3 - Meeting > 3 days away does not trigger bell
-
Scenario 4 - Invalid inputs are rejected
-
Bad date of meeting value
-
Organizer ID not existing
-
Participant ID not existing
-
Invalid meeting location
-
Issues
…culation in getAllMeetingsByOrganizer function
kzou55
approved these changes
Jul 18, 2026
kzou55
left a comment
There was a problem hiding this comment.
Hi Purav,
I ran and retested the PR alongside the associated frontend PR.
Verified
- The following as before:
- Test scenario 1 - Bell appears for participant
- Test scenario 2 - Notification clears after viewing
- Test scenario 3 - Meeting > 3 days away does not trigger bell
- Test scenario 4 - Invalid inputs are rejected
- The previous issue of the getting upcoming meetings for organizer endpoint not working is now functional
Co-authored-by: Cursor <cursoragent@cursor.com>
…condition for user promotion
|
Member
|
Thank you all, merging! |
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.












PR #1677 — Bell Notification for Meetings (Backend)
Branch:
Gopika_Fix_Bell_notification_for_meetings→developmentRelated Frontend PR: HighestGoodNetworkApp #3946
Summary
This PR adds the backend for the Meeting Bell Notification feature. It allows Administrators, Managers, and Owners to schedule meetings for team members. Participants receive a bell notification when a meeting is scheduled within the next 3 days. The notification resets (clears) once the participant views it.
Files changed (feature only — no unrelated changes)
src/models/meeting.jssrc/controllers/meetingController.jssrc/routes/meetingRouter.js/apisrc/startup/routes.jsmeetingRoutersrc/utilities/createInitialPermissions.jsscheduleMeetingspermission to Administrator, Manager, OwnerHow to Run the Backend Locally
Prerequisites
npm install -g yarn)hgnData_dev) — get.envcredentials from a teammate1. Clone and checkout
git clone https://github.com/OneCommunityGlobal/HGNRest.git cd HGNRest git checkout Gopika_Fix_Bell_notification_for_meetings2. Install dependencies
3. Create your
.envfileCreate a
.envfile in the project root with the following variables (get values from a teammate):4. Start the server
This runs from
src/directly viababel-nodewith auto-restart on file changes.5. Confirm the server is running
You should see both of these lines in the terminal:
The API base URL is:
http://localhost:4500/api6. Configure the frontend
In the
HighestGoodNetworkAppfrontend repo, set your.env:API Endpoints
All endpoints require a valid JWT in the
Authorizationheader (raw token, noBearerprefix). Get your token by logging in viaPOST /api/login.Authentication
Response:
{ "token": "<JWT>" }Use this token in all subsequent requests as:
Authorization: <JWT>POST /api/meetings/new— Schedule a meetingPermission required:
scheduleMeetings(Administrator, Manager, Owner)Request body:
{ "dateOfMeeting": "2026-07-05", "startHour": "02", "startMinute": "00", "startTimePeriod": "PM", "duration": 30, "participantList": ["<participantUserId>"], "location": "Zoom", "locationDetails": "https://zoom.us/j/example", "notes": "Weekly team sync", "organizer": "<organizerUserId>" }Valid
locationvalues:"Zoom","Phone call","On-site"(or omit for none)Responses:
201—{ "message": "Meeting saved successfully" }400— Invalid form values, invalid/nonexistent user IDs500— Internal server errorGET /api/meetings?startTime=&endTime=— Get meetings in a date rangeReturns all meetings (with per-participant read status) within the given time window.
Query params: ISO 8601 timestamps (URL-encoded)
Example:
Response: Array of meeting objects:
[ { "_id": "...", "dateTime": "2026-07-05T19:00:00.000Z", "duration": 30, "organizer": "...", "location": "Zoom", "locationDetails": "...", "notes": "...", "recipient": "<participantId>", "isRead": false } ]GET /api/meetings/participant/:participantId— Get unread upcoming meetings (bell popup)Returns meetings within the next 3 days that are unread for the given participant. This is the primary endpoint the frontend bell uses to populate the notification popup.
Response:
{ "upComingMeetings": [ { "_id": "...", "dateTime": "2026-07-05T19:00:00.000Z", "organizerName": "Jane Smith", "duration": 30, "location": "Zoom", "locationDetails": "...", "notes": "...", "participant": "<participantId>" } ] }404if no unread meetings within 3 days (bell should not light up)POST /api/meetings/markRead/:meetingId/:recipient— Dismiss notificationMarks a specific meeting as read for a specific participant. Call this when the participant views/dismisses the bell popup.
Response:
200—{ "message": "Meeting marked as read successfully" }404— Meeting not found or already read400— Invalid IDsGET /api/meetings/upcoming/:organizerId— Get organizer's future meetingsReturns all upcoming (future) meetings scheduled by the given organizer.
Query param:
organizerId=<userId>Response: Array of meeting objects with full
participantListGET /api/meeting/:meetingId/calendar— Get calendar invite dataReturns Google Calendar link and
.icscontent for a meeting.Response:
{ "googleCalendarLink": "https://calendar.google.com/...", "icsContent": "BEGIN:VCALENDAR\n...", "organizerFullName": "Jane Smith" }Testing the Bell Notification Feature
Test accounts setup
You need two accounts to test the full flow:
Administrator,Manager, orOwnerroleGet their
_idvalues from MongoDB (userProfilescollection) or decode them from the JWT token after login.Test scenario 1 — Bell appears for participant
200 { "token": "..." }POST /api/meetings/newwith participant's ID and a date within 3 days201 { "message": "Meeting saved successfully" }200 { "token": "..." }GET /api/meetings/participant/<participantId>200 { "upComingMeetings": [ ... ] }— meeting appearsTest scenario 2 — Notification clears after viewing
POST /api/meetings/markRead/<meetingId>/<participantId>200 { "message": "Meeting marked as read successfully" }GET /api/meetings/participant/<participantId>again404— no more unread meetingsTest scenario 3 — Meeting > 3 days away does NOT trigger bell
POST /api/meetings/newwith a date 5+ days from now201GET /api/meetings/participant/<participantId>404— not within 3-day windowTest scenario 4 — Invalid inputs are rejected
dateOfMeeting400 Bad request: Invalid form valuesorganizerID400 Bad request: Organizer ID does not exist400 Bad request: Participant ID does not existlocationvalue (e.g."Slack")400 Bad request: Invalid form valuesmeetingIdinmarkRead400 Invalid meeting or recipient IDQuick curl test block
Replace
<TOKEN>,<ORGANIZER_ID>,<PARTICIPANT_ID>with real values.Known Issues / Notes for Reviewers
meetingscollection does not pre-exist — MongoDB creates it automatically on the first successfulPOST /api/meetings/new.Calendar duration —
getCalendarInvitecomputes end time asstartTime + duration * 1000ms. The frontend sendsdurationin minutes; this means the calendar end time will be off (30 minutes will show as 30 seconds). A fix should multiply by60 * 1000instead.getAllMeetingsByOrganizerroute — The route param is:organizerIdbut the controller readsreq.query.organizerId. This will always return an empty array when called with a path param. Frontend should use?organizerId=<id>as a query param, or the route should be fixed to usereq.params.organizerId.No email/push notification on create — Meetings are saved to DB. Calendar links are available via
GET /api/meeting/:id/calendarafter creation, but no automatic email or push is sent when a meeting is scheduled.SonarCloud security — All user-controlled IDs are now validated and cast to
mongoose.Types.ObjectIdbefore being used in DB queries (fixed in this branch).Permissions Added
scheduleMeetingspermission added to the following default roles increateInitialPermissions.js: