feat: Credits-System — Token-Usage-Router, Budget-Verwaltung, Frontend-Übersicht

- Neuer Router /api/token-usage mit Overview, Org-Detail, Monatsstatistik
- Budget-Felder (credits_total, cost_per_credit, token_budget_usd) bei Lizenz-Erstellung
- Token-Nutzung Sub-Tab in Org-Detail mit Verbrauchsbalken und Monatstabelle
- Dashboard Stat-Card für API-Kosten gesamt
- CSS Dark-Theme Styling für Token-Komponenten
Dieser Commit ist enthalten in:
Claude Dev
2026-03-17 23:59:49 +01:00
Ursprung 3828d7c8bf
Commit 7cd36959b0
7 geänderte Dateien mit 333 neuen und 4 gelöschten Zeilen

Datei anzeigen

@@ -58,9 +58,11 @@ async def create_license(
valid_until = (now + timedelta(days=365)).isoformat()
cursor = await db.execute(
"""INSERT INTO licenses (organization_id, license_type, max_users, valid_from, valid_until, status)
VALUES (?, ?, ?, ?, ?, 'active')""",
(data.organization_id, data.license_type, data.max_users, valid_from, valid_until),
"""INSERT INTO licenses (organization_id, license_type, max_users, valid_from, valid_until, status,
token_budget_usd, credits_total, cost_per_credit, budget_warning_percent)
VALUES (?, ?, ?, ?, ?, 'active', ?, ?, ?, ?)""",
(data.organization_id, data.license_type, data.max_users, valid_from, valid_until,
data.token_budget_usd, data.credits_total, data.cost_per_credit, data.budget_warning_percent),
)
await db.commit()