feat(license): Kundenzähler und Upgrade-Hinweise in der Lizenzübersicht (#117)

Zeigt jetzt den tatsächlichen Kundenstand (aktive + gesperrte Organisationen)
gegen die Kundengrenze, nicht nur die Grenze selbst. Dazu Warnungen bei
erreichter Grenze (≥100%), kurz davor (≥90%) und bei bald endendem
Testzeitraum (<7 Tage) - erste Teile des Lizenzübersicht-Tickets.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Kundencenter 2026-10-01 10:50:49 +02:00
parent d033088223
commit c52996b559
2 changed files with 7 additions and 2 deletions

View file

@ -19,7 +19,8 @@ export const licenseModule: KcModule = {
requirePermission(req, 'license.read');
const ent = await getEntitlement();
const row = await one('SELECT instance_id, license_key_enc IS NOT NULL AS has_key, last_error, last_attempt_at FROM license_state WHERE id = 1');
return { ...ent, instanceId: row?.instance_id ?? null, hasKey: !!row?.has_key, lastError: row?.last_error ?? null, lastAttemptAt: row?.last_attempt_at ?? null };
const customers = await one("SELECT COUNT(*) AS n FROM organizations WHERE status IN ('active','suspended')");
return { ...ent, instanceId: row?.instance_id ?? null, hasKey: !!row?.has_key, lastError: row?.last_error ?? null, lastAttemptAt: row?.last_attempt_at ?? null, customerCount: Number(customers?.n ?? 0) };
});
app.put('/admin/license/settings', async (req) => {