Wipe flow
Wiping a business deletes its footprint across the external systems, streaming progress over SSE. The external deletions have system-specific gotchas.
sequenceDiagram
actor Admin
participant Portal as portal (admin)
participant API as scheduler-api
participant ST as Stripe
participant WO as WorkOS
participant R as Redis (SSE)
Admin->>Portal: wipe business (confirm)
Portal->>API: start wipe
API->>R: progress: started
API->>ST: close account (v2/core/accounts)
API->>WO: delete organization
API->>API: delete scheduler rows + caches
API->>R: progress: per-step ok / error
R-->>Portal: SSE progress (stoken)
Deletion gotchas
Section titled “Deletion gotchas”- Stripe V2 accounts must be closed via
v2/core/accounts— not the v1 delete call. - The WorkOS “Test Organization” fixture is un-deletable and must be ignored rather than retried.
- Failures surface via
progress.erroron the SSE stream and in scheduler-worker logs — the wipe does not silently swallow them.
Reference: the wipe deletion notes in repo memory / ops docs.