Merge branch 'feat/add-product-space' into feat/add-space-position

This commit is contained in:
hannathkadher
2024-11-20 21:46:33 +04:00
38 changed files with 821 additions and 23 deletions
+17
View File
@@ -1,11 +1,14 @@
import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import {
IsArray,
IsBoolean,
IsNotEmpty,
IsNumber,
IsOptional,
IsString,
IsUUID,
ValidateNested,
} from 'class-validator';
export class AddSpaceDto {
@@ -50,6 +53,11 @@ export class AddSpaceDto {
@IsString()
@IsOptional()
direction: string;
@IsArray()
@ValidateNested({ each: true })
@Type(() => ProductAssignmentDto)
products: ProductAssignmentDto[];
}
export class AddUserSpaceDto {
@@ -87,7 +95,16 @@ export class AddUserSpaceUsingCodeDto {
@IsString()
@IsNotEmpty()
public inviteCode: string;
constructor(dto: Partial<AddUserSpaceDto>) {
Object.assign(this, dto);
}
}
class ProductAssignmentDto {
@IsNotEmpty()
productId: string;
@IsNotEmpty()
count: number;
}