mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-15 10:25:23 +00:00
added space link service
This commit is contained in:
5
libs/common/src/constants/direction.enum.ts
Normal file
5
libs/common/src/constants/direction.enum.ts
Normal file
@ -0,0 +1,5 @@
|
||||
export enum Direction {
|
||||
LEFT = 'left',
|
||||
RIGHT = 'right',
|
||||
DOWN = 'down',
|
||||
}
|
@ -1,8 +1,9 @@
|
||||
import { Column, Entity, JoinColumn, ManyToOne } from 'typeorm';
|
||||
import { AbstractEntity } from '../../abstract/entities/abstract.entity';
|
||||
import { SpaceEntity } from './space.entity';
|
||||
import { Direction } from '@app/common/constants/direction.enum';
|
||||
|
||||
@Entity({ name: 'space_link' })
|
||||
@Entity({ name: 'space-link' })
|
||||
export class SpaceLinkEntity extends AbstractEntity {
|
||||
@ManyToOne(() => SpaceEntity, { nullable: false, onDelete: 'CASCADE' })
|
||||
@JoinColumn({ name: 'start_space_id' })
|
||||
@ -13,9 +14,8 @@ export class SpaceLinkEntity extends AbstractEntity {
|
||||
public endSpace: SpaceEntity;
|
||||
|
||||
@Column({
|
||||
type: 'varchar',
|
||||
length: 10,
|
||||
nullable: false,
|
||||
enum: Object.values(Direction),
|
||||
})
|
||||
direction: string;
|
||||
|
||||
|
Reference in New Issue
Block a user