import { Type } from 'class-transformer';
import {
  IsIn,
  IsInt,
  IsNumber,
  IsOptional,
  IsString,
  MaxLength,
  Min,
} from 'class-validator';

export class CreateFlyerSelectionDto {
  @Type(() => Number)
  @IsInt()
  @Min(1)
  itemId!: number;

  @IsOptional()
  @Type(() => Number)
  @IsNumber({ maxDecimalPlaces: 2 })
  @Min(0)
  plannedQuantity?: number;

  @IsOptional()
  @IsString()
  @MaxLength(24)
  plannedUnit?: string;

  @IsOptional()
  @IsString()
  @IsIn(['low', 'normal', 'high'])
  priority?: string;

  @IsOptional()
  @IsString()
  @MaxLength(500)
  note?: string;
}
