mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-15 10:25:23 +00:00
updated space update
This commit is contained in:
@ -58,4 +58,9 @@ export class SpaceModelEntity extends AbstractEntity<SpaceModelDto> {
|
||||
|
||||
@OneToMany(() => TagModel, (tag) => tag.spaceModel)
|
||||
tags: TagModel[];
|
||||
|
||||
constructor(partial: Partial<SpaceModelEntity>) {
|
||||
super();
|
||||
Object.assign(this, partial);
|
||||
}
|
||||
}
|
||||
|
@ -30,10 +30,10 @@ export class SubspaceModelEntity extends AbstractEntity<SubSpaceModelDto> {
|
||||
)
|
||||
public spaceModel: SpaceModelEntity;
|
||||
|
||||
@OneToMany(() => SubspaceEntity, (space) => space.subSpaceModel, {
|
||||
@OneToMany(() => SubspaceEntity, (subspace) => subspace.subSpaceModel, {
|
||||
cascade: true,
|
||||
})
|
||||
public spaces: SubspaceEntity[];
|
||||
public subspaceModel: SubspaceEntity[];
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
|
@ -103,8 +103,9 @@ export class SpaceEntity extends AbstractEntity<SpaceDto> {
|
||||
@OneToMany(() => SceneEntity, (scene) => scene.space)
|
||||
scenes: SceneEntity[];
|
||||
|
||||
@ManyToOne(() => SpaceModelEntity, { nullable: true })
|
||||
@JoinColumn({ name: 'space_model_uuid' })
|
||||
@ManyToOne(() => SpaceModelEntity, (spaceModel) => spaceModel.spaces, {
|
||||
nullable: true,
|
||||
})
|
||||
spaceModel?: SpaceModelEntity;
|
||||
|
||||
@OneToMany(
|
||||
|
@ -37,8 +37,9 @@ export class SubspaceEntity extends AbstractEntity<SubspaceDto> {
|
||||
})
|
||||
devices: DeviceEntity[];
|
||||
|
||||
@ManyToOne(() => SubspaceModelEntity, { nullable: true })
|
||||
@JoinColumn({ name: 'subspace_model_uuid' })
|
||||
@ManyToOne(() => SubspaceModelEntity, (subspace) => subspace.subspaceModel, {
|
||||
nullable: true,
|
||||
})
|
||||
subSpaceModel?: SubspaceModelEntity;
|
||||
|
||||
@OneToMany(() => TagEntity, (tag) => tag.subspace)
|
||||
|
Reference in New Issue
Block a user