feat(admin): repair a tenant's sign-in, delete an archived tenant #42

Merged
sharang merged 2 commits from feat/tenant-purge into main 2026-09-26 11:00:15 +00:00
2 Commits
Author SHA1 Message Date
Sharang ParnerkarandClaude Opus 5.5 1a57025bcf ci: rerun after runner disk cleanup
ci / shared (pull_request) Successful in 33s
ci / test (pull_request) Successful in 23m56s
ci / image (pull_request) Skipped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
2026-09-26 12:23:38 +02:00
Sharang ParnerkarandClaude Opus 5.5 6f3451272c feat(admin): repair a tenant's sign-in, delete an archived tenant
ci / shared (pull_request) Successful in 17s
ci / test (pull_request) Failing after 5m34s
ci / image (pull_request) Skipped
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