feat: add billing foundation and entitlement enforcement
- add workspace-scoped billing storage, usage tracking, and add-on catalog - enforce plan entitlements for search and deep research routes - expand pricing and account UI around billing state, usage, and upgrades
This commit is contained in:
+22
-1
@@ -1,4 +1,5 @@
|
||||
import type { BillingInterval, PlanCode } from './billing/plans.js';
|
||||
import type { AddonCode, BillingInterval, PlanCode } from './billing/plans.js';
|
||||
import type { UsageAllowanceAvailability, UsageResource } from './billing/entitlements.js';
|
||||
|
||||
export type JobStatus = 'pending' | 'running' | 'completed' | 'failed' | 'stopped';
|
||||
|
||||
@@ -34,10 +35,30 @@ export interface AccountSummary {
|
||||
|
||||
export type AccountBillingStatus = 'not_configured' | 'inactive' | 'active' | 'past_due' | 'canceled';
|
||||
|
||||
export interface BillingUsageResourceSummary {
|
||||
resource: UsageResource;
|
||||
availability: UsageAllowanceAvailability;
|
||||
included: number | null;
|
||||
consumed: number;
|
||||
remaining: number | null;
|
||||
}
|
||||
|
||||
export interface BillingAddonBalanceSummary {
|
||||
addonCode: AddonCode;
|
||||
resource: UsageResource;
|
||||
remainingQuantity: number;
|
||||
expiresAt: string | null;
|
||||
}
|
||||
|
||||
export interface AccountBillingState {
|
||||
status: AccountBillingStatus;
|
||||
planCode: PlanCode | null;
|
||||
billingInterval: BillingInterval | null;
|
||||
currentPeriodStartsAt: string | null;
|
||||
currentPeriodEndsAt: string | null;
|
||||
cancelAtPeriodEnd: boolean;
|
||||
usage: BillingUsageResourceSummary[];
|
||||
addonBalances: BillingAddonBalanceSummary[];
|
||||
message: string;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user