Atualiza portal e admin com bloqueio de máquinas desativadas
This commit is contained in:
parent
e5085962e9
commit
630110bf3a
31 changed files with 1756 additions and 244 deletions
|
|
@ -375,8 +375,20 @@ export const dashboardOverview = query({
|
|||
const awaitingTickets = tickets.filter((ticket) => OPEN_STATUSES.has(normalizeStatus(ticket.status)));
|
||||
const atRiskTickets = awaitingTickets.filter((ticket) => ticket.dueAt && ticket.dueAt < now);
|
||||
|
||||
const surveys = await collectCsatSurveys(ctx, tickets);
|
||||
const averageScore = average(surveys.map((item) => item.score));
|
||||
const resolvedLastWindow = tickets.filter(
|
||||
(ticket) => ticket.resolvedAt && ticket.resolvedAt >= lastWindowStart && ticket.resolvedAt < now
|
||||
);
|
||||
const resolvedPreviousWindow = tickets.filter(
|
||||
(ticket) =>
|
||||
ticket.resolvedAt &&
|
||||
ticket.resolvedAt >= previousWindowStart &&
|
||||
ticket.resolvedAt < lastWindowStart
|
||||
);
|
||||
const resolutionRate = tickets.length > 0 ? (resolvedLastWindow.length / tickets.length) * 100 : null;
|
||||
const resolutionDelta =
|
||||
resolvedPreviousWindow.length > 0
|
||||
? ((resolvedLastWindow.length - resolvedPreviousWindow.length) / resolvedPreviousWindow.length) * 100
|
||||
: null;
|
||||
|
||||
return {
|
||||
newTickets: {
|
||||
|
|
@ -394,9 +406,11 @@ export const dashboardOverview = query({
|
|||
total: awaitingTickets.length,
|
||||
atRisk: atRiskTickets.length,
|
||||
},
|
||||
csat: {
|
||||
averageScore,
|
||||
totalSurveys: surveys.length,
|
||||
resolution: {
|
||||
resolvedLast7d: resolvedLastWindow.length,
|
||||
previousResolved: resolvedPreviousWindow.length,
|
||||
rate: resolutionRate,
|
||||
deltaPercentage: resolutionDelta,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue