D1: Remove /api/admin/fp-patch from PUBLIC_PATHS — it was returning live financial
data (fp_liquiditaet rows) to any unauthenticated caller; middleware admin gate now
applies as it does for all /api/admin/* paths.
D2: Add PITCH_ADMIN_SECRET bearer guard to POST /api/financial-model (create scenario)
and PUT /api/financial-model/assumptions (update assumptions) — any authenticated
investor could previously create/modify global financial model data.
D3: Add PITCH_ADMIN_SECRET bearer guard to POST /api/finanzplan/compute — any
investor could trigger a full DB recomputation across all fp_* tables. Also replace
String(error) in error response with a static message.
D4: GET /api/finanzplan/[sheetName] now ignores ?scenarioId= for non-admin callers;
investors always receive the default scenario only. Previously any investor could
enumerate UUIDs and read any scenario's financials including other investors' plans.
D9: Remove `name` from the non-admin /api/finanzplan response — scenario names like
"Wandeldarlehen v2" reveal internal versioning to investors.
D10: Remove hardcoded postgres://breakpilot:breakpilot123@localhost fallback from
lib/db.ts — missing DATABASE_URL now fails loudly instead of silently using stale
credentials that are committed to the repository.
D6: Fix all 4 TypeScript errors that were masked by ignoreBuildErrors:true; bump
tsconfig target to ES2018 (regex s flag in ChatFAB), type lang as 'de'|'en' in
chat route, add 'as string' assertion in adapter.ts. Remove ignoreBuildErrors:true
from next.config.js so future type errors fail the build rather than being silently
shipped.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
C3: Split SYSTEM_PROMPT into PART1/PART2/PART3 constants; Kernbotschaft #9 and
VERSIONS-ISOLATION now concatenated directly at runtime instead of .replace() — a
whitespace mismatch can no longer cause placeholder text to leak verbatim to the LLM.
I2: Add second liquidity-chain pass (sumAus→ÜBERSCHUSS→rolling balance) after tax rows
(Gewerbesteuer/Körperschaftsteuer) are written to fp_liquiditaet, so first-run LIQUIDITÄT
figures include tax outflows without requiring a second engine invocation.
I6: Warn when loadFpLiquiditaetSummary finds no fp_liquiditaet rows for a named scenario,
surfacing scenario-name mismatches that would otherwise silently return empty context.
I8: Sanitize console.error calls in chat/route.ts (3 sites) and data/route.ts; cap
LiteLLM error body to 200 chars, use (error as Error).message for stream/handler errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Engine now uses dynamic row_type-based summation instead of hardcoded label
strings that differed between scenarios (e.g. 'Summe ERTRÄGE' vs
'Summe EINZAHLUNGEN'), fixing stale 9.2M value in Wandeldarlehen scenarios.
Rolling balance now includes all financing cash flows via ÜBERSCHUSS chain.
MilestonesSlide: widen Theme type to union so t.key comparisons compile.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Cloud-Hosting, KI Tools, 3rd Party API → Materialaufwand
- New rows: Datenbank-Hosting, CDN/Storage
- Engine: compute Cloud-Hosting formula in materialaufwand
- Gross Margin now realistic (~82% in 2026)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Revenue rows without qty/price (e.g. Beratung & Service) were excluded
from total. Now all revenue rows contribute to GESAMTUMSATZ.
Same fix for materialaufwand SUMME.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Removed 'sonst_ertraege' from SHEET_LIST (empty, irrelevant for pre-seed)
- DB: Added Mac Studio (LLM Training) 13.000 EUR, Jan 2027, AfA 3 Jahre
- DB: Added Software-Lizenzen (GWG) 800 EUR/Jahr (2026-2030)
- DB: Added Domain/SSL/Zertifikate (GWG) 500 EUR at founding
- DB: Removed GPU-Server (wrong assumption — Mac Studio used instead)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Engine: All formula-based rows (F) now start at FOUNDING_MONTH (m8),
not m1. Affects: Fortbildung, Fahrzeug, KFZ, Reise, Bewirtung,
Internet, BG, Marketing, Serverkosten, Gewerbesteuer.
DB: All manual (M) betriebliche rows zeroed for m1-m7 across all
6 scenarios.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Engine:
- Gewerbesteuer (F): 12.25% of monthly profit (only when positive)
- Berufsgenossenschaft (F): 2.77% of brutto payroll
- Allgemeine Marketingkosten (F): 10% of revenue
- Internet/Mobilfunk (F): Headcount × 50 EUR/Mon
UI: Tooltip for Gewerbesteuer formula added.
DB changes (production):
- Gewerbesteuer: (M) → (F), auto-calculated
- Rechtsanwalt/Datenschutz: new hire Oct 2026, 7500 EUR brutto
- Beratung & Services: new revenue line (5k→30k/Mon)
- Investitionen: Home Office 2500 EUR per new hire
- Marketing Videos moved to marketing category
- Bank → Bank-/Kreditkartengebühren
- Jahresabschluss costs filled (1000-2000 EUR/year)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All financial data now flows from the same compute engine (useFinancialModel).
No more hardcoded numbers in any slide — all values are derived from the
finanzplan database, ensuring consistency across all pitch deck versions.
- FinanzplanSlide: KPI table + charts now use computeAnnualKPIs() from FMResult[]
- BusinessModelSlide: bottom-up calc (customers × ACV = ARR) from compute engine
- AssumptionsSlide: Base case from compute, Bear/Bull scaled from Base
- New helper: lib/finanzplan/annual-kpis.ts for 60-month → 5-year aggregation
- PitchDeck: passes investorId to all financial slides for version-aware data
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Gründer immer sort_order 1+2, dann nach start_date
- Beide Gründer exakt gleiches Gehalt (7.000 EUR/Mo ab Jan 2027)
- Alle Pos-Namen durchnummeriert (Pos 3 bis Pos 35)
Umlaute in DB-Labels (Liquidität, GuV, Betriebliche):
Umsatzerloese→Umsatzerlöse, UEBERSCHUSS→ÜBERSCHUSS,
Koerperschaftsteuer→Körperschaftsteuer, etc.
Engine-Labels synchron aktualisiert.
Summenzeile (SUMME) als tfoot für:
Personalkosten, Materialaufwand, Betriebliche Aufwendungen,
Investitionen, Sonstige Erträge
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Überschuss = NUR operativer Cashflow:
Einzahlungen: Umsatz + Sonst.Erträge + Anzahlungen (OHNE EK/FK)
Auszahlungen: Material + Personal + Sonstige + Steuern (OHNE Kredit)
= Operativer Überschuss
Kontostand = Vormonat + Operativer Überschuss + Finanzierung
Finanzierung = EK + FK - Kreditrückzahlungen (separat)
So zeigt der Überschuss die echte operative Performance,
die Kapitaleinzahlung erscheint nur im Kontostand.
Marketing: 5.000€/Mo ab Jul 2027 (statt 20k)
Alle Werte Math.round() — ganzzahlig
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>