diff --git a/convex/queues.ts b/convex/queues.ts index 2f70228..78bb6a9 100644 --- a/convex/queues.ts +++ b/convex/queues.ts @@ -154,10 +154,17 @@ export const summary = query({ const now = Date.now(); for (const ticket of tickets) { const status = normalizeStatus(ticket.status); + const isWorking = ticket.working === true; if (status === "PENDING") { pending += 1; } else if (status === "AWAITING_ATTENDANCE") { - inProgress += 1; + // "Em andamento" conta apenas tickets com play ativo + if (isWorking) { + inProgress += 1; + } else { + // Tickets em atendimento sem play ativo contam como "Em aberto" + pending += 1; + } } else if (status === "PAUSED") { paused += 1; }