import { ApiProperty } from '@nestjs/swagger';
import { IsEmail, IsInt, IsOptional, IsString } from 'class-validator';

export class CreateProductDto {
  @ApiProperty()
  @IsString()
  title: string;

  @ApiProperty()
  @IsString()
  description: string;

  @ApiProperty()
  @IsString({
    message: 'price must be a string',
  })
  @IsOptional()
  price: string;

  @ApiProperty()
  @IsInt({
    message: 'stock must be a number',
  })
  @IsOptional()
  stock: number;

  @ApiProperty()
  @IsString({
    message: 'address must be a string',
  })
  @IsOptional()
  address: string;

  @ApiProperty()
  @IsString({
    message: 'address must be a string',
  })
  @IsOptional()
  status: string;

  @ApiProperty()
  @IsOptional()
  userId: number;

  @ApiProperty()
  @IsOptional()
  urlImg: string;
}
