{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "tax_year": {
      "type": "integer",
      "enum": [
        2025,
        2026
      ]
    },
    "jurisdiction": {
      "const": "US-federal"
    },
    "record_context": {
      "type": "string",
      "enum": [
        "original",
        "correction",
        "unknown"
      ]
    },
    "vendor_facts": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "vendor_id": {
            "type": "string",
            "maxLength": 18,
            "pattern": "^v_[0-9a-f]{16}$"
          },
          "us_status": {
            "type": "string",
            "enum": [
              "us",
              "foreign",
              "unknown"
            ]
          },
          "entity_class": {
            "type": "string",
            "enum": [
              "reviewed_covered_noncorporate",
              "corporation",
              "uncertain",
              "unknown"
            ]
          },
          "service_class": {
            "type": "string",
            "enum": [
              "nec_services_reviewed",
              "misc_rents_reviewed",
              "misc_royalties_reviewed",
              "attorney_fees",
              "attorney_gross_proceeds",
              "fish_purchases",
              "fishing_boat",
              "direct_sales",
              "substitute_payments",
              "other_special",
              "unknown"
            ]
          },
          "w9_presence": {
            "type": "string",
            "enum": [
              "present",
              "missing",
              "unknown",
              "conflicting"
            ]
          },
          "tin_presence": {
            "type": "string",
            "enum": [
              "present",
              "missing",
              "unknown",
              "conflicting"
            ]
          }
        },
        "required": [
          "vendor_id",
          "us_status",
          "entity_class",
          "service_class",
          "w9_presence",
          "tin_presence"
        ]
      },
      "minItems": 1,
      "maxItems": 1000,
      "uniqueItems": true
    },
    "payments": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "row_id": {
            "type": "string",
            "maxLength": 18,
            "pattern": "^r_[0-9a-f]{16}$"
          },
          "vendor_id": {
            "type": "string",
            "maxLength": 18,
            "pattern": "^v_[0-9a-f]{16}$"
          },
          "payment_date": {
            "type": "string",
            "maxLength": 10,
            "pattern": "^20[0-9]{2}-[0-9]{2}-[0-9]{2}$",
            "description": "Real Gregorian calendar date; runtime rejects impossible dates."
          },
          "amount_cents": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "currency": {
            "const": "USD"
          },
          "payment_channel": {
            "type": "string",
            "enum": [
              "direct",
              "payment_card",
              "tpso",
              "unknown",
              "mixed",
              "contradictory"
            ]
          },
          "withholding_cents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "row_id",
          "vendor_id",
          "payment_date",
          "amount_cents",
          "currency",
          "payment_channel",
          "withholding_cents"
        ]
      },
      "minItems": 0,
      "maxItems": 10000,
      "uniqueItems": true
    },
    "reviewed_policy_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "covered_business_scope_reviewed_v1",
          "complete_original_annual_rows_reviewed_v1",
          "federal_backup_withholding_reviewed_v1",
          "tpso_settlement_rows_reviewed_v1"
        ]
      },
      "minItems": 0,
      "maxItems": 4,
      "uniqueItems": true
    }
  },
  "required": [
    "tax_year",
    "jurisdiction",
    "record_context",
    "vendor_facts",
    "payments"
  ]
}
