Fundament: ISMS-Module entfernt; Craftvia-Rollen, Module, Navigation, i18n-Split

- ISMS-Routen, Actions, Server-/Lib-Code, Komponenten, Prisma-Modelle, Seeds,
  Importer, Skripte und ISMS-Tests entfernt (Fundament bleibt: Auth, Identity,
  MFA/WebAuthn, RBAC, Audit, Mail, Storage, Backup/DSGVO, Plattform-Admin)
- Schema auf Fundament-Modelle reduziert; TenantSettings generisch (+phone/email)
- TENANT_MODELS (db.ts, backup/topology.ts) und PII-Felder ausgedünnt
- RBAC: Rollen tenant-admin/backoffice/team-lead/technician + Craftvia-Permissions
- Modul-Katalog (customers, sites, teams, work_orders, imports, field, reports,
  emergency, documents, notifications, lotse) + Navigation aus src/lib/nav.ts
- Modul-Routen mit requireModule-Layout und Platzhalterseite
- Message-Katalog je Namespace (messages/<locale>/<namespace>.json), fs-Loader
- check-module-guards: Modul-Key aus src/server/actions/<moduleKey>/
- Provisionierung, Admin-Konsole, Einstellungen, Files-Route, Mail entkoppelt
- Seed minimal (demo/demo2, Nutzer je Rolle); Fundament-Tests auf Role/
  NotificationPreference-Fixtures umgestellt

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-14 11:35:44 +02:00
co-authored by Claude Opus 5
parent c8e6f30a27
commit 8491c7f173
443 changed files with 1325 additions and 87773 deletions
+6 -6
View File
@@ -30,7 +30,7 @@ async function cleanup() {
await prisma.tombstoneEntry.deleteMany({ where: { tenantId: t.id } });
await prisma.deletionCertificate.deleteMany({ where: { tenantId: t.id } });
await prisma.auditLog.deleteMany({ where: { tenantId: t.id } });
await prisma.asset.deleteMany({ where: { tenantId: t.id } });
await prisma.notificationPreference.deleteMany({ where: { tenantId: t.id } });
await prisma.userRole.deleteMany({ where: { user: { tenantId: t.id } } });
await prisma.user.deleteMany({ where: { tenantId: t.id } });
await prisma.role.deleteMany({ where: { tenantId: t.id } });
@@ -49,7 +49,7 @@ async function cleanup() {
async function main() {
await cleanup();
// Fixture: Mandant + Identity + Mitgliedschaft + Rolle + Asset + AuditLog.
// Fixture: Mandant + Identity + Mitgliedschaft + Rolle + NotificationPreference + AuditLog.
const tenant = await prisma.tenant.create({ data: { name: "DSGVO Test", slug: SLUG } });
const identity = await prisma.identity.create({
data: { email: EMAIL, passwordHash: "x", status: "ACTIVE" },
@@ -59,11 +59,11 @@ async function main() {
});
const role = await prisma.role.create({ data: { tenantId: tenant.id, key: "member", name: "Member" } });
await prisma.userRole.create({ data: { userId: user.id, roleId: role.id } });
await prisma.asset.create({
data: { tenantId: tenant.id, name: "Server der Person", type: "SYSTEM", ownerId: user.id, createdBy: user.id },
await prisma.notificationPreference.create({
data: { tenantId: tenant.id, userId: user.id, eventType: "work_order_assigned", email: false },
});
await prisma.auditLog.create({
data: { tenantId: tenant.id, actorId: user.id, action: "create", entity: "asset" },
data: { tenantId: tenant.id, actorId: user.id, action: "create", entity: "user" },
});
// 1. Auskunft (Art. 15/20).
@@ -71,7 +71,7 @@ async function main() {
ok(subj.identity?.email === EMAIL, "Auskunft enthält Identity-Metadaten (E-Mail)");
ok(!("passwordHash" in (subj.identity ?? {})), "Auskunft enthält KEINE Secrets (passwordHash)");
ok(subj.memberships.length === 1, "Auskunft enthält die Mitgliedschaft");
ok(!!subj.references["Asset.ownerId"], "Auskunft findet Asset über ownerId");
ok(!!subj.references["NotificationPreference.userId"], "Auskunft findet NotificationPreference über userId");
ok(!!subj.references["AuditLog.actorId"], "Auskunft findet AuditLog über actorId");
// Snapshot MIT Original-PII (für den Tombstone-on-Restore-Beweis).