import { IsEnum, IsInt, IsOptional, IsBoolean, IsString } from 'class-validator';
import { NotificationType } from '../enums/notification-type.enum';

export class CreateConfigDto {

  @IsEnum(NotificationType, {
    message: `event_type must be one of: ${Object.values(NotificationType).join(', ')}`,
  })
  event_type: NotificationType;

  @IsInt()
  role_id: number;

  // Optional description for admin UI
  @IsOptional()
  @IsString()
  description?: string;

  @IsOptional()
  @IsBoolean()
  is_active?: boolean;
}

export class UpdateConfigDto {

  // Toggle on/off without deleting the row
  @IsOptional()
  @IsBoolean()
  is_active?: boolean;

  // Update description
  @IsOptional()
  @IsString()
  description?: string;
}