mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-24 06:27:55 +00:00
added subspace product item
This commit is contained in:
+2
-2
@@ -13,14 +13,14 @@ export class SubspaceProductItemModelEntity extends AbstractEntity<SubspaceProdu
|
||||
|
||||
@ManyToOne(
|
||||
() => SubspaceProductModelEntity,
|
||||
(subspaceProductModel) => subspaceProductModel.items,
|
||||
(productModel) => productModel.itemModels,
|
||||
{
|
||||
nullable: false,
|
||||
},
|
||||
)
|
||||
public subspaceProductModel: SubspaceProductModelEntity;
|
||||
|
||||
@OneToMany(() => SubspaceProductItemEntity, (item) => item.model, {
|
||||
@OneToMany(() => SubspaceProductItemEntity, (item) => item.subspaceProduct, {
|
||||
nullable: true,
|
||||
})
|
||||
items: SubspaceProductItemEntity[];
|
||||
|
||||
+9
-3
@@ -3,6 +3,7 @@ import { SubpaceProductModelDto } from '../../dtos';
|
||||
import { AbstractEntity } from '@app/common/modules/abstract/entities/abstract.entity';
|
||||
import { SubspaceModelEntity } from './subspace-model.entity';
|
||||
import { ProductEntity } from '@app/common/modules/product/entities';
|
||||
import { SubspaceProductEntity } from '@app/common/modules/space/entities';
|
||||
import { SubspaceProductItemModelEntity } from './subspace-product-item-model.entity';
|
||||
|
||||
@Entity({ name: 'subspace-product-model' })
|
||||
@@ -27,12 +28,17 @@ export class SubspaceProductModelEntity extends AbstractEntity<SubpaceProductMod
|
||||
})
|
||||
public product: ProductEntity;
|
||||
|
||||
@OneToMany(() => SubspaceProductEntity, (product) => product.model, {
|
||||
nullable: true,
|
||||
})
|
||||
public subspaceProducts: SubspaceProductEntity[];
|
||||
|
||||
@OneToMany(
|
||||
() => SubspaceProductItemModelEntity,
|
||||
(item) => item.subspaceProductModel,
|
||||
(product) => product.subspaceProductModel,
|
||||
{
|
||||
cascade: true,
|
||||
nullable: true,
|
||||
},
|
||||
)
|
||||
public items: SubspaceProductItemModelEntity[];
|
||||
public itemModels: SubspaceProductItemModelEntity[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user