import { Pool } from 'pg'
import { computeFinanzplan } from '../lib/finanzplan/engine'

async function main() {
  const pool = new Pool({ connectionString: process.env.DATABASE_URL || 'postgres://breakpilot:breakpilot123@localhost:5432/breakpilot_db' })
  try {
    const sid = 'c0000000-0000-0000-0000-000000000200'
    console.log('Computing WD scenario:', sid)
    const result = await computeFinanzplan(pool, sid)
    console.log('Done. Cash m60:', result.liquiditaet?.endstand?.m60)
    console.log('Headcount m60:', result.personalkosten?.headcount?.m60)
  } catch (e) {
    console.error('Error:', e)
  } finally {
    await pool.end()
  }
}
main()
