import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsDate, IsEnum, ValidateNested } from 'class-validator';
import { Type } from 'class-transformer';
import { DriverDto } from '../../driver/dto/DriverDto';

export class LeagueMemberDTO {
  @ApiProperty()
  @IsString()
  driverId: string;

  @ApiProperty({ type: () => DriverDto })
  @ValidateNested()
  @Type(() => DriverDto)
  driver: DriverDto;

  @ApiProperty({ enum: ['owner', 'manager', 'member'] })
  @IsEnum(['owner', 'manager', 'member'])
  role: 'owner' | 'manager' | 'member';

  @ApiProperty()
  @IsDate()
  @Type(() => Date)
  joinedAt: Date;
}