import { IsIn, IsObject, IsOptional, IsString } from 'class-validator'; /** * DTO for creating a new widget instance on a user's dashboard. * widgetType must be one of the four supported types. * config is optional and defaults to {} on the model. */ export class CreateWidgetDto { @IsString() @IsIn(['clock', 'search', 'calendar', 'note', 'calculator', 'favorites', 'link', 'stopwatch']) widgetType!: string; @IsOptional() @IsObject() config?: Record; }