Rework core model: financial elements as plan-wide entities across phases; derived phase types (Erwerb/Pension/Misch) with retirement-capped durations and per-plan retirement age; AHV (gap years + couple ceiling), PK payout/annuity, 3a, real estate, other assets/debts; horizontal timeline with retirement markers; phase x element matrix with detail panel; savings/consumption quota + available-capital key figures with red status
Deploy App / deploy (push) Successful in 1m57s

This commit is contained in:
2026-07-13 07:55:58 +02:00
parent b3a3b565ac
commit b775ab77cb
27 changed files with 2407 additions and 2166 deletions
+9 -4
View File
@@ -50,23 +50,28 @@ export function Dashboard({
return result;
}, [plan.name, computed, compareIds, compareData, allPlans]);
const ASSET_CATS = ["PENSION_FUND", "PILLAR_3A", "REAL_ESTATE", "OTHER_ASSET"];
const barKeys = useMemo(() => {
const keys = new Set<string>();
for (const phase of computed.phases) {
for (const s of phase.securities) keys.add(s.name);
for (const re of phase.realEstates) keys.add(re.name);
for (const el of phase.elements) {
if (ASSET_CATS.includes(el.category) && el.endValue > 0) keys.add(el.name);
}
}
return Array.from(keys);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [computed]);
const barData = useMemo(
() =>
computed.phases.map((phase) => {
const row: Record<string, number | string> = { phase: phase.name };
for (const s of phase.securities) row[s.name] = s.endValue;
for (const re of phase.realEstates) row[re.name] = re.endNet;
for (const el of phase.elements) {
if (ASSET_CATS.includes(el.category) && el.endValue > 0) row[el.name] = el.endValue;
}
return row;
}),
// eslint-disable-next-line react-hooks/exhaustive-deps
[computed]
);