feat: implement save receipt functionality with transaction handling and DTOs
Test Suite / test (24.15.0) (push) Has been cancelled

This commit is contained in:
Nils-Johan Gynther
2026-05-09 15:04:23 +02:00
parent 853e853e5e
commit 8354abbc8f
10 changed files with 461 additions and 99 deletions
+1 -12
View File
@@ -1,9 +1,8 @@
import { IsNotEmpty, IsNumber, IsOptional, IsString, MaxLength } from 'class-validator';
import { IsNumber, IsOptional, IsString, MaxLength } from 'class-validator';
export class UpdateProductDto {
@IsOptional()
@IsString()
@IsNotEmpty()
@MaxLength(191)
name?: string;
@@ -12,16 +11,6 @@ export class UpdateProductDto {
@MaxLength(191)
canonicalName?: string;
@IsOptional()
@IsString()
@MaxLength(191)
category?: string;
@IsOptional()
@IsString()
@MaxLength(191)
subcategory?: string;
@IsOptional()
@IsNumber()
categoryId?: number | null;
-4
View File
@@ -188,10 +188,6 @@ export class ProductsService {
updateData.canonicalName = data.canonicalName.trim() || undefined;
}
if (typeof data.category === 'string') {
updateData.category = data.category.trim() || null;
}
if ('categoryId' in data) {
updateData.categoryId = data.categoryId ?? null;
}