mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-27 20:34:53 +00:00
finished add default icon for scene
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import { Column, Entity, ManyToOne, OneToMany } from 'typeorm';
|
||||
import { SceneDto, SceneIconDto } from '../dtos';
|
||||
import { AbstractEntity } from '../../abstract/entities/abstract.entity';
|
||||
import { SceneIconType } from '@app/common/constants/secne-icon-type.enum';
|
||||
|
||||
// Define SceneIconEntity before SceneEntity
|
||||
@Entity({ name: 'scene-icon' })
|
||||
@ -11,6 +12,13 @@ export class SceneIconEntity extends AbstractEntity<SceneIconDto> {
|
||||
})
|
||||
public icon: string;
|
||||
|
||||
@Column({
|
||||
type: 'enum',
|
||||
enum: SceneIconType,
|
||||
default: SceneIconType.Other,
|
||||
})
|
||||
iconType: SceneIconType;
|
||||
|
||||
@OneToMany(
|
||||
() => SceneEntity,
|
||||
(scenesIconEntity) => scenesIconEntity.sceneIcon,
|
||||
|
||||
Reference in New Issue
Block a user