{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/livetennisapi-com/json-schema/livetennisapi-com-status-change-schema.json",
  "title": "StatusChange",
  "description": "One row of the per-match status ledger (added 2026-09-12).",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/livetennisapi-com-matches-api-openapi.yml#/components/schemas/StatusChange",
  "type": "object",
  "properties": {
    "at": {
      "type": "string",
      "format": "date-time",
      "description": "The instant we published the change (UTC)."
    },
    "status": {
      "type": "object",
      "properties": {
        "from": {
          "type": [
            "string",
            "null"
          ]
        },
        "to": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "event_status": {
      "type": "object",
      "properties": {
        "from": {
          "type": [
            "string",
            "null"
          ]
        },
        "to": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "outcome": {
      "type": [
        "string",
        "null"
      ],
      "description": "Derived from the after-state by the Match.outcome definition."
    },
    "basis": {
      "type": "string",
      "enum": [
        "observed",
        "backfill",
        "restatement"
      ],
      "description": "How the row was made. observed = written at the instant of the change (from 2026-09-11T22:45:48Z); backfill = reconstructed on 2026-09-12 from the one stamp per kind the match row kept before the ledger existed (last promotion to live from 2026-09-05, completion instant from 2026-08-21, last reopen, last event_status change). One row per stamp; overwritten intermediate transitions are not recovered. restatement (added 2026-09-22) = a CORRECTION to a result that had already been published — the match's `status`, `event_status`, winner or final score (sets, games) changed after it was first published as completed (or as a cancelled walkover with a winner). A correction is always a new row, never an edit, written at the instant we made the change; `status` / `event_status` carry before and after as usual (the same value twice when only the winner or the score moved) and its `score` is the result AFTER the correction (null when the match holds no score row, as on a walkover). Every path that can change a result writes one — a source's late final, a second authority's correction, an operator's repair, a completion reopened and re-closed — because it is enforced where the result is written. A re-assertion of the same result, or a change to points alone, is not a correction and writes nothing. `result_restated_at` and `result_version` on the Match summarise these rows. Rows with this basis exist from 2026-09-22; earlier corrections were not signalled."
    },
    "score": {
      "type": [
        "object",
        "null"
      ],
      "description": "The newest score row at that instant (sets, games, points, server); null when none existed."
    }
  }
}