import { IsOptional, IsString, IsInt, IsArray } from 'class-validator';
import { Type } from 'class-transformer';

export class QuerySubmissionDto {
  @IsOptional()
  @Type(() => Number)
  @IsInt()
  page?: number = 1;

  @IsOptional()
  @Type(() => Number)
  @IsInt()
  pageSize?: number = 10;

  @IsOptional()
  @Type(() => Number)
  @IsInt()
  homeworkId?: number;

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

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

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

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

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

  @IsOptional()
  @IsArray()
  @Type(() => Number)
  classIds?: number[];

  @IsOptional()
  @Type(() => Number)
  @IsInt()
  gradeId?: number;
}
