-
Notifications
You must be signed in to change notification settings - Fork 28
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
feat: adjust schedules logic for upgrades to occur immediately #265
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #265 +/- ##
=====================================
Coverage 95.54 95.54
=====================================
Files 721 721
Lines 16048 16048
=====================================
Hits 15332 15332
Misses 716 716
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #265 +/- ##
=======================================
Coverage 95.63% 95.63%
=======================================
Files 607 607
Lines 15641 15641
=======================================
Hits 14958 14958
Misses 683 683
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pre-approved with one little thing
services/billing.py
Outdated
new_plan = desired_plan["value"] | ||
new_quantity = desired_plan["quantity"] | ||
|
||
print("downgrade", new_plan, new_quantity) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debugging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tyty
) | ||
log.info( | ||
f"Stripe subscription modified successfully for owner {owner.ownerid} by user #{self.requesting_user.ownerid}" | ||
) | ||
else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
under this else block can be simplified to:
if not subscription_schedule_id:
subscription_schedule_id = stripe.SubscriptionSchedule.create(
from_subscription=owner.stripe_subscription_id
).id
self._modify_subscription_schedule(
owner, subscription, subscription_schedule_id, desired_plan
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense, will make the changes!
* feat: adjust schedules logic for upgrades to occur immediately * feat: adjust logic
Purpose/Motivation
We're adjusting the logic that governs schedules to make changes effective immediate when the desired scheduled value is an upgrade from the original one, either seats or billing rate.
What does this PR do?
Notes to Reviewer
screen-capture.8.webm
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.