import { IsDefined, IsNotEmpty, IsObject, IsString, ValidateNested } from "class-validator";
import { Type } from "class-transformer";

export class LightBulbForUserRoomDto {
  @IsString()
  @IsNotEmpty()
  type: string;

  @IsString()
  @IsNotEmpty()
  powerRating: string;

  @IsString()
  @IsNotEmpty()
  noOfBulbs: string;

  @IsString()
  @IsNotEmpty()
  operatingHours: string;
}

export class CreateLightBulbForUserRoomDto {
  @ValidateNested({ each: true })
  @IsObject({ each: true })
  @IsNotEmpty({ each: true })
  @IsDefined()
  @Type(() => LightBulbForUserRoomDto)
  lightBulbs: LightBulbForUserRoomDto[];
}
