homemanager-be/src/app-group/dto/groups-create-request.dto.ts

18 lines
373 B
TypeScript

import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsOptional, IsString, MaxLength, MinLength } from 'class-validator';
export class CreateGroupRequestDto {
@ApiProperty()
@IsString()
@MinLength(3)
@MaxLength(32)
name: string;
@ApiPropertyOptional()
@IsString()
@IsOptional()
@MinLength(4)
@MaxLength(16)
color?: string;
}