added space link service

This commit is contained in:
hannathkadher
2024-11-20 16:01:51 +04:00
parent 4a98d94dda
commit c7404972a2
7 changed files with 145 additions and 159 deletions

View File

@ -0,0 +1,5 @@
export enum Direction {
LEFT = 'left',
RIGHT = 'right',
DOWN = 'down',
}

View File

@ -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;