import { ApiProperty } from '@nestjs/swagger';
import { IsDateString, IsEnum, IsNumber, IsOptional, IsString } from 'class-validator';

export class AvailableLeagueDTO {
  @ApiProperty()
  @IsString()
  id: string = '';

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

  @ApiProperty()
  @IsString()
  game: string = '';

  @ApiProperty()
  @IsNumber()
  drivers: number = 0;

  @ApiProperty()
  @IsNumber()
  avgViewsPerRace: number = 0;

  @ApiProperty({ type: Object })
  mainSponsorSlot: {
    available: boolean;
    price: number;
  } = { available: false, price: 0 };

  @ApiProperty({ type: Object })
  secondarySlots: {
    available: number;
    total: number;
    price: number;
  } = { available: 0, total: 0, price: 0 };

  @ApiProperty()
  @IsNumber()
  rating: number = 0;

  @ApiProperty({ enum: ['premium', 'standard', 'starter'] })
  @IsEnum(['premium', 'standard', 'starter'])
  tier: 'premium' | 'standard' | 'starter' = 'standard';

  @ApiProperty({ required: false })
  @IsOptional()
  @IsDateString()
  nextRace?: string;

  @ApiProperty({ enum: ['active', 'upcoming', 'completed'] })
  @IsEnum(['active', 'upcoming', 'completed'])
  seasonStatus: 'active' | 'upcoming' | 'completed' = 'active';

  @ApiProperty()
  @IsString()
  description: string = '';
}