import { IsString, Length, IsOptional } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';

export class GoogleLoginDto {
  @ApiProperty({ description: 'Flutter google_sign_in 返回的 ID Token（JWT 格式）' })
  @IsString()
  @Length(1, 2000)
  idToken: string;

  @ApiPropertyOptional({ description: '推荐码（仅新用户注册时有效）' })
  @IsOptional()
  @IsString()
  @Length(1, 20)
  referralCode?: string;

  @ApiPropertyOptional({ description: '设备信息' })
  @IsOptional()
  @IsString()
  deviceInfo?: string;
}
