import { ApiProperty } from '@nestjs/swagger'
import { IsEnum, IsInt, Min } from 'class-validator'
import { Transform } from 'class-transformer'
import { Platform } from '@/domain/enums/platform.enum'

export class CheckUpdateDto {
  @ApiProperty({ enum: ['android', 'ios', 'ANDROID', 'IOS'], description: '平台类型' })
  @Transform(({ value }) => (typeof value === 'string' ? value.toUpperCase() : value))
  @IsEnum(Platform)
  platform: Platform

  @ApiProperty({ description: '当前版本号', example: 100 })
  @IsInt()
  @Min(1)
  currentVersionCode: number
}
