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

export class SponsorshipDetailDTO {
  @ApiProperty()
  @IsString()
  id: string;

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

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

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

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

  @ApiProperty({ required: false })
  @IsOptional()
  @IsDate()
  seasonStartDate?: Date;

  @ApiProperty({ required: false })
  @IsOptional()
  @IsDate()
  seasonEndDate?: Date;

  @ApiProperty({ enum: ['main', 'secondary'] })
  @IsEnum(['main', 'secondary'])
  tier: 'main' | 'secondary';

  @ApiProperty({ enum: ['pending', 'active', 'expired', 'cancelled'] })
  @IsEnum(['pending', 'active', 'expired', 'cancelled'])
  status: 'pending' | 'active' | 'expired' | 'cancelled';

  @ApiProperty()
  pricing: {
    amount: number;
    currency: string;
  };

  @ApiProperty()
  platformFee: {
    amount: number;
    currency: string;
  };

  @ApiProperty()
  netAmount: {
    amount: number;
    currency: string;
  };

  @ApiProperty()
  metrics: {
    drivers: number;
    races: number;
    completedRaces: number;
    impressions: number;
  };

  @ApiProperty()
  createdAt: Date;

  @ApiProperty({ required: false })
  @IsOptional()
  @IsDate()
  activatedAt?: Date;
}