Skip to content

Commit

Permalink
feat: add groups for assets (#306)
Browse files Browse the repository at this point in the history
* feat(assets-groups): implement CRUD actions
* feat(assets-groups): implement add assets to group
* feat: implement remove assets to group
* feat: export group api types
* feat(createGroup): id is not mandatory anymore, auto generated if missing
* feat(groupName): add check of name unicity
* feat(groupAsset): handle group hierarchy
* feat(groupName): check presence of name when create
  • Loading branch information
sebtiz13 committed Jul 24, 2023
1 parent 028c65c commit 9254a73
Show file tree
Hide file tree
Showing 18 changed files with 1,350 additions and 20 deletions.
6 changes: 6 additions & 0 deletions lib/modules/asset/AssetModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,24 @@ import { Module } from "../shared/Module";
import { AssetHistoryService } from "./AssetHistoryService";
import { AssetsController } from "./AssetsController";
import { AssetService } from "./AssetService";
import { AssetsGroupsController } from "./AssetsGroupsController";
import { RoleAssetsAdmin } from "./roles/RoleAssetsAdmin";
import { RoleAssetsReader } from "./roles/RoleAssetsReader";

export class AssetModule extends Module {
private assetService: AssetService;
private assetHistoryService: AssetHistoryService;
private assetController: AssetsController;
private assetGroupsController: AssetsGroupsController;

public async init(): Promise<void> {
this.assetHistoryService = new AssetHistoryService(this.plugin);
this.assetService = new AssetService(this.plugin, this.assetHistoryService);
this.assetController = new AssetsController(this.plugin, this.assetService);
this.assetGroupsController = new AssetsGroupsController(this.plugin);

this.plugin.api["device-manager/assetsGroup"] =
this.assetGroupsController.definition;

this.plugin.api["device-manager/assets"] = this.assetController.definition;

Expand Down

0 comments on commit 9254a73

Please sign in to comment.