{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://receiz.com/standards/receiz.bundle.schema.v1.json",
  "title": "Receiz Bundle Envelope v1",
  "description": "Canonical schema for Receiz document bundle envelopes (application/vnd.receiz.bundle+json).",
  "type": "object",
  "additionalProperties": false,
  "required": ["kind", "manifest", "originalBase64", "proofbundle"],
  "properties": {
    "kind": {
      "const": "receiz.bundle.v1"
    },
    "manifest": {
      "type": "object",
      "additionalProperties": false,
      "required": ["filename", "mime", "basisSha256", "createdAt", "version"],
      "properties": {
        "filename": {
          "type": "string",
          "minLength": 1
        },
        "mime": {
          "type": "string",
          "minLength": 1
        },
        "basisSha256": {
          "type": "string",
          "pattern": "^[0-9a-fA-F]{64}$"
        },
        "createdAt": {
          "type": "integer",
          "minimum": 0
        },
        "version": {
          "const": 1
        }
      }
    },
    "originalBase64": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]+$"
    },
    "proofbundle": {
      "$ref": "https://receiz.com/standards/receiz.schema.v1.json"
    }
  }
}
