feat(pitch-deck): Use of Funds computed from fp_* spending data
Some checks failed
Build pitch-deck / build-push-deploy (push) Successful in 1m20s
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 22s
CI / test-python-voice (push) Successful in 32s
CI / test-bqas (push) Successful in 35s

Use of Funds pie chart now shows actual spending breakdown from fp_* tables
(months 8-24) instead of manually set percentages:
- Engineering & Personal: from fp_personalkosten
- Vertrieb & Marketing: from fp_betriebliche (marketing category)
- Betrieb & Infrastruktur: from fp_betriebliche (other categories)
- Hardware & Ausstattung: from fp_investitionen

Falls back to funding.use_of_funds if fp_* data not yet loaded.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-04-19 17:50:08 +02:00
parent 7be1a296c6
commit 30c63bbef6
3 changed files with 78 additions and 7 deletions

View File

@@ -189,7 +189,7 @@ export default function PitchDeck({ lang, onToggleLanguage, investor, onLogout,
case 'financials':
return <FinancialsSlide lang={lang} investorId={investor?.id || null} preferredScenarioId={preferredScenarioId} isWandeldarlehen={isWandeldarlehen} />
case 'the-ask':
return <TheAskSlide lang={lang} funding={data.funding} />
return <TheAskSlide lang={lang} funding={data.funding} isWandeldarlehen={isWandeldarlehen} />
case 'cap-table':
if (isWandeldarlehen) return null
return <CapTableSlide lang={lang} />

View File

@@ -3,6 +3,7 @@
import { motion } from 'framer-motion'
import { Language, PitchFunding } from '@/lib/types'
import { t } from '@/lib/i18n'
import { useFpKPIs } from '@/lib/hooks/useFpKPIs'
import ProjectionFooter from '../ui/ProjectionFooter'
import GradientText from '../ui/GradientText'
import FadeInView from '../ui/FadeInView'
@@ -14,6 +15,7 @@ import { PieChart, Pie, Cell, ResponsiveContainer, Tooltip } from 'recharts'
interface TheAskSlideProps {
lang: Language
funding: PitchFunding
isWandeldarlehen?: boolean
}
const COLORS = ['#6366f1', '#a78bfa', '#60a5fa', '#34d399', '#fbbf24']
@@ -39,15 +41,18 @@ function formatTargetDate(dateStr: string, lang: Language): string {
}
}
export default function TheAskSlide({ lang, funding }: TheAskSlideProps) {
export default function TheAskSlide({ lang, funding, isWandeldarlehen }: TheAskSlideProps) {
const i = t(lang)
const de = lang === 'de'
const isWandeldarlehen = (funding?.instrument || '').toLowerCase().includes('wandeldarlehen')
const rawFunds = funding?.use_of_funds
const useOfFunds = Array.isArray(rawFunds) ? rawFunds : (typeof rawFunds === 'string' ? JSON.parse(rawFunds) : [])
const isWD = isWandeldarlehen || (funding?.instrument || '').toLowerCase() === 'wandeldarlehen'
const amount = Number(funding?.amount_eur) || 0
const { target, suffix } = formatFundingAmount(amount)
const totalBudget = isWandeldarlehen ? amount * 2 : amount
const totalBudget = isWD ? amount * 2 : amount
// Use of Funds from fp_* data (computed, not manual)
const { useOfFunds: fpUseOfFunds } = useFpKPIs(isWD)
const rawFunds = fpUseOfFunds.length > 0 ? fpUseOfFunds : (funding?.use_of_funds || [])
const useOfFunds = Array.isArray(rawFunds) ? rawFunds : (typeof rawFunds === 'string' ? JSON.parse(rawFunds) : [])
const pieData = useOfFunds.map((item: Record<string, unknown>) => ({
name: (de ? item.label_de : item.label_en) as string || 'N/A',