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

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

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

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

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

  @Allow()
  airConditionerId: string;
}

export class CreateAirConditionerForUserRoomDto {
  @ValidateNested({ each: true })
  @IsObject({ each: true })
  @IsDefined()
  @Type(() => AirConditionerForUserRoomDto)
  airConditioners: AirConditionerForUserRoomDto[];
}
