From 8a523a981a8f1a871a5041176a61cd74c65aaac9 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 4 Nov 2023 10:17:58 +0100 Subject: [PATCH] Bugfix/fix fees on account level (#2588) * Fix fees on account level * Update changelog --- CHANGELOG.md | 6 ++++++ apps/api/src/app/order/create-order.dto.ts | 5 ++--- apps/api/src/app/order/update-order.dto.ts | 6 ++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13b2a768b..8a0f960ba 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 3eafa704f..f25a7ee12 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 9d968aa86..3123d5665 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; }