feat(task): add progress mode handling and update related functions

Introduce a new `progress_mode` field to tasks and projects to support different progress calculation methods (manual, weighted, time, default). Update database migrations, task progress calculation functions, and related handlers to accommodate these changes. This ensures consistent progress tracking across different project management needs.

The changes include:
- Adding `progress_mode` to the `tasks` table.
- Updating progress calculation functions to respect the selected mode.
- Adding triggers to reset progress values when the project's progress mode changes.
- Enhancing documentation to explain the default progress method.
This commit is contained in:
chamikaJ
2025-05-09 15:59:25 +05:30
parent 4a2393881b
commit ba90fa1274
4 changed files with 712 additions and 238 deletions

View File

@@ -1,6 +1,6 @@
import { LabelType } from './label.type';
import { MemberType } from './member.types';
import { ProjectType } from './project.types';
import { ITaskLabel } from './tasks/taskLabel.types';
export type TaskStatusType = 'doing' | 'todo' | 'done';
export type TaskPriorityType = 'low' | 'medium' | 'high';
@@ -13,13 +13,16 @@ export type SubTaskType = {
subTaskDueDate?: Date;
};
export type ProgressModeType = 'manual' | 'weighted' | 'time' | 'default';
export type TaskType = {
taskId: string;
progress_mode?: ProgressModeType;
task: string;
description?: string | null;
progress?: number;
members?: MemberType[];
labels?: LabelType[];
labels?: ITaskLabel[];
status: TaskStatusType | string;
priority: TaskPriorityType | string;
timeTracking?: number;