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
|
# Analytics routes - require different levels based on actual app routes
|
||||||
r'/api/v1/tenants/[^/]+/analytics/.*': {
|
r'/api/v1/tenants/[^/]+/analytics/.*': {
|
||||||
'feature': '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/.*': {
|
r'/api/v1/tenants/[^/]+/forecasts/.*': {
|
||||||
'feature': 'analytics',
|
'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/.*': {
|
r'/api/v1/tenants/[^/]+/predictions/.*': {
|
||||||
'feature': 'analytics',
|
'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/.*': {
|
r'/api/v1/tenants/[^/]+/training/.*': {
|
||||||
'feature': 'analytics',
|
'feature': 'analytics',
|
||||||
'minimum_level': 'advanced'
|
'minimum_level': 'basic' # Changed to basic to allow all tiers access to training
|
||||||
},
|
},
|
||||||
r'/api/v1/tenants/[^/]+/models/.*': {
|
r'/api/v1/tenants/[^/]+/models/.*': {
|
||||||
'feature': 'analytics',
|
'feature': 'analytics',
|
||||||
'minimum_level': 'advanced'
|
'minimum_level': 'basic' # Changed to basic to allow all tiers access to models
|
||||||
},
|
},
|
||||||
# Advanced production features - Professional+
|
# Advanced production features - Professional+
|
||||||
r'/api/v1/tenants/[^/]+/production/optimization/.*': {
|
r'/api/v1/tenants/[^/]+/production/optimization/.*': {
|
||||||
'feature': 'analytics',
|
'feature': 'analytics',
|
||||||
'minimum_level': 'advanced'
|
'minimum_level': 'basic'
|
||||||
},
|
},
|
||||||
# Enterprise-only features
|
# Enterprise-only features
|
||||||
r'/api/v1/tenants/[^/]+/statistics.*': {
|
r'/api/v1/tenants/[^/]+/statistics.*': {
|
||||||
'feature': 'analytics',
|
'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",
|
"analytics": "basic",
|
||||||
"support": "email",
|
"support": "email",
|
||||||
"trial_days": 14,
|
"trial_days": 14,
|
||||||
"locations": "1_location"
|
"locations": "1_location",
|
||||||
|
"ai_model_configuration": "basic" # Added AI model configuration for all tiers
|
||||||
},
|
},
|
||||||
"trial_available": True
|
"trial_available": True
|
||||||
},
|
},
|
||||||
@@ -282,7 +283,8 @@ async def get_available_plans():
|
|||||||
"analytics": "advanced",
|
"analytics": "advanced",
|
||||||
"support": "priority_24_7",
|
"support": "priority_24_7",
|
||||||
"trial_days": 14,
|
"trial_days": 14,
|
||||||
"locations": "1_2_locations"
|
"locations": "1_2_locations",
|
||||||
|
"ai_model_configuration": "advanced" # Enhanced AI model configuration for Professional
|
||||||
},
|
},
|
||||||
"trial_available": True,
|
"trial_available": True,
|
||||||
"popular": True
|
"popular": True
|
||||||
@@ -304,7 +306,8 @@ async def get_available_plans():
|
|||||||
"api_access": "personalized",
|
"api_access": "personalized",
|
||||||
"account_manager": True,
|
"account_manager": True,
|
||||||
"demo": "personalized",
|
"demo": "personalized",
|
||||||
"locations": "unlimited_obradores"
|
"locations": "unlimited_obradores",
|
||||||
|
"ai_model_configuration": "enterprise" # Full AI model configuration for Enterprise
|
||||||
},
|
},
|
||||||
"trial_available": False,
|
"trial_available": False,
|
||||||
"contact_sales": True
|
"contact_sales": True
|
||||||
|
|||||||
@@ -410,7 +410,8 @@ class SubscriptionRepository(TenantBaseRepository):
|
|||||||
"analytics": "basic",
|
"analytics": "basic",
|
||||||
"support": "email",
|
"support": "email",
|
||||||
"trial_days": 14,
|
"trial_days": 14,
|
||||||
"locations": "1_location"
|
"locations": "1_location",
|
||||||
|
"ai_model_configuration": "basic" # Added AI model configuration for all tiers
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"professional": {
|
"professional": {
|
||||||
@@ -427,7 +428,8 @@ class SubscriptionRepository(TenantBaseRepository):
|
|||||||
"analytics": "advanced",
|
"analytics": "advanced",
|
||||||
"support": "priority_24_7",
|
"support": "priority_24_7",
|
||||||
"trial_days": 14,
|
"trial_days": 14,
|
||||||
"locations": "1_2_locations"
|
"locations": "1_2_locations",
|
||||||
|
"ai_model_configuration": "advanced" # Enhanced AI model configuration for Professional
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"enterprise": {
|
"enterprise": {
|
||||||
@@ -445,7 +447,8 @@ class SubscriptionRepository(TenantBaseRepository):
|
|||||||
"api_access": "personalized",
|
"api_access": "personalized",
|
||||||
"account_manager": True,
|
"account_manager": True,
|
||||||
"demo": "personalized",
|
"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",
|
"demand_prediction": "basic",
|
||||||
"production_reports": "basic",
|
"production_reports": "basic",
|
||||||
"analytics": "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