import { ApiProperty } from '@nestjs/swagger';
import { IsEnum, IsIn, IsMongoId, IsOptional } from 'class-validator';
import { ReactionType } from '../../../common/enums/reaction-type.enum';

export class ToggleLikeDto {
  @ApiProperty()
  @IsMongoId()
  targetId!: string;

  @ApiProperty({ enum: ['post', 'comment'] })
  @IsIn(['post', 'comment'])
  targetType!: 'post' | 'comment';

  @ApiProperty({ enum: ReactionType, required: false, default: ReactionType.LIKE })
  @IsOptional()
  @IsEnum(ReactionType)
  reactionType?: ReactionType;
}
