import { ApiPropertyOptional } from '@nestjs/swagger';
import { IsArray, IsEnum, IsOptional, IsString, Length } from 'class-validator';
import { ExperienceLevel } from '../../../common/enums/experience-level.enum';
import { MusicRole } from '../../../common/enums/music-role.enum';

export class MusicSetupDto {
  @ApiPropertyOptional({ enum: MusicRole, isArray: true })
  @IsOptional()
  @IsArray()
  @IsEnum(MusicRole, { each: true })
  musicRoles?: MusicRole[];

  @ApiPropertyOptional({ type: [String], example: ['Tarab', 'Pop'] })
  @IsOptional()
  @IsArray()
  @IsString({ each: true })
  musicGenres?: string[];

  @ApiPropertyOptional({ enum: ExperienceLevel, example: ExperienceLevel.BEGINNER })
  @IsOptional()
  @IsEnum(ExperienceLevel)
  experienceLevel?: ExperienceLevel;

  @ApiPropertyOptional({ type: [String], example: ['Oud', 'Piano'] })
  @IsOptional()
  @IsArray()
  @IsString({ each: true })
  favoriteInstruments?: string[];

  @ApiPropertyOptional({ type: [String], example: ['Bayati', 'Rast'] })
  @IsOptional()
  @IsArray()
  @IsString({ each: true })
  favoriteMaqamat?: string[];

  @ApiPropertyOptional({ example: 'طربي', maxLength: 80 })
  @IsOptional()
  @IsString()
  @Length(0, 80)
  preferredMood?: string;
}
