23 lines
564 B
TypeScript
23 lines
564 B
TypeScript
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
import { IsInt, IsOptional, IsString, Max, MaxLength, Min } from 'class-validator';
|
|
|
|
export class CreateReviewDto {
|
|
@ApiProperty({ description: 'Rating from 1 to 5', minimum: 1, maximum: 5 })
|
|
@IsInt()
|
|
@Min(1)
|
|
@Max(5)
|
|
rating: number;
|
|
|
|
@ApiPropertyOptional({ description: 'Review title' })
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(120)
|
|
title?: string;
|
|
|
|
@ApiPropertyOptional({ description: 'Review content' })
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(4000)
|
|
content?: string;
|
|
}
|