{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/coldrig-dev/json-schema/coldrig-dev-dashboard-view-detail-schema.json",
  "title": "DashboardViewDetail",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/coldrig-dev-dashboard-api-openapi.yml#/components/schemas/DashboardViewDetail",
  "allOf": [
    {
      "$ref": "#/$defs/DashboardViewSummary"
    },
    {
      "type": "object",
      "required": [
        "layout",
        "createdAt"
      ],
      "properties": {
        "layout": {
          "$ref": "#/$defs/DashboardLayout"
        },
        "createdAt": {
          "type": "string"
        }
      }
    }
  ],
  "$defs": {
    "DashboardLayout": {
      "type": "object",
      "required": [
        "schemaVersion",
        "widgets"
      ],
      "properties": {
        "schemaVersion": {
          "type": "integer",
          "enum": [
            1
          ]
        },
        "widgets": {
          "type": "array",
          "maxItems": 50,
          "items": {
            "type": "object",
            "required": [
              "id",
              "type",
              "gridPos",
              "visible",
              "props"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "type": {
                "type": "string",
                "enum": [
                  "kpi_row",
                  "mailbox_health",
                  "campaign_performance",
                  "activity_feed",
                  "inbox_preview",
                  "agent_log",
                  "agent_note",
                  "quota_usage"
                ]
              },
              "gridPos": {
                "type": "object",
                "required": [
                  "x",
                  "y",
                  "w",
                  "h"
                ],
                "properties": {
                  "x": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 11
                  },
                  "y": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1000
                  },
                  "w": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 12
                  },
                  "h": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 20
                  }
                }
              },
              "visible": {
                "type": "boolean",
                "default": true
              },
              "props": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "DashboardViewSummary": {
      "type": "object",
      "required": [
        "id",
        "name",
        "isDefault",
        "rev",
        "editedBy",
        "editedByNote",
        "updatedAt"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "isDefault": {
          "type": "boolean"
        },
        "rev": {
          "type": "integer"
        },
        "editedBy": {
          "type": "string",
          "enum": [
            "dashboard",
            "mcp",
            "api",
            "system"
          ]
        },
        "editedByNote": {
          "type": [
            "string",
            "null"
          ]
        },
        "updatedAt": {
          "type": "string"
        }
      }
    }
  }
}