mirror of
https://github.com/bitwarden/server
synced 2025-12-15 15:53:59 +00:00
* Use payment domain * Run dotnet format and remove unused code * Fix swagger * Stephon's feedback * Run dotnet format
24 lines
948 B
C#
24 lines
948 B
C#
using Bit.Core.Billing.Enums;
|
|
|
|
namespace Bit.Core.Billing.Organizations.Models;
|
|
|
|
public record OrganizationSubscriptionPlanChange
|
|
{
|
|
public ProductTierType Tier { get; init; }
|
|
public PlanCadenceType Cadence { get; init; }
|
|
|
|
public PlanType PlanType =>
|
|
// ReSharper disable once SwitchExpressionHandlesSomeKnownEnumValuesWithExceptionInDefault
|
|
Tier switch
|
|
{
|
|
ProductTierType.Families => PlanType.FamiliesAnnually,
|
|
ProductTierType.Teams => Cadence == PlanCadenceType.Monthly
|
|
? PlanType.TeamsMonthly
|
|
: PlanType.TeamsAnnually,
|
|
ProductTierType.Enterprise => Cadence == PlanCadenceType.Monthly
|
|
? PlanType.EnterpriseMonthly
|
|
: PlanType.EnterpriseAnnually,
|
|
_ => throw new InvalidOperationException("Cannot change an Organization subscription to a tier that isn't Families, Teams or Enterprise.")
|
|
};
|
|
}
|