Skip to content

feat(server): add notification service for trade lifecycle events - #188

Merged
dark-sarge merged 2 commits into
arflexx:mainfrom
annieolivia61-ux:feat/issue-71-notification-service
Aug 28, 2026
Merged

feat(server): add notification service for trade lifecycle events#188
dark-sarge merged 2 commits into
arflexx:mainfrom
annieolivia61-ux:feat/issue-71-notification-service

Conversation

@annieolivia61-ux

Copy link
Copy Markdown
Contributor

Closes #71

What changed

  • Adds NotificationService.send(userId, event, payload) in server/src/services/notifications.ts.
  • SMS templates live as string constants in server/src/services/notificationTemplates.ts (no template strings in handlers).
  • Wires notifications into the trade lifecycle:
    • TRADE_LOCKED (to seller) after POST /trades/:id/buy
    • TRADE_COMPLETED (both parties) after escrow release
    • DISPUTE_FILED (both parties + admins) on escalation
    • WITHDRAWAL_PROCESSED (user) after withdrawal
  • Failures are logged with logger.warn and never fail the parent operation (best-effort).
  • Respects the opt_out_notifications flag on the user record.

How to test

  • cd server && pnpm tsc --noEmit
  • pnpm test (tradeVerification suite still passes)

- Add NotificationService.send() with best-effort Termii SMS dispatch
- Store SMS templates as string constants in notificationTemplates.ts
- Trigger TRADE_LOCKED, TRADE_COMPLETED, DISPUTE_FILED, WITHDRAWAL_PROCESSED
- Respect opt_out_notifications flag; failures logged via logger.warn

Closes arflexx#71
@drips-wave

drips-wave Bot commented Aug 28, 2026

Copy link
Copy Markdown

@annieolivia61-ux Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@dark-sarge
dark-sarge merged commit ab14d32 into arflexx:main Aug 28, 2026
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.

[server] - Build Notification Service for Email and SMS Alerts

2 participants