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

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

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

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

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

  @ApiProperty({ enum: ['planned', 'active', 'completed'] })
  @IsEnum(['planned', 'active', 'completed'])
  status: 'planned' | 'active' | 'completed';

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

  @ApiProperty({ required: false })
  @IsOptional()
  @IsString()
  seasonGroupId?: string;
}