This commit is contained in:
2025-11-25 11:26:33 +03:30
parent d737b3dc24
commit e21abda0ce
7 changed files with 67 additions and 69 deletions
+9 -5
View File
@@ -1,8 +1,12 @@
import { IsBoolean, IsOptional, IsString, IsNumber, IsArray } from 'class-validator';
import { ApiPropertyOptional } from '@nestjs/swagger';
import { IsBoolean, IsOptional, IsString, IsNumber, IsArray, IsNotEmpty } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { Type } from 'class-transformer';
export class CreateFoodDto {
@IsNotEmpty()
@IsString()
@ApiProperty({ example: '123e4567-e89b-12d3-a456-426614174000' })
categoryId: string;
@IsOptional()
@IsBoolean()
@ApiPropertyOptional({ example: false })
@@ -92,7 +96,7 @@ export class CreateFoodDto {
@ApiPropertyOptional({ example: true })
@Type(() => Boolean)
dinner?: boolean;
@IsOptional()
@IsNumber()
@Type(() => Number)
@@ -128,13 +132,13 @@ export class CreateFoodDto {
@ApiPropertyOptional({ example: false })
@Type(() => Boolean)
pickupServe?: boolean;
@IsOptional()
@IsNumber()
@Type(() => Number)
@ApiPropertyOptional({ example: 0 })
discount?: number;
@IsOptional()
@IsArray()
@IsString({ each: true })