1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-10 04:14:41 -05:00

[AC-1708] Teams Starter Plan (#3386)

* Upgraded old 2019 plans to have the same features as 2020 and beyond

* Removed redundant test and moved additional test cases to GetByOrgIdAsync_SmNoneFreePlans_ReturnsNull

* Fixed issue where feature flag wasn't returning correct plans

* Added teams 2010 plan

* Reverted accidental change to StripePaymentService

* Split feature flag logic and added some explanatory comments

* Removed families changes

* Resolved issue where Teams Starter could not sign up for a new org with SM enabled

* Fixed issue with signing up for SM with Teams Starter

* Resolved issue where an active plan could increase their SM seat count to be greater than the base seats in the password manager plan

* Updated unit test to ensure Seats are higher than SmSeats

* Resolved issue where getting plans would return a value that LINQ previously cached when feature flag was in a different state
This commit is contained in:
Conner Turnbull
2023-11-03 18:26:47 -04:00
committed by GitHub
parent 92ffe5fc20
commit 3eb4d547a8
18 changed files with 171 additions and 8 deletions

View File

@ -33,9 +33,12 @@ public class PlansController : Controller
public ListResponseModel<PlanResponseModel> Get()
{
var plansUpgradeIsEnabled = _featureService.IsEnabled(FeatureFlagKeys.BillingPlansUpgrade, _currentContext);
var data = StaticStore.Plans;
var responses = data
.Where(plan => plansUpgradeIsEnabled || plan.Type <= PlanType.EnterpriseAnnually2020)
var teamsStarterPlanIsEnabled = _featureService.IsEnabled(FeatureFlagKeys.BillingStarterPlan, _currentContext);
var responses = StaticStore.Plans
// If plans upgrade is disabled, return only the original plans. Otherwise, return everything
.Where(plan => plansUpgradeIsEnabled || plan.Type <= PlanType.EnterpriseAnnually2020 || plan.Type == PlanType.TeamsStarter)
// If teams starter is disabled, don't return that plan, otherwise return everything
.Where(plan => teamsStarterPlanIsEnabled || plan.Product != ProductType.TeamsStarter)
.Select(plan =>
{
if (!plansUpgradeIsEnabled && plan.Type is <= PlanType.EnterpriseAnnually2020 and >= PlanType.TeamsMonthly2020)