removed unit,floor,building,room modules

This commit is contained in:
hannathkadher
2024-10-22 10:02:54 +04:00
parent 581618296d
commit 3bd18c2b29
53 changed files with 110 additions and 2416 deletions
+2 -9
View File
@@ -6,7 +6,6 @@ import {
} from '@nestjs/common';
import { SpaceRepository } from '@app/common/modules/space/repositories';
import { AddSceneTapToRunDto, UpdateSceneTapToRunDto } from '../dtos';
import { GetUnitByUuidInterface } from 'src/unit/interface/unit.interface';
import { ConfigService } from '@nestjs/config';
import { TuyaContext } from '@tuya/tuya-connector-nodejs';
import { convertKeysToSnakeCase } from '@app/common/helper/snakeCaseConverter';
@@ -18,7 +17,6 @@ import {
SceneDetailsResult,
} from '../interface/scene.interface';
import { convertKeysToCamelCase } from '@app/common/helper/camelCaseConverter';
import { SpaceType } from '@app/common/constants/space-type.enum';
import { ActionExecutorEnum } from '@app/common/constants/automation.enum';
@Injectable()
@@ -104,18 +102,14 @@ export class SceneService {
}
}
}
async getUnitByUuid(unitUuid: string): Promise<GetUnitByUuidInterface> {
async getUnitByUuid(unitUuid: string) {
try {
const unit = await this.spaceRepository.findOne({
where: {
uuid: unitUuid,
spaceType: {
type: SpaceType.UNIT,
},
},
relations: ['spaceType'],
});
if (!unit || !unit.spaceType || unit.spaceType.type !== SpaceType.UNIT) {
if (!unit) {
throw new BadRequestException('Invalid unit UUID');
}
return {
@@ -123,7 +117,6 @@ export class SceneService {
createdAt: unit.createdAt,
updatedAt: unit.updatedAt,
name: unit.spaceName,
type: unit.spaceType.type,
spaceTuyaUuid: unit.spaceTuyaUuid,
};
} catch (err) {