fixed dtos

This commit is contained in:
hannathkadher
2024-12-20 08:03:25 +04:00
parent 7a82d88aa5
commit 038f93f16a

View File

@ -6,6 +6,7 @@ import {
ValidateNested,
IsInt,
ArrayNotEmpty,
IsOptional,
} from 'class-validator';
import { Type } from 'class-transformer';
import { CreateProductItemModelDto } from './create-space-product-item-model.dto';
@ -65,3 +66,23 @@ export class UpdateSpaceProductModelDto {
@Type(() => CreateProductItemModelDto)
items: CreateProductItemModelDto[];
}
export class ModifyProductItemModelDto {
@IsArray()
@ApiProperty({
description: 'Create the product model ',
type: [CreateSpaceProductModelDto],
})
@ValidateNested({ each: true })
@IsOptional()
add?: CreateSpaceProductModelDto[];
@IsArray()
@ApiProperty({
description: 'Update the product model ',
type: [UpdateSpaceProductModelDto],
})
@ValidateNested({ each: true })
@IsOptional()
update?: UpdateSpaceProductModelDto[];
}