feat(contracts): Add contracts permission to subscription tiers

- Add contracts_enabled field to SubscriptionPlan model
- Add contracts toggle to plan create/edit modal in platform settings
- Hide contracts menu item for tenants without contracts permission
- Protect /contracts routes with canUse('contracts') check
- Add HasContractsPermission to contracts API ViewSets
- Add contracts to PlanPermissions interface and feature definitions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
poduck
2025-12-05 23:28:51 -05:00
parent 35f4301fe1
commit 023ea7f020
12 changed files with 105 additions and 13 deletions

View File

@@ -51,6 +51,8 @@ export interface SubscriptionPlan {
masked_calling_price_per_minute_cents: number;
proxy_number_enabled: boolean;
proxy_number_monthly_fee_cents: number;
// Contracts feature
contracts_enabled: boolean;
// Default credit settings
default_auto_reload_enabled: boolean;
default_auto_reload_threshold_cents: number;
@@ -82,6 +84,8 @@ export interface SubscriptionPlanCreate {
masked_calling_price_per_minute_cents?: number;
proxy_number_enabled?: boolean;
proxy_number_monthly_fee_cents?: number;
// Contracts feature
contracts_enabled?: boolean;
// Default credit settings
default_auto_reload_enabled?: boolean;
default_auto_reload_threshold_cents?: number;