fix: BreakPilot TTS pronunciation (Brejk-Peilot), re-secure fp-patch
All checks were successful
Build pitch-deck / build-push-deploy (push) Successful in 1m17s
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 32s
CI / test-python-voice (push) Successful in 30s
CI / test-bqas (push) Successful in 34s

This commit is contained in:
Benjamin Admin
2026-04-22 11:00:01 +02:00
parent 0194af8a64
commit 31b6e38459
3 changed files with 14 additions and 35 deletions

View File

@@ -1,37 +1,17 @@
import { NextResponse } from 'next/server'
import { NextRequest, NextResponse } from 'next/server'
import { requireAdmin } from '@/lib/admin-auth'
import pool from '@/lib/db'
import { computeFinanzplan } from '@/lib/finanzplan/engine'
export async function POST() {
const results: string[] = []
/** Admin-only: recompute a Finanzplan scenario. */
export async function POST(request: NextRequest) {
const guard = await requireAdmin(request)
if (guard.kind === 'response') return guard.response
try {
// Fix pitch_financials with WD numbers
const fixes: [number, number, number, number, number][] = [
[2026, 71447, 6, 3, 205788],
[2027, 476354, 23, 3, 598188],
[2028, 951641, 56, 5, 1176564],
[2029, 1827761, 113, 7, 2312328],
[2030, 3314258, 195, 9, 4080492],
]
for (const [y, rev, cust, emp, arr] of fixes) {
await pool.query(`UPDATE pitch_financials SET revenue_eur=$1, customers_count=$2, employees_count=$3, arr_eur=$4 WHERE year=$5`, [rev, cust, emp, arr, y])
}
results.push('pitch_financials updated')
const body = await request.json().catch(() => ({}))
const scenarioId = body.scenarioId || (await pool.query("SELECT id FROM fp_scenarios WHERE is_default = true LIMIT 1")).rows[0]?.id
if (!scenarioId) return NextResponse.json({ error: 'No scenario found' }, { status: 404 })
// Fix pitch_funding
await pool.query(`UPDATE pitch_funding SET round_name='Pre-Seed (Wandeldarlehen)', amount_eur=200000, instrument='Wandeldarlehen', use_of_funds=$1`,
[JSON.stringify([
{category:'personal',label_de:'Personal & Gehälter',label_en:'Personnel & Salaries',percentage:45},
{category:'cloud',label_de:'Cloud-Infrastruktur',label_en:'Cloud Infrastructure',percentage:15},
{category:'sales',label_de:'Vertrieb & Marketing',label_en:'Sales & Marketing',percentage:15},
{category:'ausstattung',label_de:'Arbeitsplatzausstattung',label_en:'Workplace Equipment',percentage:10},
{category:'legal',label_de:'Zertifizierung & Recht',label_en:'Certification & Legal',percentage:10},
{category:'reserve',label_de:'Reserve',label_en:'Reserve',percentage:5},
])])
results.push('pitch_funding updated')
} catch (err) {
results.push(`ERROR: ${err instanceof Error ? err.message : String(err)}`)
}
return NextResponse.json({ ok: true, results })
const result = await computeFinanzplan(pool, scenarioId)
return NextResponse.json({ success: true, scenarioId, cash_m60: result.liquiditaet?.endstand?.m60 })
}

View File

@@ -33,8 +33,8 @@ export async function POST(request: NextRequest) {
let ttsText = text
if (language === 'de') {
ttsText = ttsText
.replace(/BreakPilot/g, 'Bräikpailot')
.replace(/Breakpilot/g, 'Bräikpailot')
.replace(/BreakPilot/g, 'Brejk-Peilot')
.replace(/Breakpilot/g, 'Brejk-Peilot')
.replace(/COMPLAI/g, 'Complei')
.replace(/Executive Summary/g, 'Exekjutiv Sammäri')
.replace(/Onepager/g, 'Wann-Päidscher')

View File

@@ -6,7 +6,6 @@ const PUBLIC_PATHS = [
'/auth', // investor login pages
'/api/auth', // investor auth API
'/api/health',
'/api/admin/fp-patch',
'/api/admin-auth', // admin login API
'/pitch-admin/login', // admin login page
'/_next',