39 lines
780 B
TypeScript
39 lines
780 B
TypeScript
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
import {
|
|
IsString,
|
|
IsOptional,
|
|
IsBoolean,
|
|
IsInt,
|
|
IsUUID,
|
|
MinLength,
|
|
MaxLength,
|
|
} from 'class-validator';
|
|
|
|
export class CreateSpecializationDto {
|
|
@ApiProperty({ example: 'uuid-of-category' })
|
|
@IsUUID()
|
|
categoryId: string;
|
|
|
|
@ApiProperty({ example: 'Residential Sales' })
|
|
@IsString()
|
|
@MinLength(2)
|
|
@MaxLength(100)
|
|
name: string;
|
|
|
|
@ApiPropertyOptional({ example: 'Specializing in residential property sales' })
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(500)
|
|
description?: string;
|
|
|
|
@ApiPropertyOptional({ example: true, default: true })
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
isActive?: boolean;
|
|
|
|
@ApiPropertyOptional({ example: 0 })
|
|
@IsOptional()
|
|
@IsInt()
|
|
sortOrder?: number;
|
|
}
|