fix(dashboard): "Em andamento" conta apenas tickets com play ativo
All checks were successful
CI/CD Web + Desktop / Detect changes (push) Successful in 7s
Quality Checks / Lint, Test and Build (push) Successful in 3m46s
CI/CD Web + Desktop / Deploy (VPS Linux) (push) Successful in 3m39s
CI/CD Web + Desktop / Deploy Convex functions (push) Successful in 2m13s

- Tickets com status AWAITING_ATTENDANCE mas sem play ativo
  agora contam como "Em aberto"
- "Em andamento" mostra apenas tickets onde working === true

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
rever-tecnologia 2025-12-17 14:39:39 -03:00
parent 6f9cdc8670
commit bddce33217

View file

@ -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") {
// "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;
}