Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
@@ -30,6 +30,18 @@
|
||||
* If a future migration adds a new User-FK without updating this map,
|
||||
* the test fails and the cascade silently leaking PII is blocked at
|
||||
* CI time.
|
||||
*
|
||||
* BARE-SCALAR user references (R-P6C, 2026-06-29): columns like
|
||||
* `createdByUserId` / `zustaendigerUserId` (crm.prisma) or
|
||||
* `createdByUserId` / `assignedToUserId` (tasks.prisma, hr.prisma) are
|
||||
* intentionally NOT enumerated here. They carry no DB-level `@relation`
|
||||
* to `User`, so there is no FK to cascade and the companion test's grep
|
||||
* (which matches `@relation ... references: [id]` to `User`) does not see
|
||||
* them — by design, repo-wide. They are metadata references; after user
|
||||
* deletion they become dangling cuids (no PII payload). Project-wide
|
||||
* pseudonymization of bare-scalar user references is a separate
|
||||
* cross-cutting hardening topic (not CRM-specific) — to be addressed when
|
||||
* the DSGVO deletion flow goes live, consistently across all modules.
|
||||
*/
|
||||
|
||||
export type DsgvoCascadeStrategy = "hard-delete" | "pseudonymize" | "retain-tombstone";
|
||||
@@ -52,11 +64,16 @@ export interface UserFkMapEntry {
|
||||
* additions stay reviewable.
|
||||
*/
|
||||
export const USER_FK_MAP: ReadonlyArray<UserFkMapEntry> = Object.freeze([
|
||||
// P19 admin tenant notes. Schema declares `author User? @relation(..., onDelete: SetNull)`
|
||||
// → `retain-tombstone` (note survives, FK nulled). `includeInExport: false`: an operator
|
||||
// note *about a tenant* is an internal admin record, not the author's personal data, so it
|
||||
// stays out of the author's export bundle. TODO(VR-P31): confirm DSGVO intent (retain-tombstone sign-off).
|
||||
{ model: "AdminTenantNote", column: "authorUserId", strategy: "retain-tombstone", source: "admin.prisma", includeInExport: false },
|
||||
{ model: "AdminUser", column: "userId", strategy: "hard-delete", source: "accounts.prisma", includeInExport: true },
|
||||
{ model: "AnalyticsUniqueVisitor", column: "userId", strategy: "pseudonymize", source: "analytics.prisma", includeInExport: false },
|
||||
{ model: "ApiKey", column: "createdByUserId", strategy: "hard-delete", source: "core.prisma", includeInExport: true },
|
||||
{ model: "App", column: "installedByUserId", strategy: "retain-tombstone", source: "appsEngine.prisma", includeInExport: true },
|
||||
{ model: "AppSyncRun", column: "createdByUserId", strategy: "retain-tombstone", source: "appsEngine.prisma", includeInExport: false },
|
||||
// R-P5: Apps-Engine uses bare String scalars for createdByUserId (AD-21, like
|
||||
// tasks/files/hr) — no User @relation, so no USER_FK_MAP entry (retain by default).
|
||||
// AuditEvent has no FK relation in the schema (actorId is a free
|
||||
// string column) — we list it here as a *logical* reference. The
|
||||
// pseudonymization strategy is mandatory: SOC2-CC6.1 requires the
|
||||
@@ -90,7 +107,12 @@ export const USER_FK_MAP: ReadonlyArray<UserFkMapEntry> = Object.freeze([
|
||||
{ model: "RowTask", column: "completedByUserId", strategy: "retain-tombstone", source: "entityBuilder.prisma", includeInExport: true },
|
||||
{ model: "RowTask", column: "createdByUserId", strategy: "pseudonymize", source: "entityBuilder.prisma", includeInExport: true },
|
||||
{ model: "Site", column: "createdByUserId", strategy: "retain-tombstone", source: "sites.prisma", includeInExport: true },
|
||||
// Help-desk staff/author FKs (schema `onDelete: SetNull`) → retain-tombstone; the ticket
|
||||
// *owner* (`userId`) stays pseudonymize per the help-desk-retention note above.
|
||||
// TODO(VR-P31): confirm DSGVO intent for assignee/message-author rows.
|
||||
{ model: "SupportTicket", column: "assignedToUserId", strategy: "retain-tombstone", source: "helpDesk.prisma", includeInExport: true },
|
||||
{ model: "SupportTicket", column: "userId", strategy: "pseudonymize", source: "helpDesk.prisma", includeInExport: true },
|
||||
{ model: "SupportTicketMessage", column: "authorUserId", strategy: "retain-tombstone", source: "admin.prisma", includeInExport: true },
|
||||
{ model: "TenantIpAddress", column: "userId", strategy: "hard-delete", source: "accounts.prisma", includeInExport: true },
|
||||
{ model: "TenantUser", column: "userId", strategy: "hard-delete", source: "accounts.prisma", includeInExport: true },
|
||||
{ model: "TenantUserInvitation", column: "acceptedByUserId", strategy: "retain-tombstone", source: "accounts.prisma", includeInExport: true },
|
||||
|
||||
Reference in new issue
Block a user