Found on staging: a workspace whose Keycloak organization and admin
were deleted by hand stayed in the registry. Its name could not be
used again, and setting it back to trial did not bring the sign-in
back, because nothing re-creates the Keycloak side.
- POST /v1/admin/tenants/{id}/reprovision creates the organization with
the admin invited when it is missing, invites the admin into an
existing one, or sends the invitation again; then syncs the status.
- DELETE /v1/admin/tenants/{id}?confirm=<slug> removes an archived
tenant: document files, then the Keycloak organization and the
accounts whose tenant_id names this tenant, then the tenant row, whose
foreign keys take everything attached. The ERP customer and the audit
trail stay; tenant.purged records the staff member. The name is free.
- Store.DeleteTenant (memory and Postgres), Adapter.PurgeTenant (HTTP
and mock), OpenAPI, tests against both stores and a stub Keycloak.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
56 KiB
56 KiB