V4: Vendor — Suspend a tenant who hasn't paid #43
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
User Story: As a vendor, I want to suspend a tenant who hasn't paid.
Revised approach: Instead of stopping containers, enforce read-only access via a suspension flag. Users keep viewing their data but cannot make changes.
Acceptance Criteria:
suspended_aton TenantEntity, tenant status → SUSPENDEDTenantIsolationInterceptorrejects POST/PUT/DELETE with 423 Locked whensuspended_atis set (GET still allowed → read-only)suspended_at, tenant status → ACTIVE, instant effectWhy not Logto role manipulation:
Logto Management API has no "remove specific role" method — only add role or remove user entirely. Storing/restoring original roles per user is fragile and requires Logto round-trips. The suspension flag approach is atomic (single DB write), instantly reversible, and works even if Logto is down.
Implementation:
suspended_at TIMESTAMPcolumn to tenants table (migration)TenantIsolationInterceptorto checksuspended_atand reject mutating requests with 423VendorTenantService.suspend()/activate()to set/clearsuspended_at(remove container stop/start)Spec:
docs/superpowers/specs/2026-04-09-platform-redesign.mdAPI:
POST /api/vendor/tenants/{id}/suspend,POST /api/vendor/tenants/{id}/activate