mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-17 03:05:13 +00:00
Remove Home Module
This commit is contained in:
@ -1,19 +0,0 @@
|
||||
import { IsNotEmpty, IsString } from 'class-validator';
|
||||
|
||||
export class HomeDto {
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
public uuid: string;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
public userUuid: string;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
public homeId: string;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
public homeName: string;
|
||||
}
|
@ -1 +0,0 @@
|
||||
export * from './home.dto';
|
@ -1,34 +0,0 @@
|
||||
import { Column, Entity } from 'typeorm';
|
||||
import { HomeDto } from '../dtos';
|
||||
import { AbstractEntity } from '../../abstract/entities/abstract.entity';
|
||||
|
||||
@Entity({ name: 'home' })
|
||||
export class HomeEntity extends AbstractEntity<HomeDto> {
|
||||
@Column({
|
||||
type: 'uuid',
|
||||
default: () => 'gen_random_uuid()', // Use gen_random_uuid() for default value
|
||||
nullable: false,
|
||||
})
|
||||
public uuid: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
})
|
||||
userUuid: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
unique: true,
|
||||
})
|
||||
public homeId: string;
|
||||
|
||||
@Column({
|
||||
nullable: false,
|
||||
})
|
||||
public homeName: string;
|
||||
|
||||
constructor(partial: Partial<HomeEntity>) {
|
||||
super();
|
||||
Object.assign(this, partial);
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
export * from './home.entity';
|
@ -1,11 +0,0 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { HomeEntity } from './entities/home.entity';
|
||||
|
||||
@Module({
|
||||
providers: [],
|
||||
exports: [],
|
||||
controllers: [],
|
||||
imports: [TypeOrmModule.forFeature([HomeEntity])],
|
||||
})
|
||||
export class HomeRepositoryModule {}
|
@ -1,10 +0,0 @@
|
||||
import { DataSource, Repository } from 'typeorm';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { HomeEntity } from '../entities/home.entity';
|
||||
|
||||
@Injectable()
|
||||
export class HomeRepository extends Repository<HomeEntity> {
|
||||
constructor(private dataSource: DataSource) {
|
||||
super(HomeEntity, dataSource.createEntityManager());
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
export * from './home.repository';
|
Reference in New Issue
Block a user