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

export class MarkAttendanceDto {
    @IsString()
    @IsNotEmpty()
    studentId: string;

    @IsString()
    @IsNotEmpty()
    @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'

    @IsIn(['present', 'absent'])
    status: 'present' | 'absent';
}
