mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-13 01:22:15 +00:00
feat: Add unit invitation code functionality and user verification using code
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { Column, Entity, ManyToOne, OneToMany } from 'typeorm';
|
||||
import { Column, Entity, ManyToOne, OneToMany, Unique } from 'typeorm';
|
||||
import { SpaceDto } from '../dtos';
|
||||
import { AbstractEntity } from '../../abstract/entities/abstract.entity';
|
||||
import { SpaceTypeEntity } from '../../space-type/entities';
|
||||
@ -6,6 +6,7 @@ import { UserSpaceEntity } from '../../user-space/entities';
|
||||
import { DeviceEntity } from '../../device/entities';
|
||||
|
||||
@Entity({ name: 'space' })
|
||||
@Unique(['invitationCode'])
|
||||
export class SpaceEntity extends AbstractEntity<SpaceDto> {
|
||||
@Column({
|
||||
type: 'uuid',
|
||||
@ -18,6 +19,11 @@ export class SpaceEntity extends AbstractEntity<SpaceDto> {
|
||||
nullable: false,
|
||||
})
|
||||
public spaceName: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
})
|
||||
public invitationCode: string;
|
||||
@ManyToOne(() => SpaceEntity, (space) => space.children, { nullable: true })
|
||||
parent: SpaceEntity;
|
||||
|
||||
|
Reference in New Issue
Block a user