feat(pitch-deck): Bear/Bull scenarios from DB + Assumptions slide reads all 3
Some checks failed
Build pitch-deck / build-push-deploy (push) Failing after 21s
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) Failing after 6s
CI / test-python-voice (push) Failing after 9s
CI / test-bqas (push) Failing after 8s
Some checks failed
Build pitch-deck / build-push-deploy (push) Failing after 21s
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) Failing after 6s
CI / test-python-voice (push) Failing after 9s
CI / test-bqas (push) Failing after 8s
4 new fp_scenarios created on production: - Wandeldarlehen Bear (5%/8% growth, 1.5x churn → 11 customers 2030) - Wandeldarlehen Bull (12%/16% growth, 0.7x churn → 999 customers 2030) - 1 Mio Bear (6%/10% growth, 1.5x churn → 22 customers 2030) - 1 Mio Bull (12%/18% growth, 0.7x churn → 2574 customers 2030) AssumptionsSlide loads all 3 scenarios (Bear/Base/Bull) from their respective fp_* tables. No more scaling factors — real DB data. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -15,181 +15,130 @@ interface AssumptionsSlideProps {
|
||||
isWandeldarlehen?: boolean
|
||||
}
|
||||
|
||||
function fmtArr(v: number, de: boolean): string {
|
||||
if (v >= 1_000_000) {
|
||||
const m = (v / 1_000_000).toFixed(1)
|
||||
return de ? `~${m.replace('.', ',')} Mio. EUR` : `~EUR ${m}M`
|
||||
}
|
||||
return de ? `~${Math.round(v / 1000)}k EUR` : `~EUR ${Math.round(v / 1000)}k`
|
||||
}
|
||||
|
||||
function fmtCash(v: number, de: boolean): string {
|
||||
if (Math.abs(v) >= 1_000_000) {
|
||||
const m = (v / 1_000_000).toFixed(1)
|
||||
return de ? `~${m.replace('.', ',')} Mio. EUR` : `~EUR ${m}M`
|
||||
}
|
||||
return de ? `~${Math.round(v / 1000)}k EUR` : `~EUR ${Math.round(v / 1000)}k`
|
||||
}
|
||||
|
||||
interface SheetRow {
|
||||
row_label?: string
|
||||
values?: Record<string, number>
|
||||
values_total?: Record<string, number>
|
||||
is_sum_row?: boolean
|
||||
}
|
||||
|
||||
export default function AssumptionsSlide({ lang, investorId, preferredScenarioId, isWandeldarlehen }: AssumptionsSlideProps) {
|
||||
const i = t(lang)
|
||||
const de = lang === 'de'
|
||||
interface ScenarioKPIs {
|
||||
arr: number
|
||||
customers: number
|
||||
headcount: number
|
||||
cash: number
|
||||
breakEvenYear: string
|
||||
}
|
||||
|
||||
// Load KPIs from fp_* tables (source of truth)
|
||||
const [baseKPIs, setBaseKPIs] = useState<Record<string, number>>({})
|
||||
function fmtArr(v: number, de: boolean): string {
|
||||
if (v >= 1_000_000) return de ? `~${(v / 1_000_000).toFixed(1).replace('.', ',')} Mio. EUR` : `~EUR ${(v / 1_000_000).toFixed(1)}M`
|
||||
if (v >= 1000) return de ? `~${Math.round(v / 1000)}k EUR` : `~EUR ${Math.round(v / 1000)}k`
|
||||
return de ? `~${v} EUR` : `~EUR ${v}`
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
async function load() {
|
||||
function fmtCash(v: number, de: boolean): string {
|
||||
if (Math.abs(v) >= 1_000_000) return de ? `~${(v / 1_000_000).toFixed(1).replace('.', ',')} Mio. EUR` : `~EUR ${(v / 1_000_000).toFixed(1)}M`
|
||||
return de ? `~${Math.round(v / 1000)}k EUR` : `~EUR ${Math.round(v / 1000)}k`
|
||||
}
|
||||
|
||||
async function loadScenarioKPIs(scenarioId: string | null): Promise<ScenarioKPIs> {
|
||||
const param = scenarioId ? `?scenarioId=${scenarioId}` : ''
|
||||
try {
|
||||
const scenarioParam = isWandeldarlehen ? '?scenarioId=c0000000-0000-0000-0000-000000000200' : ''
|
||||
const [guvRes, liqRes, persRes, kundenRes] = await Promise.all([
|
||||
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' }),
|
||||
fetch(`/api/finanzplan/guv${param}`, { cache: 'no-store' }),
|
||||
fetch(`/api/finanzplan/liquiditaet${param}`, { cache: 'no-store' }),
|
||||
fetch(`/api/finanzplan/personalkosten${param}`, { cache: 'no-store' }),
|
||||
fetch(`/api/finanzplan/kunden${param}`, { cache: 'no-store' }),
|
||||
])
|
||||
const [guv, liq, pers, kunden] = await Promise.all([guvRes.json(), liqRes.json(), persRes.json(), kundenRes.json()])
|
||||
|
||||
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 */ }
|
||||
return {
|
||||
arr: findGuv('Umsatzerlöse')?.values?.y2030 || 0,
|
||||
customers: kundenGesamt?.values?.m60 || 0,
|
||||
headcount: (pers.rows || []).filter((r: SheetRow) => ((r.values_total || r.values)?.m60 || 0) > 0).length,
|
||||
cash: findLiq('LIQUIDIT')?.values?.m60 || findLiq('LIQUIDITAET')?.values?.m60 || 0,
|
||||
breakEvenYear,
|
||||
}
|
||||
} catch {
|
||||
return { arr: 0, customers: 0, headcount: 0, cash: 0, breakEvenYear: '—' }
|
||||
}
|
||||
}
|
||||
|
||||
export default function AssumptionsSlide({ lang, isWandeldarlehen }: AssumptionsSlideProps) {
|
||||
const i = t(lang)
|
||||
const de = lang === 'de'
|
||||
|
||||
const [scenarioData, setScenarioData] = useState<{ bear: ScenarioKPIs; base: ScenarioKPIs; bull: ScenarioKPIs } | null>(null)
|
||||
|
||||
useEffect(() => {
|
||||
async function load() {
|
||||
const baseId = isWandeldarlehen ? 'c0000000-0000-0000-0000-000000000200' : null
|
||||
const bearId = isWandeldarlehen ? 'd0000000-0000-0000-0000-000000000201' : 'd0000000-0000-0000-0000-000000000301'
|
||||
const bullId = isWandeldarlehen ? 'd0000000-0000-0000-0000-000000000202' : 'd0000000-0000-0000-0000-000000000302'
|
||||
const [bear, base, bull] = await Promise.all([loadScenarioKPIs(bearId), loadScenarioKPIs(baseId), loadScenarioKPIs(bullId)])
|
||||
setScenarioData({ bear, base, bull })
|
||||
}
|
||||
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 bearArr = baseArr * 0.42
|
||||
const bearEmployees = Math.round(baseEmployees * 0.7)
|
||||
const bearCash = Math.round(baseCash * 0.3)
|
||||
const bearBreakEven = baseKPIs.breakEvenYear ? String(baseKPIs.breakEvenYear + 1) : '—'
|
||||
|
||||
const bullCustomers = Math.round(baseCustomers * 1.7)
|
||||
const bullArr = baseArr * 1.8
|
||||
const bullEmployees = Math.round(baseEmployees * 1.3)
|
||||
const bullCash = Math.round(baseCash * 2.0)
|
||||
const bullBreakEven = baseKPIs.breakEvenYear ? String(baseKPIs.breakEvenYear - 1) : '—'
|
||||
const bear = scenarioData?.bear || { arr: 0, customers: 0, headcount: 0, cash: 0, breakEvenYear: '—' }
|
||||
const base = scenarioData?.base || { arr: 0, customers: 0, headcount: 0, cash: 0, breakEvenYear: '—' }
|
||||
const bull = scenarioData?.bull || { arr: 0, customers: 0, headcount: 0, cash: 0, breakEvenYear: '—' }
|
||||
|
||||
const baseAssumptions = isWandeldarlehen
|
||||
? (de ? [
|
||||
`Kundenwachstum: 8% monatlich (Slow), ab m32: 15%`,
|
||||
'Kundenwachstum: 8% monatlich, ab m32: 15%',
|
||||
'Mix: 60% Starter, 25% Professional, 15% Enterprise',
|
||||
`Personalaufbau: 3→${baseEmployees} Personen (lean)`,
|
||||
`Personalaufbau: 3→${base.headcount} Personen (lean)`,
|
||||
'Serverkosten: 50€/Kunde + 300€ Basis',
|
||||
`Break-Even ${baseBreakEven}`,
|
||||
] : [
|
||||
`Customer growth: 8% monthly (slow), from m32: 15%`,
|
||||
'Customer growth: 8% monthly, from m32: 15%',
|
||||
'Mix: 60% Starter, 25% Professional, 15% Enterprise',
|
||||
`Hiring: 3→${baseEmployees} people (lean)`,
|
||||
`Hiring: 3→${base.headcount} people (lean)`,
|
||||
'Server costs: €50/customer + €300 base',
|
||||
`Break-even ${baseBreakEven}`,
|
||||
])
|
||||
: (de ? [
|
||||
'Kundenwachstum wie geplant (5→1.200)',
|
||||
'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)',
|
||||
'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',
|
||||
])
|
||||
|
||||
const cases = [
|
||||
{
|
||||
name: 'Bear Case',
|
||||
icon: TrendingDown,
|
||||
color: 'text-red-400',
|
||||
bg: 'bg-red-500/10 border-red-500/20',
|
||||
name: 'Bear Case', icon: TrendingDown, color: 'text-red-400', bg: 'bg-red-500/10 border-red-500/20',
|
||||
desc: de ? 'Langsames Wachstum, höhere Churn' : 'Slow growth, higher churn',
|
||||
assumptions: de ? [
|
||||
'Kundenwachstum 50% langsamer als Base',
|
||||
'Churn Rate 8% pro Monat (Startups)',
|
||||
'Durchschnittspreis 20% niedriger',
|
||||
'Personalaufbau verzögert um 6 Monate',
|
||||
] : [
|
||||
'Customer growth 50% slower than base',
|
||||
'Churn rate 8% per month (startups)',
|
||||
'Average price 20% lower',
|
||||
'Hiring delayed by 6 months',
|
||||
],
|
||||
kpis: {
|
||||
kunden2030: `~${bearCustomers.toLocaleString('de-DE')}`,
|
||||
arr2030: fmtArr(bearArr, de),
|
||||
ma2030: String(bearEmployees),
|
||||
breakEven: bearBreakEven,
|
||||
cash2030: fmtCash(bearCash, de),
|
||||
},
|
||||
assumptions: de
|
||||
? ['Kundenwachstum 40% langsamer', 'Churn Rate 50% höher', 'Personalaufbau wie Base Case']
|
||||
: ['Customer growth 40% slower', 'Churn rate 50% higher', 'Hiring same as base case'],
|
||||
kpis: bear,
|
||||
},
|
||||
{
|
||||
name: 'Base Case',
|
||||
icon: Minus,
|
||||
color: 'text-indigo-400',
|
||||
bg: 'bg-indigo-500/10 border-indigo-500/20',
|
||||
name: 'Base Case', icon: Minus, color: 'text-indigo-400', bg: 'bg-indigo-500/10 border-indigo-500/20',
|
||||
desc: de ? 'Aktueller Finanzplan' : 'Current financial plan',
|
||||
assumptions: baseAssumptions,
|
||||
kpis: {
|
||||
kunden2030: `~${baseCustomers.toLocaleString('de-DE')}`,
|
||||
arr2030: fmtArr(baseArr, de),
|
||||
ma2030: String(baseEmployees),
|
||||
breakEven: baseBreakEven,
|
||||
cash2030: fmtCash(baseCash, de),
|
||||
},
|
||||
kpis: base,
|
||||
},
|
||||
{
|
||||
name: 'Bull Case',
|
||||
icon: TrendingUp,
|
||||
color: 'text-emerald-400',
|
||||
bg: 'bg-emerald-500/10 border-emerald-500/20',
|
||||
name: 'Bull Case', icon: TrendingUp, color: 'text-emerald-400', bg: 'bg-emerald-500/10 border-emerald-500/20',
|
||||
desc: de ? 'Beschleunigtes Wachstum' : 'Accelerated growth',
|
||||
assumptions: de ? [
|
||||
'Kundenwachstum 70% schneller (Regulierungsdruck)',
|
||||
'Enterprise-Anteil steigt auf 20%',
|
||||
'Durchschnittspreis 15% höher (Upselling)',
|
||||
'Channel-Partner ab Q1/2028',
|
||||
] : [
|
||||
'Customer growth 70% faster (regulation pressure)',
|
||||
'Enterprise share rises to 20%',
|
||||
'Average price 15% higher (upselling)',
|
||||
'Channel partners from Q1/2028',
|
||||
],
|
||||
kpis: {
|
||||
kunden2030: `~${bullCustomers.toLocaleString('de-DE')}`,
|
||||
arr2030: fmtArr(bullArr, de),
|
||||
ma2030: String(bullEmployees),
|
||||
breakEven: bullBreakEven,
|
||||
cash2030: fmtCash(bullCash, de),
|
||||
},
|
||||
assumptions: de
|
||||
? ['Kundenwachstum 30-50% schneller', 'Churn Rate 30% niedriger', 'Personalaufbau wie Base Case']
|
||||
: ['Customer growth 30-50% faster', 'Churn rate 30% lower', 'Hiring same as base case'],
|
||||
kpis: bull,
|
||||
},
|
||||
]
|
||||
|
||||
@@ -213,7 +162,6 @@ export default function AssumptionsSlide({ lang, investorId, preferredScenarioId
|
||||
<h3 className={`text-base font-bold ${c.color}`}>{c.name}</h3>
|
||||
</div>
|
||||
<p className="text-xs text-white/40 mb-3">{c.desc}</p>
|
||||
|
||||
<div className="space-y-1.5 mb-4">
|
||||
{c.assumptions.map((a, i) => (
|
||||
<p key={i} className="text-xs text-white/60 pl-3 relative">
|
||||
@@ -222,14 +170,13 @@ export default function AssumptionsSlide({ lang, investorId, preferredScenarioId
|
||||
</p>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="border-t border-white/10 pt-3 space-y-1.5">
|
||||
{[
|
||||
{ label: de ? 'Kunden 2030' : 'Customers 2030', value: c.kpis.kunden2030 },
|
||||
{ label: 'ARR 2030', value: c.kpis.arr2030 },
|
||||
{ label: de ? 'Mitarbeiter' : 'Employees', value: c.kpis.ma2030 },
|
||||
{ label: 'Break-Even', value: c.kpis.breakEven },
|
||||
{ label: 'Cash 2030', value: c.kpis.cash2030 },
|
||||
{ label: de ? 'Kunden 2030' : 'Customers 2030', value: `~${c.kpis.customers.toLocaleString('de-DE')}` },
|
||||
{ label: 'ARR 2030', value: fmtArr(c.kpis.arr, de) },
|
||||
{ label: de ? 'Mitarbeiter' : 'Employees', value: String(c.kpis.headcount) },
|
||||
{ label: 'Break-Even', value: c.kpis.breakEvenYear },
|
||||
{ label: 'Cash 2030', value: fmtCash(c.kpis.cash, de) },
|
||||
].map((kpi, i) => (
|
||||
<div key={i} className="flex justify-between text-xs">
|
||||
<span className="text-white/40">{kpi.label}</span>
|
||||
@@ -243,7 +190,6 @@ export default function AssumptionsSlide({ lang, investorId, preferredScenarioId
|
||||
})}
|
||||
</div>
|
||||
|
||||
{/* Comparison Table */}
|
||||
<FadeInView delay={0.5}>
|
||||
<GlassCard hover={false} className="p-4">
|
||||
<h3 className="text-xs font-bold text-white/40 uppercase tracking-wider mb-3">
|
||||
@@ -260,11 +206,11 @@ export default function AssumptionsSlide({ lang, investorId, preferredScenarioId
|
||||
</thead>
|
||||
<tbody>
|
||||
{[
|
||||
{ label: de ? 'Kunden' : 'Customers', bear: cases[0].kpis.kunden2030, base: cases[1].kpis.kunden2030, bull: cases[2].kpis.kunden2030 },
|
||||
{ label: 'ARR', bear: cases[0].kpis.arr2030, base: cases[1].kpis.arr2030, bull: cases[2].kpis.arr2030 },
|
||||
{ label: de ? 'Mitarbeiter' : 'Employees', bear: cases[0].kpis.ma2030, base: cases[1].kpis.ma2030, bull: cases[2].kpis.ma2030 },
|
||||
{ label: 'Break-Even', bear: cases[0].kpis.breakEven, base: cases[1].kpis.breakEven, bull: cases[2].kpis.breakEven },
|
||||
{ label: 'Cash', bear: cases[0].kpis.cash2030, base: cases[1].kpis.cash2030, bull: cases[2].kpis.cash2030 },
|
||||
{ label: de ? 'Kunden' : 'Customers', bear: `~${bear.customers.toLocaleString('de-DE')}`, base: `~${base.customers.toLocaleString('de-DE')}`, bull: `~${bull.customers.toLocaleString('de-DE')}` },
|
||||
{ label: 'ARR', bear: fmtArr(bear.arr, de), base: fmtArr(base.arr, de), bull: fmtArr(bull.arr, de) },
|
||||
{ label: de ? 'Mitarbeiter' : 'Employees', bear: String(bear.headcount), base: String(base.headcount), bull: String(bull.headcount) },
|
||||
{ label: 'Break-Even', bear: bear.breakEvenYear, base: base.breakEvenYear, bull: bull.breakEvenYear },
|
||||
{ label: 'Cash', bear: fmtCash(bear.cash, de), base: fmtCash(base.cash, de), bull: fmtCash(bull.cash, de) },
|
||||
].map((row, idx) => (
|
||||
<tr key={idx} className="border-b border-white/[0.03]">
|
||||
<td className="py-1.5 text-white/60">{row.label}</td>
|
||||
|
||||
Reference in New Issue
Block a user