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 7ebebe5d11
commit 381012db98
5 changed files with 78 additions and 4 deletions

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,