Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Bugfix/fix fees on account level (#2588)

Thomas Kaul8a523a981a8f
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 13b2a768bd..8a0f960bac 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## Unreleased
+
+### Fixed
+
+- Loosened the validation in the activities import (expects values greater than or equal to 0 for `fee`, `quantity` and `unitPrice`)
+
## 2.17.0 - 2023-11-02
### Added
diff --git a/apps/api/src/app/order/create-order.dto.ts b/apps/api/src/app/order/create-order.dto.ts
index 3eafa704f8..f25a7ee121 100644
--- a/apps/api/src/app/order/create-order.dto.ts
+++ b/apps/api/src/app/order/create-order.dto.ts
@@ -13,7 +13,6 @@ import {
IsISO8601,
IsNumber,
IsOptional,
- IsPositive,
IsString,
Min
} from 'class-validator';
@@ -54,7 +53,7 @@ export class CreateOrderDto {
fee: number;
@IsNumber()
- @IsPositive()
+ @Min(0)
quantity: number;
@IsString()
@@ -68,7 +67,7 @@ export class CreateOrderDto {
type: Type;
@IsNumber()
- @IsPositive()
+ @Min(0)
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 9d968aa868..3123d5665e 100644
--- a/apps/api/src/app/order/update-order.dto.ts
+++ b/apps/api/src/app/order/update-order.dto.ts
@@ -8,12 +8,10 @@ import {
import { Transform, TransformFnParams } from 'class-transformer';
import {
IsArray,
- IsBoolean,
IsEnum,
IsISO8601,
IsNumber,
IsOptional,
- IsPositive,
IsString,
Min
} from 'class-validator';
@@ -56,7 +54,7 @@ export class UpdateOrderDto {
id: string;
@IsNumber()
- @IsPositive()
+ @Min(0)
quantity: number;
@IsString()
@@ -70,6 +68,6 @@ export class UpdateOrderDto {
type: Type;
@IsNumber()
- @IsPositive()
+ @Min(0)
unitPrice: number;
}