mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 20:14:54 +00:00
28 lines
849 B
TypeScript
28 lines
849 B
TypeScript
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<SpaceProductItemDto> {
|
|
@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;
|
|
}
|