34 lines
432 B
TypeScript
34 lines
432 B
TypeScript
import {
|
|
IsNotEmpty,
|
|
IsNumber,
|
|
IsOptional,
|
|
IsString,
|
|
IsUUID,
|
|
} from 'class-validator';
|
|
|
|
export class CreateItemDto {
|
|
@IsNotEmpty()
|
|
@IsString()
|
|
name: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
description?: string;
|
|
|
|
@IsNotEmpty()
|
|
@IsNumber()
|
|
price: number;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
image?: string;
|
|
|
|
@IsOptional()
|
|
@IsUUID()
|
|
categoryId?: string;
|
|
|
|
@IsNotEmpty()
|
|
@IsUUID()
|
|
restaurantId: string;
|
|
}
|