fashionAvenue / server / src / products / dto / create-product.dto.ts
create-product.dto.ts
Raw
import { IsNotEmpty, IsNumber, IsOptional, IsString } from 'class-validator';

export class CreateProductDto {
  @IsNotEmpty()
  @IsString()
  name: string;

  @IsNotEmpty()
  @IsString()
  gender: string;

  @IsNotEmpty()
  @IsString()
  category: string;

  @IsNotEmpty()
  @IsString()
  subcategory: string;

  @IsOptional()
  @IsString()
  color: string;

  @IsOptional()
  @IsString()
  season: string;

  @IsOptional()
  @IsString()
  usage: string;

  @IsOptional()
  @IsString()
  image: string;

  @IsNotEmpty()
  @IsNumber()
  price: number;
}