You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(deleter): clear or report org delete blockers up front
The delete first checks everything that blocks it and returns all the
reasons together as one failed_precondition response: a running
subscription on a paid plan (the caller downgrades it to the standard
plan), invoices that still ask for money, and a negative token balance
which support has to settle. Plans resolve lazily, only when a running
subscription references one. When nothing blocks, subscriptions still
running on a free plan are canceled immediately with unbilled usage
invoiced on the spot — tolerating copies already gone on the provider —
and the invoice check runs again so a final invoice still blocks. The
plan is judged again in that pass, so a paid subscription created
mid-delete blocks instead of being canceled. Unused tokens do not
block: the delete forfeits them and writes the amount to an audit
record. An already-deleted org returns not found before any checks run.
Invoices are judged straight from the billing provider through a new
cheap ListPayableOnProvider (three status-filtered pages, no local
writes) instead of a full sync, and drafts with a non-zero amount now
block too: the provider finalizes them shortly, and deleting inside
that window would silently lose the charge.
0 commit comments