import { NextResponse } from 'next/server'
import { prisma } from '@/lib/db'

// GET: Public app settings (no auth required, non-sensitive values only)
export async function GET() {
  try {
    let defaultSymbolScale = 1.5
    try {
      const setting = await (prisma as any).systemSetting.findUnique({ where: { key: 'default_symbol_scale' } })
      if (setting) defaultSymbolScale = parseFloat(setting.value) || 1.5
    } catch {}

    return NextResponse.json({ defaultSymbolScale })
  } catch {
    return NextResponse.json({ defaultSymbolScale: 1.5 })
  }
}
