Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support: Show annual revenue for active fixed price plans. #30170

Merged

Conversation

laurynmm
Copy link
Collaborator

@laurynmm laurynmm commented May 22, 2024

In the activity and support views, we want to see the annual revenue for fixed price plans. While on billing pages, we do not display this information as these plans are renegotiated annually.

Adds get_annual_recurring_revenue_for_support_data function to BillingSession class, so that we can get the fixed price plan data for these views without changing the logic for what is displayed on the billing pages.

Screenshots and screen captures:

Remote support view
Before After
Screenshot from 2024-05-22 17-03-17 Screenshot from 2024-05-22 17-03-38
Remote activity view
Before After
Screenshot from 2024-05-22 17-06-23 Screenshot from 2024-05-22 17-06-06

Self-review checklist
  • Self-reviewed the changes for clarity and maintainability
    (variable names, code reuse, readability, etc.).

Communicate decisions, questions, and potential concerns.

  • Explains differences from previous plans (e.g., issue description).
  • Highlights technical choices and bugs encountered.
  • Calls out remaining decisions and concerns.
  • Automated tests verify logic where appropriate.

Individual commits are ready for review (see commit discipline).

  • Each commit is a coherent idea.
  • Commit message(s) explain reasoning and motivation for changes.

Completed manual review and testing of the following:

  • Visual appearance of the changes.
  • Responsiveness and internationalization.
  • Strings and tooltips.
  • End-to-end functionality of buttons, interactions and flows.
  • Corner cases, error conditions, and easily imagined bugs.

# For support and activity views, we want to show the annual
# revenue for the currently configured fixed price, which
# is the annual amount charged in cents.
return plan.fixed_price
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this depend on the billing cycle? I think fixed-price with monthly billing may be a possible variation.

Also, what's the thinking around whether we should instead be changing get_customer_plan_renewal_amount?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed price monthly billing is possible, but the amount in the fixed_plan field of the model is the annual amount in cents. That would probably be useful documentation to add. But my previous changes were incorrect, in that the non-fixed price plans were returning an amount based on the billing schedule (monthly or annually).

I've updated the new helper function to always return the annual revenue amount.


Re: why add a new function instead of updating get_customer_plan_renewal_amount is that for user-facing billing pages, we want to show this:

        if plan.fixed_price is not None:
            if plan.end_date == self.get_next_billing_cycle(plan):
                return 0

And for activity/support pages, we want to show the annual fixed price amount.

@laurynmm laurynmm force-pushed the support-show-fixed-price-plan-revenue branch from d67eee3 to 81d17ee Compare May 22, 2024 19:09
@zulipbot zulipbot added size: M and removed size: S labels May 22, 2024
In the activity and support views, we want to see the annual
revenue for fixed price plans. While on billing pages, we do
not display this information as these plans are renegotiated
annually.

Adds get_annual_recurring_revenue_for_support_data function
to BillingSession class, so that we can get the fixed price
plan data for these views without changing the logic for
what is displayed on the billing pages.
@timabbott timabbott force-pushed the support-show-fixed-price-plan-revenue branch from 81d17ee to 94a95fb Compare May 22, 2024 22:34
@timabbott timabbott enabled auto-merge (rebase) May 22, 2024 22:34
@timabbott
Copy link
Sponsor Member

OK, looks good, marked to merge once CI passes.

I feel like I'm never going to get to doing a pass of comment documentation on corporate/models.py; maybe you should do a pass on documenting the fields there, and I can do a follow-up for anything unclear after reviewing that?

@timabbott timabbott merged commit 4fcf794 into zulip:main May 22, 2024
6 checks passed
@laurynmm laurynmm deleted the support-show-fixed-price-plan-revenue branch May 23, 2024 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants