feat: Wiederkehrende Aufgaben-Vorlagen (recurring task templates)
Neue TaskTemplate-Entität mit YEARLY/MONTHLY/INTERVAL_DAYS-Wiederholung. Fällige Aufgaben werden lazy bei GET /tasks erzeugt (Compare-and-Swap auf nextDueDate), damit mehrere API-Replicas im Kubernetes-Cluster dieselbe Vorlage nicht doppelt feuern - ohne zusätzliche Cron-Abhängigkeit. Frontend: Verwaltungsseite unter /settings/task-templates zum Anlegen, Auflisten und Deaktivieren von Vorlagen.
This commit is contained in:
1 parent
e458a7cf07
commit
4609a0f9ec
20 files changed
+1341
No files matched your search
@@ -0,0 +1,53 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { IsEnum, IsInt, IsOptional, IsString, Max, Min } from 'class-validator';
|
||||
import {
|
||||
TaskPriority,
|
||||
TaskTemplateRecurrenceType,
|
||||
} from '../../../generated/prisma';
|
||||
|
||||
export class CreateTaskTemplateDto {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
title!: string;
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
description?: string;
|
||||
|
||||
@ApiPropertyOptional({ enum: TaskPriority })
|
||||
@IsOptional()
|
||||
@IsEnum(TaskPriority)
|
||||
priority?: TaskPriority;
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
assignedUserId?: string;
|
||||
|
||||
@ApiProperty({ enum: TaskTemplateRecurrenceType })
|
||||
@IsEnum(TaskTemplateRecurrenceType)
|
||||
recurrenceType!: TaskTemplateRecurrenceType;
|
||||
|
||||
@ApiPropertyOptional({ description: '1-12, erforderlich bei YEARLY' })
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@Max(12)
|
||||
recurrenceMonth?: number;
|
||||
|
||||
@ApiPropertyOptional({
|
||||
description: '1-31, erforderlich bei YEARLY und MONTHLY',
|
||||
})
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@Max(31)
|
||||
recurrenceDayOfMonth?: number;
|
||||
|
||||
@ApiPropertyOptional({ description: 'erforderlich bei INTERVAL_DAYS' })
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
intervalDays?: number;
|
||||
}
|
||||
Reference in new issue
Block a user