New enterprise feature2
This commit is contained in:
@@ -19,6 +19,7 @@ from .tenant_client import TenantServiceClient
|
||||
from .ai_insights_client import AIInsightsClient
|
||||
from .alerts_client import AlertsServiceClient
|
||||
from .procurement_client import ProcurementServiceClient
|
||||
from .distribution_client import DistributionServiceClient
|
||||
|
||||
# Import config
|
||||
from shared.config.base import BaseServiceSettings
|
||||
@@ -146,6 +147,16 @@ def get_procurement_client(config: BaseServiceSettings = None, service_name: str
|
||||
_client_cache[cache_key] = ProcurementServiceClient(config, service_name)
|
||||
return _client_cache[cache_key]
|
||||
|
||||
def get_distribution_client(config: BaseServiceSettings = None, service_name: str = "unknown") -> DistributionServiceClient:
|
||||
"""Get or create a distribution service client"""
|
||||
if config is None:
|
||||
from app.core.config import settings as config
|
||||
|
||||
cache_key = f"distribution_{service_name}"
|
||||
if cache_key not in _client_cache:
|
||||
_client_cache[cache_key] = DistributionServiceClient(config, service_name)
|
||||
return _client_cache[cache_key]
|
||||
|
||||
|
||||
class ServiceClients:
|
||||
"""Convenient wrapper for all service clients"""
|
||||
@@ -257,6 +268,7 @@ __all__ = [
|
||||
'SuppliersServiceClient',
|
||||
'AlertsServiceClient',
|
||||
'TenantServiceClient',
|
||||
'DistributionServiceClient',
|
||||
'ServiceClients',
|
||||
'get_training_client',
|
||||
'get_sales_client',
|
||||
@@ -270,6 +282,7 @@ __all__ = [
|
||||
'get_alerts_client',
|
||||
'get_tenant_client',
|
||||
'get_procurement_client',
|
||||
'get_distribution_client',
|
||||
'get_service_clients',
|
||||
'create_forecast_client'
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user