refactor cart
This commit is contained in:
@@ -1,7 +1,19 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNotEmpty, IsArray, ValidateNested, ArrayMinSize } from 'class-validator';
|
||||
import { IsNotEmpty, IsArray, ValidateNested, ArrayMinSize, IsNumber, Min, IsString } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { AddItemToCartDto } from './add-item.dto';
|
||||
|
||||
class AddItemToCartDto {
|
||||
@ApiProperty({ description: 'Quantity of the food item', example: 1, minimum: 1 })
|
||||
@IsNotEmpty()
|
||||
@IsNumber()
|
||||
@Min(1)
|
||||
quantity!: number;
|
||||
|
||||
@ApiProperty({ description: 'Food ID' })
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
foodId!: string;
|
||||
}
|
||||
|
||||
export class BulkAddItemsToCartDto {
|
||||
@ApiProperty({
|
||||
|
||||
Reference in New Issue
Block a user