1
0
mirror of https://github.com/bitwarden/server.git synced 2025-05-20 19:14:32 -05:00
bitwarden/src/Core/Billing/Entities/ProviderPlan.cs
Alex Morask e2cb406a95
[AC-1910] Allocate seats to a provider organization (#3936)
* Add endpoint to update a provider organization's seats for consolidated billing.

* Fixed failing tests
2024-03-29 11:18:10 -04:00

26 lines
658 B
C#

using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Utilities;
namespace Bit.Core.Billing.Entities;
public class ProviderPlan : ITableObject<Guid>
{
public Guid Id { get; set; }
public Guid ProviderId { get; set; }
public PlanType PlanType { get; set; }
public int? SeatMinimum { get; set; }
public int? PurchasedSeats { get; set; }
public int? AllocatedSeats { get; set; }
public void SetNewId()
{
if (Id == default)
{
Id = CoreHelpers.GenerateComb();
}
}
public bool IsConfigured() => SeatMinimum.HasValue && PurchasedSeats.HasValue && AllocatedSeats.HasValue;
}