Added Notifications screen and logic for Records.

This commit is contained in:
Bruno Silva committed 2026-09-28 16:41:51 -04:00
1 parent 72ec7472c5
commit 697d72f379
13 files changed
+2255 -145

No files matched your search

+29
View File
@@ -4,6 +4,7 @@ import path from 'node:path'
import {
fetchEntries,
fetchTravellers,
createTraveller,
createEntry,
updateEntry,
deleteEntry,
@@ -11,6 +12,11 @@ import {
fetchVaccineRecords,
saveVaccineRecord,
updateVaccineRecord,
fetchNotifications,
updateNotification,
markNotificationRead,
markAllNotificationsRead,
archiveNotification,
} from './pocketbase.js'
import { JUVONNO_API_URL, JUVONNO_API_KEY } from './juvonno-config.js'
@@ -104,6 +110,9 @@ ipcMain.handle('pb:fetch-entries', async () => {
ipcMain.handle('pb:fetch-travellers', async () => {
return await fetchTravellers()
})
ipcMain.handle('pb:create-traveller', async (_event, data) => {
return await createTraveller(data)
})
ipcMain.handle('pb:create-entry', async (_event, trip) => {
return await createEntry(trip)
})
@@ -130,6 +139,26 @@ ipcMain.handle('pb:update-vaccine-record', async (_event, id, recordData) => {
return await updateVaccineRecord(id, recordData)
})
ipcMain.handle('pb:fetch-notifications', async (_event, options) => {
return await fetchNotifications(options)
})
ipcMain.handle('pb:update-notification', async (_event, id, data) => {
return await updateNotification(id, data)
})
ipcMain.handle('pb:mark-notification-read', async (_event, id, isRead) => {
return await markNotificationRead(id, isRead)
})
ipcMain.handle('pb:mark-all-notifications-read', async () => {
return await markAllNotificationsRead()
})
ipcMain.handle('pb:archive-notification', async (_event, id, isArchived) => {
return await archiveNotification(id, isArchived)
})
// ─── Health Risk Audit IPC Handler (Node-side to avoid CORS) ────────────────
ipcMain.handle('audit:run-health-audit', async (_event, payload) => {
const AUDIT_WEBHOOK_URL = 'https://n8n.wirediv.dev/webhook/travel-health-audit'