import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { IsBoolean, IsDate, IsNumber, IsOptional, IsString } from 'class-validator';

export class LeagueSeasonSummaryDTO {
  @ApiProperty()
  @IsString()
  seasonId!: string;

  @ApiProperty()
  @IsString()
  name!: string;

  @ApiProperty()
  @IsString()
  status!: string;

  @ApiProperty({ required: false })
  @IsOptional()
  @IsDate()
  @Type(() => Date)
  startDate?: Date;

  @ApiProperty({ required: false })
  @IsOptional()
  @IsDate()
  @Type(() => Date)
  endDate?: Date;

  @ApiProperty()
  @IsBoolean()
  isPrimary!: boolean;

  @ApiProperty()
  @IsBoolean()
  isParallelActive!: boolean;

  @ApiProperty()
  @IsNumber()
  totalRaces!: number;

  @ApiProperty()
  @IsNumber()
  completedRaces!: number;

  @ApiProperty({ required: false })
  @IsOptional()
  @IsDate()
  @Type(() => Date)
  nextRaceAt?: Date;
}