Add unified account lifecycle stage to admin tools#632
Merged
Conversation
- Add `get_account` as the primary tool for looking up any organization - Introduce `computeLifecycleStage()` function that combines subscription_status and prospect_status into a unified view: prospect → contacted → responded → interested → negotiating → member (or declined/churned) - Handle all subscription statuses: active, trialing, canceled, past_due, unpaid, incomplete, incomplete_expired - Mark `lookup_organization` and `find_prospect` as deprecated (still functional) - Update `find_prospect` to show lifecycle stage instead of raw prospect_status - Export `LIFECYCLE_STAGE_EMOJI` constant for consistent emoji usage This fixes the issue where paying members (like Mediaocean) would incorrectly show as "prospect" in find_prospect because it didn't check subscription_status. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.
Summary
get_accountas the primary tool for looking up any organizationcomputeLifecycleStage()function that combinessubscription_statusandprospect_statusinto a unified viewlookup_organizationandfind_prospectas deprecated (still functional for backwards compatibility)Lifecycle Stages
Problem Solved
Previously,
find_prospectwould show paying members (like Mediaocean) as "prospect" because it only checkedprospect_statusand ignoredsubscription_status. Now all tools show the correct lifecycle stage.Subscription Status Handling
active,trialing→ membercanceled,past_due,unpaid,incomplete_expired→ churnedincomplete→ negotiating (started payment but didn't complete)Test plan
🤖 Generated with Claude Code