Files
gongxue-base/apps/server/src/attendance-devices/dto/attendance-device.dto.ts

62 lines
1.0 KiB
TypeScript

import { IsEnum, IsInt, IsNotEmpty, IsOptional, IsString, MaxLength } from 'class-validator';
import { AttendanceDeviceStatus } from '../../entities/attendance-device.entity';
export class CreateAttendanceDeviceDto {
@IsString()
@IsNotEmpty()
@MaxLength(100)
deviceSn: string;
@IsString()
@IsNotEmpty()
@MaxLength(100)
deviceName: string;
@IsInt()
classroomId: number;
@IsOptional()
@IsEnum(AttendanceDeviceStatus)
status?: AttendanceDeviceStatus;
@IsOptional()
@IsString()
@MaxLength(200)
location?: string;
@IsOptional()
@IsString()
notes?: string;
}
export class UpdateAttendanceDeviceDto {
@IsOptional()
@IsString()
@IsNotEmpty()
@MaxLength(100)
deviceSn?: string;
@IsOptional()
@IsString()
@IsNotEmpty()
@MaxLength(100)
deviceName?: string;
@IsOptional()
@IsInt()
classroomId?: number;
@IsOptional()
@IsEnum(AttendanceDeviceStatus)
status?: AttendanceDeviceStatus;
@IsOptional()
@IsString()
@MaxLength(200)
location?: string;
@IsOptional()
@IsString()
notes?: string;
}