mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-16 02:36:19 +00:00
changed name of dtos
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNotEmpty, IsString, IsArray, ValidateNested } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { CreateSubspaceModelDto } from './create-subspace-model.dto';
|
||||
import { CreateSubspaceModelDto } from './subspaces-model-dtos/create-subspace-model.dto';
|
||||
import { CreateSpaceProductModelDto } from './create-space-product-model.dto';
|
||||
|
||||
export class CreateSpaceModelDto {
|
||||
|
@ -37,3 +37,31 @@ export class CreateSpaceProductModelDto {
|
||||
@Type(() => CreateProductItemModelDto)
|
||||
items: CreateProductItemModelDto[];
|
||||
}
|
||||
|
||||
export class UpdateSpaceProductModelDto {
|
||||
@ApiProperty({
|
||||
description: 'ID of the product model',
|
||||
example: 'product-uuid',
|
||||
})
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
productModelUuid: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Number of products in the model',
|
||||
example: 3,
|
||||
})
|
||||
@IsNotEmpty()
|
||||
@IsInt()
|
||||
productCount: number;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Specific names for each product item',
|
||||
type: [CreateProductItemModelDto],
|
||||
})
|
||||
@IsArray()
|
||||
@ArrayNotEmpty()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => CreateProductItemModelDto)
|
||||
items: CreateProductItemModelDto[];
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
export * from './create-space-model.dto';
|
||||
export * from './create-space-product-item-model.dto';
|
||||
export * from './create-space-product-model.dto';
|
||||
export * from './create-subspace-model.dto';
|
||||
export * from './project-param.dto';
|
||||
export * from './update-space-model.dto';
|
||||
export * from './space-model-param';
|
||||
export * from './update-subspace-model.dto';
|
||||
export * from './subspaces-model-dtos';
|
||||
|
@ -6,7 +6,7 @@ import {
|
||||
IsString,
|
||||
ValidateNested,
|
||||
} from 'class-validator';
|
||||
import { CreateSpaceProductModelDto } from './create-space-product-model.dto';
|
||||
import { CreateSpaceProductModelDto } from '../create-space-product-model.dto';
|
||||
import { Type } from 'class-transformer';
|
||||
|
||||
export class CreateSubspaceModelDto {
|
@ -1 +1,3 @@
|
||||
export * from './delete-subspace-model.dto';
|
||||
export * from './create-subspace-model.dto';
|
||||
export * from './update-subspace-model.dto';
|
||||
|
@ -7,7 +7,7 @@ import {
|
||||
IsOptional,
|
||||
ValidateNested,
|
||||
} from 'class-validator';
|
||||
import { CreateSpaceProductModelDto } from './create-space-product-model.dto';
|
||||
import { CreateSpaceProductModelDto } from '../create-space-product-model.dto';
|
||||
|
||||
export class UpdateSubspaceModelDto {
|
||||
@ApiProperty({
|
@ -1,11 +1,13 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsArray, IsOptional, IsString, ValidateNested } from 'class-validator';
|
||||
import { CreateSubspaceModelDto } from './create-subspace-model.dto';
|
||||
import { CreateSubspaceModelDto } from './subspaces-model-dtos/create-subspace-model.dto';
|
||||
import { Type } from 'class-transformer';
|
||||
import { UpdateSubspaceModelDto } from './update-subspace-model.dto';
|
||||
import { DeleteSubspaceModelDto } from './subspaces-model-dtos';
|
||||
import {
|
||||
DeleteSubspaceModelDto,
|
||||
UpdateSubspaceModelDto,
|
||||
} from './subspaces-model-dtos';
|
||||
|
||||
export class UpdateSubspacesModelDto {
|
||||
export class ModifySubspacesModelDto {
|
||||
@ApiProperty({
|
||||
description: 'List of subspaces to add',
|
||||
type: [CreateSubspaceModelDto],
|
||||
@ -50,5 +52,5 @@ export class UpdateSpaceModelDto {
|
||||
modelName?: string;
|
||||
|
||||
@IsOptional()
|
||||
subspaceModels?: UpdateSubspacesModelDto;
|
||||
subspaceModels?: ModifySubspacesModelDto;
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import { HttpException, HttpStatus, Injectable } from '@nestjs/common';
|
||||
import {
|
||||
CreateSubspaceModelDto,
|
||||
UpdateSubspaceModelDto,
|
||||
UpdateSubspacesModelDto,
|
||||
ModifySubspacesModelDto,
|
||||
} from '../../dtos';
|
||||
import { QueryRunner } from 'typeorm';
|
||||
import { SubspaceProductModelService } from './subspace-product-model.service';
|
||||
@ -178,7 +178,7 @@ export class SubSpaceModelService {
|
||||
}
|
||||
|
||||
async modifySubSpaceModels(
|
||||
dto: UpdateSubspacesModelDto,
|
||||
dto: ModifySubspacesModelDto,
|
||||
spaceModel: SpaceModelEntity,
|
||||
queryRunner: QueryRunner,
|
||||
) {
|
||||
|
Reference in New Issue
Block a user