feat: add backlog status and update task stats
- Introduced 'backlog' status in TaskStatus type and STATUS_CONFIG for better task categorization. - Updated TaskStats interface to include backlog count. - Enhanced getTaskStats method to fetch backlog statistics and display in Header component. - Added backlog stat card in Header for improved visibility of task status.
This commit is contained in:
@@ -189,13 +189,15 @@ export class TasksService {
|
||||
* Récupère les statistiques des tâches
|
||||
*/
|
||||
async getTaskStats() {
|
||||
const [total, completed, inProgress, todo, cancelled, freeze] = await Promise.all([
|
||||
const [total, completed, inProgress, todo, backlog, cancelled, freeze, archived] = await Promise.all([
|
||||
prisma.task.count(),
|
||||
prisma.task.count({ where: { status: 'done' } }),
|
||||
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: 'freeze' } }),
|
||||
prisma.task.count({ where: { status: 'archived' } })
|
||||
]);
|
||||
|
||||
return {
|
||||
@@ -203,8 +205,10 @@ export class TasksService {
|
||||
completed,
|
||||
inProgress,
|
||||
todo,
|
||||
backlog,
|
||||
cancelled,
|
||||
freeze,
|
||||
archived,
|
||||
completionRate: total > 0 ? Math.round((completed / total) * 100) : 0
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user