fix: allow deleting organization with failed invoices#3055
Conversation
The cloud backend (already merged) now cancels pending/failed invoices on organization delete instead of throwing BILLING_INVOICE_PENDING. The console was still gating the delete modal via the unpaid-invoices branch of the delete-estimation endpoint, which rendered an alternate view without the org-name confirmation input and left the Delete button permanently disabled. Drop the estimation-based gate (and the now-unused estimation fetch, component, and import) so the confirm-name form always renders. The backend will cancel any failed invoices server-side as part of the delete. The informational upcoming-invoice Alert is preserved. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Greptile SummaryRemoves the frontend gate that prevented deletion of organizations with failed or pending invoices. The backend now cancels such invoices server-side during org deletion, so the estimation-fetch branch and its
Confidence Score: 5/5Safe to merge — the change removes a frontend gate that was already inconsistent with backend behaviour, and all remaining imports and reactive state are still correctly wired. The diff is a targeted removal of dead code: the estimation fetch, its state variable, and the component that rendered an unresolvable 'must settle invoices' block. The confirm-name input and the upcoming-invoice Alert that remain are unchanged and still function correctly. No new logic was introduced. No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "fix: allow deleting organization with fa..." | Re-trigger Greptile |
Summary
The cloud backend was updated to cancel pending/failed invoices when an organization is deleted, instead of throwing
BILLING_INVOICE_PENDING. The console, however, still gated the delete modal via the unpaid-invoices branch of theestimationDeleteOrganizationendpoint, which rendered an alternate view without the organization-name confirmation input. That left the Delete button permanently disabled for any org that had a failed or pending invoice, even though the backend was perfectly happy to proceed.This PR drops that frontend gate so the confirm-name form always renders. The backend takes care of cancelling failed invoices server-side as part of the delete.
deleteOrganizationModal.svelteand the now-unused estimation fetch / import / state.deleteOrganizationEstimation.sveltecomponent (only consumer was the modal).upcomingInvoiceAlert and theinvoicesprop — they remain in use.Test plan