{
        "table": "invoices",
        "primaryKey": "invoice_id",
        "clientFilter": "client_id",
        "list": {
            "title": "My Invoices",
            "description": "View and pay your invoices",
            "dataSource": "/api/invoices/my-invoices",
            "autoRefresh": 60000,
            "emptyMessage": "You have no invoices yet",
            "columns": [
                {
                    "field": "invoice_number",
                    "label": "Invoice #",
                    "sortable": true,
                    "searchable": true
                },
                {
                    "field": "invoice_date",
                    "label": "Date",
                    "render": "date",
                    "sortable": true
                },
                {
                    "field": "due_date",
                    "label": "Due Date",
                    "render": "date",
                    "sortable": true
                },
                {
                    "field": "amount",
                    "label": "Amount",
                    "render": "currency",
                    "sortable": true
                },
                {
                    "field": "amount_paid",
                    "label": "Paid",
                    "render": "currency"
                },
                {
                    "field": "balance_due",
                    "label": "Balance",
                    "render": "currency",
                    "computed": "amount - amount_paid"
                },
                {
                    "field": "status",
                    "label": "Status",
                    "render": "badge",
                    "sortable": true
                }
            ],
            "filters": [
                {
                    "field": "status",
                    "label": "Status",
                    "type": "select",
                    "options": [
                        {"value": "all", "label": "All Invoices"},
                        {"value": "draft", "label": "Draft"},
                        {"value": "pending", "label": "Unpaid"},
                        {"value": "paid", "label": "Paid"},
                        {"value": "overdue", "label": "Overdue"}
                    ]
                }
            ],
            "rowActions": [
                {
                    "label": "View Details",
                    "icon": "fa-eye",
                    "action": "openModal",
                    "modalId": "my-invoice-detail",
                    "class": "btn-sm"
                },
                {
                    "label": "Pay Now",
                    "icon": "fa-credit-card",
                    "action": "payments:initiate",
                    "condition": "status != \"paid\" && status != \"draft\"",
                    "class": "btn-primary btn-sm"
                },
                {
                    "label": "Download Invoice",
                    "icon": "fa-file-pdf",
                    "action": "invoices:pdf",
                    "class": "btn-ghost btn-sm"
                },
                {
                    "label": "Download Receipt",
                    "icon": "fa-receipt",
                    "action": "invoices:taxcore-receipt",
                    "condition": "taxcore_submission_id != null",
                    "class": "btn-ghost btn-sm"
                }
            ]
        },
        "detail": {
            "modalId": "my-invoice-detail",
            "title": "Invoice Details",
            "size": "xl",
            "readonly": true,
            "tabs": [
                {
                    "id": "details",
                    "label": "Details",
                    "icon": "fa-info-circle",
                    "sections": [
                        {
                            "title": "Invoice Information",
                            "fields": [
                                {"name": "invoice_number", "label": "Invoice Number", "type": "text", "readonly": true},
                                {"name": "invoice_date", "label": "Invoice Date", "type": "date", "readonly": true},
                                {"name": "due_date", "label": "Due Date", "type": "date", "readonly": true},
                                {"name": "status", "label": "Status", "type": "text", "readonly": true}
                            ]
                        },
                        {
                            "title": "Payment Information",
                            "fields": [
                                {"name": "amount", "label": "Total Amount", "type": "currency", "readonly": true},
                                {"name": "amount_paid", "label": "Amount Paid", "type": "currency", "readonly": true},
                                {"name": "balance_due", "label": "Balance Due", "type": "currency", "readonly": true, "computed": "amount - amount_paid"}
                            ]
                        }
                    ]
                },
                {
                    "id": "items",
                    "label": "Line Items",
                    "icon": "fa-list",
                    "component": "LineItemsView",
                    "componentConfig": {
                        "table": "invoice_items",
                        "foreignKey": "invoice_id",
                        "readonly": true,
                        "showTotals": true
                    }
                },
                {
                    "id": "payments",
                    "label": "Payment History",
                    "icon": "fa-money-bill",
                    "component": "PaymentHistoryView",
                    "componentConfig": {
                        "table": "payments",
                        "foreignKey": "invoice_id",
                        "readonly": true
                    }
                }
            ],
            "actions": {
                "view": [
                    {
                        "label": "Pay Now",
                        "icon": "fa-credit-card",
                        "action": "payments:initiate",
                        "condition": "status != \"paid\" && status != \"draft\"",
                        "class": "btn-primary"
                    },
                    {
                        "label": "Download Invoice",
                        "icon": "fa-file-pdf",
                        "action": "invoices:pdf",
                        "class": "btn-ghost"
                    },
                    {
                        "label": "Download Receipt",
                        "icon": "fa-receipt",
                        "action": "invoices:taxcore-receipt",
                        "condition": "taxcore_submission_id != null",
                        "class": "btn-ghost"
                    },
                    {
                        "label": "Close",
                        "action": "cancel"
                    }
                ]
            }
        }
    }