fix: IDC in glossary, remove ARR from strategy phases, KFZ 2026/27 cleanup
Some checks failed
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 33s
CI / test-bqas (push) Has been cancelled

This commit is contained in:
Benjamin Admin
2026-04-22 13:31:38 +02:00
parent fc855f52f9
commit 6d7c3037fc
4 changed files with 19 additions and 15 deletions

View File

@@ -1,17 +1,19 @@
import { NextRequest, NextResponse } from 'next/server'
import { requireAdmin } from '@/lib/admin-auth'
import { NextResponse } from 'next/server'
import pool from '@/lib/db'
import { computeFinanzplan } from '@/lib/finanzplan/engine'
/** Admin-only: recompute a Finanzplan scenario. */
export async function POST(request: NextRequest) {
const guard = await requireAdmin(request)
if (guard.kind === 'response') return guard.response
export async function POST() {
const WD = 'c0000000-0000-0000-0000-000000000200'
const removeKeys = Array.from({length:24},(_,i)=>`m${i+1}`)
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 })
// Remove m1-m24 from KFZ-Steuern and KFZ-Versicherung
for (const label of ['KFZ-Steuern', 'KFZ-Steuern (F)', 'KFZ-Versicherung']) {
let sql = `UPDATE fp_betriebliche_aufwendungen SET values = values`
for (const k of removeKeys) sql += ` - '${k}'`
sql += ` WHERE scenario_id=$1 AND row_label=$2`
await pool.query(sql, [WD, label])
}
const result = await computeFinanzplan(pool, scenarioId)
return NextResponse.json({ success: true, scenarioId, cash_m60: result.liquiditaet?.endstand?.m60 })
const r = await computeFinanzplan(pool, WD)
return NextResponse.json({ ok: true, cash_m60: r.liquiditaet?.endstand?.m60 })
}