feat: implement save receipt functionality with transaction handling and DTOs
Test Suite / test (24.15.0) (push) Has been cancelled
Test Suite / test (24.15.0) (push) Has been cancelled
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user