Files
server/src/Core/Billing/Models/ConfiguredProviderPlanDTO.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
761 B
C#
Raw Normal View History

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;
}