Files
dsc-api/src/modules/task-manager/dto/task/create-task.dto.ts
T
2026-07-01 13:10:05 +03:30

47 lines
1.4 KiB
TypeScript

import { ApiProperty } from "@nestjs/swagger";
import { IsString, IsOptional, IsNotEmpty, IsUUID, IsDateString, MaxLength } from "class-validator";
export class CreateTaskDto {
@ApiProperty({ description: "Title of the task", example: "Implement login page" })
@IsString()
@IsNotEmpty()
@MaxLength(150)
title: string;
@ApiProperty({ description: "Description of the task", required: false, example: "Implement the login page with JWT auth" })
@IsString()
@IsOptional()
description?: string;
@ApiProperty({ description: "Color code for the task", required: false, example: "#4F46E5" })
@IsString()
@IsOptional()
@MaxLength(20)
color?: string;
@ApiProperty({ description: "Start date of the task", required: false, example: "2026-07-01" })
@IsDateString()
@IsOptional()
startDate?: string;
@ApiProperty({ description: "End date of the task", required: false, example: "2026-07-15" })
@IsDateString()
@IsOptional()
endDate?: string;
@ApiProperty({ description: "ID of the task phase this task belongs to", example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" })
@IsUUID()
@IsNotEmpty()
taskPhaseId: string;
@ApiProperty({
description: "IDs of users to assign to the task",
required: false,
type: [String],
example: ["b2c3d4e5-f6a7-8901-bcde-f12345678901"],
})
@IsUUID("4", { each: true })
@IsOptional()
userIds?: string[];
}