Add UserPremiumAccess model to represent user premium access status from personal subscriptions and memberships

This commit is contained in:
Rui Tome 2025-12-08 16:18:29 +00:00
parent 02c2aa89be
commit 2184296d10
No known key found for this signature in database
GPG Key ID: 526239D96A8EC066

View File

@ -0,0 +1,29 @@
namespace Bit.Core.Billing.Premium.Models;
/// <summary>
/// Represents user premium access status from personal subscriptions and organization memberships.
/// </summary>
public class UserPremiumAccess
{
/// <summary>
/// The unique identifier for the user.
/// </summary>
public Guid Id { get; set; }
/// <summary>
/// Indicates whether the user has a personal premium subscription.
/// This does NOT include premium access from organizations.
/// </summary>
public bool PersonalPremium { get; set; }
/// <summary>
/// Indicates whether the user has premium access through any organization membership.
/// This is true if the user is a member of at least one enabled organization that grants premium access to users.
/// </summary>
public bool OrganizationPremium { get; set; }
/// <summary>
/// Indicates whether the user has premium access from any source (personal subscription or organization).
/// </summary>
public bool HasPremiumAccess => PersonalPremium || OrganizationPremium;
}