Add subcription level filtering 2
This commit is contained in:
@@ -29,34 +29,34 @@ class SubscriptionMiddleware(BaseHTTPMiddleware):
|
||||
# Analytics routes - require different levels based on actual app routes
|
||||
r'/api/v1/tenants/[^/]+/analytics/.*': {
|
||||
'feature': 'analytics',
|
||||
'minimum_level': 'advanced' # General analytics require Professional+
|
||||
'minimum_level': 'basic' # Changed to basic to allow all tiers access to analytics
|
||||
},
|
||||
r'/api/v1/tenants/[^/]+/forecasts/.*': {
|
||||
'feature': 'analytics',
|
||||
'minimum_level': 'advanced' # Forecasting requires Professional+
|
||||
'minimum_level': 'basic' # Changed to basic to allow all tiers access to forecasting
|
||||
},
|
||||
r'/api/v1/tenants/[^/]+/predictions/.*': {
|
||||
'feature': 'analytics',
|
||||
'minimum_level': 'advanced' # Predictions require Professional+
|
||||
'minimum_level': 'basic' # Changed to basic to allow all tiers access to predictions
|
||||
},
|
||||
# Training and AI models - Professional+
|
||||
# Training and AI models - Now available to all tiers
|
||||
r'/api/v1/tenants/[^/]+/training/.*': {
|
||||
'feature': 'analytics',
|
||||
'minimum_level': 'advanced'
|
||||
'minimum_level': 'basic' # Changed to basic to allow all tiers access to training
|
||||
},
|
||||
r'/api/v1/tenants/[^/]+/models/.*': {
|
||||
'feature': 'analytics',
|
||||
'minimum_level': 'advanced'
|
||||
'minimum_level': 'basic' # Changed to basic to allow all tiers access to models
|
||||
},
|
||||
# Advanced production features - Professional+
|
||||
r'/api/v1/tenants/[^/]+/production/optimization/.*': {
|
||||
'feature': 'analytics',
|
||||
'minimum_level': 'advanced'
|
||||
'minimum_level': 'basic'
|
||||
},
|
||||
# Enterprise-only features
|
||||
r'/api/v1/tenants/[^/]+/statistics.*': {
|
||||
'feature': 'analytics',
|
||||
'minimum_level': 'predictive' # Advanced stats for Enterprise only
|
||||
'minimum_level': 'basic' # Advanced stats for Enterprise only
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -262,7 +262,8 @@ async def get_available_plans():
|
||||
"analytics": "basic",
|
||||
"support": "email",
|
||||
"trial_days": 14,
|
||||
"locations": "1_location"
|
||||
"locations": "1_location",
|
||||
"ai_model_configuration": "basic" # Added AI model configuration for all tiers
|
||||
},
|
||||
"trial_available": True
|
||||
},
|
||||
@@ -282,7 +283,8 @@ async def get_available_plans():
|
||||
"analytics": "advanced",
|
||||
"support": "priority_24_7",
|
||||
"trial_days": 14,
|
||||
"locations": "1_2_locations"
|
||||
"locations": "1_2_locations",
|
||||
"ai_model_configuration": "advanced" # Enhanced AI model configuration for Professional
|
||||
},
|
||||
"trial_available": True,
|
||||
"popular": True
|
||||
@@ -304,7 +306,8 @@ async def get_available_plans():
|
||||
"api_access": "personalized",
|
||||
"account_manager": True,
|
||||
"demo": "personalized",
|
||||
"locations": "unlimited_obradores"
|
||||
"locations": "unlimited_obradores",
|
||||
"ai_model_configuration": "enterprise" # Full AI model configuration for Enterprise
|
||||
},
|
||||
"trial_available": False,
|
||||
"contact_sales": True
|
||||
|
||||
@@ -410,7 +410,8 @@ class SubscriptionRepository(TenantBaseRepository):
|
||||
"analytics": "basic",
|
||||
"support": "email",
|
||||
"trial_days": 14,
|
||||
"locations": "1_location"
|
||||
"locations": "1_location",
|
||||
"ai_model_configuration": "basic" # Added AI model configuration for all tiers
|
||||
}
|
||||
},
|
||||
"professional": {
|
||||
@@ -427,7 +428,8 @@ class SubscriptionRepository(TenantBaseRepository):
|
||||
"analytics": "advanced",
|
||||
"support": "priority_24_7",
|
||||
"trial_days": 14,
|
||||
"locations": "1_2_locations"
|
||||
"locations": "1_2_locations",
|
||||
"ai_model_configuration": "advanced" # Enhanced AI model configuration for Professional
|
||||
}
|
||||
},
|
||||
"enterprise": {
|
||||
@@ -445,7 +447,8 @@ class SubscriptionRepository(TenantBaseRepository):
|
||||
"api_access": "personalized",
|
||||
"account_manager": True,
|
||||
"demo": "personalized",
|
||||
"locations": "unlimited_obradores"
|
||||
"locations": "unlimited_obradores",
|
||||
"ai_model_configuration": "enterprise" # Full AI model configuration for Enterprise
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,8 @@ class SubscriptionLimitService:
|
||||
"demand_prediction": "basic",
|
||||
"production_reports": "basic",
|
||||
"analytics": "basic",
|
||||
"support": "email"
|
||||
"support": "email",
|
||||
"ai_model_configuration": "basic" # Added AI model configuration for all tiers
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user