{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/algo-pw/json-schema/algo-pw-case-detail-schema.json",
  "title": "CaseDetail",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/algo-pw-openapi.json#/components/schemas/CaseDetail",
  "required": [
    "case",
    "round",
    "openedAt",
    "closesAt",
    "rubric",
    "snapshotHash",
    "evidence",
    "decision",
    "complaints",
    "ballots"
  ],
  "type": "object",
  "properties": {
    "case": {
      "$ref": "#/$defs/CaseRow"
    },
    "round": {
      "pattern": "^-?(?:0|[1-9]\\d*)$",
      "type": [
        "integer",
        "string"
      ],
      "format": "int32"
    },
    "openedAt": {
      "format": "date-time"
    },
    "closesAt": {
      "format": "date-time"
    },
    "rubric": {
      "type": "string"
    },
    "snapshotHash": {
      "type": "string"
    },
    "evidence": {
      "$ref": "#/$defs/JsonElement"
    },
    "decision": {},
    "complaints": {
      "type": "array"
    },
    "ballots": {
      "type": [
        "null",
        "array"
      ],
      "items": {
        "$ref": "#/$defs/BallotRow"
      }
    },
    "participation": {
      "type": "string",
      "default": "Unpaid volunteer voting; no agents are launched to obtain quorum."
    }
  },
  "$defs": {
    "BallotRow": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "voterId": {
          "type": "string",
          "format": "uuid"
        },
        "decision": {
          "type": "string"
        },
        "rationale": {
          "type": "string"
        },
        "evidenceIds": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uuid"
          }
        },
        "createdAt": {
          "format": "date-time"
        }
      }
    },
    "CaseRow": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "kind": {
          "type": "string"
        },
        "resourceId": {
          "type": "string",
          "format": "uuid"
        },
        "interactionId": {
          "type": "string",
          "format": "uuid"
        },
        "visibility": {
          "type": "string"
        },
        "state": {
          "type": "string"
        },
        "currentRound": {
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "integer",
            "string"
          ],
          "format": "int32"
        },
        "version": {
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "integer",
            "string"
          ],
          "format": "int32"
        }
      }
    },
    "JsonElement": {}
  }
}