{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/andrewsfreebies-com/json-schema/andrewsfreebies-com-verification-ingest-input-schema.json",
  "title": "VerificationIngestInput",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/andrewsfreebies-com-verification-api-openapi.yml#/components/schemas/VerificationIngestInput",
  "type": "object",
  "required": [
    "run",
    "verification_events"
  ],
  "properties": {
    "schema_version": {
      "type": "string",
      "maxLength": 32,
      "default": "1.0"
    },
    "generated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Defaults to the ingestion time."
    },
    "run": {
      "$ref": "#/$defs/VerificationRunInput"
    },
    "verification_events": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "items": {
        "$ref": "#/$defs/VerificationEventInput"
      }
    }
  },
  "$defs": {
    "VerificationEventInput": {
      "type": "object",
      "required": [
        "record_id",
        "record_type",
        "url",
        "url_role",
        "outcome",
        "url_health",
        "offer_existence",
        "terms_match",
        "redemption_path",
        "evidence_quality",
        "freshness"
      ],
      "properties": {
        "record_id": {
          "type": "string",
          "maxLength": 200
        },
        "record_type": {
          "type": "string",
          "enum": [
            "trial",
            "entitlement"
          ]
        },
        "category": {
          "type": "string",
          "maxLength": 120,
          "description": "Optional; when present it must match the canonical record category."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "maxLength": 2048
        },
        "url_role": {
          "type": "string",
          "maxLength": 80
        },
        "checked_at": {
          "type": "string",
          "format": "date-time",
          "description": "Defaults to generated_at."
        },
        "method": {
          "type": "string",
          "maxLength": 100,
          "description": "Defaults to run.method."
        },
        "outcome": {
          "$ref": "#/$defs/VerificationOutcome"
        },
        "content_hash": {
          "type": "string",
          "maxLength": 256
        },
        "evidence_excerpt": {
          "type": "string",
          "maxLength": 2000
        },
        "matched_fields": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "type": "string",
            "maxLength": 100
          }
        },
        "unmatched_fields": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "type": "string",
            "maxLength": 100
          }
        },
        "url_health": {
          "type": "object",
          "description": "Structured status, redirect, and reachability observations.",
          "additionalProperties": true
        },
        "offer_existence": {
          "type": "object",
          "description": "Structured evidence for whether the provider currently describes the offer.",
          "additionalProperties": true
        },
        "terms_match": {
          "type": "object",
          "description": "Matched, unmatched, and contradicted normalized fields.",
          "additionalProperties": true
        },
        "redemption_path": {
          "type": "object",
          "description": "Structured activation, application, or claim-path result.",
          "additionalProperties": true
        },
        "evidence_quality": {
          "type": "object",
          "description": "Evidence ownership, authority, and sufficiency.",
          "additionalProperties": true
        },
        "freshness": {
          "type": "object",
          "description": "Audit age and next-check scheduling fields.",
          "additionalProperties": true
        }
      }
    },
    "VerificationOutcome": {
      "type": "string",
      "enum": [
        "confirmed-exact",
        "confirmed-partial",
        "terms-changed",
        "explicitly-expired",
        "moved",
        "blocked",
        "fetch-error",
        "not-found",
        "unknown"
      ],
      "description": "Conservative field-level audit result. blocked, fetch-error, not-found, and unknown do not establish expiration."
    },
    "VerificationRunInput": {
      "type": "object",
      "required": [
        "method"
      ],
      "properties": {
        "method": {
          "type": "string",
          "maxLength": 100
        },
        "verifier": {
          "type": "string",
          "maxLength": 200
        },
        "started_at": {
          "type": "string",
          "format": "date-time"
        },
        "completed_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  }
}