mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 22:04:53 +00:00
added space product service
This commit is contained in:
@ -1,10 +1,13 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Type } from 'class-transformer';
|
||||
import {
|
||||
IsArray,
|
||||
IsBoolean,
|
||||
IsNotEmpty,
|
||||
IsOptional,
|
||||
IsString,
|
||||
IsUUID,
|
||||
ValidateNested,
|
||||
} from 'class-validator';
|
||||
|
||||
export class AddSpaceDto {
|
||||
@ -32,6 +35,11 @@ export class AddSpaceDto {
|
||||
})
|
||||
@IsBoolean()
|
||||
isPrivate: boolean;
|
||||
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => ProductAssignmentDto)
|
||||
products: ProductAssignmentDto[];
|
||||
}
|
||||
|
||||
export class AddUserSpaceDto {
|
||||
@ -69,7 +77,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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user