Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍
TypeScript angularetffinancefintechghostfoliohacktoberfestinvestingnestjsosspersonal-financeportfolioprismasoftwarestocktrackertradingtypescriptwealth-managementweb
Task/improve symbol validation of create and update order DTO (#8005)
Thomas Kaulf260f1572eca
diff --git a/libs/common/src/lib/dtos/create-order.dto.ts b/libs/common/src/lib/dtos/create-order.dto.tsindex d473e8e7b6..d2374e9b1a 100644--- a/libs/common/src/lib/dtos/create-order.dto.ts+++ b/libs/common/src/lib/dtos/create-order.dto.ts@@ -18,6 +18,7 @@ import {IsBoolean,IsEnum,IsISO8601,+ IsNotEmpty,IsNumber,IsOptional,IsString,@@ -71,8 +72,12 @@ export class CreateOrderDto {@Min(0)quantity: number;+ @IsNotEmpty()@IsString()@MaxLength(SYMBOL_MAXIMUM_LENGTH)+ @Transform(({ value }: TransformFnParams) =>+ isString(value) ? value.trim() : value+ )symbol: string;@ArrayUnique()diff --git a/libs/common/src/lib/dtos/update-order.dto.ts b/libs/common/src/lib/dtos/update-order.dto.tsindex f7dfb0df53..77e4a42286 100644--- a/libs/common/src/lib/dtos/update-order.dto.ts+++ b/libs/common/src/lib/dtos/update-order.dto.ts@@ -17,6 +17,7 @@ import {IsArray,IsEnum,IsISO8601,+ IsNotEmpty,IsNumber,IsOptional,IsString,@@ -72,8 +73,12 @@ export class UpdateOrderDto {@Min(0)quantity: number;+ @IsNotEmpty()@IsString()@MaxLength(SYMBOL_MAXIMUM_LENGTH)+ @Transform(({ value }: TransformFnParams) =>+ isString(value) ? value.trim() : value+ )symbol: string;@ArrayUnique()