{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://nevadapoliticalestablishment.com/schemas/politician.schema.json",
  "title": "Nevada Politician",
  "description": "Per-politician record for the Nevada-politicians shared data layer. Covers legislators (state + federal), statewide constitutional officers, judges, county sheriffs/DAs, mayors, NSHE Regents, and State Board of Education members. Mirrors the NPE legislators-README.md schema where overlap exists; extends with bio/contact/elections/term/sources for non-legislator offices.",
  "type": "object",
  "required": ["slug", "name", "party", "office", "data_quality"],
  "additionalProperties": false,
  "properties": {
    "slug": {
      "type": "string",
      "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
      "description": "URL-safe identifier. Where the politician exists in NPE legislators-index.json the slug is reused verbatim (e.g. aaron-ford-3993). For scraped non-NPE rows, slug is built as <first>-<last>[-<disambiguator>] with no candidate_id suffix."
    },
    "candidate_id": {
      "type": ["integer", "null"],
      "description": "NV SOS Aurora candidate_id when the politician appears in cf_candidates. Null for officeholders absent from cf_* (judges, sheriffs, mayors who never filed campaign finance with NV SOS, current SoS/Treas/Ctrl which have zero rows)."
    },
    "name": { "type": "string", "minLength": 1 },
    "first_name": { "type": "string" },
    "last_name": { "type": "string" },
    "honorific": {
      "type": "string",
      "description": "Pre-name title used in display (Sen., Rep., Gov., Justice, Sheriff, Mayor, etc.). Optional."
    },
    "suffix": { "type": "string", "description": "Generational suffix (Jr., Sr., II). Optional." },
    "party": {
      "type": "string",
      "enum": [
        "Republican Party",
        "Democratic Party",
        "Independent",
        "Independent American Party",
        "Libertarian Party of Nevada",
        "Nevada Green Party",
        "The Alliance Party of Nevada",
        "Nonpartisan",
        "Unspecified"
      ],
      "description": "Party label. Mirrors NPE / NV SOS Aurora taxonomy. Judicial offices and many local offices are 'Nonpartisan' by NV statute."
    },
    "office": {
      "$ref": "#/$defs/office",
      "description": "Currently-held office. For politicians with multiple held offices, this is the latest/highest; full history goes in offices_held[]."
    },
    "offices_held": {
      "type": "array",
      "items": { "$ref": "#/$defs/office_held" },
      "description": "Chronological history of offices held, including the current one. Earliest first."
    },
    "term": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "start_date": { "type": "string", "format": "date" },
        "end_date": { "type": "string", "format": "date" },
        "term_length_years": { "type": "integer", "minimum": 1 },
        "current": { "type": "boolean" },
        "notes": { "type": "string", "description": "Editorial note about the term — departures, special-session participation, suspension, censure, etc." }
      },
      "required": ["current"],
      "description": "Current term details. start_date/end_date may be null for officeholders mid-term where the originating filing isn't in our data."
    },
    "elections": {
      "type": "array",
      "description": "Electoral history. Populated from NV SOS election results when scraped (Phase 2+) and from cf_candidates for filing-only context.",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "year": { "type": "integer", "minimum": 1900 },
          "type": { "type": "string", "enum": ["primary", "general", "special", "runoff", "recall"] },
          "office": { "type": "string" },
          "jurisdiction": { "type": "string" },
          "result": { "type": "string", "enum": ["won", "lost", "withdrew", "incumbent_unopposed", "appointed"] },
          "votes_received": { "type": ["integer", "null"] },
          "votes_total": { "type": ["integer", "null"] },
          "vote_percent": { "type": ["number", "null"] },
          "opponents": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "name": { "type": "string" },
                "party": { "type": "string" },
                "votes_received": { "type": ["integer", "null"] }
              }
            }
          },
          "source_url": { "type": "string", "format": "uri" }
        },
        "required": ["year", "type", "office", "result"]
      }
    },
    "jurisdiction": {
      "type": "string",
      "description": "Filing jurisdiction. 'NV SOS' for state-level, 'FEC' for federal, '<county> County' for county, '<city>' for city."
    },
    "city": { "type": "string", "description": "Politician's mailing city per NV SOS Aurora. May be 'CONFIDENTIAL' (e.g. judges)." },
    "state": { "type": "string", "minLength": 0, "maxLength": 2 },

    "money_in": {
      "type": "object",
      "description": "Campaign finance receipts. Mirrors NPE legislators schema. Populated from gnomey.cf_contributions joined to cf_candidates by candidate_id.",
      "additionalProperties": true,
      "properties": {
        "total_received": { "type": ["number", "null"] },
        "n_contributions": { "type": ["integer", "null"] },
        "first_contribution_date": { "type": ["string", "null"] },
        "last_contribution_date": { "type": ["string", "null"] },
        "top_donors": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "contributor_id": { "type": ["integer", "null"] },
              "name": { "type": "string" },
              "total": { "type": ["number", "null"] },
              "count": { "type": ["integer", "null"] }
            },
            "required": ["name"]
          }
        },
        "donor_concentration_hhi": { "type": ["number", "null"] },
        "top1_donor_share": { "type": ["number", "null"] },
        "benford_chi_square_vs_nv_baseline": { "type": ["number", "null"] }
      }
    },

    "money_out": {
      "type": "object",
      "description": "Campaign finance expenditures. Mirrors NPE legislators schema.",
      "additionalProperties": true,
      "properties": {
        "total_spent": { "type": ["number", "null"] },
        "n_expenditures": { "type": ["integer", "null"] },
        "to_registered_lobbyists": {
          "type": "object",
          "additionalProperties": true,
          "properties": {
            "total": { "type": ["number", "null"] },
            "n_payments": { "type": ["integer", "null"] },
            "payments": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "lobbyist_slug": { "type": "string" },
                  "amount": { "type": ["number", "null"] },
                  "date": { "type": ["string", "null"] }
                },
                "required": ["lobbyist_slug"]
              }
            }
          }
        }
      }
    },

    "legislative": {
      "type": "object",
      "description": "Bill sponsorships and roll-call votes. Only populated for state legislators (and federal members where NPE has data); empty/null for non-legislator offices.",
      "additionalProperties": false,
      "properties": {
        "session": { "type": "string", "description": "e.g. '83rd 2025' for the most recent session represented in this record." },
        "sponsored_bills": { "type": "array", "items": { "type": "string" } },
        "vote_count": { "type": "integer", "minimum": 0 },
        "votes": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "bill_label": { "type": "string" },
              "bill_id": { "type": ["integer", "null"] },
              "chamber": { "type": "string", "description": "NELIS chamber label as-is (e.g. 'Assembly', 'Senate', 'Assembly (As Introduced)', 'Joint Committee on...'). Normalized downstream by the renderer." },
              "vote": { "type": "string" },
              "result": { "type": "string" },
              "date": { "type": "string" },
              "name_at_source": { "type": "string" },
              "vote_key": { "type": ["string", "integer", "null"] }
            },
            "required": ["bill_label", "chamber", "vote"]
          }
        },
        "committee_assignments": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "committee": { "type": "string" },
              "role": { "type": "string", "description": "e.g. 'Chair', 'Vice Chair', 'Member'" },
              "session": { "type": "string" }
            },
            "required": ["committee", "session"]
          }
        }
      }
    },

    "federal_legislative": {
      "type": "object",
      "description": "Federal Congress roll-call votes + sponsorships. Populated for NV's US Senate + US House delegation. Separate from state 'legislative' (NELIS). Sources: api.congress.gov (House vote list + bill metadata), clerk.house.gov XML (House member-vote details), senate.gov XML (Senate per-vote details). Each vote row carries source_url back to the primary-source XML.",
      "additionalProperties": false,
      "properties": {
        "congress": { "type": "string", "description": "e.g. '119th 2025-2026' for the current Congress represented in this record." },
        "chamber": { "type": "string", "enum": ["House", "Senate"], "description": "Which chamber the member sits in for this Congress." },
        "bioguide_id": { "type": "string", "description": "Library of Congress bioguide identifier (e.g. 'A000369' for Mark Amodei)." },
        "sponsored_bills": { "type": "array", "items": { "type": "string" }, "description": "Bill labels (e.g. 'H.R. 3424', 'S. 5') the member sponsored." },
        "cosponsored_bills": { "type": "array", "items": { "type": "string" } },
        "vote_count": { "type": "integer", "minimum": 0 },
        "votes": {
          "type": "array",
          "description": "Per-vote records. Truncated to first 200 in published JSON; full record lives at data/raw/congress-votes/<bioguide>.json.",
          "items": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "chamber": { "type": "string", "enum": ["House", "Senate"] },
              "congress": { "type": ["integer", "string"] },
              "session": { "type": ["string", "integer"] },
              "rollcall_num": { "type": ["string", "integer", "null"], "description": "House roll-call number (clerk.house.gov)" },
              "vote_number": { "type": ["string", "integer", "null"], "description": "Senate vote number (senate.gov)" },
              "legislation_number": { "type": ["string", "null"], "description": "Bill identifier like 'HR 3424' (House) — Senate uses vote_title for context." },
              "vote_question": { "type": ["string", "null"] },
              "vote_question_text": { "type": ["string", "null"], "description": "Senate equivalent of vote_question." },
              "vote_type": { "type": ["string", "null"] },
              "vote_result": { "type": ["string", "null"] },
              "vote_result_text": { "type": ["string", "null"] },
              "question": { "type": ["string", "null"] },
              "vote_title": { "type": ["string", "null"] },
              "vote_desc": { "type": ["string", "null"] },
              "vote_document_text": { "type": ["string", "null"] },
              "action_date": { "type": ["string", "null"] },
              "vote_date": { "type": ["string", "null"] },
              "vote": { "type": "string", "description": "Member's vote: 'Yea' | 'Nay' | 'Present' | 'Not Voting' | 'Excused' (and Senate variants)." },
              "source_url": { "type": "string", "format": "uri", "description": "Primary-source XML: clerk.house.gov/evs/<year>/roll<n>.xml or senate.gov/legislative/LIS/roll_call_votes/...xml" },
              "api_url": { "type": ["string", "null"], "format": "uri", "description": "api.congress.gov backing URL (House only)." }
            },
            "required": ["chamber", "vote", "source_url"]
          }
        },
        "committee_assignments": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "committee": { "type": "string" },
              "role": { "type": "string" },
              "congress": { "type": "string" }
            },
            "required": ["committee", "congress"]
          }
        }
      }
    },

    "auditor_flags": {
      "type": "object",
      "description": "Pass-through of NPE auditor outputs. Research leads only; verify before publishing claims.",
      "additionalProperties": false,
      "properties": {
        "recusal_findings": { "type": "array" },
        "quid_pro_quo_chains": { "type": "array" },
        "revolving_door": { "type": "array" },
        "donor_concentration": { "type": "array", "description": "DOJ HHI-threshold concentrated-funding flags." },
        "state_contractor_donor": { "type": "array", "description": "Vendors paid by state agencies who also donated to this candidate." }
      }
    },

    "judicial": {
      "type": "object",
      "description": "Judicial-officer fields (Supreme Court, Court of Appeals, District Court, Justice/Municipal). Only populated for judges.",
      "additionalProperties": false,
      "properties": {
        "court": { "type": "string", "description": "e.g. 'Nevada Supreme Court', 'Nevada Court of Appeals', 'Eighth Judicial District Court'" },
        "department": { "type": "string", "description": "Department / seat number where applicable." },
        "appointed_or_elected": { "type": "string", "enum": ["appointed", "elected", "appointed_then_elected"] },
        "predecessor": { "type": "string" },
        "judicial_canons_complaints": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "year": { "type": "integer" },
              "summary": { "type": "string" },
              "outcome": { "type": "string" },
              "source_url": { "type": "string", "format": "uri" }
            }
          }
        }
      }
    },

    "executive": {
      "type": "object",
      "description": "Executive-branch fields (Governor, statewide constitutional, mayors, sheriffs). Only populated for executive offices.",
      "additionalProperties": false,
      "properties": {
        "key_appointments": {
          "type": "array",
          "description": "Notable boards/commissions/appointments this executive has staffed.",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "appointee": { "type": "string" },
              "position": { "type": "string" },
              "date": { "type": "string", "format": "date" },
              "source_url": { "type": "string", "format": "uri" }
            }
          }
        },
        "policy_initiatives": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "label": { "type": "string" },
              "status": { "type": "string", "enum": ["proposed", "enacted", "vetoed", "withdrawn"] },
              "year": { "type": "integer" },
              "source_url": { "type": "string", "format": "uri" }
            }
          }
        }
      }
    },

    "biography": {
      "type": "object",
      "description": "Manually curated biographical content. Every field cited; LLM-drafted text is acceptable but every claim must point to a public record.",
      "additionalProperties": false,
      "properties": {
        "summary_md_path": { "type": "string", "description": "Relative path to bios/<slug>.md narrative content." },
        "birth_date": { "type": ["string", "null"], "format": "date" },
        "birthplace": { "type": "string" },
        "education": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "institution": { "type": "string" },
              "degree": { "type": "string" },
              "year": { "type": ["integer", "null"] },
              "field": { "type": "string" }
            },
            "required": ["institution"]
          }
        },
        "career_history": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "role": { "type": "string" },
              "organization": { "type": "string" },
              "start_year": { "type": ["integer", "null"] },
              "end_year": { "type": ["integer", "null"] }
            },
            "required": ["role", "organization"]
          }
        },
        "military_service": { "type": "string", "description": "Branch + years if applicable, citing source." },
        "religion": { "type": "string", "description": "Per the politician's own public statements; cite source." },
        "predecessor_note": { "type": "string", "description": "Short prose noting the immediate predecessor in the current office. Sourced from Ballotpedia." }
      }
    },

    "contact": {
      "type": "object",
      "description": "Public office contact info only. No home addresses or family-member private info.",
      "additionalProperties": false,
      "properties": {
        "office_phone": { "type": "string" },
        "office_email": { "type": "string", "format": "email" },
        "official_website": { "type": ["string", "null"], "format": "uri" },
        "campaign_website": { "type": "string", "format": "uri" },
        "social_media": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "twitter": { "type": "string" },
            "facebook": { "type": "string" },
            "instagram": { "type": "string" },
            "linkedin": { "type": "string" },
            "tiktok": { "type": "string" },
            "youtube": { "type": "string" },
            "bluesky": { "type": "string" },
            "mastodon": { "type": "string" },
            "truth_social": { "type": "string" }
          }
        },
        "mailing_address": {
          "type": "string",
          "description": "Office mailing address only — never personal residence."
        }
      }
    },

    "salary": {
      "type": "object",
      "description": "Statutory salary attached to the office. Cite the NRS section.",
      "additionalProperties": false,
      "properties": {
        "annual_usd": { "type": ["number", "null"] },
        "nrs_citation": { "type": "string", "description": "e.g. 'NRS 218A.300'" },
        "as_of_year": { "type": "integer" }
      }
    },

    "endorsements": {
      "type": "array",
      "description": "Curated endorsement list with source citations. Manual curation; no DB source today.",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "endorser": { "type": "string" },
          "endorser_type": { "type": "string", "enum": ["organization", "elected_official", "newspaper", "union", "PAC", "other"] },
          "election_year": { "type": "integer" },
          "office_endorsed_for": { "type": "string" },
          "source_url": { "type": "string", "format": "uri" },
          "date": { "type": "string", "format": "date" }
        },
        "required": ["endorser", "election_year"]
      }
    },

    "issue_positions": {
      "type": "array",
      "description": "Politician's stated positions on policy issues. Each position cites a public statement (press release, official website, recorded speech, voting record summary). Manual curation.",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "issue": { "type": "string", "description": "e.g. 'Energy', 'Cannabis', 'Public Records'" },
          "position": { "type": "string", "description": "Brief statement of position. ≤200 characters; verbatim quote preferred." },
          "source_url": { "type": "string", "format": "uri" },
          "date": { "type": "string", "format": "date" }
        },
        "required": ["issue", "position", "source_url"]
      }
    },

    "photo": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "local_path": { "type": ["string", "null"], "description": "Repo-relative path to locally-cached headshot, e.g. 'images/politicians/<slug>.jpg'. Null when no headshot has been captured locally yet." },
        "source_url": { "type": ["string", "null"], "format": "uri", "description": "Original URL the photo was scraped from. Must be official .gov source." },
        "license": { "type": ["string", "null"], "description": "e.g. 'public domain (US gov work)', 'fair use — newsworthiness'." },
        "placeholder": { "type": "boolean", "description": "True if no real photo is available; renderer falls back to initials-on-party-color tile." }
      }
    },

    "references": {
      "type": "array",
      "description": "Citation list rendered at the bottom of every politician page.",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "label": { "type": "string", "description": "Short human-readable label (e.g. 'NV SOS Aurora — Aaron Ford candidate filing 2022 cycle')." },
          "url": { "type": "string", "format": "uri" },
          "accessed": { "type": "string", "format": "date" },
          "kind": { "type": "string", "enum": [".gov", "court_record", "campaign_finance", "press", "academic", "FOIA", "other"] }
        },
        "required": ["label", "url", "accessed"]
      }
    },

    "data_quality": {
      "type": "object",
      "additionalProperties": false,
      "required": ["last_verified", "completeness", "sources"],
      "properties": {
        "last_verified": { "type": "string", "format": "date" },
        "completeness": {
          "type": "object",
          "additionalProperties": false,
          "required": ["finance", "voting", "bio", "contact", "endorsements"],
          "properties": {
            "finance": { "type": "boolean" },
            "voting": { "type": "boolean" },
            "bio": { "type": "boolean" },
            "contact": { "type": "boolean" },
            "endorsements": { "type": "boolean" },
            "federal_voting": { "type": "boolean", "description": "True when federal_legislative.votes[] is populated. Added by etl_from_congress.py for NV federal delegation members." }
          }
        },
        "stub_badge": { "type": "boolean", "description": "True when fewer than 70% of completeness flags are true. Renderer surfaces a 'stub' badge." },
        "stale_banner": { "type": "boolean", "description": "True when last_verified is older than 120 days. Renderer surfaces a 'stale verification' banner." },
        "sources": {
          "type": "array",
          "items": { "type": "string" },
          "description": "Every source path or URL that contributed to this record (NPE JSON path, scraper output, manual bio file, cf_* table reference, etc.)."
        },
        "rescue_run_date": { "type": "string", "format": "date", "description": "Date this record was rescued from stale upstream (e.g. NPE legislators-index had vote_count=0)." },
        "rescue_reason": { "type": "string", "description": "Free-text explanation of the rescue intervention." },
        "federal_voting": { "type": "boolean", "description": "True when federal_legislative.votes[] is populated. Added by etl_from_congress.py." }
      }
    },

    "pharma_payments": {
      "type": "object",
      "description": "CMS Open Payments cross-reference for physician-politicians. Populated by populate_pharma_payments.py from cms_open_payments.gnrl_* tables.",
      "additionalProperties": true,
      "properties": {
        "is_physician": { "type": "boolean" },
        "total_amount": { "type": ["number", "null"] },
        "total_payment_count": { "type": ["integer", "null"] },
        "year_breakdown": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "year": { "type": "integer" },
              "count": { "type": ["integer", "null"] },
              "amount": { "type": ["number", "null"] }
            }
          }
        }
      }
    },

    "_generated_at_utc": {
      "type": "string",
      "format": "date-time",
      "description": "Stamped by etl_from_npe.py at write time."
    }
  },

  "$defs": {
    "office": {
      "type": "object",
      "additionalProperties": false,
      "required": ["title", "level"],
      "properties": {
        "title": {
          "type": "string",
          "description": "Office title, e.g. 'Governor', 'State Senator', 'Sheriff', 'Justice of the Nevada Supreme Court'."
        },
        "level": {
          "type": "string",
          "enum": ["federal", "statewide_constitutional", "state_legislature", "judicial", "county", "city", "special_district", "appointed_board"],
          "description": "Coarse-grained taxonomy used by office-index pages and per-office filtering."
        },
        "chamber": {
          "type": "string",
          "enum": ["Senate", "Assembly", "House", "Joint"],
          "description": "Only set for legislative offices."
        },
        "district": {
          "type": "string",
          "description": "District identifier for legislators (e.g. 'SD-13', 'AD-25', 'NV-3' for Congress)."
        },
        "county": { "type": "string" },
        "city": { "type": "string" },
        "leadership_title": {
          "type": "string",
          "description": "Leadership role within the chamber (e.g. 'Speaker', 'Majority Leader', 'Deputy Majority Whip', 'President Pro Tempore')."
        }
      }
    },
    "office_held": {
      "type": "object",
      "additionalProperties": false,
      "required": ["title", "level", "current"],
      "properties": {
        "title": { "type": "string" },
        "level": {
          "type": "string",
          "enum": ["federal", "statewide_constitutional", "state_legislature", "judicial", "county", "city", "special_district", "appointed_board"]
        },
        "chamber": { "type": "string", "enum": ["Senate", "Assembly", "House", "Joint"] },
        "district": { "type": "string" },
        "county": { "type": "string" },
        "city": { "type": "string" },
        "start_date": { "type": ["string", "null"], "format": "date" },
        "end_date": { "type": ["string", "null"], "format": "date" },
        "current": { "type": "boolean" }
      }
    }
  }
}
