src/models/product/dto/find-products.dto.ts
Describes the information to search for products
Properties |
|
Optional offset |
Type : number
|
Decorators :
@IsOptional()
|
Show this amount of products per page
|
Optional page |
Type : number
|
Decorators :
@IsOptional()
|
Show products in this page
|
Optional productName |
Type : string
|
Decorators :
@IsOptional()
|
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;
}