Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
Notification Digest via pg_cron Sweep
Last tested: 2026-10-04 Route: /x (topbar bell)
Prerequisites
- Migration
20261004183512_scheduled-jobs-from-database.sqlapplied. - Vault secret
inngest_event_urlset and the Inngest dev server running (both are done bycrbn up). - The test user has no unread notifications (start from
has_work = false).
Steps
1. Seed — five unread notifications for [email protected], same company and
topic (event = 'job-assignment', topic = 'jobs'), createdAt more than
60 minutes ago. Give them a recognisable title so they can be deleted.
2. Sweep
SELECT util.notification_digest_has_work();→trueSELECT util.sweep_notification_digest();
3. Verify — database (within about 5 seconds)
- One
event = 'digest'row for the user withpayload->>'count' = '5'and title "5 unread notifications". - The five seeded rows have
digestedIntoset to that row. util.notification_digest_has_work()→false.- The newest
net._http_responserows are 200.
4. Verify — app
- Reload
/x. The bell badge reads 1, not 5. - Open the bell: the Inbox lists "5 unread notifications".
5. Clean up — delete the seeded rows and the digest row.
Selector Notes
- The bell is the topbar button with class
w-8 h-8 flex items-center relative; it has no aria-label. Its text content is the unread count.
Common Failures
- Fewer than five rows, or rows younger than 60 minutes:
has_workstays false and nothing is sent. Both thresholds are innotification-digest.ts. - Seeding rows across two companies or topics: each bucket is counted separately.