This commit is contained in:
2026-02-08 08:50:08 +03:30
commit 8af4936ed0
323 changed files with 92747 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsString, IsArray, ValidateNested, IsInt, Min } from 'class-validator';
import { Type } from 'class-transformer';
export class CartItemDto {
@ApiProperty({ description: 'Food ID' })
@IsNotEmpty()
@IsString()
foodId!: string;
@ApiProperty({ description: 'Quantity of the food item', example: 2, minimum: 1 })
@IsNotEmpty()
@Type(() => Number)
@IsInt()
@Min(1)
quantity!: number;
}
export class CreateCartDto {
@ApiProperty({
description: 'List of cart items',
type: [CartItemDto],
})
@IsNotEmpty()
@IsArray()
@ValidateNested({ each: true })
@Type(() => CartItemDto)
items!: CartItemDto[];
}