refactor: simplify KPI to 4 metrics and update CLAUDE.md (#83)

KPI page: removed operational grid (Intäktstillväxt, Kostnadsandel,
Snittbetaltid — all usually empty or redundant). Now shows 4 cards
(Resultat, Kassa, Kundfordringar, Moms) + trend chart. Removed unused
fields from KPIReport type and simplified API route.

CLAUDE.md: documented MCP server extension, API key infrastructure,
OAuth 2.1 flow, gnubok-mcp npm package, KPI page, cookieless Supabase
client, and updated migration count (65 → 70).

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jakob Wennberg
2026-03-22 12:59:53 +01:00
committed by GitHub
parent 8cce21983f
commit 6b51d13ba7
6 changed files with 50 additions and 182 deletions
-5
View File
@@ -1999,15 +1999,10 @@ export interface VatBreakdownItem {
// KPI Report
export interface KPIReport {
grossMargin: number | null // percentage, null if no revenue
netResult: number // SEK
cashPosition: number // SEK (sum of 19xx account balances)
outstandingReceivables: number // SEK
overdueReceivables: number // SEK
revenueGrowth: number | null // percentage, null if no prior period or current period incomplete
expenseRatio: number | null // percentage, null if no revenue
avgPaymentDays: number | null // days, null if < 5 paid invoices with paid_at
paidInvoiceCount: number // how many invoices had paid_at data (for gating)
vatLiability: number // SEK, ruta 49 (positive = owe, negative = refund)
totalRevenue: number // SEK
totalExpenses: number // SEK