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

export class OtherAppForUserRoomDto {
  @IsString()
  @IsNotEmpty()
  applianceName: string;

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

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

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

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

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

  @Allow()
  appliance_id: string;
}

export class CreateOtherAppForUserRoomDto {
  @ValidateNested({ each: true })
  @IsObject({ each: true })
  @IsDefined({ each: true })
  @Type(() => OtherAppForUserRoomDto)
  otherApp: OtherAppForUserRoomDto[];
}
