This repository was archived by the owner on Jun 13, 2025. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork30
feat: add plan tier service#150
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
10 commits Select commitHold shift + click to select a range
bad228e WIP features
adrian-codecov89d8392 feat: add a tier service class
adrian-codecovbdfbd03 feat: add trial plan to pro tier
adrian-codecovf3be7e8 Merge branch 'main' of github.com:codecov/codecov-api into 412-plan-p…
adrian-codecovf01c96d Merge branch 'main' of github.com:codecov/codecov-api into 412-plan-p…
adrian-codecov70a1205 Add resolver for tier
adrian-codecov45a18bb feat: add tier to the plan service + resolver instead
adrian-codecovd7c3b07 bug: get rid of print statement
adrian-codecova2857f8 Adjust return type of the plan service/resolvers + tier
adrian-codecov0f511b6 Merge branch 'main' of github.com:codecov/codecov-api into 412-plan-p…
adrian-codecovFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
14 changes: 14 additions & 0 deletionsapi/internal/tests/views/test_plans_viewset.py
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| enum TierName { | ||
| BASIC | ||
| LITE | ||
| PRO | ||
| ENTERPRISE | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -6,6 +6,7 @@ type Plan { | ||
| pretrialUsersCount: Int | ||
| marketingName: String! | ||
| planName: String! | ||
| tierName: String! | ||
Contributor 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 use the GraphQL enum anywhere? Should this be | ||
| billingRate: String | ||
| baseUnitPrice: Int! | ||
| benefits: [String!]! | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -10,6 +10,7 @@ | ||
| PlanMarketingName, | ||
| PlanName, | ||
| PlanPrice, | ||
| TierName, | ||
| TrialStatus, | ||
| ) | ||
| from plan.service import PlanService | ||
| @@ -38,25 +39,31 @@ def resolve_trial_status(plan_service: PlanService, info) -> TrialStatus: | ||
| @plan_bindable.field("marketingName") | ||
| @convert_kwargs_to_snake_case | ||
| def resolve_marketing_name(plan_service: PlanService, info) ->str: | ||
| return plan_service.marketing_name | ||
| @plan_bindable.field("planName") | ||
| @convert_kwargs_to_snake_case | ||
| def resolve_plan_name(plan_service: PlanService, info) ->str: | ||
| return plan_service.plan_name | ||
| @plan_bindable.field("tierName") | ||
| @convert_kwargs_to_snake_case | ||
| def resolve_tier_name(plan_service: PlanService, info) -> str: | ||
| return plan_service.tier_name | ||
Contributor 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. This is where you could call | ||
| @plan_bindable.field("billingRate") | ||
| @convert_kwargs_to_snake_case | ||
| def resolve_billing_rate(plan_service: PlanService, info) -> Optional[str]: | ||
| return plan_service.billing_rate | ||
| @plan_bindable.field("baseUnitPrice") | ||
| @convert_kwargs_to_snake_case | ||
| def resolve_base_unit_price(plan_service: PlanService, info) ->int: | ||
| return plan_service.base_unit_price | ||
| @@ -75,7 +82,5 @@ def resolve_pretrial_users_count(plan_service: PlanService, info) -> Optional[in | ||
| @plan_bindable.field("monthlyUploadLimit") | ||
| @convert_kwargs_to_snake_case | ||
| def resolve_monthly_uploads_limit(plan_service: PlanService, info) -> Optional[int]: | ||
| return plan_service.monthly_uploads_limit | ||
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
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
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.