import { Column, Entity, ManyToOne } from 'typeorm'; import { SpaceProductEntity } from './space-product.entity'; import { AbstractEntity } from '../../abstract/entities/abstract.entity'; import { SpaceProductItemDto } from '../dtos'; import { SpaceProductItemModelEntity } from '../../space-model'; @Entity({ name: 'space-product-item' }) export class SpaceProductItemEntity extends AbstractEntity { @Column({ nullable: false, }) public tag: string; @ManyToOne(() => SpaceProductEntity, (spaceProduct) => spaceProduct.items, { nullable: false, }) public spaceProduct: SpaceProductEntity; @ManyToOne( () => SpaceProductItemModelEntity, (spaceProductItemModel) => spaceProductItemModel.items, { nullable: true, }, ) public spaceProductItemModel?: SpaceProductItemModelEntity; }