import { Type } from 'class-transformer';
import { ArrayMaxSize, IsArray, IsBoolean, IsIn, IsNotEmpty, IsOptional, IsString, Length, Max, Min } from 'class-validator';

export class UpdateSocialProfileDto {
  @IsOptional()
  @IsString()
  @Length(1, 50)
  nickname?: string;

  @IsOptional()
  @IsString()
  @Length(0, 160)
  bio?: string;

  @IsOptional()
  @IsArray()
  @ArrayMaxSize(3)
  @IsString({ each: true })
  interests?: string[];
}

export class SocialUserActionDto {
  @IsString()
  @IsNotEmpty()
  userId: string;
}

export class CreateBlockDto extends SocialUserActionDto {}

export class CreateReportDto extends SocialUserActionDto {
  @IsString()
  @IsIn(['harassment', 'spam', 'inappropriate_content', 'impersonation', 'other'])
  reason: string;

  @IsOptional()
  @IsString()
  @Length(0, 500)
  note?: string;

  @IsOptional()
  @IsString()
  messageId?: string;

  @IsOptional()
  @IsBoolean()
  blockAlso?: boolean;
}

export class PaginationDto {
  @IsOptional()
  @Type(() => Number)
  @Min(1)
  @Max(100)
  limit?: number = 30;

  @IsOptional()
  @IsString()
  before?: string;
}

export class TravelDestinationDto {
  @IsString()
  @IsNotEmpty()
  destinationId: string;
}
