fix & enhance workspace
This commit is contained in:
@@ -1,25 +1,40 @@
|
||||
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: "ID of the workspace type", example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" })
|
||||
@IsUUID()
|
||||
@IsNotEmpty()
|
||||
workspaceTypeId: 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()
|
||||
@IsOptional()
|
||||
isActive?: boolean;
|
||||
isActive: boolean;
|
||||
|
||||
@IsUUID()
|
||||
@IsNotEmpty()
|
||||
workspaceTypeId: string;
|
||||
@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[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user