Files
dsc-api/src/modules/task-manager/dto/project/create-project.dto.ts
T

62 lines
1.8 KiB
TypeScript

import { ApiProperty } from "@nestjs/swagger";
import { IsString, IsOptional, IsNotEmpty, IsUUID, IsDateString, IsBoolean, MaxLength } from "class-validator";
export class CreateProjectDto {
@ApiProperty({ description: "Name of the project", example: "Mobile App Redesign" })
@IsString()
@IsNotEmpty()
@MaxLength(150)
name: string;
@ApiProperty({ description: "Name of the project owner", example: "Jane Doe" })
@IsString()
@IsNotEmpty()
@MaxLength(150)
ownerName: string;
@ApiProperty({ description: "Description of the project", required: false, example: "Redesign of the mobile app UI/UX" })
@IsString()
@IsOptional()
description?: string;
@ApiProperty({ description: "Start date of the project", example: "2026-07-01" })
@IsDateString()
@IsNotEmpty()
startDate: string;
@ApiProperty({
description: "Background picture URL of the project",
required: false,
example: "https://cdn.example.com/projects/bg1.png",
})
@IsString()
@IsOptional()
backgroundPicture?: string;
@ApiProperty({ description: "Background color of the project (hex or named)", required: false, example: "#4F46E5" })
@IsString()
@IsOptional()
@MaxLength(20)
backgroundColor?: string;
@ApiProperty({ description: "Whether the project is active", required: false, default: true, example: true })
@IsBoolean()
@IsOptional()
isActive?: boolean;
@ApiProperty({ description: "ID of the workspace this project belongs to", example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" })
@IsUUID()
@IsNotEmpty()
workspaceId: string;
@ApiProperty({
description: "IDs of users to assign to the project (must be members of the workspace)",
required: false,
type: [String],
example: ["b2c3d4e5-f6a7-8901-bcde-f12345678901"],
})
@IsUUID("4", { each: true })
@IsOptional()
userIds?: string[];
}