import { IsOptional, IsString, IsEnum, IsInt, Min, Max } from 'class-validator';
import { Type } from 'class-transformer';
import { RegistrationState } from './review-registration.dto';

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

  @IsInt()
  @Min(1)
  @Max(100)
  @Type(() => Number)
  @IsOptional()
  pageSize?: number = 10;

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

  @IsEnum(RegistrationState)
  @IsOptional()
  registrationState?: RegistrationState;

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

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

  @IsString()
  @IsOptional()
  participantType?: string; // self / child

  @IsString()
  @IsOptional()
  keyword?: string; // 搜索参与者姓名、手机号、子女姓名
}

