import { IsArray, IsIn, IsOptional, IsString } from 'class-validator';
import { COMMENT_ENTITY_TYPES, type CommentEntityType } from '../comment.service';

export class CreateCommentDto {
  @IsString()
  actorId!: string;

  @IsIn(COMMENT_ENTITY_TYPES)
  entityType!: CommentEntityType;

  @IsString()
  entityId!: string;

  @IsOptional()
  @IsString()
  entityVersionId?: string;

  @IsOptional()
  @IsString()
  productId?: string;

  @IsOptional()
  @IsString()
  projectId?: string;

  @IsOptional()
  @IsString()
  versionId?: string;

  @IsString()
  content!: string;

  @IsOptional()
  @IsArray()
  @IsString({ each: true })
  mentionMemberIds?: string[];
}
