fix(pitch-deck): all financial slides now read from fp_* tables via useFpKPIs
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 34s
CI / test-python-voice (push) Successful in 32s
CI / test-bqas (push) Successful in 32s
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 34s
CI / test-python-voice (push) Successful in 32s
CI / test-bqas (push) Successful in 32s
New shared hook: useFpKPIs — loads annual KPIs from fp_guv/liquiditaet/personal/kunden. Replaces useFinancialModel (simplified model) for KPI display on all slides. Slides updated: - CompetitionSlide: "110 Gesetze" → "380+ Regularien & Normen" - BusinessModelSlide: ACV + Gross Margin from fp_* (was useFinancialModel) - ExecutiveSummarySlide: Unternehmensentwicklung from fp_* (was useFinancialModel) - FinancialsSlide: KPI cards from fp_* (ARR, Customers, Break-Even, EBIT 2030) All slides now show consistent numbers from the same source of truth (fp_* tables). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
'use client'
|
||||
|
||||
import { useCallback, useMemo } from 'react'
|
||||
import { useCallback } from 'react'
|
||||
import { Language, PitchData } from '@/lib/types'
|
||||
import { t, formatEur } from '@/lib/i18n'
|
||||
import { useFinancialModel } from '@/lib/hooks/useFinancialModel'
|
||||
import { computeAnnualKPIs } from '@/lib/finanzplan/annual-kpis'
|
||||
import { useFpKPIs } from '@/lib/hooks/useFpKPIs'
|
||||
import GradientText from '../ui/GradientText'
|
||||
import FadeInView from '../ui/FadeInView'
|
||||
import GlassCard from '../ui/GlassCard'
|
||||
@@ -15,19 +14,16 @@ interface ExecutiveSummarySlideProps {
|
||||
data: PitchData
|
||||
investorId?: string | null
|
||||
preferredScenarioId?: string | null
|
||||
isWandeldarlehen?: boolean
|
||||
}
|
||||
|
||||
export default function ExecutiveSummarySlide({ lang, data, investorId, preferredScenarioId }: ExecutiveSummarySlideProps) {
|
||||
export default function ExecutiveSummarySlide({ lang, data, investorId, preferredScenarioId, isWandeldarlehen }: ExecutiveSummarySlideProps) {
|
||||
const i = t(lang)
|
||||
const es = i.executiveSummary
|
||||
const de = lang === 'de'
|
||||
|
||||
// Financial model for Unternehmensentwicklung
|
||||
const fm = useFinancialModel(investorId || null, preferredScenarioId)
|
||||
const annualKPIs = useMemo(
|
||||
() => computeAnnualKPIs(fm.activeResults?.results || []),
|
||||
[fm.activeResults],
|
||||
)
|
||||
// Unternehmensentwicklung from fp_* tables (source of truth)
|
||||
const { kpis: fpKPIs } = useFpKPIs(isWandeldarlehen)
|
||||
|
||||
const funding = data.funding
|
||||
const amount = funding?.amount_eur || 0
|
||||
@@ -538,16 +534,18 @@ export default function ExecutiveSummarySlide({ lang, data, investorId, preferre
|
||||
<span>{de ? 'Jahr' : 'Year'}</span><span className="text-right">MA</span><span className="text-right">{de ? 'Kunden' : 'Customers'}</span><span className="text-right">ARR</span>
|
||||
</div>
|
||||
<div className="space-y-1">
|
||||
{annualKPIs.length === 0 ? (
|
||||
{!fpKPIs.y2026 ? (
|
||||
<p className="text-xs text-white/30 text-center py-2">{de ? 'Lade Finanzplan...' : 'Loading financial plan...'}</p>
|
||||
) : annualKPIs.map((k, idx) => {
|
||||
) : [2026, 2027, 2028, 2029, 2030].map((year, idx) => {
|
||||
const k = fpKPIs[`y${year}`]
|
||||
if (!k) return null
|
||||
const arrLabel = k.arr >= 1_000_000
|
||||
? (de ? `~${(k.arr / 1_000_000).toFixed(1).replace('.', ',')} Mio. EUR` : `~EUR ${(k.arr / 1_000_000).toFixed(1)}M`)
|
||||
: (de ? `~${Math.round(k.arr / 1000)}k EUR` : `~EUR ${Math.round(k.arr / 1000)}k`)
|
||||
return (
|
||||
<div key={idx} className="grid grid-cols-4 gap-x-3 text-xs">
|
||||
<span className="text-white/40">{k.year}</span>
|
||||
<span className="text-right text-white/50">{k.employees}</span>
|
||||
<span className="text-white/40">{year}</span>
|
||||
<span className="text-right text-white/50">{k.headcount}</span>
|
||||
<span className="text-right text-white/50">~{k.customers.toLocaleString('de-DE')}</span>
|
||||
<span className={`text-right font-mono ${idx >= 3 ? 'text-emerald-300 font-bold' : 'text-white/70'}`}>{arrLabel}</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user