import { IsOptional, IsString, Matches } from 'class-validator';

export class FilterAttendanceDto {
    @IsOptional()
    @IsString()
    classId?: string;

    @IsOptional()
    @IsString()
    sectionId?: string;

    @IsOptional()
    @IsString()
    @Matches(/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, {
        message: 'date must be in YYYY-MM-DD format',
    })
    date?: string; // 'YYYY-MM-DD'

    @IsOptional()
    @IsString()
    academicYearId?: string;
}
