import { ApiProperty } from "@nestjs/swagger";
import { Type } from "class-transformer";
import { IsArray, IsNumber, IsObject, IsUUID, ValidateNested } from "class-validator";

class MonthDto {
    @IsNumber()
    month: number

    @IsNumber()
    value: number
}

export class CreateLimitDto {
    @ApiProperty({ format: 'uuid' })
    @IsUUID()
    id_boiler: string

    @ApiProperty()
    @IsNumber()
    id_fuel: number

    @ApiProperty()
    @IsNumber()
    year: number

    @ApiProperty()
    @IsArray()
    @ValidateNested({ each: true })
    @Type(() => MonthDto)
    months: MonthDto[]
}