Files
tenant-registry/internal
Sharang ParnerkarandClaude Opus 5.5 6f3451272c
ci / shared (pull_request) Successful in 17s
ci / test (pull_request) Failing after 5m34s
ci / image (pull_request) Skipped
feat(admin): repair a tenant's sign-in, delete an archived tenant
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
2026-09-26 12:07:49 +02:00
..