import {
  IsString,
  IsOptional,
  IsEnum,
  IsInt,
  IsDateString,
  IsUUID,
  MaxLength,
  Min,
} from 'class-validator';
import { SettingStatus } from 'generated/prisma/client'
import { PartialType } from '@nestjs/mapped-types';

export class CreatePricingHeaderDto {
  @IsUUID()
  itemTypeId: string;

  @IsString()
  @MaxLength(50)
  code: string;

  @IsString()
  @MaxLength(100)
  name: string;

  @IsInt()
  @Min(1)
  weight: number;

  @IsString()
  @MaxLength(50)
  unit: string;

  @IsOptional()
  @IsString()
  description?: string;

  @IsOptional()
  @IsEnum(SettingStatus)
  status?: SettingStatus;

  @IsDateString()
  effectiveDate: string;
}

export class UpdatePricingHeaderDto extends PartialType(CreatePricingHeaderDto) {}