-
-
Notifications
You must be signed in to change notification settings - Fork 2
chore(billing-platform): Add trial limits to package line items #325
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,13 @@ message LineItemConfig { | |
|
|
||
| // Used for calculating spend that should not apply towards an organization's PAYG budget (ie Seer seats) | ||
| sentry_protos.billing.v1.common.v1.TieredPricingRate uncapped_rate = 9; | ||
|
|
||
| // How many units are available for a PackageConfig during a subscription trial? For packages that are not eligible for trials, | ||
| // this field will be unset for all line items. | ||
| oneof trial_units { | ||
| bool is_unlimited_trial = 10; | ||
| uint64 num_trial_units = 11; | ||
| } | ||
|
Comment on lines
+29
to
+35
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we really need this? I think it would be a positive change to allow trials for any line item. Why would we want to restrict it and also have the package know about trials?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i'll let brendan confirm but i think the intention is to store the exact amount of units an org gets when they trial a specific package, that needs to be limited to a specific amount based on the package. we need to store this info(the reserved quotas per category for a trial of a specific package) somewhere, not sure what the best place is
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Subscription trials have limited amounts of reserved quantity for each line item that users do not control. So when a subscription trial begins they get pre-determined reserved quantities for all line items. I needed a way to encode those specific limits in the code. One option was to define these limits in the Engagement service, but that just felt like an extra file we'd need to update when launching a new line item. Defining it in the package proto also gives us the benefit of being able to enforce the fact that users can only trial specific plans (ie am3_business or am3_business_ent). I'm ok with defining these trial limits as a constant in the engagement service for now and we can revisit later.
From my perspective, the user is trialing a specific package (including its features, which we'll need to take into account at some point in the future) so it felt natural to include that as part of the package config. |
||
| } | ||
|
|
||
| // Represents a budget included in a package that is collectively used by one or more line items, | ||
|
|
@@ -51,6 +58,13 @@ message SharedLineItemPool { | |
| // Similar to LineItemConfig.reserved_rate, this field will hold the list of available reserved tiers for this line item | ||
| // as well as the prices for each respective tier. | ||
| sentry_protos.billing.v1.common.v1.TieredPricingRate reserved_tier = 8; | ||
|
|
||
| // How many units are available for a PackageConfig during a subscription trial? For packages that are not eligible for trials, | ||
| // this field will be unset for all line items. | ||
| oneof trial_units { | ||
| bool is_unlimited_trial = 9; | ||
| uint64 num_trial_units = 10; | ||
| } | ||
| } | ||
|
|
||
| message PackageConfig { | ||
|
|
||
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.
i'm wondering if these fields now mean we cannot effectively inherit from dev to team to business packages, since we will need different trial units for team and business packages, and therefore have to redefine all line item configs
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.
I'm not sure I follow. Can we leave trial units empty on developer and just overwrite the values in business plans?
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.
this works fine as long as we only allow subscription trials for business, i thought we offer them for team plans as well which means we would need to define trial units differently for team/business packages.