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

export class AppleLoginDto {
  @ApiProperty({ description: 'Flutter sign_in_with_apple 返回的 Identity Token（JWT 格式）' })
  @IsString()
  @Length(1, 2000)
  identityToken: string;

  @ApiPropertyOptional({ description: '用户显示名（Apple 首次授权时返回，之后不再提供）' })
  @IsOptional()
  @IsString()
  @Length(1, 50)
  displayName?: string;

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

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