feat(billing): cap active users on an owner subscription

Super admin can set a seat limit of 3, 10, 20, or a negotiated number so an owner cannot add users past that cap.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-02 18:33:51 +03:30
co-authored by Cursor
parent 06977d27ed
commit acb5d51f24
9 changed files with 220 additions and 2 deletions
+14
View File
@@ -351,6 +351,18 @@ export interface SetStorageQuotaRequest {
quotaGb: number | null;
}
/** سقف‌های آمادهٔ تعداد کاربر. بالاتر از ۲۰ توافقی و با عدد جدا ذخیره می‌شود. */
export const BILLING_USER_CAPS = [3, 10, 20] as const;
export interface OwnerSeatUsageDto {
usedUsers: number;
maxUsers: number | null;
}
export interface SetUserCapRequest {
maxUsers: number;
}
export interface SubscriptionSummaryDto {
planCode: BillingPlanCode;
status: BillingAccountStatus;
@@ -369,6 +381,8 @@ export interface BillingAccountDto {
startsAt: string;
expiresAt: string;
maxOrganizations: number;
/** null یعنی سقف کاربر هنوز تعیین نشده */
maxUsers?: number | null;
externalPaymentRef?: string | null;
notes?: string | null;
daysRemaining: number;