Repository navigation
feat(plan): plan delete (refused while workspaces are on it), plan archive, tenant set-plan (TBP-806) - #61
Closed
iman-nebulr wants to merge 4 commits into
Closed
iman-nebulr wants to merge 4 commits into
iman-nebulr wants to merge 4 commits into
Conversation
A plan could be created and reshaped from the CLI but never removed, so a scripted reset (a demo app back to clean) always ended with "delete these plans in the dashboard". `bridge plan delete --key <key>` removes it. The server decides what that means: a plan no workspace is on is deleted, one workspaces are on is archived (they keep it, nobody new can choose it), and the answer's `action` says which. `--dry-run` shows that decision and the workspaces on the plan, through the delete's read-only preview route, like `tenant delete` and `flag delete`. Needs delete authority (`auth login --admin`). Refs: TBP-806 Claude-Session: 9e06c000
…plan archive and tenant set-plan (TBP-806) Owner decision: deleting a plan workspaces are on is refused, not turned into an archive. The server answers 409 PLAN_IN_USE with how many workspaces are on it and the choices, which the CLI prints as the fix: archive the plan (`bridge plan archive`, `--undo` brings it back), or move those workspaces (`bridge tenant set-plan`, the dashboard's plan picker on the same route, Stripe subscription included) or delete them, then delete. Refs: TBP-806 Claude-Session: 9e06c000
…TBP-806)
- --dry-run calls only the deletion-preview route and never sends a DELETE.
- The delete sends a DELETE to the encoded key path and prints the
server's answer.
- A 409 PLAN_IN_USE answer comes out as that code, with the server's fix as
the hint and exit code 1.
- plan archive sends { archived: true }; --undo sends false.
- tenant set-plan picks the plan's price and posts to planDetails. An
unknown plan, price or tenant, or an ambiguous tenant name, sends nothing.
- The three commands are registered.
Not run yet: no running container mounts bridge-cli.
Refs: TBP-806
Claude-Session: 9e06c000
…_plan and set_tenant_plan (TBP-806) Refs: TBP-806 Claude-Session: 9e06c000
Contributor
Author
|
Shipped in #62 (release v0.6.5). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commands
bridge plan delete --key <key> [--dry-run]deletes a plan no workspace is on. When workspaces are on it, the server refuses with 409PLAN_IN_USE, and the CLI prints the server's fix: archive the plan, or move or delete those workspaces first. Needsbridge auth login --admin.bridge plan archive --key <key> [--undo]: workspaces on the plan keep it, and nobody new can choose it.bridge tenant set-plan --name|--id --plan <key> [--interval] [--currency]moves a workspace to another plan, the same change as the dashboard's plan picker. A paid Stripe subscription moves with it.The README and the payments decision guide are updated.
prompts/mcp-tools.jsonis regenerated from bridge-api to includedelete_plan,archive_planandset_tenant_plan.Tests
tbp806-plan-commands.test.ts(17 cases).Depends on
The server side is in bridge-api
feature/tbp-806-plan-delete. Against an older server,plan delete --dry-runfails safe (preview not supported) andplan archivereturns 404.Ticket: TBP-806