New enterprise feature2
This commit is contained in:
@@ -6,6 +6,7 @@ Handles all API calls to the sales service
|
||||
|
||||
import httpx
|
||||
import structlog
|
||||
from datetime import date
|
||||
from typing import Dict, Any, Optional, List, Union
|
||||
from .base_service_client import BaseServiceClient
|
||||
from shared.config.base import BaseServiceSettings
|
||||
@@ -183,6 +184,37 @@ class SalesServiceClient(BaseServiceClient):
|
||||
tenant_id=tenant_id)
|
||||
return None
|
||||
|
||||
async def get_sales_summary(
|
||||
self,
|
||||
tenant_id: str,
|
||||
start_date: date,
|
||||
end_date: date
|
||||
) -> Dict[str, Any]:
|
||||
"""
|
||||
Get sales summary/analytics for a tenant.
|
||||
|
||||
This method calls the sales analytics summary endpoint which provides
|
||||
aggregated sales metrics over a date range.
|
||||
|
||||
Args:
|
||||
tenant_id: The tenant UUID
|
||||
start_date: Start date for summary range
|
||||
end_date: End date for summary range
|
||||
|
||||
Returns:
|
||||
Sales summary data including metrics like total sales, revenue, etc.
|
||||
"""
|
||||
params = {
|
||||
"start_date": start_date.isoformat(),
|
||||
"end_date": end_date.isoformat()
|
||||
}
|
||||
|
||||
return await self.get(
|
||||
"sales/analytics/summary",
|
||||
tenant_id=tenant_id,
|
||||
params=params
|
||||
)
|
||||
|
||||
# ================================================================
|
||||
# DATA IMPORT
|
||||
# ================================================================
|
||||
|
||||
Reference in New Issue
Block a user