mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-24 23:37:54 +00:00
added relation between subspace product item and model
This commit is contained in:
+7
-1
@@ -1,7 +1,8 @@
|
||||
import { AbstractEntity } from '@app/common/modules/abstract/entities/abstract.entity';
|
||||
import { Entity, Column, ManyToOne } from 'typeorm';
|
||||
import { Entity, Column, ManyToOne, OneToMany } from 'typeorm';
|
||||
import { SubspaceProductItemModelDto } from '../../dtos';
|
||||
import { SubspaceProductModelEntity } from './subspace-product-model.entity';
|
||||
import { SubspaceProductItemEntity } from '@app/common/modules/space/entities';
|
||||
|
||||
@Entity({ name: 'subspace-product-item-model' })
|
||||
export class SubspaceProductItemModelEntity extends AbstractEntity<SubspaceProductItemModelDto> {
|
||||
@@ -18,4 +19,9 @@ export class SubspaceProductItemModelEntity extends AbstractEntity<SubspaceProdu
|
||||
},
|
||||
)
|
||||
public subspaceProductModel: SubspaceProductModelEntity;
|
||||
|
||||
@OneToMany(() => SubspaceProductItemEntity, (item) => item.model, {
|
||||
nullable: true,
|
||||
})
|
||||
items: SubspaceProductItemEntity[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user