File

src/models/product/dto/find-products.dto.ts

Description

Describes the information to search for products

Index

Properties

Properties

Optional offset
Type : number
Decorators :
@IsOptional()
@Type(undefined)
@IsInt()
@IsPositive()

Show this amount of products per page

Optional page
Type : number
Decorators :
@IsOptional()
@Type(undefined)
@IsInt()
@IsPositive()

Show products in this page

Optional productName
Type : string
Decorators :
@IsOptional()
@IsString()

String containing in product name

import { Type } from 'class-transformer';
import { IsInt, IsOptional, IsPositive, IsString } from 'class-validator';

/** Describes the information to search for products */
export class FindProductsDto {
  /** String containing in product name
   * @example "chair"
   */
  @IsOptional()
  @IsString()
  productName?: string;

  /** Show products in this page
   * @example 1
   */
  @IsOptional()
  @Type(() => Number)
  @IsInt()
  @IsPositive()
  page?: number;

  /** Show this amount of products per page
   * @example 10
   */
  @IsOptional()
  @Type(() => Number)
  @IsInt()
  @IsPositive()
  offset?: number;
}

results matching ""

    No results matching ""