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

class Product {
  @ApiProperty()
  @IsNotEmpty()
  productId: string;

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

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