{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://plenaverify.com/vrx1-deadline-receipt.schema.json",
  "title": "PLENA VRX-1 Deadline Receipt v1",
  "description": "Schema for VRX-1 Receipt Type 5, the Deadline Receipt. Documents a date-bound obligation: what must be done by when, by whom, with what consequence if missed and what correction or extension path applies. The receipt is self-attested by its creator and tamper-evident via SHA-256 over the canonical JSON; it is not signed by an issuer key, not externally anchored to a public timestamp, and not certified by PLENA or any third party. Acceptance is decided by the receiving party. PLENA does not certify AI systems or guarantee regulatory compliance. The schema is the canonical contract for VRX-1 Deadline Receipts produced by the d19.82 reference implementation at vrx1-deadline-receipt.html.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "vrx1_version",
    "schema_version",
    "receipt_id",
    "receipt_type",
    "created_at",
    "subject",
    "deadline_kind",
    "deadline_datetime",
    "responsible_party",
    "required_action",
    "consequence_of_miss",
    "correction_or_extension_path",
    "reminder_dates",
    "privacy_level",
    "verification_url",
    "integrity_note",
    "hash"
  ],
  "properties": {
    "vrx1_version": {
      "type": "string",
      "const": "1.0-d19.82-deadline-receipt-reference",
      "description": "VRX-1 reference-implementation version string. Bound to the d19.82 reference implementation."
    },
    "schema_version": {
      "type": "string",
      "const": "vrx1.deadline-receipt.v1",
      "description": "Stable schema identifier for VRX-1 Deadline Receipt v1."
    },
    "receipt_id": {
      "type": "string",
      "pattern": "^PLENA-DRR-[0-9]{8}-[A-F0-9]{4}$",
      "description": "Unique identifier for this receipt. Format: PLENA-DRR-<YYYYMMDD>-<4 uppercase hex>. DRR = Deadline Receipt; the second R disambiguates from non-PLENA prefixes."
    },
    "receipt_type": {
      "type": "string",
      "const": "DEADLINE_RECEIPT",
      "description": "Receipt type discriminator. Always DEADLINE_RECEIPT for this schema."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "ISO-8601 date-time string from the device that built the receipt."
    },
    "subject": {
      "type": "string",
      "minLength": 1,
      "description": "What the deadline applies to: a person, application, document, status, payment, appointment, or other date-bound obligation."
    },
    "deadline_kind": {
      "type": "string",
      "enum": [
        "legal",
        "administrative",
        "immigration",
        "appeal_window",
        "expiry",
        "renewal",
        "submission",
        "payment",
        "medical",
        "other"
      ],
      "description": "Classification of the deadline. The receipt does not assert that the deadline carries the force of law unless 'legal' is selected and the institution attests so; even then the receipt is self-attested."
    },
    "deadline_datetime": {
      "type": "string",
      "minLength": 1,
      "description": "ISO-8601 date or date-time of the deadline. For all-day deadlines, time component may be 00:00."
    },
    "responsible_party": {
      "type": "string",
      "minLength": 1,
      "description": "Who must act before the deadline. May be a named individual or a role title."
    },
    "required_action": {
      "type": "string",
      "minLength": 1,
      "description": "Free-text description of what must be done."
    },
    "consequence_of_miss": {
      "type": "string",
      "minLength": 1,
      "description": "Free-text description of what happens if the deadline is missed."
    },
    "correction_or_extension_path": {
      "type": "string",
      "minLength": 1,
      "description": "Free-text description of how an extension can be requested or how a missed deadline can be remedied."
    },
    "reminder_dates": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "description": "Optional pre-deadline reminder dates. The receipt records them but does not send them; reminder delivery is a future production feature. May be an empty array."
    },
    "linked_submission_receipt_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Optional cross-reference to a VRX-1 Submission Receipt whose response or completion window the deadline marks."
    },
    "notes": {
      "type": [
        "string",
        "null"
      ],
      "description": "Optional free-text notes."
    },
    "privacy_level": {
      "type": "string",
      "enum": [
        "restricted",
        "private",
        "public"
      ],
      "description": "Privacy classification."
    },
    "supersedes": {
      "type": [
        "string",
        "null"
      ],
      "description": "Optional receipt_id of a prior Deadline Receipt that this one extends, amends, or replaces."
    },
    "verification_url": {
      "type": "string",
      "minLength": 1,
      "description": "URL where the receipt can be opened in the VRX-1 Deadline Receipt reference implementation Verify panel."
    },
    "integrity_note": {
      "type": "string",
      "minLength": 1,
      "description": "Plain-language statement of the receipt's truth boundary."
    },
    "hash": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$",
      "description": "SHA-256 hex digest, prefixed with 'sha256:', over canonical JSON without the 'hash' field."
    }
  }
}
