feat: added task DTOs
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
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[];
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
import { PartialType } from "@nestjs/swagger";
|
||||
import { CreateTaskDto } from "./create-task.dto";
|
||||
|
||||
export class UpdateTaskDto extends PartialType(CreateTaskDto) {}
|
||||
Reference in New Issue
Block a user