feat(filters): ticket company filter + column; reports: company filter in CSVs; dashboard: queue summary; docs: agents.md and roadmap updates

This commit is contained in:
Esdras Renan 2025-10-07 14:18:59 -03:00
parent 70f91f5bbd
commit 2cf399dcb1
9 changed files with 100 additions and 31 deletions

View file

@ -34,6 +34,7 @@ export async function GET(request: Request) {
const { searchParams } = new URL(request.url)
const range = searchParams.get("range") ?? undefined // "7d" | "30d" | undefined(=90d)
const companyId = searchParams.get("companyId") ?? undefined
const client = new ConvexHttpClient(convexUrl)
const tenantId = session.user.tenantId ?? DEFAULT_TENANT_ID
@ -62,6 +63,7 @@ export async function GET(request: Request) {
tenantId,
viewerId: viewerId as unknown as Id<"users">,
range,
companyId: companyId as any,
})
const channels = report.channels
@ -91,7 +93,7 @@ export async function GET(request: Request) {
return new NextResponse(csv, {
headers: {
"Content-Type": "text/csv; charset=UTF-8",
"Content-Disposition": `attachment; filename="tickets-by-channel-${tenantId}-${range ?? '90d'}.csv"`,
"Content-Disposition": `attachment; filename="tickets-by-channel-${tenantId}-${range ?? '90d'}${companyId ? `-${companyId}` : ''}.csv"`,
"Cache-Control": "no-store",
},
})