import { ApiPropertyOptional } from '@nestjs/swagger';
import { IsEmail, IsOptional, IsString, IsUrl, MinLength } from 'class-validator';

export class UpdateProfileDto {
  @ApiPropertyOptional({ example: 'Nguyen Van A', description: 'Full name' })
  @IsOptional()
  @IsString()
  @MinLength(1)
  fullName?: string;

  @ApiPropertyOptional({
    example: 'https://cdn.goodgo.vn/avatars/user-123.jpg',
    description: 'Avatar URL',
  })
  @IsOptional()
  @IsString()
  @IsUrl({}, { message: 'Avatar URL không hợp lệ' })
  avatarUrl?: string;

  @ApiPropertyOptional({ example: 'user@example.com', description: 'Email address' })
  @IsOptional()
  @IsEmail({}, { message: 'Email không hợp lệ' })
  email?: string;

  @ApiPropertyOptional({
    example: '0912345678',
    description: 'Vietnamese phone number (will trigger SMS OTP re-verification)',
  })
  @IsOptional()
  @IsString()
  @MinLength(9, { message: 'Số điện thoại không hợp lệ' })
  phoneNumber?: string;
}
