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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  @ApiProperty({ type: Object })
  seasonDates: {
    start: string;
    end: string;
  } = { start: '', end: '' };

  @ApiProperty({ type: Object, required: false })
  @IsOptional()
  nextRace?: {
    name: string;
    date: string;
  };

  @ApiProperty({ type: Object })
  sponsorSlots: {
    main: {
      available: boolean;
      price: number;
      benefits: string[];
    };
    secondary: {
      available: number;
      total: number;
      price: number;
      benefits: string[];
    };
  } = {
    main: { available: false, price: 0, benefits: [] },
    secondary: { available: 0, total: 0, price: 0, benefits: [] }
  };
}