28 lines
559 B
TypeScript
28 lines
559 B
TypeScript
import { ApiProperty, PickType } from '@nestjs/swagger';
|
|
import { IsNumber, IsString, MaxLength, MinLength } from 'class-validator';
|
|
import { Building } from 'src/objects/building/entities/building.entity';
|
|
|
|
export class CreateBuildingRequestDto extends PickType(Building, [
|
|
'displayName',
|
|
'address',
|
|
'color',
|
|
]) {
|
|
@ApiProperty()
|
|
@IsNumber()
|
|
group: number;
|
|
|
|
@ApiProperty()
|
|
@IsString()
|
|
displayName: string;
|
|
|
|
@ApiProperty()
|
|
@IsString()
|
|
address: string;
|
|
|
|
@ApiProperty()
|
|
@IsString()
|
|
@MinLength(4)
|
|
@MaxLength(16)
|
|
color: string;
|
|
}
|