tasks: add refresh mode toggle (completion date vs planned date)

Recurring tasks can now calculate next due date from either the
completion time (default) or the planned due date, catching up
if overdue.
This commit is contained in:
2026-04-02 17:29:06 +02:00
parent 346740e375
commit c2007aaa4a
5 changed files with 78 additions and 4 deletions
+6
View File
@@ -7,6 +7,7 @@ export interface ITask {
assignees: string[];
tags: string[];
difficulty?: 'low' | 'medium' | 'high';
refreshMode?: 'completion' | 'planned';
isRecurring: boolean;
frequency?: {
type: 'daily' | 'weekly' | 'biweekly' | 'monthly' | 'custom';
@@ -45,6 +46,11 @@ const TaskSchema = new mongoose.Schema(
type: String,
enum: ['low', 'medium', 'high']
},
refreshMode: {
type: String,
enum: ['completion', 'planned'],
default: 'completion'
},
isRecurring: {
type: Boolean,
required: true,