Public Access
1
0

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:
pguerrerox
2026-05-22 17:50:28 +00:00
parent f1a46c79f2
commit 94b8c357b4
21 changed files with 2269 additions and 151 deletions
+12
View File
@@ -524,6 +524,18 @@ export function getPublicPricingPlans() {
return ACTIVE_PLAN_CATALOG.filter((plan) => plan.listingCategory === 'pricing_page_primary');
}
export function getPublicPricingPlansForInterval(billingInterval: BillingInterval) {
return ACTIVE_PLAN_CATALOG.filter((plan) => {
if (plan.code === 'enterprise_custom') {
return true;
}
return plan.listingCategory === 'pricing_page_hidden'
? plan.billingInterval === billingInterval
: plan.listingCategory === 'pricing_page_primary' && plan.billingInterval === billingInterval;
});
}
export function getPlanVariant(tier: PlanTier, billingInterval: BillingInterval) {
return ACTIVE_PLAN_CATALOG.find((plan) => plan.planFamily === tier && plan.billingInterval === billingInterval) ?? null;
}