feat(quick-261003-387): Kategorien-API - Anlegen, Sortieren, Zuordnen, Loeschen mit Verschieben, Ueberlagerung in allen Modullisten

- Verwaltungs-Endpunkte nur fuer Administratoren, statische Routen vor :key
- Loeschen verschiebt alle Eintraege inkl. persoenlicher eigener Module in einer Transaktion, ohne Ziel 409
- /modules, /modules/catalog und /module-grants/matrix liefern wirksame Kategorie und Reihenfolge
- eigene Module pruefen die Kategorie gegen die Organisation (400 bei unbekannter)
- Zugriffsinventar nachgezogen

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-10-03 02:39:36 +02:00
parent 8ec116c75a
commit af1878d5ee
15 changed files with 1152 additions and 37 deletions
@@ -42,8 +42,13 @@ export class ModuleRegistryController {
* Available to any authenticated user (T-03-03: module catalog is non-sensitive).
*/
@Get()
async findAll() {
return this.moduleRegistryService.findAll();
async findAll(@Req() req: AuthenticatedRequest) {
const modules = await this.moduleRegistryService.findAll();
// quick-261003-387: wirksame Kategorie + Reihenfolge der Organisation;
// ohne Organisationskontext bleibt die Liste unveraendert.
const tenantId = req?.tenantId ?? req?.user?.tenantId;
if (!tenantId) return modules;
return this.moduleCategoriesService.applyToModules(tenantId, modules);
}
/**
@@ -92,7 +97,9 @@ export class ModuleRegistryController {
this.moduleAccessService.getCatalogFlags(tenantId, userId, role),
]);
return modules.map((module) => ({
// quick-261003-387: wirksame Kategorie + Reihenfolge der Organisation.
const withCategories = await this.moduleCategoriesService.applyToModules(tenantId, modules);
return withCategories.map((module) => ({
...module,
isActiveForTenant: flags.get(module.id)?.isActiveForTenant ?? false,
hasAccess: flags.get(module.id)?.hasAccess ?? false,