forked from wangziqi/gongxue-base
59 lines
948 B
TypeScript
59 lines
948 B
TypeScript
import { IsOptional, IsString, IsNotEmpty, IsInt, IsEnum } from 'class-validator';
|
|
import { ClassroomStatus } from '../../entities/classroom.entity';
|
|
|
|
export class CreateClassroomDto {
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
name: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
building?: string;
|
|
|
|
@IsOptional()
|
|
@IsInt()
|
|
floor?: number;
|
|
|
|
@IsOptional()
|
|
@IsInt()
|
|
capacity?: number;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
roomType?: string; // 大 / 次大 / 小
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
notes?: string;
|
|
}
|
|
|
|
export class UpdateClassroomDto {
|
|
@IsOptional()
|
|
@IsString()
|
|
name?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
building?: string;
|
|
|
|
@IsOptional()
|
|
@IsInt()
|
|
floor?: number;
|
|
|
|
@IsOptional()
|
|
@IsInt()
|
|
capacity?: number;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
roomType?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
notes?: string;
|
|
|
|
@IsOptional()
|
|
@IsEnum([ClassroomStatus.AVAILABLE, ClassroomStatus.MAINTENANCE])
|
|
status?: ClassroomStatus;
|
|
}
|