Merge pull request #339 from SyncrowIOT/feat/commission-device

Feat/commission device
This commit is contained in:
hannathkadher
2025-04-22 11:04:15 +04:00
committed by GitHub
17 changed files with 495 additions and 66 deletions

View File

@ -43,6 +43,11 @@ export class ControllerRoute {
'Get user by uuid in project';
public static readonly GET_USER_BY_UUID_IN_PROJECT_DESCRIPTION =
'This endpoint retrieves a user by their unique identifier (UUID) associated with a specific project.';
public static readonly EXPORT_STRUCTURE_CSV_SUMMARY =
'Export project with their full structure to a CSV file';
public static readonly EXPORT_STRUCTURE_CSV_DESCRIPTION =
'This endpoint exports project along with their associated communities, spaces, and nested space hierarchy into a downloadable CSV file. Useful for backups, reports, or audits';
};
};
static PROJECT_USER = class {

View File

@ -3,6 +3,7 @@ import { RoleType } from './role.type.enum';
export const RolePermissions = {
[RoleType.SUPER_ADMIN]: [
'DEVICE_SINGLE_CONTROL',
'COMMISSION_DEVICE',
'DEVICE_VIEW',
'DEVICE_DELETE',
'DEVICE_UPDATE',
@ -58,6 +59,7 @@ export const RolePermissions = {
'PRODUCT_ADD',
],
[RoleType.ADMIN]: [
'COMMISSION_DEVICE',
'DEVICE_SINGLE_CONTROL',
'DEVICE_VIEW',
'DEVICE_DELETE',
@ -127,6 +129,7 @@ export const RolePermissions = {
'SCENES_CONTROL',
],
[RoleType.SPACE_OWNER]: [
'COMMISSION_DEVICE',
'DEVICE_SINGLE_CONTROL',
'DEVICE_VIEW',
'DEVICE_DELETE',

View File

@ -78,7 +78,7 @@ export class DeviceEntity extends AbstractEntity<DeviceDto> {
@OneToMany(() => NewTagEntity, (tag) => tag.devices)
// @JoinTable({ name: 'device_tags' })
public tag: NewTagEntity[];
public tag: NewTagEntity;
constructor(partial: Partial<DeviceEntity>) {
super();

View File

@ -8,7 +8,6 @@ import { SpaceLinkEntity } from './space-link.entity';
import { SceneEntity } from '../../scene/entities';
import { SpaceModelEntity } from '../../space-model';
import { InviteUserSpaceEntity } from '../../Invite-user/entities';
import { TagEntity } from './tag.entity';
import { SpaceProductAllocationEntity } from './space-product-allocation.entity';
import { SubspaceEntity } from './subspace/subspace.entity';
@ -103,9 +102,6 @@ export class SpaceEntity extends AbstractEntity<SpaceDto> {
)
invitedUsers: InviteUserSpaceEntity[];
@OneToMany(() => TagEntity, (tag) => tag.space)
tags: TagEntity[];
@OneToMany(
() => SpaceProductAllocationEntity,
(allocation) => allocation.space,

View File

@ -3,7 +3,6 @@ import { AbstractEntity } from '../../abstract/entities/abstract.entity';
import { ProductEntity } from '../../product/entities';
import { TagDto } from '../dtos';
import { TagModel } from '../../space-model/entities/tag-model.entity';
import { SpaceEntity } from './space.entity';
import { DeviceEntity } from '../../device/entities';
import { SubspaceEntity } from './subspace/subspace.entity';
@ -22,9 +21,6 @@ export class TagEntity extends AbstractEntity<TagDto> {
})
product: ProductEntity;
@ManyToOne(() => SpaceEntity, (space) => space.tags, { nullable: true })
space: SpaceEntity;
@ManyToOne(() => SubspaceEntity, (subspace) => subspace.tags, {
nullable: true,
})