mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-24 18:27:54 +00:00
added device-to-tag
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import { Column, Entity, ManyToOne } from 'typeorm';
|
||||
import { Column, Entity, ManyToOne, OneToOne } from 'typeorm';
|
||||
import { SpaceProductEntity } from './space-product.entity';
|
||||
import { AbstractEntity } from '../../abstract/entities/abstract.entity';
|
||||
import { SpaceProductItemDto } from '../dtos';
|
||||
import { SpaceProductItemModelEntity } from '../../space-model';
|
||||
import { DeviceEntity } from '../../device/entities';
|
||||
|
||||
@Entity({ name: 'space-product-item' })
|
||||
export class SpaceProductItemEntity extends AbstractEntity<SpaceProductItemDto> {
|
||||
@@ -30,4 +31,9 @@ export class SpaceProductItemEntity extends AbstractEntity<SpaceProductItemDto>
|
||||
},
|
||||
)
|
||||
public spaceProductItemModel?: SpaceProductItemModelEntity;
|
||||
|
||||
@OneToOne(() => DeviceEntity, (device) => device.tag, {
|
||||
nullable: true,
|
||||
})
|
||||
public device?: DeviceEntity;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user