From a034e265fdba58bfe0eb7d2a344092e8c312cdcc Mon Sep 17 00:00:00 2001 From: Julien Froidefond Date: Wed, 1 Oct 2025 21:28:24 +0200 Subject: [PATCH] feat: update task statistics calculation - Renamed variables in `getTaskStats` for clarity, changing `completed` to `done` and ensuring `archived` is counted separately. - Added logic to calculate `completed` tasks as the sum of `done` and `archived`, improving task status reporting. --- src/services/task-management/tasks.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/services/task-management/tasks.ts b/src/services/task-management/tasks.ts index 2a08ae1..dda499b 100644 --- a/src/services/task-management/tasks.ts +++ b/src/services/task-management/tasks.ts @@ -254,17 +254,19 @@ export class TasksService { * Récupère les statistiques des tâches */ async getTaskStats() { - const [total, completed, inProgress, todo, backlog, cancelled, freeze, archived] = await Promise.all([ + const [total, done, archived, inProgress, todo, backlog, cancelled, freeze] = await Promise.all([ prisma.task.count(), prisma.task.count({ where: { status: 'done' } }), + prisma.task.count({ where: { status: 'archived' } }), prisma.task.count({ where: { status: 'in_progress' } }), prisma.task.count({ where: { status: 'todo' } }), prisma.task.count({ where: { status: 'backlog' } }), prisma.task.count({ where: { status: 'cancelled' } }), - prisma.task.count({ where: { status: 'freeze' } }), - prisma.task.count({ where: { status: 'archived' } }) + prisma.task.count({ where: { status: 'freeze' } }) ]); + const completed = done + archived; // Terminées = Done + Archived + return { total, completed,