fix(worker): handle invoice.issued event in discord.notify
The invoices module started enqueueing invoice.issued notifications but the worker's discord.notify handler had no case for it, causing the job to exhaust retries and land in needs_review (surfaced on the dashboard as "Aufträge mit Fehlern / Prüfbedarf"). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
69fbad9090
commit
2f8566307b
1 changed files with 2 additions and 1 deletions
|
|
@ -13,7 +13,8 @@ const handlers: Record<string, Handler> = {
|
||||||
: p.event === 'backup.stale' ? `⚠ Kein aktuelles Backup: ${p.detail ?? ''}`.trim()
|
: p.event === 'backup.stale' ? `⚠ Kein aktuelles Backup: ${p.detail ?? ''}`.trim()
|
||||||
: p.event === 'restoretest.failed' ? `⚠ Wiederherstellungstest fehlgeschlagen: ${p.detail ?? ''}`.trim()
|
: p.event === 'restoretest.failed' ? `⚠ Wiederherstellungstest fehlgeschlagen: ${p.detail ?? ''}`.trim()
|
||||||
: p.event === 'ticket.created' ? `🎫 Neues Ticket ${p.number}: ${p.subject ?? ''}`.trim()
|
: p.event === 'ticket.created' ? `🎫 Neues Ticket ${p.number}: ${p.subject ?? ''}`.trim()
|
||||||
: p.event === 'ticket.message' ? `🎫 Neue Nachricht zu Ticket ${p.number}` : null; // keine personenbezogenen Daten
|
: p.event === 'ticket.message' ? `🎫 Neue Nachricht zu Ticket ${p.number}`
|
||||||
|
: p.event === 'invoice.issued' ? `🧾 Rechnung ${p.number} ausgestellt (${(Number(p.gross ?? 0) / 100).toLocaleString('de-DE', { style: 'currency', currency: 'EUR' })})` : null; // keine personenbezogenen Daten
|
||||||
if (!text) throw new Error(`Unbekanntes Ereignis: ${p.event}`);
|
if (!text) throw new Error(`Unbekanntes Ereignis: ${p.event}`);
|
||||||
const r = await notifyAdmin(text);
|
const r = await notifyAdmin(text);
|
||||||
if (r === 'skipped') return 'übersprungen: Discord nicht konfiguriert';
|
if (r === 'skipped') return 'übersprungen: Discord nicht konfiguriert';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue