2.6 KiB
2.6 KiB
Data Model — Spec 080 Workspace-Managed Tenant Administration Migration
This feature is primarily a routing + panel registration change. No new entities are required, but the plan relies on these existing domain objects and their relationships.
Entities
Workspace
- Represents the portfolio/customer context.
- Key fields (typical):
id,name,slugoruuid,archived_at, timestamps.
WorkspaceMembership
- Joins a
Userto aWorkspacewith a role. - Key fields:
id,workspace_id,user_id,role, timestamps. - Rules:
- Workspace membership is an isolation boundary for
/admin/*management.
- Workspace membership is an isolation boundary for
Tenant (Managed Tenant)
- Workspace-owned representation of an Entra/Intune tenant.
- Key fields (from usage in the codebase):
idworkspace_idexternal_id(canonical route identifier; Entra tenant GUID)tenant_id(Entra tenant ID / GUID — may be same domain meaning depending on model)name,domain,environmentmetadata(JSON)archived_at(if supported)- timestamps
- Notes:
{tenant}route parameter refers toTenant.external_idin both/admin/tenants/{tenant}and/admin/t/{tenant}.
TenantMembership
- Joins a
Userto aTenantwith a tenant role. - Key fields:
id,tenant_id,user_id,role, timestamps. - Rules:
- Tenant membership is an isolation boundary for
/admin/t/{tenant}/*. - Guardrails: cannot remove/demote the last Owner (existing rule in constitution and code).
- Tenant membership is an isolation boundary for
ProviderConnection
- Stores provider integration configuration for a managed tenant.
- Key fields (from resource usage):
id,workspace_id,tenant_idproviderdisplay_nameentra_tenant_idis_defaultstatus,health_status- timestamps
- Notes:
- Treated as workspace-managed configuration, but scoped to a specific managed tenant via FK.
AuditLog
- Append-only record of security/management events.
- Required attributes (per spec):
workspace_id,tenant_id,actor_id,action_id, redacted metadata, timestamp.
OperationRun
- Existing observability record for long-running operations.
- This migration itself should not introduce new runs; management page renders must be DB-only.
Relationships (high level)
- Workspace 1—* WorkspaceMembership
- Workspace 1—* Tenant
- Tenant 1—* TenantMembership
- Tenant 1—* ProviderConnection
- Workspace 1—* ProviderConnection
- Workspace/Tenant 1—* AuditLog
State & Transitions
- This feature does not add new domain state transitions.
- Any existing onboarding/activation state changes remain workspace-managed in UI (per spec) and must continue to be audited.