feat(plans): order deleted plans after active ones - #6033
feat(plans): order deleted plans after active ones#6033lago-claude-ai-agent[bot] wants to merge 3 commits into
Conversation
## Context Plans are soft deleted so the history of the subscriptions, invoices and terminations attached to them stays available. As a consequence, deleted plans keep appearing in the plan lists and filters mixed in with the active ones, and customers have reported that this makes the list hard to read. ## Description Order plans by `deleted_at` first, so non-deleted plans come before deleted ones, then by name so the active list stays in a predictable order that is easy to scan. Both the GraphQL resolver used by the UI and the REST index read through `PlansQuery`, so the two stay consistent. Signed-off-by: lago-claude-ai-agent[bot] <297187938+lago-claude-ai-agent[bot]@users.noreply.github.com>
|
HOLD — the change also re-sorts the public REST plan list alphabetically, which goes beyond grouping deleted plans last, and deleted plans end up ordered by deletion time rather than by name.
Verified and non-blocking: both consumers ( Nit: |
Group deleted plans with a boolean key so both groups sort by name, and move the order into a DEFAULT_ORDER constant. Signed-off-by: lago-claude-ai-agent[bot] <297187938+lago-claude-ai-agent[bot]@users.noreply.github.com>
Specs and Rubocop could not be executed in my sandbox (no Ruby toolchain or database available), so CI is the first real run of the ordering assertions. |
|
Held: CI is not green on this PR; not reviewed. Re-run CI, then re-review. Checks: https://github.com/getlago/lago-api/pull/6033/checks |
|
|
HOLD — the last commit ("review: fix mixed hash syntax in plans order") touches six files that have nothing to do with the plans ordering, and one of them introduces a reachable
Verified and good: the |
3fa8ddc to
574e22e
Compare
Use rockets for every DEFAULT_ORDER key so Rubocop's Style/HashSyntax passes. Signed-off-by: lago-claude-ai-agent[bot] <297187938+lago-claude-ai-agent[bot]@users.noreply.github.com>
Locally: |
|
PASS — the ordering change is correct and now scoped to Verified: Needs a human/product call before merge (non-blocking for review, called out in the PR description): this flips the default Nits: two of the three commits use a |
|
@claude create a scenario to also sort the plan names when contains special characters, for example, with three plans names:
The sorting should respect the order and return |
PlansQuerynow orders plans bydeleted_at(non-deleted first), then by name, instead of bycreated_at DESC. Plans are soft deleted to keep their billing history, but they were showing up mixed into the plan lists and filters, which made the active plans hard to find.Both the GraphQL resolver used by the UI and the REST index read through this query, so they stay consistent.