mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-27 16:04:54 +00:00
added subspace model product and item entities
This commit is contained in:
@ -3,6 +3,7 @@ import { Column, Entity, ManyToOne, OneToMany, Unique } from 'typeorm';
|
||||
import { SubSpaceModelDto } from '../../dtos';
|
||||
import { SpaceModelEntity } from '../space-model.entity';
|
||||
import { SubspaceEntity } from '@app/common/modules/space/entities';
|
||||
import { SubspaceProductModelEntity } from './subspace-product-model.entity';
|
||||
|
||||
@Entity({ name: 'subspace-model' })
|
||||
@Unique(['subspaceName', 'spaceModel'])
|
||||
@ -33,4 +34,13 @@ export class SubspaceModelEntity extends AbstractEntity<SubSpaceModelDto> {
|
||||
cascade: true,
|
||||
})
|
||||
public spaces: SubspaceEntity[];
|
||||
|
||||
@OneToMany(
|
||||
() => SubspaceProductModelEntity,
|
||||
(productModel) => productModel.subspaceModel,
|
||||
{
|
||||
nullable: true,
|
||||
},
|
||||
)
|
||||
public subspaceProductModels: SubspaceProductModelEntity[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user