Skip to main content

Notifications

The platform has a built-in notification system that keeps users informed about workflow events through in-app notifications and email alerts.

In-App Notifications

The notification center is the default landing page after login, located at /dashboard/notifications.

Component: src/features/notification_system/components/allNotificationWrapper.tsx

Notification Layout

The notification center uses a split-panel layout:

  • Left panel — Scrollable list of notifications with unread badges and timestamps
  • Right panel — Detail view of the selected notification with rendered markdown content

Notification Tabs

TabDescription
ActiveUnread and read notifications that haven't been marked as complete
CompletedNotifications marked as complete by the user

Auto-Polling

Notifications are refreshed automatically every 30 seconds without requiring a page reload.

Notification Actions

  • Mark as read — Triggered automatically when a notification is clicked
  • Mark as complete — Moves the notification from Active to Completed
  • Delete — Permanently removes the notification

Notification Data

Notifications are stored in MongoDB with the following key fields:

  • user_emails — Array of recipient email addresses
  • read — Boolean indicating read status
  • finished — Boolean indicating completion status
  • Notification content is stored as markdown and rendered using react-markdown

Server actions: src/features/notification_system/apis/notification_actions.tsx

Email Notifications

Email notifications are sent at each workflow transition point. All emails are dispatched through an AWS Lambda function that forwards to AWS SES.

Email helper: src/helpers/send_email.ts

MOC Email Triggers

EventRecipients
MOC createdAssigned implementer
Implementer submits (approved)HSEQ department email, assigned HSEQ user, approver, all MOC users
Implementer declinesOriginator, all MOC users
HSEQ approvesApprover, originator, implementer
HSEQ declines (returns to implementer)Implementer, originator
Approver approvesOriginator, implementer, HSEQ user
Approver declinesOriginator, implementer, HSEQ user
Implementation completeAll stakeholders
Deviation/extension requestedApprover, HSEQ user
Verification complete (MOC closed)Originator, implementer, HSEQ user, approver

PCR Email Triggers

EventRecipients
PCR createdVP Fleet Management, all admins, affected parties
Signature collectedNext role in the signing chain
All signatures completeOriginator, all admins

PCR email helper: src/helpers/pcr_email_helpers.ts

All emails include branded HTML templates with the Bahri logo, relevant serial numbers, and direct links to the MOC or PCR in the platform.