Skip to content

feat(notifications): unified in-app + email dispatch for escrow events#162

Open
Rufai-Ahmed wants to merge 1 commit into
Lumina-eX:mainfrom
Rufai-Ahmed:feat/notification-system
Open

feat(notifications): unified in-app + email dispatch for escrow events#162
Rufai-Ahmed wants to merge 1 commit into
Lumina-eX:mainfrom
Rufai-Ahmed:feat/notification-system

Conversation

@Rufai-Ahmed

Copy link
Copy Markdown

What

Unified notification layer covering the four escrow events: milestone submitted, funds released, dispute opened, wallet activity.

How

  • lib/notifications.ts dispatches each event through both channels: a persisted in-app notification and an email.
  • Email sits behind a transport interface in lib/email.ts: Resend over plain fetch when RESEND_API_KEY is set, a console transport otherwise so development works with no provider configured. The provider call is bounded by a 10s abort signal so a hung provider cannot stall a route response.
  • Each channel fails independently and only logs, so route handlers can notify after their main side effect without risking the request.
  • Every NotificationType must have a message template, so adding an event type forces a template.
  • Dispute notifications go to every contract party except whoever raised the dispute.

Testing

15/15 notification dispatch tests (new). Full suite green apart from 5 pre-existing failures in reviews.test.ts, identical on main.

Closes #54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Notification System (Email + In-App)

1 participant