From b1691cf8931671c814245b13817da92229d2768b Mon Sep 17 00:00:00 2001 From: Abhishek Sah Date: Tue, 18 Aug 2026 10:03:33 +0530 Subject: [PATCH 1/2] feat(frontier): add CheckOrganizationDelete to report org delete blockers --- raystack/frontier/v1beta1/frontier.proto | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/raystack/frontier/v1beta1/frontier.proto b/raystack/frontier/v1beta1/frontier.proto index 89b6e095..4c3b7652 100644 --- a/raystack/frontier/v1beta1/frontier.proto +++ b/raystack/frontier/v1beta1/frontier.proto @@ -164,6 +164,11 @@ service FrontierService { rpc DeleteOrganization(DeleteOrganizationRequest) returns (DeleteOrganizationResponse) {} + // CheckOrganizationDelete reports everything that currently blocks deleting + // the organization, without changing anything. An empty blocker list means + // DeleteOrganization would proceed right now. + rpc CheckOrganizationDelete(CheckOrganizationDeleteRequest) returns (CheckOrganizationDeleteResponse) {} + // Projects rpc CreateProject(CreateProjectRequest) returns (CreateProjectResponse) {} @@ -1748,6 +1753,26 @@ message DeleteOrganizationRequest { message DeleteOrganizationResponse {} +message CheckOrganizationDeleteRequest { + string id = 1; +} + +message CheckOrganizationDeleteResponse { + message Blocker { + // machine-readable reason, e.g. ACTIVE_SUBSCRIPTION, UNPAID_INVOICE, + // NEGATIVE_TOKEN_BALANCE + string type = 1; + // id of the blocking entity, e.g. a subscription or an invoice id + string subject = 2; + // what blocks the delete and what the caller can do about it + string message = 3; + } + // true when nothing blocks the delete right now + bool can_delete = 1; + // every reason the delete would be refused; empty when can_delete is true + repeated Blocker blockers = 2; +} + message GetOrganizationKycRequest { string org_id = 1; } From 5395005405e10ba4a651b7257d3b46a9bb83de3a Mon Sep 17 00:00:00 2001 From: Abhishek Sah Date: Tue, 18 Aug 2026 10:15:20 +0530 Subject: [PATCH 2/2] feat(frontier): name the blocking entity kind on CheckOrganizationDelete --- raystack/frontier/v1beta1/frontier.proto | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/raystack/frontier/v1beta1/frontier.proto b/raystack/frontier/v1beta1/frontier.proto index 4c3b7652..d8aca710 100644 --- a/raystack/frontier/v1beta1/frontier.proto +++ b/raystack/frontier/v1beta1/frontier.proto @@ -1762,10 +1762,13 @@ message CheckOrganizationDeleteResponse { // machine-readable reason, e.g. ACTIVE_SUBSCRIPTION, UNPAID_INVOICE, // NEGATIVE_TOKEN_BALANCE string type = 1; - // id of the blocking entity, e.g. a subscription or an invoice id + // id of the blocking entity string subject = 2; // what blocks the delete and what the caller can do about it string message = 3; + // what kind of entity the subject id refers to, e.g. + // billing_subscription, billing_invoice, billing_account + string subject_type = 4; } // true when nothing blocks the delete right now bool can_delete = 1;