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
| Tab | Description |
|---|---|
| Active | Unread and read notifications that haven't been marked as complete |
| Completed | Notifications 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 addressesread— Boolean indicating read statusfinished— 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
| Event | Recipients |
|---|---|
| MOC created | Assigned implementer |
| Implementer submits (approved) | HSEQ department email, assigned HSEQ user, approver, all MOC users |
| Implementer declines | Originator, all MOC users |
| HSEQ approves | Approver, originator, implementer |
| HSEQ declines (returns to implementer) | Implementer, originator |
| Approver approves | Originator, implementer, HSEQ user |
| Approver declines | Originator, implementer, HSEQ user |
| Implementation complete | All stakeholders |
| Deviation/extension requested | Approver, HSEQ user |
| Verification complete (MOC closed) | Originator, implementer, HSEQ user, approver |
PCR Email Triggers
| Event | Recipients |
|---|---|
| PCR created | VP Fleet Management, all admins, affected parties |
| Signature collected | Next role in the signing chain |
| All signatures complete | Originator, 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.