mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-25 10:17:54 +00:00
added entities for space product item
This commit is contained in:
@@ -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