mirror of
https://github.com/bitwarden/server
synced 2025-12-30 15:14:02 +00:00
* Remove feature flag and move StaticStore plans to MockPlans for tests * Remove old plan models / move sponsored plans out of StaticStore * Run dotnet format * Add pricing URI to Development appsettings for local development and integration tests * Updated Api Integration tests to get current plan type * Run dotnet format * Fix failing tests
99 lines
3.0 KiB
C#
99 lines
3.0 KiB
C#
using Bit.Core.Billing.Enums;
|
|
using Bit.Core.Models.StaticStore;
|
|
|
|
namespace Bit.Core.Test.Billing.Mocks.Plans;
|
|
|
|
public record TeamsPlan : Plan
|
|
{
|
|
public TeamsPlan(bool isAnnual)
|
|
{
|
|
Type = isAnnual ? PlanType.TeamsAnnually : PlanType.TeamsMonthly;
|
|
ProductTier = ProductTierType.Teams;
|
|
Name = isAnnual ? "Teams (Annually)" : "Teams (Monthly)";
|
|
IsAnnual = isAnnual;
|
|
NameLocalizationKey = "planNameTeams";
|
|
DescriptionLocalizationKey = "planDescTeams";
|
|
CanBeUsedByBusiness = true;
|
|
|
|
TrialPeriodDays = 7;
|
|
|
|
HasGroups = true;
|
|
HasDirectory = true;
|
|
HasEvents = true;
|
|
HasTotp = true;
|
|
Has2fa = true;
|
|
HasApi = true;
|
|
UsersGetPremium = true;
|
|
HasScim = true;
|
|
|
|
UpgradeSortOrder = 3;
|
|
DisplaySortOrder = 3;
|
|
|
|
PasswordManager = new TeamsPasswordManagerFeatures(isAnnual);
|
|
SecretsManager = new TeamsSecretsManagerFeatures(isAnnual);
|
|
}
|
|
|
|
private record TeamsSecretsManagerFeatures : SecretsManagerPlanFeatures
|
|
{
|
|
public TeamsSecretsManagerFeatures(bool isAnnual)
|
|
{
|
|
BaseSeats = 0;
|
|
BasePrice = 0;
|
|
BaseServiceAccount = 20;
|
|
|
|
HasAdditionalSeatsOption = true;
|
|
HasAdditionalServiceAccountOption = true;
|
|
|
|
AllowSeatAutoscale = true;
|
|
AllowServiceAccountsAutoscale = true;
|
|
|
|
if (isAnnual)
|
|
{
|
|
StripeSeatPlanId = "secrets-manager-teams-seat-annually";
|
|
StripeServiceAccountPlanId = "secrets-manager-service-account-2024-annually";
|
|
SeatPrice = 72;
|
|
AdditionalPricePerServiceAccount = 12;
|
|
}
|
|
else
|
|
{
|
|
StripeSeatPlanId = "secrets-manager-teams-seat-monthly";
|
|
StripeServiceAccountPlanId = "secrets-manager-service-account-2024-monthly";
|
|
SeatPrice = 7;
|
|
AdditionalPricePerServiceAccount = 1;
|
|
}
|
|
}
|
|
}
|
|
|
|
private record TeamsPasswordManagerFeatures : PasswordManagerPlanFeatures
|
|
{
|
|
public TeamsPasswordManagerFeatures(bool isAnnual)
|
|
{
|
|
BaseSeats = 0;
|
|
BaseStorageGb = 1;
|
|
BasePrice = 0;
|
|
|
|
HasAdditionalStorageOption = true;
|
|
HasAdditionalSeatsOption = true;
|
|
|
|
AllowSeatAutoscale = true;
|
|
|
|
if (isAnnual)
|
|
{
|
|
StripeStoragePlanId = "storage-gb-annually";
|
|
StripeSeatPlanId = "2023-teams-org-seat-annually";
|
|
SeatPrice = 48;
|
|
AdditionalStoragePricePerGb = 4;
|
|
}
|
|
else
|
|
{
|
|
StripeSeatPlanId = "2023-teams-org-seat-monthly";
|
|
StripeProviderPortalSeatPlanId = "password-manager-provider-portal-teams-monthly-2024";
|
|
StripeStoragePlanId = "storage-gb-monthly";
|
|
SeatPrice = 5;
|
|
ProviderPortalSeatPrice = 4;
|
|
AdditionalStoragePricePerGb = 0.5M;
|
|
}
|
|
}
|
|
}
|
|
}
|