Skip to content

[Admin Console] Phase 7: Operator notification backend (dispatch, channels, events, delivery log) #759

Description

@Ferryx349

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

Activity

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

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions