fix(pitch-deck): Assumptions slide reads KPIs from fp_* tables + version-aware text
All checks were successful
Build pitch-deck / build-push-deploy (push) Successful in 1m18s
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 35s
CI / test-python-voice (push) Successful in 37s
CI / test-bqas (push) Successful in 35s
All checks were successful
Build pitch-deck / build-push-deploy (push) Successful in 1m18s
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 35s
CI / test-python-voice (push) Successful in 37s
CI / test-bqas (push) Successful in 35s
- Base Case KPIs now loaded from fp_guv/fp_liquiditaet/fp_kunden (source of truth) - Bear/Bull derived from Base with scaling factors - Assumptions text conditional: Wandeldarlehen shows lean plan (3→10, 8%/15% growth), 1 Mio shows original (5→35, aggressive growth) - Removed dependency on useFinancialModel (simplified model) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -198,7 +198,7 @@ export default function PitchDeck({ lang, onToggleLanguage, investor, onLogout,
|
|||||||
case 'ai-qa':
|
case 'ai-qa':
|
||||||
return <AIQASlide lang={lang} />
|
return <AIQASlide lang={lang} />
|
||||||
case 'annex-assumptions':
|
case 'annex-assumptions':
|
||||||
return <AssumptionsSlide lang={lang} investorId={investor?.id || null} preferredScenarioId={preferredScenarioId} />
|
return <AssumptionsSlide lang={lang} investorId={investor?.id || null} preferredScenarioId={preferredScenarioId} isWandeldarlehen={isWandeldarlehen} />
|
||||||
case 'annex-architecture':
|
case 'annex-architecture':
|
||||||
return <ArchitectureSlide lang={lang} />
|
return <ArchitectureSlide lang={lang} />
|
||||||
case 'annex-gtm':
|
case 'annex-gtm':
|
||||||
|
|||||||
@@ -1,17 +1,18 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
|
import { useEffect, useState } from 'react'
|
||||||
import { Language } from '@/lib/types'
|
import { Language } from '@/lib/types'
|
||||||
import { t } from '@/lib/i18n'
|
import { t } from '@/lib/i18n'
|
||||||
import GradientText from '../ui/GradientText'
|
import GradientText from '../ui/GradientText'
|
||||||
import FadeInView from '../ui/FadeInView'
|
import FadeInView from '../ui/FadeInView'
|
||||||
import GlassCard from '../ui/GlassCard'
|
import GlassCard from '../ui/GlassCard'
|
||||||
import { TrendingUp, TrendingDown, Minus } from 'lucide-react'
|
import { TrendingUp, TrendingDown, Minus } from 'lucide-react'
|
||||||
import { useFinancialModel } from '@/lib/hooks/useFinancialModel'
|
|
||||||
|
|
||||||
interface AssumptionsSlideProps {
|
interface AssumptionsSlideProps {
|
||||||
lang: Language
|
lang: Language
|
||||||
investorId?: string | null
|
investorId?: string | null
|
||||||
preferredScenarioId?: string | null
|
preferredScenarioId?: string | null
|
||||||
|
isWandeldarlehen?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
function fmtArr(v: number, de: boolean): string {
|
function fmtArr(v: number, de: boolean): string {
|
||||||
@@ -30,45 +31,100 @@ function fmtCash(v: number, de: boolean): string {
|
|||||||
return de ? `~${Math.round(v / 1000)}k EUR` : `~EUR ${Math.round(v / 1000)}k`
|
return de ? `~${Math.round(v / 1000)}k EUR` : `~EUR ${Math.round(v / 1000)}k`
|
||||||
}
|
}
|
||||||
|
|
||||||
function breakEvenYear(month: number | null): string {
|
interface SheetRow {
|
||||||
if (!month || month <= 0) return '—'
|
row_label?: string
|
||||||
const year = 2026 + Math.floor((month - 1) / 12)
|
values?: Record<string, number>
|
||||||
return String(year)
|
values_total?: Record<string, number>
|
||||||
|
is_sum_row?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function AssumptionsSlide({ lang, investorId, preferredScenarioId }: AssumptionsSlideProps) {
|
export default function AssumptionsSlide({ lang, investorId, preferredScenarioId, isWandeldarlehen }: AssumptionsSlideProps) {
|
||||||
const i = t(lang)
|
const i = t(lang)
|
||||||
const de = lang === 'de'
|
const de = lang === 'de'
|
||||||
|
|
||||||
// Load computed financial data for Base Case
|
// Load KPIs from fp_* tables (source of truth)
|
||||||
const fm = useFinancialModel(investorId || null, preferredScenarioId)
|
const [baseKPIs, setBaseKPIs] = useState<Record<string, number>>({})
|
||||||
const summary = fm.activeResults?.summary
|
|
||||||
const results = fm.activeResults?.results || []
|
|
||||||
const lastResult = results.length > 0 ? results[results.length - 1] : null
|
|
||||||
|
|
||||||
// Base case from compute engine
|
useEffect(() => {
|
||||||
const baseCustomers = summary?.final_customers || 0
|
async function load() {
|
||||||
const baseArr = summary?.final_arr || 0
|
try {
|
||||||
const baseEmployees = lastResult?.employees_count || 0
|
const scenarioParam = isWandeldarlehen ? '?scenarioId=c0000000-0000-0000-0000-000000000200' : ''
|
||||||
const baseCash = lastResult?.cash_balance_eur || 0
|
const [guvRes, liqRes, persRes, kundenRes] = await Promise.all([
|
||||||
const baseBreakEven = breakEvenYear(summary?.break_even_month || null)
|
fetch(`/api/finanzplan/guv${scenarioParam}`, { cache: 'no-store' }),
|
||||||
|
fetch(`/api/finanzplan/liquiditaet${scenarioParam}`, { cache: 'no-store' }),
|
||||||
|
fetch(`/api/finanzplan/personalkosten${scenarioParam}`, { cache: 'no-store' }),
|
||||||
|
fetch(`/api/finanzplan/kunden${scenarioParam}`, { cache: 'no-store' }),
|
||||||
|
])
|
||||||
|
const [guv, liq, pers, kunden] = await Promise.all([guvRes.json(), liqRes.json(), persRes.json(), kundenRes.json()])
|
||||||
|
|
||||||
// Bear/Bull derived from Base (scaling factors)
|
const findGuv = (label: string) => (guv.rows || []).find((r: SheetRow) => (r.row_label || '').includes(label))
|
||||||
|
const findLiq = (label: string) => (liq.rows || []).find((r: SheetRow) => (r.row_label || '').includes(label))
|
||||||
|
const kundenGesamt = (kunden.rows || []).find((r: SheetRow) => r.row_label === 'Bestandskunden gesamt')
|
||||||
|
|
||||||
|
const arr = findGuv('Umsatzerlöse')?.values?.y2030 || 0
|
||||||
|
const customers = kundenGesamt?.values?.m60 || 0
|
||||||
|
const headcount = (pers.rows || []).filter((r: SheetRow) => ((r.values_total || r.values)?.m60 || 0) > 0).length
|
||||||
|
const cash = findLiq('LIQUIDIT')?.values?.m60 || findLiq('LIQUIDITAET')?.values?.m60 || 0
|
||||||
|
const ebit = findGuv('EBIT')?.values || {}
|
||||||
|
// Find break-even year
|
||||||
|
let breakEvenYear = '—'
|
||||||
|
for (const y of [2026, 2027, 2028, 2029, 2030]) {
|
||||||
|
if ((ebit[`y${y}`] || 0) > 0) { breakEvenYear = String(y); break }
|
||||||
|
}
|
||||||
|
|
||||||
|
setBaseKPIs({ arr, customers, headcount, cash, breakEvenYear: parseInt(breakEvenYear) || 0 })
|
||||||
|
} catch { /* ignore */ }
|
||||||
|
}
|
||||||
|
load()
|
||||||
|
}, [isWandeldarlehen])
|
||||||
|
|
||||||
|
const baseCustomers = baseKPIs.customers || 0
|
||||||
|
const baseArr = baseKPIs.arr || 0
|
||||||
|
const baseEmployees = baseKPIs.headcount || 0
|
||||||
|
const baseCash = baseKPIs.cash || 0
|
||||||
|
const baseBreakEven = baseKPIs.breakEvenYear ? String(baseKPIs.breakEvenYear) : '—'
|
||||||
|
|
||||||
|
// Bear/Bull scaled from Base
|
||||||
const bearCustomers = Math.round(baseCustomers * 0.5)
|
const bearCustomers = Math.round(baseCustomers * 0.5)
|
||||||
const bearArr = baseArr * 0.42
|
const bearArr = baseArr * 0.42
|
||||||
const bearEmployees = Math.round(baseEmployees * 0.7)
|
const bearEmployees = Math.round(baseEmployees * 0.7)
|
||||||
const bearCash = baseCash * 0.08
|
const bearCash = Math.round(baseCash * 0.3)
|
||||||
const bearBreakEvenMonth = summary?.break_even_month ? Math.round(summary.break_even_month * 1.3) : null
|
const bearBreakEven = baseKPIs.breakEvenYear ? String(baseKPIs.breakEvenYear + 1) : '—'
|
||||||
const bearBreakEven = breakEvenYear(bearBreakEvenMonth)
|
|
||||||
|
|
||||||
const bullCustomers = Math.round(baseCustomers * 1.7)
|
const bullCustomers = Math.round(baseCustomers * 1.7)
|
||||||
const bullArr = baseArr * 1.8
|
const bullArr = baseArr * 1.8
|
||||||
const bullEmployees = Math.round(baseEmployees * 1.4)
|
const bullEmployees = Math.round(baseEmployees * 1.3)
|
||||||
const bullCash = baseCash * 2.3
|
const bullCash = Math.round(baseCash * 2.0)
|
||||||
const bullBreakEvenMonth = summary?.break_even_month ? Math.round(summary.break_even_month * 0.75) : null
|
const bullBreakEven = baseKPIs.breakEvenYear ? String(baseKPIs.breakEvenYear - 1) : '—'
|
||||||
const bullBreakEven = breakEvenYear(bullBreakEvenMonth)
|
|
||||||
|
const baseAssumptions = isWandeldarlehen
|
||||||
|
? (de ? [
|
||||||
|
`Kundenwachstum: 8% monatlich (Slow), ab m32: 15%`,
|
||||||
|
'Mix: 60% Starter, 25% Professional, 15% Enterprise',
|
||||||
|
`Personalaufbau: 3→${baseEmployees} Personen (lean)`,
|
||||||
|
'Serverkosten: 50€/Kunde + 300€ Basis',
|
||||||
|
`Break-Even ${baseBreakEven}`,
|
||||||
|
] : [
|
||||||
|
`Customer growth: 8% monthly (slow), from m32: 15%`,
|
||||||
|
'Mix: 60% Starter, 25% Professional, 15% Enterprise',
|
||||||
|
`Hiring: 3→${baseEmployees} people (lean)`,
|
||||||
|
'Server costs: €50/customer + €300 base',
|
||||||
|
`Break-even ${baseBreakEven}`,
|
||||||
|
])
|
||||||
|
: (de ? [
|
||||||
|
'Kundenwachstum wie geplant (5→1.200)',
|
||||||
|
'Mix: 60% Starter, 25% Professional, 15% Enterprise',
|
||||||
|
'Personalaufbau 5→10→17→25→35',
|
||||||
|
'Serverkosten 100€ pro Kunde + 2.000€ Basis',
|
||||||
|
'Break-Even Mitte 2029',
|
||||||
|
] : [
|
||||||
|
'Customer growth as planned (5→1,200)',
|
||||||
|
'Mix: 60% Starter, 25% Professional, 15% Enterprise',
|
||||||
|
'Hiring 5→10→17→25→35',
|
||||||
|
'Server costs €100 per customer + €2,000 base',
|
||||||
|
'Break-even mid 2029',
|
||||||
|
])
|
||||||
|
|
||||||
// 3 Cases abgeleitet aus dem Finanzplan (Base Case = aktuelle DB-Daten)
|
|
||||||
const cases = [
|
const cases = [
|
||||||
{
|
{
|
||||||
name: 'Bear Case',
|
name: 'Bear Case',
|
||||||
@@ -81,13 +137,11 @@ export default function AssumptionsSlide({ lang, investorId, preferredScenarioId
|
|||||||
'Churn Rate 8% pro Monat (Startups)',
|
'Churn Rate 8% pro Monat (Startups)',
|
||||||
'Durchschnittspreis 20% niedriger',
|
'Durchschnittspreis 20% niedriger',
|
||||||
'Personalaufbau verzögert um 6 Monate',
|
'Personalaufbau verzögert um 6 Monate',
|
||||||
'Serverkosten 150€ pro Kunde',
|
|
||||||
] : [
|
] : [
|
||||||
'Customer growth 50% slower than base',
|
'Customer growth 50% slower than base',
|
||||||
'Churn rate 8% per month (startups)',
|
'Churn rate 8% per month (startups)',
|
||||||
'Average price 20% lower',
|
'Average price 20% lower',
|
||||||
'Hiring delayed by 6 months',
|
'Hiring delayed by 6 months',
|
||||||
'Server costs €150 per customer',
|
|
||||||
],
|
],
|
||||||
kpis: {
|
kpis: {
|
||||||
kunden2030: `~${bearCustomers.toLocaleString('de-DE')}`,
|
kunden2030: `~${bearCustomers.toLocaleString('de-DE')}`,
|
||||||
@@ -103,19 +157,7 @@ export default function AssumptionsSlide({ lang, investorId, preferredScenarioId
|
|||||||
color: 'text-indigo-400',
|
color: 'text-indigo-400',
|
||||||
bg: 'bg-indigo-500/10 border-indigo-500/20',
|
bg: 'bg-indigo-500/10 border-indigo-500/20',
|
||||||
desc: de ? 'Aktueller Finanzplan' : 'Current financial plan',
|
desc: de ? 'Aktueller Finanzplan' : 'Current financial plan',
|
||||||
assumptions: de ? [
|
assumptions: baseAssumptions,
|
||||||
'Kundenwachstum wie geplant (14→1.200)',
|
|
||||||
'Mix: 75% Startup, 15% KMU, 7% Mittel, 3% Enterprise',
|
|
||||||
'Personalaufbau 5→10→17→25→35',
|
|
||||||
'Serverkosten 100€ pro Kunde + 2.000€ Basis',
|
|
||||||
'Break-Even Mitte 2029',
|
|
||||||
] : [
|
|
||||||
'Customer growth as planned (14→1,200)',
|
|
||||||
'Mix: 75% startup, 15% SME, 7% mid, 3% enterprise',
|
|
||||||
'Hiring 5→10→17→25→35',
|
|
||||||
'Server costs €100 per customer + €2,000 base',
|
|
||||||
'Break-even mid 2029',
|
|
||||||
],
|
|
||||||
kpis: {
|
kpis: {
|
||||||
kunden2030: `~${baseCustomers.toLocaleString('de-DE')}`,
|
kunden2030: `~${baseCustomers.toLocaleString('de-DE')}`,
|
||||||
arr2030: fmtArr(baseArr, de),
|
arr2030: fmtArr(baseArr, de),
|
||||||
@@ -131,17 +173,15 @@ export default function AssumptionsSlide({ lang, investorId, preferredScenarioId
|
|||||||
bg: 'bg-emerald-500/10 border-emerald-500/20',
|
bg: 'bg-emerald-500/10 border-emerald-500/20',
|
||||||
desc: de ? 'Beschleunigtes Wachstum' : 'Accelerated growth',
|
desc: de ? 'Beschleunigtes Wachstum' : 'Accelerated growth',
|
||||||
assumptions: de ? [
|
assumptions: de ? [
|
||||||
'Kundenwachstum 50% schneller (Regulierungsdruck)',
|
'Kundenwachstum 70% schneller (Regulierungsdruck)',
|
||||||
'Enterprise-Anteil steigt auf 8%',
|
'Enterprise-Anteil steigt auf 20%',
|
||||||
'Durchschnittspreis 15% höher (Upselling)',
|
'Durchschnittspreis 15% höher (Upselling)',
|
||||||
'Channel-Partner ab Q1/2027',
|
'Channel-Partner ab Q1/2028',
|
||||||
'EU-Expansion ab 2028',
|
|
||||||
] : [
|
] : [
|
||||||
'Customer growth 50% faster (regulation pressure)',
|
'Customer growth 70% faster (regulation pressure)',
|
||||||
'Enterprise share rises to 8%',
|
'Enterprise share rises to 20%',
|
||||||
'Average price 15% higher (upselling)',
|
'Average price 15% higher (upselling)',
|
||||||
'Channel partners from Q1/2027',
|
'Channel partners from Q1/2028',
|
||||||
'EU expansion from 2028',
|
|
||||||
],
|
],
|
||||||
kpis: {
|
kpis: {
|
||||||
kunden2030: `~${bullCustomers.toLocaleString('de-DE')}`,
|
kunden2030: `~${bullCustomers.toLocaleString('de-DE')}`,
|
||||||
@@ -162,19 +202,18 @@ export default function AssumptionsSlide({ lang, investorId, preferredScenarioId
|
|||||||
<p className="text-sm text-white/50 max-w-2xl mx-auto">{i.annex.assumptions.subtitle}</p>
|
<p className="text-sm text-white/50 max-w-2xl mx-auto">{i.annex.assumptions.subtitle}</p>
|
||||||
</FadeInView>
|
</FadeInView>
|
||||||
|
|
||||||
{/* 3 Cases nebeneinander */}
|
|
||||||
<div className="grid md:grid-cols-3 gap-4 mb-6">
|
<div className="grid md:grid-cols-3 gap-4 mb-6">
|
||||||
{cases.map((c, idx) => {
|
{cases.map((c, idx) => {
|
||||||
const Icon = c.icon
|
const Icon = c.icon
|
||||||
return (
|
return (
|
||||||
<GlassCard key={idx} delay={0.1 + idx * 0.1} hover={false} className={`p-4 border-t-2 ${c.bg}`}>
|
<FadeInView key={idx} delay={0.1 + idx * 0.1}>
|
||||||
|
<GlassCard hover={false} className={`p-4 h-full ${c.bg} border`}>
|
||||||
<div className="flex items-center gap-2 mb-2">
|
<div className="flex items-center gap-2 mb-2">
|
||||||
<Icon className={`w-5 h-5 ${c.color}`} />
|
<Icon className={`w-5 h-5 ${c.color}`} />
|
||||||
<h3 className={`text-sm font-bold ${c.color}`}>{c.name}</h3>
|
<h3 className={`text-base font-bold ${c.color}`}>{c.name}</h3>
|
||||||
</div>
|
</div>
|
||||||
<p className="text-[10px] text-white/40 mb-3">{c.desc}</p>
|
<p className="text-xs text-white/40 mb-3">{c.desc}</p>
|
||||||
|
|
||||||
{/* Annahmen */}
|
|
||||||
<div className="space-y-1.5 mb-4">
|
<div className="space-y-1.5 mb-4">
|
||||||
{c.assumptions.map((a, i) => (
|
{c.assumptions.map((a, i) => (
|
||||||
<p key={i} className="text-xs text-white/60 pl-3 relative">
|
<p key={i} className="text-xs text-white/60 pl-3 relative">
|
||||||
@@ -184,12 +223,11 @@ export default function AssumptionsSlide({ lang, investorId, preferredScenarioId
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* KPIs */}
|
|
||||||
<div className="border-t border-white/10 pt-3 space-y-1.5">
|
<div className="border-t border-white/10 pt-3 space-y-1.5">
|
||||||
{[
|
{[
|
||||||
{ label: de ? 'Kunden 2030' : 'Customers 2030', value: c.kpis.kunden2030 },
|
{ label: de ? 'Kunden 2030' : 'Customers 2030', value: c.kpis.kunden2030 },
|
||||||
{ label: 'ARR 2030', value: c.kpis.arr2030 },
|
{ label: 'ARR 2030', value: c.kpis.arr2030 },
|
||||||
{ label: de ? 'Mitarbeiter 2030' : 'Employees 2030', value: c.kpis.ma2030 },
|
{ label: de ? 'Mitarbeiter' : 'Employees', value: c.kpis.ma2030 },
|
||||||
{ label: 'Break-Even', value: c.kpis.breakEven },
|
{ label: 'Break-Even', value: c.kpis.breakEven },
|
||||||
{ label: 'Cash 2030', value: c.kpis.cash2030 },
|
{ label: 'Cash 2030', value: c.kpis.cash2030 },
|
||||||
].map((kpi, i) => (
|
].map((kpi, i) => (
|
||||||
@@ -200,11 +238,12 @@ export default function AssumptionsSlide({ lang, investorId, preferredScenarioId
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</GlassCard>
|
</GlassCard>
|
||||||
|
</FadeInView>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Vergleichstabelle */}
|
{/* Comparison Table */}
|
||||||
<FadeInView delay={0.5}>
|
<FadeInView delay={0.5}>
|
||||||
<GlassCard hover={false} className="p-4">
|
<GlassCard hover={false} className="p-4">
|
||||||
<h3 className="text-xs font-bold text-white/40 uppercase tracking-wider mb-3">
|
<h3 className="text-xs font-bold text-white/40 uppercase tracking-wider mb-3">
|
||||||
@@ -221,11 +260,11 @@ export default function AssumptionsSlide({ lang, investorId, preferredScenarioId
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{[
|
{[
|
||||||
{ label: de ? 'Kunden' : 'Customers', bear: `~${bearCustomers.toLocaleString('de-DE')}`, base: `~${baseCustomers.toLocaleString('de-DE')}`, bull: `~${bullCustomers.toLocaleString('de-DE')}` },
|
{ label: de ? 'Kunden' : 'Customers', bear: cases[0].kpis.kunden2030, base: cases[1].kpis.kunden2030, bull: cases[2].kpis.kunden2030 },
|
||||||
{ label: 'ARR', bear: fmtArr(bearArr, de), base: fmtArr(baseArr, de), bull: fmtArr(bullArr, de) },
|
{ label: 'ARR', bear: cases[0].kpis.arr2030, base: cases[1].kpis.arr2030, bull: cases[2].kpis.arr2030 },
|
||||||
{ label: de ? 'Mitarbeiter' : 'Employees', bear: String(bearEmployees), base: String(baseEmployees), bull: String(bullEmployees) },
|
{ label: de ? 'Mitarbeiter' : 'Employees', bear: cases[0].kpis.ma2030, base: cases[1].kpis.ma2030, bull: cases[2].kpis.ma2030 },
|
||||||
{ label: 'Break-Even', bear: bearBreakEven, base: baseBreakEven, bull: bullBreakEven },
|
{ label: 'Break-Even', bear: cases[0].kpis.breakEven, base: cases[1].kpis.breakEven, bull: cases[2].kpis.breakEven },
|
||||||
{ label: 'Cash', bear: fmtCash(bearCash, de), base: fmtCash(baseCash, de), bull: fmtCash(bullCash, de) },
|
{ label: 'Cash', bear: cases[0].kpis.cash2030, base: cases[1].kpis.cash2030, bull: cases[2].kpis.cash2030 },
|
||||||
].map((row, idx) => (
|
].map((row, idx) => (
|
||||||
<tr key={idx} className="border-b border-white/[0.03]">
|
<tr key={idx} className="border-b border-white/[0.03]">
|
||||||
<td className="py-1.5 text-white/60">{row.label}</td>
|
<td className="py-1.5 text-white/60">{row.label}</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user