import { IsIn, IsObject, IsOptional, IsString } from 'class-validator';
import { NOTIFICATION_TYPES, type NotificationType } from '../notification.service';

export class CreateNotificationDto {
  @IsString()
  recipientId!: string;

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

  @IsIn(NOTIFICATION_TYPES)
  type!: NotificationType;

  @IsString()
  title!: string;

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

  @IsString()
  resourceType!: string;

  @IsString()
  resourceId!: string;

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

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

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

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

  @IsOptional()
  @IsObject()
  metadata?: Record<string, unknown>;
}
