mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 09:14:54 +00:00
renamed dtos
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
import { ApiProperty } from '@nestjs/swagger';
|
import { ApiProperty } from '@nestjs/swagger';
|
||||||
import { IsNotEmpty, IsString } from 'class-validator';
|
import { IsNotEmpty, IsString } from 'class-validator';
|
||||||
|
|
||||||
export class CreateSpaceProductItemModelDto {
|
export class CreateProductItemModelDto {
|
||||||
@ApiProperty({
|
@ApiProperty({
|
||||||
description: 'Specific name for the product item',
|
description: 'Specific name for the product item',
|
||||||
example: 'Light 1',
|
example: 'Light 1',
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import {
|
|||||||
ArrayNotEmpty,
|
ArrayNotEmpty,
|
||||||
} from 'class-validator';
|
} from 'class-validator';
|
||||||
import { Type } from 'class-transformer';
|
import { Type } from 'class-transformer';
|
||||||
import { CreateSpaceProductItemModelDto } from './create-space-product-item-model.dto';
|
import { CreateProductItemModelDto } from './create-space-product-item-model.dto';
|
||||||
|
|
||||||
export class CreateSpaceProductModelDto {
|
export class CreateSpaceProductModelDto {
|
||||||
@ApiProperty({
|
@ApiProperty({
|
||||||
@ -29,11 +29,11 @@ export class CreateSpaceProductModelDto {
|
|||||||
|
|
||||||
@ApiProperty({
|
@ApiProperty({
|
||||||
description: 'Specific names for each product item',
|
description: 'Specific names for each product item',
|
||||||
type: [CreateSpaceProductItemModelDto],
|
type: [CreateProductItemModelDto],
|
||||||
})
|
})
|
||||||
@IsArray()
|
@IsArray()
|
||||||
@ArrayNotEmpty()
|
@ArrayNotEmpty()
|
||||||
@ValidateNested({ each: true })
|
@ValidateNested({ each: true })
|
||||||
@Type(() => CreateSpaceProductItemModelDto)
|
@Type(() => CreateProductItemModelDto)
|
||||||
items: CreateSpaceProductItemModelDto[];
|
items: CreateProductItemModelDto[];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import {
|
|||||||
SpaceProductModelEntity,
|
SpaceProductModelEntity,
|
||||||
} from '@app/common/modules/space-model';
|
} from '@app/common/modules/space-model';
|
||||||
import { HttpException, HttpStatus, Injectable } from '@nestjs/common';
|
import { HttpException, HttpStatus, Injectable } from '@nestjs/common';
|
||||||
import { CreateSpaceProductItemModelDto } from '../dtos';
|
import { CreateProductItemModelDto } from '../dtos';
|
||||||
import { QueryRunner } from 'typeorm';
|
import { QueryRunner } from 'typeorm';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@ -14,7 +14,7 @@ export class SpaceProductItemModelService {
|
|||||||
) {}
|
) {}
|
||||||
|
|
||||||
async createProdutItemModel(
|
async createProdutItemModel(
|
||||||
itemModelDtos: CreateSpaceProductItemModelDto[],
|
itemModelDtos: CreateProductItemModelDto[],
|
||||||
spaceProductModel: SpaceProductModelEntity,
|
spaceProductModel: SpaceProductModelEntity,
|
||||||
spaceModel: SpaceModelEntity,
|
spaceModel: SpaceModelEntity,
|
||||||
queryRunner: QueryRunner,
|
queryRunner: QueryRunner,
|
||||||
@ -43,7 +43,7 @@ export class SpaceProductItemModelService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async validateTags(
|
private async validateTags(
|
||||||
itemModelDtos: CreateSpaceProductItemModelDto[],
|
itemModelDtos: CreateProductItemModelDto[],
|
||||||
queryRunner: QueryRunner,
|
queryRunner: QueryRunner,
|
||||||
spaceModel: SpaceModelEntity,
|
spaceModel: SpaceModelEntity,
|
||||||
) {
|
) {
|
||||||
|
|||||||
Reference in New Issue
Block a user