File

src/models/purchase/dto/review-purchase.dto.ts

Description

Describes the fields needed to review a Purchase

Index

Properties

Properties

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

Product review comment

reviewNote
Type : number
Decorators :
@IsInt()
@Min(1)
@Max(5)

Product review note, from 1 to 5

import { PickType } from '@nestjs/swagger';
import { IsInt, IsOptional, IsString, Max, Min } from 'class-validator';
import { Purchase } from '../entities/purchase.entity';

/** Describes the fields needed to review a Purchase */
export class ReviewPurchaseDto extends PickType(Purchase, [
  'reviewNote',
  'reviewComment',
]) {
  /** Product review note, from 1 to 5
   * @example 5
   */
  @IsInt()
  @Min(1)
  @Max(5)
  reviewNote: number;

  /** Product review comment
   * @example "Amazing wheelchair!"
   */
  @IsString()
  @IsOptional()
  reviewComment?: string;
}

results matching ""

    No results matching ""