import { NextRequest, NextResponse } from 'next/server'

const LEGAL_SERVICE = process.env.LEGAL_SERVICE_URL ?? 'http://localhost:3200'

export async function POST(req: NextRequest) {
  const body = await req.json()
  const res = await fetch(`${LEGAL_SERVICE}/time-entries/mark-billed`, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify(body),
  })
  const data = await res.json()
  return NextResponse.json(data, { status: res.status })
}
