36 lines
1.0 KiB
TypeScript
36 lines
1.0 KiB
TypeScript
import { ApiProperty } from "@nestjs/swagger";
|
|
import { IsString, IsOptional, IsBoolean, IsNotEmpty, IsUUID, MaxLength } from "class-validator";
|
|
|
|
export class CreateWorkspaceDto {
|
|
@ApiProperty({ description: "Name of the workspace", example: "Engineering" })
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@MaxLength(100)
|
|
name: string;
|
|
|
|
@ApiProperty({ description: "Description of the workspace", required: false, example: "Workspace for the engineering team" })
|
|
@IsString()
|
|
@IsOptional()
|
|
description?: string;
|
|
|
|
@ApiProperty({ description: "Color code for the workspace (hex or named)", example: "#4F46E5" })
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@MaxLength(20)
|
|
color: string;
|
|
|
|
@ApiProperty({ description: "Whether the workspace is active", required: false, default: true, example: true })
|
|
@IsBoolean()
|
|
isActive: boolean;
|
|
|
|
@ApiProperty({
|
|
description: "IDs of users to assign to the workspace",
|
|
required: false,
|
|
type: [String],
|
|
example: ["b2c3d4e5-f6a7-8901-bcde-f12345678901"],
|
|
})
|
|
@IsUUID("4", { each: true })
|
|
@IsOptional()
|
|
userIds?: string[];
|
|
}
|