feat: add updatedAt field to TaskType and adjust completedAt logic
- Introduced `updatedAt` property in `TaskType` for better task tracking. - Modified `completedAt` assignment to use `task.updatedAt` when `completedAt` is undefined, ensuring more accurate task completion timestamps.
This commit is contained in:
@@ -8,6 +8,7 @@ type TaskType = {
|
||||
priority: string; // high, medium, low
|
||||
completedAt?: Date | null;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
taskTags?: {
|
||||
tag: {
|
||||
name: string;
|
||||
@@ -159,6 +160,7 @@ export class ManagerSummaryService {
|
||||
priority: true,
|
||||
completedAt: true,
|
||||
createdAt: true,
|
||||
updatedAt: true,
|
||||
taskTags: {
|
||||
select: {
|
||||
tag: {
|
||||
@@ -258,7 +260,7 @@ export class ManagerSummaryService {
|
||||
description: task.description || undefined,
|
||||
tags: task.taskTags?.map(tt => tt.tag.name) || [],
|
||||
impact,
|
||||
completedAt: task.completedAt || getToday(),
|
||||
completedAt: task.completedAt || task.updatedAt,
|
||||
relatedItems: [task.id],
|
||||
todosCount: allRelatedTodos // Nombre total de todos associés à cette tâche
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user