fix(dashboard): "Em andamento" conta apenas tickets com play ativo
All checks were successful
All checks were successful
- 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:
parent
6f9cdc8670
commit
bddce33217
1 changed files with 8 additions and 1 deletions
|
|
@ -154,10 +154,17 @@ export const summary = query({
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
for (const ticket of tickets) {
|
for (const ticket of tickets) {
|
||||||
const status = normalizeStatus(ticket.status);
|
const status = normalizeStatus(ticket.status);
|
||||||
|
const isWorking = ticket.working === true;
|
||||||
if (status === "PENDING") {
|
if (status === "PENDING") {
|
||||||
pending += 1;
|
pending += 1;
|
||||||
} else if (status === "AWAITING_ATTENDANCE") {
|
} 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") {
|
} else if (status === "PAUSED") {
|
||||||
paused += 1;
|
paused += 1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue