mirror of
https://github.com/bitwarden/server.git
synced 2025-05-06 04:02:15 -05:00

* Renamed ProductType to ProductTierType * Renamed Product properties to ProductTier * Moved ProductTierType to Bit.Core.Billing.Enums namespace from Bit.Core.Enums * Moved PlanType enum to Bit.Core.Billing.Enums * Moved StaticStore to Bit.Core.Billing.Models.StaticStore namespace * Added ProductType enum * dotnet format
25 lines
761 B
C#
25 lines
761 B
C#
using Bit.Core.Billing.Entities;
|
|
using Bit.Core.Billing.Enums;
|
|
|
|
namespace Bit.Core.Billing.Models;
|
|
|
|
public record ConfiguredProviderPlanDTO(
|
|
Guid Id,
|
|
Guid ProviderId,
|
|
PlanType PlanType,
|
|
int SeatMinimum,
|
|
int PurchasedSeats,
|
|
int AssignedSeats)
|
|
{
|
|
public static ConfiguredProviderPlanDTO From(ProviderPlan providerPlan) =>
|
|
providerPlan.IsConfigured()
|
|
? new ConfiguredProviderPlanDTO(
|
|
providerPlan.Id,
|
|
providerPlan.ProviderId,
|
|
providerPlan.PlanType,
|
|
providerPlan.SeatMinimum.GetValueOrDefault(0),
|
|
providerPlan.PurchasedSeats.GetValueOrDefault(0),
|
|
providerPlan.AllocatedSeats.GetValueOrDefault(0))
|
|
: null;
|
|
}
|