diff --git a/apps/api/src/app/order/create-order.dto.ts b/apps/api/src/app/order/create-order.dto.ts index 49b193ca5..d4beff752 100644 --- a/apps/api/src/app/order/create-order.dto.ts +++ b/apps/api/src/app/order/create-order.dto.ts @@ -13,6 +13,7 @@ import { IsISO8601, IsNumber, IsOptional, + IsPositive, IsString } from 'class-validator'; import { isString } from 'lodash'; @@ -51,6 +52,7 @@ export class CreateOrderDto { fee: number; @IsNumber() + @IsPositive() quantity: number; @IsString() @@ -64,6 +66,7 @@ export class CreateOrderDto { type: Type; @IsNumber() + @IsPositive() unitPrice: number; @IsBoolean() diff --git a/apps/api/src/app/order/update-order.dto.ts b/apps/api/src/app/order/update-order.dto.ts index a8c33c40e..9dfe52e8d 100644 --- a/apps/api/src/app/order/update-order.dto.ts +++ b/apps/api/src/app/order/update-order.dto.ts @@ -13,6 +13,7 @@ import { IsISO8601, IsNumber, IsOptional, + IsPositive, IsString } from 'class-validator'; import { isString } from 'lodash'; @@ -53,6 +54,7 @@ export class UpdateOrderDto { id: string; @IsNumber() + @IsPositive() quantity: number; @IsString() @@ -66,5 +68,6 @@ export class UpdateOrderDto { type: Type; @IsNumber() + @IsPositive() unitPrice: number; }