import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { IsNotEmpty, IsOptional, ValidateNested } from 'class-validator';

class MakerBrand {
  @ApiProperty()
  @IsNotEmpty()
  makerBrandId: number;

  @ApiProperty()
  @IsOptional()
  wagePrice?: number;
}

export class ProductMakerBrandDto {
  @ApiProperty({ type: [MakerBrand] })
  @IsNotEmpty()
  @ValidateNested({ each: true })
  @Type(() => MakerBrand)
  mappings: MakerBrand[];
}
