This commit is contained in:
2025-11-30 22:32:08 +03:30
parent 8b4d60618a
commit 03064cfd53
3 changed files with 115 additions and 0 deletions
@@ -0,0 +1,22 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsArray, ValidateNested, ArrayMinSize } from 'class-validator';
import { Type } from 'class-transformer';
import { AddItemToCartDto } from './add-item.dto';
export class BulkAddItemsToCartDto {
@ApiProperty({
description: 'Array of items to add to cart',
type: [AddItemToCartDto],
example: [
{ foodId: 'food-123', quantity: 2 },
{ foodId: 'food-456', quantity: 1 },
],
})
@IsNotEmpty()
@IsArray()
@ArrayMinSize(1, { message: 'At least one item is required' })
@ValidateNested({ each: true })
@Type(() => AddItemToCartDto)
items!: AddItemToCartDto[];
}