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

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

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

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

  @ApiProperty({ format: 'date-time' })
  @IsString()
  joinedAt!: string;
}