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

export class AlipayLoginDto {
  @ApiProperty({ description: '支付宝 SDK 返回的 auth_code（一次性，3分钟有效）' })
  @IsString()
  @Length(1, 200)
  authCode: string;

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

  @ApiPropertyOptional({ description: '设备信息（型号/OS 版本等）' })
  @IsOptional()
  @IsString()
  deviceInfo?: string;
}
