feat: add workspace-type DTOs
This commit is contained in:
@@ -1,17 +1,25 @@
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
import { IsString, IsOptional, IsInt, IsNotEmpty, MaxLength, Min } from "class-validator";
|
||||
|
||||
export class CreateWorkspaceTypeDto {
|
||||
@ApiProperty({ description: "Name of the workspace type", example: "Engineering" })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@MaxLength(100)
|
||||
name: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: "Description of the workspace type",
|
||||
required: false,
|
||||
example: "Workspace type for engineering related work",
|
||||
})
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
description?: string;
|
||||
|
||||
@ApiProperty({ description: "Display order of the workspace type", example: 1 })
|
||||
@IsInt()
|
||||
@IsOptional()
|
||||
@IsNotEmpty()
|
||||
@Min(0)
|
||||
order?: number;
|
||||
order: number;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PartialType } from "@nestjs/mapped-types";
|
||||
import { CreateWorkspaceTypeDto } from "./create-workspace-type.dto";
|
||||
import { PartialType } from '@nestjs/swagger';
|
||||
import { CreateWorkspaceTypeDto } from './create-workspace-type.dto';
|
||||
|
||||
export class UpdateWorkspaceTypeDto extends PartialType(CreateWorkspaceTypeDto) {}
|
||||
export class UpdateWorkspaceTypeDto extends PartialType(CreateWorkspaceTypeDto) {}
|
||||
Reference in New Issue
Block a user