feat: added project section of TM with some refactors
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
import { IsString, IsOptional, IsNotEmpty, IsUUID, IsDateString, MaxLength } from "class-validator";
|
||||
import { IsString, IsOptional, IsNotEmpty, IsUUID, IsDateString, IsBoolean, MaxLength } from "class-validator";
|
||||
|
||||
export class CreateProjectDto {
|
||||
@ApiProperty({ description: "Name of the project", example: "Mobile App Redesign" })
|
||||
@@ -33,8 +33,29 @@ export class CreateProjectDto {
|
||||
@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[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user