-
Notifications
You must be signed in to change notification settings - Fork 8
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
Shared: Migrate to Plan / Tier Tables #479
Merged
+715
−247
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
fbbb396
shared stuff should be migrated with this, first try with available_p…
ajay-sentry 52fdc2d
Merge branch 'main' into Ajay/milestone-3-migration
ajay-sentry 33d98f6
boilerplate updates, better way to do the plan searches
ajay-sentry ba68a8b
update logic a bit to work with new plan, and types as well, start fi…
ajay-sentry 3b1deb6
43 tests failing locally
ajay-sentry 7eb00e4
fix some tests:
RulaKhaled 4fd5090
uncomment stuff
RulaKhaled 7473f20
more tests fixing
RulaKhaled ccb28ab
5 more to go
RulaKhaled 208eb10
wrap up tests in test_plan
RulaKhaled a9a5eeb
resolve all tests
RulaKhaled 3dcd8ef
update test imports and helper, remove trial_days from DTO, start off…
ajay-sentry 6b1fabc
lint
ajay-sentry 906e7bc
Update with pretty plan changes
RulaKhaled 2cd7436
setupClass from setUp and clean up a bunch of the available plan tests
ajay-sentry 8277f6d
remove ttestcase if not needed
ajay-sentry 5c8398a
print
ajay-sentry d2c0af3
Merge branch 'main' into Ajay/milestone-3-migration
ajay-sentry 7804571
use cached property, remove setter
ajay-sentry 0e2207e
Merge branch 'main' into Ajay/milestone-3-migration
ajay-sentry 6e1418a
missed a couple prefetch references
ajay-sentry a4bd8f7
Merge branch 'main' into Ajay/milestone-3-migration
ajay-sentry File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,6 +73,26 @@ class TierName(enum.Enum): | |
TEAM = "team" | ||
PRO = "pro" | ||
ENTERPRISE = "enterprise" | ||
SENTRY = "sentry" | ||
TRIAL = "trial" | ||
|
||
|
||
def convert_to_DTO(plan) -> dict: | ||
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. @Swatinem this guy |
||
return { | ||
"marketing_name": plan.marketing_name, | ||
"value": plan.name, | ||
"billing_rate": plan.billing_rate, | ||
"base_unit_price": plan.base_unit_price, | ||
"benefits": plan.benefits, | ||
"tier_name": plan.tier.tier_name, | ||
"monthly_uploads_limit": plan.monthly_uploads_limit, | ||
"is_free_plan": not plan.paid_plan, | ||
"is_pro_plan": plan.tier.tier_name == TierName.PRO.value, | ||
"is_team_plan": plan.tier.tier_name == TierName.TEAM.value, | ||
"is_enterprise_plan": plan.tier.tier_name == TierName.ENTERPRISE.value, | ||
"is_trial_plan": plan.tier.tier_name == TierName.TRIAL.value, | ||
"is_sentry_plan": plan.tier.tier_name == TierName.SENTRY.value, | ||
} | ||
|
||
|
||
@dataclass(repr=False) | ||
|
@@ -99,7 +119,6 @@ def convert_to_DTO(self) -> dict: | |
"benefits": self.benefits, | ||
"tier_name": self.tier_name, | ||
"monthly_uploads_limit": self.monthly_uploads_limit, | ||
"trial_days": self.trial_days, | ||
"is_free_plan": self.tier_name == TierName.BASIC.value, | ||
"is_pro_plan": self.tier_name == TierName.PRO.value, | ||
"is_team_plan": self.tier_name == TierName.TEAM.value, | ||
|
@@ -189,7 +208,7 @@ def convert_to_DTO(self) -> dict: | |
"Unlimited private repositories", | ||
"Priority Support", | ||
], | ||
tier_name=TierName.PRO.value, | ||
tier_name=TierName.SENTRY.value, | ||
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. note: These consts are all disappearing soon and aren't / shouldn't be a SOT for anything anymore |
||
trial_days=TrialDaysAmount.CODECOV_SENTRY.value, | ||
monthly_uploads_limit=None, | ||
), | ||
|
@@ -205,7 +224,7 @@ def convert_to_DTO(self) -> dict: | |
"Unlimited private repositories", | ||
"Priority Support", | ||
], | ||
tier_name=TierName.PRO.value, | ||
tier_name=TierName.SENTRY.value, | ||
trial_days=TrialDaysAmount.CODECOV_SENTRY.value, | ||
monthly_uploads_limit=None, | ||
), | ||
|
@@ -342,7 +361,7 @@ def convert_to_DTO(self) -> dict: | |
"Unlimited private repositories", | ||
"Priority Support", | ||
], | ||
tier_name=TierName.PRO.value, | ||
tier_name=TierName.TRIAL.value, | ||
trial_days=None, | ||
monthly_uploads_limit=None, | ||
), | ||
|
Oops, something went wrong.
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.
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.
Could we make this a class method, like serialized plan or something