File

src/models/purchase/dto/find-purchases.dto.ts

Description

Describes the information to search for purchases

Index

Properties

Properties

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

Show this amount of purchases per page

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

Show purchases in this page

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

String matching product ID

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

String matching user ID

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

/** Describes the information to search for purchases */
export class FindPurchasesDto {
  /** String matching user ID
   * @example "b0e0c99e-541c-463b-8fd6-306e52f9e686"
   */
  @IsOptional()
  @IsString()
  userId?: string;

  /** String matching product ID
   * @example "26c3fd79-f5bd-4646-a287-32d0226134e2"
   */
  @IsOptional()
  @IsString()
  productId?: string;

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

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

results matching ""

    No results matching ""