Parent: #637
Summary
Ship the full server-side notification pipeline so operators can alert Discord, Telegram, Slack, or a generic HTTP webhook when important relay events happen.
Scope
Settings & validation
admin.notifications section in settings and settings-config.ts validation
enabled, targets[] (http | discord | slack | telegram), per-event toggles, retry policy
- Safe defaults: disabled, no targets
Dispatch core
NotificationService.dispatch(eventType, payload) — non-blocking, must not stall hot paths
- Configurable retry (max attempts, backoff)
- Postgres delivery log (target, event, status, attempts, error snippet, timestamps) + retention default
Channel adapters
- Generic HTTP webhook (JSON envelope: event, relay, timestamp, data)
- Discord incoming webhook
- Slack incoming webhook
- Telegram bot API (token and chat id; mask secrets in logs)
Event hooks (from #637)
| Event |
Trigger |
admission.invoice.created |
PaymentsService.createInvoice |
admission.invoice.paid |
PaymentsService.confirmInvoice / admit |
admission.invoice.failed |
expired / failed invoice paths (define explicitly) |
settings.changed |
successful admin settings patch (redact secrets) |
relay.restarted |
startup once per deploy (avoid worker spam — document choice) |
Tests
- Unit tests: validation, retry, adapters (mock HTTP), hook wiring
Parent: #637
Summary
Ship the full server-side notification pipeline so operators can alert Discord, Telegram, Slack, or a generic HTTP webhook when important relay events happen.
Scope
Settings & validation
admin.notificationssection in settings andsettings-config.tsvalidationenabled,targets[](http | discord | slack | telegram), per-event toggles, retry policyDispatch core
NotificationService.dispatch(eventType, payload)— non-blocking, must not stall hot pathsChannel adapters
Event hooks (from #637)
admission.invoice.createdPaymentsService.createInvoiceadmission.invoice.paidPaymentsService.confirmInvoice/ admitadmission.invoice.failedsettings.changedrelay.restartedTests