Skip to content

feat(support): dashboard backend (statistics, escalation alerts, clerk mapping)#3942

Open
joshuakrueger-dfx wants to merge 1 commit into
DFXswiss:developfrom
joshuakrueger-dfx:feat/support-dashboard-backend
Open

feat(support): dashboard backend (statistics, escalation alerts, clerk mapping)#3942
joshuakrueger-dfx wants to merge 1 commit into
DFXswiss:developfrom
joshuakrueger-dfx:feat/support-dashboard-backend

Conversation

@joshuakrueger-dfx

Copy link
Copy Markdown
Collaborator

Support dashboard — backend

Adds the backend for the new support dashboard overview: ticket statistics, Telegram escalation alerts, and account→clerk resolution.

What's included

  • StatisticsGET support/issue/statistics?days=N: role-scoped, period-based aggregates (total, avg messages/ticket, tickets/day, and a day- or month-bucketed trend depending on the period). MSSQL-side aggregation, no row dump.
  • Escalation alerts — a 5-minute cron notifies a Telegram group whenever a ticket escalates (customer waiting beyond Config.support.escalation.slaHours = 24h). Auto-binds to the group it was invited to, de-duplicates per waiting cycle, and posts a clickable link to the ticket. Bot token from SUPPORT_TELEGRAM_BOT_TOKEN; chat id + notified state via SettingService (no schema change).
  • Clerk resolutionGET support/issue/clerk returns the clerk mapped to the logged-in account via the new registered supportClerkAccounts setting ([{ account, name }]). Replaces client-side identity.

Setup (settings / ops)

  • Set env SUPPORT_TELEGRAM_BOT_TOKEN.
  • Invite the bot (@DFXsupport_bot) into the support Telegram group (it auto-binds within ~5 min).
  • Configure clerks (incl. Josh):
    • supportClerks (names for the assign dropdown): ["Jana","Vesa","Cyrill","Josh"]
    • supportClerkAccounts (account→name for "my tickets"): [{ "account": <JanaId>, "name": "Jana" }, { "account": <VesaId>, "name": "Vesa" }, { "account": <CyrillId>, "name": "Cyrill" }, { "account": <JoshId>, "name": "Josh" }]

Release Checklist

Pre-Release

  • Check migrations — none (settings only, no schema change)
  • Check for linter errors — tsc + ESLint clean
  • Test basic user operations (login/logout, buy/sell, KYC) on dev

Post-Release

  • Verify a test escalation reaches the Telegram group (POST support/issue/escalation/telegram-test)
  • Monitor application insights log

Pairs with the frontend PR DFXswiss/services (support dashboard overview). Merge/deploy this first for accurate stats; the frontend has a client-side fallback otherwise.

…k mapping)

- add GET support/issue/statistics?days=N with role-scoped, period-based aggregates (total, avg messages/ticket, tickets/day, day/month trend, avg resolution time per type)

- notify a Telegram group when a ticket escalates (customer waiting beyond the SLA) and for each new limit increase request; auto-bind + per-cycle de-duplication; chat id + state via SettingService; token from SUPPORT_TELEGRAM_BOT_TOKEN

- resolve the logged-in agent's clerk via GET support/issue/clerk, backed by the registered supportClerkAccounts setting ([{ account, name }])
@joshuakrueger-dfx joshuakrueger-dfx force-pushed the feat/support-dashboard-backend branch from 043dce7 to a768c04 Compare June 22, 2026 10:26
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.

1 participant