File size: 1,575 Bytes
d954b70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
"""
Script to add request body examples to chart widget endpoints.
"""

# Mapping of endpoint paths to their widget IDs and example bodies
ENDPOINT_EXAMPLES = {
    "/gross-margin-trend": {
        "widget_id": "wid_gross_margin_trend_12m_001",
        "chart_type": "line",
        "months": 12,
        "period_window": "last_12_months"
    },
    "/channel-mix": {
        "widget_id": "wid_channel_mix_001",
        "chart_type": "donut",
        "period_window": "last_12_months"
    },
    "/top-skus": {
        "widget_id": "wid_top_5_skus_001",
        "chart_type": "bar",
        "limit": 5,
        "period_window": "last_12_months"
    },
    "/inventory-status": {
        "widget_id": "wid_inventory_status_001",
        "chart_type": "donut"
    },
    "/top-selling-products": {
        "widget_id": "wid_top_selling_products_30d_001",
        "chart_type": "bar",
        "window_days": 30,
        "limit": 10
    },
    "/staff-performance": {
        "widget_id": "wid_staff_performance_001",
        "chart_type": "bar",
        "window_days": 30,
        "limit": 10
    },
    "/my-sales-trend": {
        "widget_id": "wid_personal_sales_trend_30d_001",
        "chart_type": "line",
        "window_days": 30
    },
    "/my-top-products": {
        "widget_id": "wid_top_products_sold_by_me_001",
        "chart_type": "bar",
        "window_days": 30,
        "limit": 5
    }
}

print("Chart Widget Request Body Examples:")
print("=" * 80)
for endpoint, example in ENDPOINT_EXAMPLES.items():
    print(f"\n{endpoint}:")
    print(f"  {example}")