184 lines
2.8 KiB
TypeScript
184 lines
2.8 KiB
TypeScript
import {
|
|
IsArray,
|
|
IsOptional,
|
|
IsString,
|
|
IsInt,
|
|
IsDateString,
|
|
IsIn,
|
|
ValidateNested,
|
|
IsNotEmpty,
|
|
} from 'class-validator';
|
|
import { Type } from 'class-transformer';
|
|
|
|
export class AttendanceRecordItem {
|
|
@IsInt()
|
|
@IsNotEmpty()
|
|
studentId: number;
|
|
|
|
@IsOptional()
|
|
@IsInt()
|
|
classId?: number;
|
|
|
|
@IsDateString()
|
|
@IsNotEmpty()
|
|
attendanceDate: string;
|
|
|
|
@IsString()
|
|
@IsIn(['morning_reading', 'morning', 'afternoon', 'evening_study', 'night_check'])
|
|
@IsNotEmpty()
|
|
session: string;
|
|
|
|
@IsString()
|
|
@IsIn(['present', 'late', 'absent', 'leave'])
|
|
@IsNotEmpty()
|
|
status: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
remark?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
source?: string;
|
|
}
|
|
|
|
export class BatchCreateAttendanceDto {
|
|
@IsArray()
|
|
@ValidateNested({ each: true })
|
|
@Type(() => AttendanceRecordItem)
|
|
records: AttendanceRecordItem[];
|
|
}
|
|
|
|
export class AttendanceSummaryQueryDto {
|
|
@IsOptional()
|
|
@IsInt()
|
|
@Type(() => Number)
|
|
classId?: number;
|
|
|
|
@IsOptional()
|
|
@IsDateString()
|
|
dateFrom?: string;
|
|
|
|
@IsOptional()
|
|
@IsDateString()
|
|
dateTo?: string;
|
|
}
|
|
|
|
export class AttendanceCalendarQueryDto {
|
|
@IsInt()
|
|
@Type(() => Number)
|
|
@IsNotEmpty()
|
|
classId: number;
|
|
|
|
@IsOptional()
|
|
@IsDateString()
|
|
weekStart?: string;
|
|
}
|
|
|
|
export class QueryDingRawDto {
|
|
@IsOptional()
|
|
@IsString()
|
|
@IsIn(['未处理', '已匹配', '待匹配'])
|
|
matchStatus?: string;
|
|
}
|
|
|
|
export class QueryAttendanceRecordsDto {
|
|
@IsOptional()
|
|
@IsInt()
|
|
@Type(() => Number)
|
|
classId?: number;
|
|
|
|
@IsOptional()
|
|
@IsDateString()
|
|
dateFrom?: string;
|
|
|
|
@IsOptional()
|
|
@IsDateString()
|
|
dateTo?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
session?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@IsIn(['present', 'late', 'absent', 'leave'])
|
|
status?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
source?: string;
|
|
|
|
@IsOptional()
|
|
@IsInt()
|
|
@Type(() => Number)
|
|
page?: number;
|
|
|
|
@IsOptional()
|
|
@IsInt()
|
|
@Type(() => Number)
|
|
pageSize?: number;
|
|
}
|
|
|
|
export class MatchDingRecordDto {
|
|
@IsInt()
|
|
@IsNotEmpty()
|
|
studentId: number;
|
|
}
|
|
|
|
export class UpdateAttendanceRecordDto {
|
|
@IsOptional()
|
|
@IsString()
|
|
@IsIn(['present', 'late', 'absent', 'leave'])
|
|
status?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
remark?: string;
|
|
}
|
|
|
|
export class AttendanceReportQueryDto {
|
|
@IsOptional()
|
|
@IsInt()
|
|
@Type(() => Number)
|
|
classId?: number;
|
|
|
|
@IsOptional()
|
|
@IsDateString()
|
|
dateFrom?: string;
|
|
|
|
@IsOptional()
|
|
@IsDateString()
|
|
dateTo?: string;
|
|
}
|
|
|
|
export class GenerateAttendanceFromSchedulesDto {
|
|
@IsInt()
|
|
@Type(() => Number)
|
|
@IsNotEmpty()
|
|
classId: number;
|
|
|
|
@IsDateString()
|
|
@IsNotEmpty()
|
|
dateFrom: string;
|
|
|
|
@IsDateString()
|
|
@IsNotEmpty()
|
|
dateTo: string;
|
|
}
|
|
|
|
export class GenerateFromSchedulesDto {
|
|
@IsInt()
|
|
@Type(() => Number)
|
|
@IsNotEmpty()
|
|
classId: number;
|
|
|
|
@IsOptional()
|
|
@IsDateString()
|
|
startDate?: string;
|
|
|
|
@IsOptional()
|
|
@IsDateString()
|
|
endDate?: string;
|
|
}
|