{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/peoplescourt-ai/json-schema/peoplescourt-ai-partner-case-record-bundle-attestation-schema.json",
  "title": "PartnerCaseRecordBundleAttestation",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/peoplescourt-ai-case-record-api-openapi.yml#/components/schemas/PartnerCaseRecordBundleAttestation",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "partnerId",
    "caseId",
    "externalCaseId",
    "partySide",
    "caseRevision",
    "bundleId",
    "bundleHash",
    "rules",
    "files",
    "attestationDigest",
    "signature"
  ],
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "partner-case-record-bundle-attestation-v2"
    },
    "partnerId": {
      "type": "string"
    },
    "caseId": {
      "type": "string"
    },
    "externalCaseId": {
      "type": "string"
    },
    "partySide": {
      "type": "string",
      "enum": [
        "claimant",
        "respondent"
      ]
    },
    "caseRevision": {
      "type": "integer",
      "minimum": 1
    },
    "bundleId": {
      "type": "string",
      "pattern": "^crb2_[a-f0-9]{64}$"
    },
    "bundleHash": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "rules": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "version": {
          "type": "string"
        },
        "sha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        }
      }
    },
    "files": {
      "type": "array",
      "minItems": 3,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "path",
          "mediaType",
          "byteLength",
          "sha256"
        ],
        "properties": {
          "path": {
            "type": "string"
          },
          "mediaType": {
            "type": "string"
          },
          "byteLength": {
            "type": "integer",
            "minimum": 0
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        }
      }
    },
    "attestationDigest": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "signature": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "signature",
        "signerAddress",
        "algorithm",
        "signedAt",
        "signedHash"
      ],
      "properties": {
        "signature": {
          "type": "string"
        },
        "signerAddress": {
          "type": "string",
          "pattern": "^0x[a-fA-F0-9]{40}$"
        },
        "algorithm": {
          "type": "string",
          "const": "eip191"
        },
        "signedAt": {
          "type": "string",
          "format": "date-time"
        },
        "signedHash": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        }
      }
    }
  }
}