import { ApiPropertyOptional } from '@nestjs/swagger';
import { DesignTemplateScope } from '@prisma/client';
import { IsEnum, IsObject, IsOptional, IsString } from 'class-validator';

export class UpdateTemplateDto {
  @ApiPropertyOptional({ example: 'Updated template name' })
  @IsOptional()
  @IsString()
  name?: string;

  @ApiPropertyOptional({ enum: DesignTemplateScope })
  @IsOptional()
  @IsEnum(DesignTemplateScope)
  scope?: DesignTemplateScope;

  @ApiPropertyOptional({ description: 'Design JSON from designer' })
  @IsOptional()
  @IsObject()
  design?: unknown;
}
