Spaces:
Runtime error
Runtime error
from typing import List, Dict | |
def get_platform_order_counts(data) -> List[Dict[str, int]]: | |
platform_data = data.get("getPlatFormOrderTotal", []) | |
return [ | |
{ | |
"name": item["_id"], "order_count": item["count"] | |
} for item in platform_data | |
] | |
def get_platform_revenue(data) -> List[Dict[str, float]]: | |
platform_data = data.get("getPlatFormOrderTotal", []) | |
return [ | |
{ | |
"name": item["_id"], "revenue": item["sales"] | |
} for item in platform_data | |
] | |
def get_total_order_count(data) -> Dict[str, int]: | |
total_order_data = data.get("count", 0) | |
return total_order_data | |
def get_total_revenue_count(data) -> Dict[str, float]: | |
total_revenue_data = data.get("sales", 0.0) | |
return total_revenue_data | |