{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://joinplena.com/assets/vrx1-universal-receipt.schema.json",
  "title": "VRX-1 Universal Receipt",
  "description": "Portable PLENA receipt schema for ProofOps intake, authority, evidence, human review, AI involvement, action path, evidence packet, and verification preview.",
  "type": "object",
  "additionalProperties": true,
  "required": [
    "protocol",
    "schema_version",
    "receipt_id",
    "issuer",
    "issuing_product",
    "receipt_type",
    "created_at",
    "subject",
    "summary",
    "status",
    "privacy_level",
    "sharing_mode",
    "workflow",
    "verification_url"
  ],
  "properties": {
    "protocol": {
      "const": "VRX-1"
    },
    "schema_version": {
      "type": "string",
      "pattern": "^VRX1-UNIVERSAL-d19\\.108$"
    },
    "receipt_id": {
      "type": "string",
      "minLength": 8
    },
    "issuer": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "department": {
          "type": "string"
        },
        "jurisdiction": {
          "type": "string"
        }
      }
    },
    "issuing_product": {
      "type": "string"
    },
    "receipt_type": {
      "type": "string"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "subject": {
      "type": "object",
      "required": [
        "name_or_case"
      ],
      "properties": {
        "name_or_case": {
          "type": "string"
        },
        "identifier": {
          "type": "string"
        },
        "country_or_region": {
          "type": "string"
        }
      }
    },
    "summary": {
      "type": "string"
    },
    "status": {
      "enum": [
        "draft",
        "active",
        "pending",
        "approved",
        "refused",
        "escalated",
        "corrected",
        "superseded",
        "revoked",
        "expired"
      ]
    },
    "privacy_level": {
      "enum": [
        "private",
        "shareable",
        "public",
        "redacted_public"
      ]
    },
    "sharing_mode": {
      "enum": [
        "manual",
        "verification_link",
        "enterprise_api",
        "wallet_export",
        "redacted_public_page"
      ]
    },
    "workflow": {
      "type": "object",
      "required": [
        "intake",
        "authority",
        "evidence",
        "human_review",
        "ai_involvement",
        "action_path"
      ],
      "properties": {
        "intake": {
          "type": "object"
        },
        "authority": {
          "type": "object"
        },
        "evidence": {
          "type": "object"
        },
        "human_review": {
          "type": "object"
        },
        "ai_involvement": {
          "type": "object"
        },
        "action_path": {
          "type": "object"
        }
      }
    },
    "evidence_packet": {
      "type": "object",
      "properties": {
        "packet_id": {
          "type": "string"
        },
        "items": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "redaction_summary": {
          "type": "string"
        }
      }
    },
    "verification_preview": {
      "type": "object",
      "properties": {
        "public_summary": {
          "type": "string"
        },
        "visible_fields": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "limits": {
          "type": "string"
        }
      }
    },
    "hash": {
      "type": "string"
    },
    "hash_alg": {
      "type": "string"
    },
    "related_receipts": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "verification_url": {
      "type": "string"
    }
  }
}