feat(pitch-deck): interactive charts with Y-axes, click-to-detail, explanations
All checks were successful
Build pitch-deck / build-push-deploy (push) Successful in 1m11s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-consent (push) Successful in 33s
CI / test-python-voice (push) Successful in 31s
CI / test-bqas (push) Successful in 28s
All checks were successful
Build pitch-deck / build-push-deploy (push) Successful in 1m11s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-consent (push) Successful in 33s
CI / test-python-voice (push) Successful in 31s
CI / test-bqas (push) Successful in 28s
- All charts now have Y-axis labels with scale - X-axis with year labels on border lines - Click any chart → modal with KPI explanation + yearly breakdown - 8 detail explanations: MRR, EBIT, Headcount, Cash, Rev vs Costs, ACV, Gross Margin, NRR, EBIT Margin - Unit Economics cards clickable with hover effect - Compact 2x2 grid for EBIT/Headcount and Cash/RevCost - ISO 27001 cert moved to Jan 2027 on production Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,32 +1,17 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { requireAdmin } from '@/lib/admin-auth'
|
||||
import pool from '@/lib/db'
|
||||
import { computeFinanzplan } from '@/lib/finanzplan/engine'
|
||||
|
||||
/** Admin-only: recompute a Finanzplan scenario. */
|
||||
export async function POST(request: NextRequest) {
|
||||
const WD = 'c0000000-0000-0000-0000-000000000200'
|
||||
const guard = await requireAdmin(request)
|
||||
if (guard.kind === 'response') return guard.response
|
||||
|
||||
const body = await request.json().catch(() => ({}))
|
||||
const results: string[] = []
|
||||
const scenarioId = body.scenarioId || (await pool.query("SELECT id FROM fp_scenarios WHERE is_default = true LIMIT 1")).rows[0]?.id
|
||||
if (!scenarioId) return NextResponse.json({ error: 'No scenario found' }, { status: 404 })
|
||||
|
||||
try {
|
||||
// ISO Cert: add months m13-m24 (Jan-Dec 2027) at 1500
|
||||
const { rows } = await pool.query(`SELECT id, values FROM fp_betriebliche_aufwendungen WHERE scenario_id=$1 AND row_label ILIKE '%Zertifizierung%'`, [WD])
|
||||
if (rows.length > 0) {
|
||||
const vals = rows[0].values || {}
|
||||
for (let m = 13; m <= 24; m++) {
|
||||
if (!vals[`m${m}`]) vals[`m${m}`] = 1500
|
||||
}
|
||||
await pool.query(`UPDATE fp_betriebliche_aufwendungen SET values=$1 WHERE id=$2`, [JSON.stringify(vals), rows[0].id])
|
||||
results.push('ISO cert from Jan 2027')
|
||||
}
|
||||
|
||||
// Recompute if requested
|
||||
if (body.recompute !== false) {
|
||||
const r = await computeFinanzplan(pool, WD)
|
||||
results.push(`WD cash_m60=${r.liquiditaet?.endstand?.m60}`)
|
||||
}
|
||||
} catch (err) {
|
||||
results.push(`ERROR: ${err instanceof Error ? err.message : String(err)}`)
|
||||
}
|
||||
|
||||
return NextResponse.json({ ok: true, results })
|
||||
const result = await computeFinanzplan(pool, scenarioId)
|
||||
return NextResponse.json({ success: true, scenarioId, cash_m60: result.liquiditaet?.endstand?.m60 })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user