import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import {
  IsNotEmpty,
  IsNumber,
  IsOptional,
  IsString,
  MaxLength,
  Min,
} from "class-validator";

export class AddLineaDto {
  @ApiProperty({ description: "PLU del producto (maeplu)" })
  @IsNotEmpty()
  @IsString()
  @MaxLength(24)
  plu: string;

  @ApiPropertyOptional({ description: "Cantidad", default: 1 })
  @IsOptional()
  @IsNumber()
  @Min(0.001)
  cantidad?: number;
}
