mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-14 18:05:48 +00:00
added subspace product
This commit is contained in:
@ -4,6 +4,7 @@ import { SubspaceModelEntity } from '@app/common/modules/space-model';
|
||||
import { Column, Entity, JoinColumn, ManyToOne, OneToMany } from 'typeorm';
|
||||
import { SubspaceDto } from '../../dtos';
|
||||
import { SpaceEntity } from '../space.entity';
|
||||
import { SubspaceProductEntity } from './subspace-product.entity';
|
||||
|
||||
@Entity({ name: 'subspace' })
|
||||
export class SubspaceEntity extends AbstractEntity<SubspaceDto> {
|
||||
@ -35,6 +36,15 @@ export class SubspaceEntity extends AbstractEntity<SubspaceDto> {
|
||||
@JoinColumn({ name: 'subspace_model_uuid' })
|
||||
subSpaceModel?: SubspaceModelEntity;
|
||||
|
||||
@OneToMany(
|
||||
() => SubspaceProductEntity,
|
||||
(subspaceProduct) => subspaceProduct.subspace,
|
||||
{
|
||||
nullable: true,
|
||||
},
|
||||
)
|
||||
public subspaceProducts: SubspaceProductEntity[];
|
||||
|
||||
constructor(partial: Partial<SubspaceEntity>) {
|
||||
super();
|
||||
Object.assign(this, partial);
|
||||
|
Reference in New Issue
Block a user