mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-27 22:34:53 +00:00
added entities for space product item
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
export * from './subspace-model.dto';
|
||||
export * from './space-model.dto';
|
||||
export * from './space-product-item.dto';
|
||||
export * from './space-product-item-model.dto';
|
||||
export * from './space-product-model.dto';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { IsString, IsNotEmpty } from 'class-validator';
|
||||
|
||||
export class SpaceProductItemDto {
|
||||
export class SpaceProductItemModelDto {
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
uuid: string;
|
||||
@ -1,6 +1,6 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNotEmpty, IsNumber, IsString } from 'class-validator';
|
||||
import { SpaceProductItemDto } from './space-product-item.dto';
|
||||
import { SpaceProductItemModelDto } from './space-product-item-model.dto';
|
||||
|
||||
export class SpaceProductModelDto {
|
||||
@IsString()
|
||||
@ -17,7 +17,7 @@ export class SpaceProductModelDto {
|
||||
|
||||
@ApiProperty({
|
||||
description: 'List of individual items with specific names for the product',
|
||||
type: [SpaceProductItemDto],
|
||||
type: [SpaceProductItemModelDto],
|
||||
})
|
||||
items: SpaceProductItemDto[];
|
||||
items: SpaceProductItemModelDto[];
|
||||
}
|
||||
|
||||
@ -1,12 +1,10 @@
|
||||
import { Entity, Column, ManyToOne, Unique } from 'typeorm';
|
||||
import { Entity, Column, ManyToOne } from 'typeorm';
|
||||
import { AbstractEntity } from '../../abstract/entities/abstract.entity';
|
||||
import { SpaceProductItemDto } from '../dtos';
|
||||
import { SpaceProductItemModelDto } from '../dtos';
|
||||
import { SpaceProductModelEntity } from './space-product-model.entity';
|
||||
import { SpaceModelEntity } from './space-model.entity';
|
||||
|
||||
@Entity({ name: 'space-product-item-model' })
|
||||
@Unique(['tag', 'spaceProductModel', 'spaceModel'])
|
||||
export class SpaceProductItemModelEntity extends AbstractEntity<SpaceProductItemDto> {
|
||||
export class SpaceProductItemModelEntity extends AbstractEntity<SpaceProductItemModelDto> {
|
||||
@Column({
|
||||
nullable: false,
|
||||
})
|
||||
@ -20,13 +18,4 @@ export class SpaceProductItemModelEntity extends AbstractEntity<SpaceProductItem
|
||||
},
|
||||
)
|
||||
public spaceProductModel: SpaceProductModelEntity;
|
||||
|
||||
@ManyToOne(
|
||||
() => SpaceModelEntity,
|
||||
(spaceModel) => spaceModel.spaceProductModels,
|
||||
{
|
||||
nullable: false,
|
||||
},
|
||||
)
|
||||
public spaceModel: SpaceModelEntity;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user