{
  "id": null,
  "uid": "kyc-monitoring",
  "title": "KYC Monitoring Status",
  "timezone": "browser",
  "schemaVersion": 38,
  "version": 3,
  "refresh": "30s",
  "time": { "from": "now-24h", "to": "now" },
  "panels": [
    {
      "type": "timeseries",
      "title": "In Sync / Out of Sync (24h)",
      "gridPos": { "x": 0, "y": 0, "w": 24, "h": 10 },
      "targets": [
        { "expr": "kyc_monitoring_fresh", "refId": "A" },
        { "expr": "kyc_monitoring_stale", "refId": "B" }
      ],
      "fieldConfig": {
        "defaults": { "min": 0 },
        "overrides": [
          {
            "matcher": { "id": "byName", "options": "kyc_monitoring_fresh" },
            "properties": [
              { "id": "color", "value": { "mode": "fixed", "fixedColor": "green" } },
              { "id": "displayName", "value": "In Sync" }
            ]
          },
          {
            "matcher": { "id": "byName", "options": "kyc_monitoring_stale" },
            "properties": [
              { "id": "color", "value": { "mode": "fixed", "fixedColor": "red" } },
              { "id": "displayName", "value": "Out of Sync" }
            ]
          }
        ]
      }
    },
    {
      "type": "stat",
      "title": "Current Status",
      "gridPos": { "x": 0, "y": 10, "w": 24, "h": 4 },
      "targets": [
        { "expr": "kyc_monitoring_fresh", "instant": true, "refId": "A" },
        { "expr": "kyc_monitoring_stale", "instant": true, "refId": "B" }
      ],
      "fieldConfig": {
        "defaults": { "min": 0 },
        "overrides": [
          {
            "matcher": { "id": "byName", "options": "kyc_monitoring_fresh" },
            "properties": [
              { "id": "color", "value": { "mode": "fixed", "fixedColor": "green" } },
              { "id": "displayName", "value": "In Sync" }
            ]
          },
          {
            "matcher": { "id": "byName", "options": "kyc_monitoring_stale" },
            "properties": [
              { "id": "color", "value": { "mode": "fixed", "fixedColor": "red" } },
              { "id": "displayName", "value": "Out of Sync" }
            ]
          }
        ]
      },
      "options": { "orientation": "horizontal", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "" } }
    }
  ]
}
