feat(reports): hours by client (CSV + UI), company contracted hours, UI to manage companies; adjust ticket list spacing

This commit is contained in:
Esdras Renan 2025-10-07 14:04:36 -03:00
parent 3bafcc5a0a
commit 70f91f5bbd
10 changed files with 294 additions and 4 deletions

View file

@ -20,7 +20,7 @@ export async function POST(request: Request) {
if (!session) return NextResponse.json({ error: "Não autorizado" }, { status: 401 })
const body = await request.json()
const { name, slug, isAvulso, cnpj, domain, phone, description, address } = body ?? {}
const { name, slug, isAvulso, cnpj, domain, phone, description, address, contractedHoursPerMonth } = body ?? {}
if (!name || !slug) {
return NextResponse.json({ error: "Nome e slug são obrigatórios" }, { status: 400 })
}
@ -32,6 +32,7 @@ export async function POST(request: Request) {
name: String(name),
slug: String(slug),
isAvulso: Boolean(isAvulso ?? false),
contractedHoursPerMonth: typeof contractedHoursPerMonth === "number" ? contractedHoursPerMonth : contractedHoursPerMonth ? Number(contractedHoursPerMonth) : null,
cnpj: cnpj ? String(cnpj) : null,
domain: domain ? String(domain) : null,
phone: phone ? String(phone) : null,