{
        "type": "dashboard",
        "refreshInterval": 60000,
        "layout": "grid",
        "widgets": [
            {
                "id": "aging_summary_stats",
                "type": "stats",
                "title": "Aging Overview",
                "col": 1,
                "row": 1,
                "width": 4,
                "height": 1,
                "dataSource": "/api/aging-report/summary/{org_id}",
                "stats": [
                    {
                        "key": "totals.total_invoices",
                        "label": "Outstanding Invoices",
                        "icon": "fa-file-invoice",
                        "color": "primary"
                    },
                    {
                        "key": "totals.total_balance",
                        "label": "Total Outstanding",
                        "icon": "fa-dollar-sign",
                        "color": "warning",
                        "format": "currency"
                    },
                    {
                        "key": "totals.avg_days_overdue",
                        "label": "Avg Days Overdue",
                        "icon": "fa-calendar-alt",
                        "color": "error",
                        "format": "number",
                        "decimals": 1
                    }
                ]
            },
            {
                "id": "aging_buckets_chart",
                "type": "chart",
                "title": "Aging by Bucket",
                "col": 1,
                "row": 2,
                "width": 2,
                "height": 2,
                "dataSource": "/api/aging-report/summary/{org_id}",
                "chartType": "pie",
                "dataKey": "summary",
                "labels": "age_bucket",
                "values": "total_balance",
                "colors": ["#10b981", "#f59e0b", "#f97316", "#dc2626", "#7c2d12"],
                "legend": true,
                "tooltips": true
            },
            {
                "id": "aging_buckets_bar",
                "type": "chart",
                "title": "Invoice Count by Age",
                "col": 3,
                "row": 2,
                "width": 2,
                "height": 2,
                "dataSource": "/api/aging-report/summary/{org_id}",
                "chartType": "bar",
                "dataKey": "summary",
                "xAxis": "age_bucket",
                "yAxis": ["invoice_count"],
                "colors": {
                    "invoice_count": "#3b82f6"
                }
            },
            {
                "id": "top_overdue_customers",
                "type": "list",
                "title": "Top Overdue Customers",
                "col": 1,
                "row": 4,
                "width": 4,
                "height": 2,
                "dataSource": "/api/aging-report/top-overdue/{org_id}?limit=10",
                "columns": [
                    {
                        "key": "customer_name",
                        "label": "Customer",
                        "type": "text"
                    },
                    {
                        "key": "overdue_count",
                        "label": "Overdue Invoices",
                        "type": "number"
                    },
                    {
                        "key": "total_overdue",
                        "label": "Total Overdue",
                        "type": "currency"
                    },
                    {
                        "key": "max_days_overdue",
                        "label": "Max Days",
                        "type": "number"
                    },
                    {
                        "key": "severely_overdue_amount",
                        "label": "90+ Days",
                        "type": "currency",
                        "badge": true,
                        "badgeColor": "error"
                    }
                ],
                "actions": [
                    {
                        "label": "View All",
                        "link": "/aging-report/detail"
                    }
                ]
            }
        ]
    }