This commit is contained in:
2025-12-07 00:03:32 +03:30
parent eb48187ad0
commit f2ae0fe020
10 changed files with 486 additions and 0 deletions
@@ -0,0 +1,24 @@
import { IsNotEmpty, IsNumber, IsOptional, IsString, Max, Min } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { Type } from 'class-transformer';
export class CreateFoodCommentDto {
@IsNotEmpty()
@IsString()
@ApiProperty({ description: 'Food ID' })
foodId: string;
@IsNotEmpty()
@IsNumber()
@Min(1)
@Max(5)
@Type(() => Number)
@ApiProperty({ description: 'Rating from 1 to 5', example: 5, minimum: 1, maximum: 5 })
rating: number;
@IsOptional()
@IsString()
@ApiPropertyOptional({ description: 'Comment text', example: 'Very delicious food!' })
comment?: string;
}