import { IsString, IsNotEmpty, MaxLength, IsNumber, IsBoolean, IsOptional } from 'class-validator'
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'

export class GrantCommunityDto {
  @ApiProperty({ description: '用户ID' })
  @IsString()
  @IsNotEmpty({ message: '用户ID不能为空' })
  userId: string

  @ApiProperty({ description: '账户序列号' })
  @IsString()
  @IsNotEmpty({ message: '账户序列号不能为空' })
  accountSequence: string

  @ApiProperty({ description: '社区名称', example: '深圳社区' })
  @IsString()
  @IsNotEmpty({ message: '社区名称不能为空' })
  @MaxLength(100, { message: '社区名称最大100字符' })
  communityName: string

  @ApiPropertyOptional({ description: '是否跳过考核直接激活权益', default: false })
  @IsBoolean()
  @IsOptional()
  skipAssessment?: boolean
}
