{
        "title": "Device Activity Logs",
        "modulePath": "biometric-device-logs",
        "dataSources": {
            "main": {
                "table": "biometric_device_logs",
                "orderBy": "createdAt DESC"
            },
            "devices": {
                "table": "biometric_devices",
                "displayField": "name",
                "valueField": "biometric_device_id"
            }
        },
        "header": [
            {
                "type": "filter-select",
                "options": {
                    "data_column": "biometric_device_id",
                    "label": "Device",
                    "dataSource": "devices",
                    "includeAll": true
                }
            },
            {
                "type": "filter-select",
                "options": {
                    "data_column": "event_type",
                    "label": "Event Type",
                    "options": [
                        {"label": "All Events", "value": ""},
                        {"label": "Login Success", "value": "login_success"},
                        {"label": "Login Rejected", "value": "login_rejected"},
                        {"label": "Register Rejected", "value": "register_rejected"},
                        {"label": "Device Created", "value": "device_created"},
                        {"label": "Device Updated", "value": "device_updated"},
                        {"label": "Device Deleted", "value": "device_deleted"},
                        {"label": "Attendance Recorded", "value": "attendance_recorded"},
                        {"label": "Attendance Rejected", "value": "attendance_rejected"}
                    ]
                }
            },
            {
                "type": "filter-date-range",
                "options": {
                    "data_column": "createdAt",
                    "label": "Date Range"
                }
            },
            {
                "type": "button",
                "label": "Refresh",
                "icon": "fa-sync",
                "class": "btn btn-ghost",
                "action": "refresh"
            }
        ],
        "body": [
            {
                "type": "table",
                "id": "deviceLogsTable",
                "options": {
                    "tableName": "biometric_device_logs",
                    "primaryKeyField": "biometric_device_log_id",
                    "showGlobalSearch": true,
                    "columnsToShow": [
                        "biometric_device_id",
                        "device_sn",
                        "event_type",
                        "createdAt",
                        "details"
                    ],
                    "columnLabels": {
                        "biometric_device_id": "Device",
                        "device_sn": "Serial Number",
                        "event_type": "Event Type",
                        "createdAt": "Timestamp",
                        "details": "Details"
                    },
                    "columnFormatters": {
                        "biometric_device_id": {
                            "type": "lookup",
                            "dataSource": "devices"
                        },
                        "details": {
                            "type": "json-preview"
                        },
                        "event_type": {
                            "type": "badge",
                            "mappings": {
                                "login_success": {"class": "badge-success"},
                                "login_rejected": {"class": "badge-error"},
                                "register_rejected": {"class": "badge-warning"},
                                "attendance_recorded": {"class": "badge-info"}
                            }
                        }
                    },
                    "rowClick": "selectRecord"
                }
            }
        ]
    }