fix(pitch-deck): FinanzplanSlide selects correct fp_scenario per version
All checks were successful
Build pitch-deck / build-push-deploy (push) Successful in 1m8s
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 35s
CI / test-bqas (push) Successful in 33s
All checks were successful
Build pitch-deck / build-push-deploy (push) Successful in 1m8s
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 35s
CI / test-bqas (push) Successful in 33s
Bug: Finanzplan data grid always loaded Base Case (is_default=true) even for Wandeldarlehen version, showing 35 employees + module-based customers instead of lean 10-person plan. Fix: isWandeldarlehen prop passed to FinanzplanSlide. On load, picks Wandeldarlehen scenario by name match instead of is_default. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -214,7 +214,7 @@ export default function PitchDeck({ lang, onToggleLanguage, investor, onLogout,
|
||||
case 'annex-strategy':
|
||||
return <StrategySlide lang={lang} isWandeldarlehen={isWandeldarlehen} />
|
||||
case 'annex-finanzplan':
|
||||
return <FinanzplanSlide lang={lang} investorId={investor?.id || null} preferredScenarioId={preferredScenarioId} />
|
||||
return <FinanzplanSlide lang={lang} investorId={investor?.id || null} preferredScenarioId={preferredScenarioId} isWandeldarlehen={isWandeldarlehen} />
|
||||
case 'annex-glossary':
|
||||
return <GlossarySlide lang={lang} />
|
||||
case 'risks':
|
||||
|
||||
@@ -13,6 +13,7 @@ interface FinanzplanSlideProps {
|
||||
lang: Language
|
||||
investorId?: string | null
|
||||
preferredScenarioId?: string | null
|
||||
isWandeldarlehen?: boolean
|
||||
}
|
||||
|
||||
interface SheetMeta {
|
||||
@@ -90,7 +91,7 @@ function formatCell(v: number | undefined): string {
|
||||
|
||||
interface FpScenario { id: string; name: string; is_default: boolean }
|
||||
|
||||
export default function FinanzplanSlide({ lang, investorId, preferredScenarioId }: FinanzplanSlideProps) {
|
||||
export default function FinanzplanSlide({ lang, investorId, preferredScenarioId, isWandeldarlehen }: FinanzplanSlideProps) {
|
||||
const [sheets, setSheets] = useState<SheetMeta[]>([])
|
||||
const [scenarios, setScenarios] = useState<FpScenario[]>([])
|
||||
const [selectedScenarioId, setSelectedScenarioId] = useState<string>('')
|
||||
@@ -164,9 +165,10 @@ export default function FinanzplanSlide({ lang, investorId, preferredScenarioId
|
||||
setSheets(data.sheets || [])
|
||||
const scens: FpScenario[] = data.scenarios || []
|
||||
setScenarios(scens)
|
||||
// Pick default scenario on first load
|
||||
// Pick scenario: Wandeldarlehen version → WD scenario, otherwise default
|
||||
if (!selectedScenarioId) {
|
||||
const def = scens.find(s => s.is_default) ?? scens[0]
|
||||
const wdScenario = isWandeldarlehen ? scens.find(s => s.name.toLowerCase().includes('wandeldarlehen') && !s.name.toLowerCase().includes('bear') && !s.name.toLowerCase().includes('bull')) : null
|
||||
const def = wdScenario ?? scens.find(s => s.is_default) ?? scens[0]
|
||||
if (def) setSelectedScenarioId(def.id)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user