{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$ref": "#/definitions/Tournament",
  "definitions": {
    "Tournament": {
      "type": "object",
      "properties": {
        "appliedPolicies": {
          "$ref": "#/definitions/PolicyDefinitions"
        },
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "endDate": {
          "type": "string",
          "description": "Date on which the tournament ends",
          "anyOf": [
            {
              "format": "date-time"
            },
            {
              "format": "date"
            }
          ]
        },
        "events": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Event"
          }
        },
        "formalName": {
          "type": "string"
        },
        "hostCountryCode": {
          "$ref": "#/definitions/CountryCodeEnum"
        },
        "indoorOutdoor": {
          "$ref": "#/definitions/IndoorOutdoorEnum"
        },
        "localTimeZone": {
          "type": "string"
        },
        "matchUps": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/MatchUp"
          }
        },
        "parentOrganisation": {
          "$ref": "#/definitions/Organisation"
        },
        "onlineResources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/OnlineResource"
          }
        },
        "parentOrganisationId": {
          "type": "string"
        },
        "participants": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Participant"
          }
        },
        "processCodes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "promotionalName": {
          "type": "string"
        },
        "registrationProfile": {
          "$ref": "#/definitions/RegistrationProfile"
        },
        "season": {
          "type": "string"
        },
        "startDate": {
          "type": "string",
          "description": "Date on which the tournament starts",
          "anyOf": [
            {
              "format": "date-time"
            },
            {
              "format": "date"
            }
          ]
        },
        "surfaceCategory": {
          "$ref": "#/definitions/SurfaceCategoryEnum"
        },
        "totalPrizeMoney": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PrizeMoney"
          }
        },
        "tournamentCategories": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Category"
          }
        },
        "tournamentRank": {
          "type": "string"
        },
        "tournamentSeriesId": {
          "type": "string",
          "description": "The same tournament across its editions: the same value every year it is held, where tournamentId is one edition."
        },
        "tournamentGroups": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "tournamentId": {
          "type": "string"
        },
        "tournamentLevel": {
          "$ref": "#/definitions/TournamentLevelEnum"
        },
        "tournamentStatus": {
          "$ref": "#/definitions/TournamentStatusEnum"
        },
        "cancelledAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "cancellationReason": {
          "type": "string"
        },
        "tournamentName": {
          "type": "string"
        },
        "tournamentOtherIds": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/UnifiedTournamentId"
          }
        },
        "venues": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Venue"
          }
        },
        "activeDates": {
          "type": "array",
          "items": {
            "type": ["string", "object"]
          }
        },
        "factory": {
          "type": "object",
          "description": "The factory versions that created and last wrote this record. Formerly the `factory` extension.",
          "properties": {
            "createdVersion": {
              "type": "string",
              "description": "Factory version that created the record; absent on records created before it was stamped"
            },
            "version": {
              "type": "string",
              "description": "Factory version that last wrote the record"
            },
            "timeStamp": {
              "type": "number",
              "description": "Engine clock (milliseconds since the epoch) at the last write"
            }
          }
        },
        "linkedTournamentIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "prizeMoneyAwards": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PrizeMoneyAward"
          }
        },
        "sanction": {
          "$ref": "#/definitions/TournamentSanction"
        },
        "sanctions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TournamentSanction"
          }
        },
        "scheduling": {
          "$ref": "#/definitions/TournamentScheduling"
        },
        "tournamentTier": {
          "$ref": "#/definitions/TierClassification"
        },
        "weekdays": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": ["tournamentId"],
      "additionalProperties": true,
      "$comment": "OPEN, and this is a KNOWN GAP rather than a decision \u2014 closing it is blocked, not declined. Measured 2026-08-28 against the 16 TODS fixtures: 13 records carry `venueIds`, 6 carry `deleted`, and `dualMatchMetadata`, `associatedOrganisations`, `rootOrganisationId`, `tournamentExternalId` and a nested `tournamentRecord` each appear. Closing this definition today fails 14 of 16 fixtures. Each undeclared field must first be resolved as either a real CODES concept (declare it in `types/tournamentTypes.ts` AND here) or as legacy data (correct the fixtures), after which this should become `false` to match the other 51."
    },
    "EntryRestrictionEnum": {
      "type": "string",
      "enum": ["RESIDENCY", "MEMBERSHIP", "RANKING_FLOOR", "CLEARANCE", "INVITATION", "OTHER"]
    },
    "EntryRestriction": {
      "$comment": "A condition on WHO may enter, beyond age/gender/rating. Advisory in v1: CODES holds no section roster or membership register, so `evaluable` defaults to undecidable and getParticipantEligibility reports indeterminate rather than guessing.",
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/definitions/EntryRestrictionEnum"
        },
        "organisationId": {
          "type": "string"
        },
        "membershipCategory": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "evaluable": {
          "type": "boolean"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        }
      },
      "required": ["type"],
      "additionalProperties": false
    },
    "EventRegistration": {
      "type": "object",
      "properties": {
        "entriesOpen": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "entriesClose": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "withdrawalDeadline": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "entryFees": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/RegistrationEntryFee"
          }
        },
        "entryUrl": {
          "type": "string"
        },
        "eligibilityNotes": {
          "type": "string"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        }
      },
      "additionalProperties": false
    },
    "EventEntryProfile": {
      "type": "object",
      "properties": {
        "entriesLimit": {
          "type": "number"
        },
        "targetDrawSize": {
          "type": "number"
        },
        "qualifyingDrawSize": {
          "type": "number"
        },
        "qualifiersCount": {
          "type": "number"
        },
        "qualifyingProfiles": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/EntryQualifyingProfile"
          }
        },
        "selectionProcess": {
          "$ref": "#/definitions/SelectionProcessEnum"
        },
        "selectionScaleName": {
          "type": "string"
        },
        "wildcardCount": {
          "type": "number"
        },
        "waitlistEnabled": {
          "type": "boolean"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        }
      },
      "additionalProperties": false
    },
    "EntryQualifyingProfile": {
      "type": "object",
      "properties": {
        "roundTarget": {
          "type": "number"
        },
        "structureProfiles": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/EntryQualifyingStructureProfile"
          }
        }
      },
      "required": ["structureProfiles"],
      "additionalProperties": false
    },
    "EntryQualifyingStructureProfile": {
      "type": "object",
      "properties": {
        "stageSequence": {
          "type": "number"
        },
        "drawSize": {
          "type": "number"
        },
        "qualifyingPositions": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "SelectionProcessEnum": {
      "type": "string",
      "enum": ["FIRST_COME_FIRST_SERVED", "TOP_DOWN_BY_RANKING", "TOP_DOWN_BY_RATING", "MANUAL", "LOTTERY"]
    },
    "Extension": {
      "type": "object",
      "properties": {
        "description": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "value": {}
      },
      "required": ["name", "value"],
      "additionalProperties": true,
      "$comment": "OPEN, deliberately and permanently. Extensions are CODES' escape hatch: `value` is unconstrained by design, and callers attach their own keys. This is the one exception that is not a backlog item."
    },
    "TierClassification": {
      "type": "object",
      "properties": {
        "system": {
          "type": "string"
        },
        "value": {
          "type": "string"
        },
        "numericRank": {
          "type": "number"
        }
      },
      "required": ["system", "value"],
      "additionalProperties": false
    },
    "TimeItem": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "itemDate": {
          "type": "string",
          "anyOf": [
            {
              "format": "date"
            },
            {
              "format": "date-time"
            }
          ]
        },
        "itemSubTypes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "itemType": {
          "type": "string"
        },
        "itemValue": {}
      },
      "required": [],
      "additionalProperties": false
    },
    "Event": {
      "type": "object",
      "properties": {
        "appliedPolicies": {
          "$ref": "#/definitions/PolicyDefinitions"
        },
        "registrationProfile": {
          "$ref": "#/definitions/EventRegistration"
        },
        "entryProfile": {
          "$ref": "#/definitions/EventEntryProfile"
        },
        "entryRestrictions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/EntryRestriction"
          }
        },
        "cancelledAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "cancellationReason": {
          "type": "string"
        },
        "flightProfile": {
          "$ref": "#/definitions/FlightProfile"
        },
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "allowedDrawTypes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DrawTypeEnum"
          }
        },
        "category": {
          "$ref": "#/definitions/Category"
        },
        "discipline": {
          "$ref": "#/definitions/DisciplineEnum"
        },
        "drawDefinitions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DrawDefinition"
          }
        },
        "endDate": {
          "type": "string",
          "description": "Date on which the event ends",
          "anyOf": [
            {
              "format": "date-time"
            },
            {
              "format": "date"
            }
          ]
        },
        "entries": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Entry"
          }
        },
        "eventAbbreviation": {
          "type": "string"
        },
        "eventId": {
          "type": "string"
        },
        "eventLevel": {
          "$ref": "#/definitions/TournamentLevelEnum"
        },
        "eventOrder": {
          "type": "number"
        },
        "eventType": {
          "$ref": "#/definitions/EventTypeEnum"
        },
        "eventName": {
          "type": "string"
        },
        "eventRank": {
          "type": "string"
        },
        "indoorOutdoor": {
          "$ref": "#/definitions/IndoorOutdoorEnum"
        },
        "gender": {
          "$ref": "#/definitions/GenderEnum"
        },
        "links": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DrawLink"
          }
        },
        "matchUpFormat": {
          "type": "string"
        },
        "processCodes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "startDate": {
          "type": "string",
          "description": "Date on which the event starts",
          "anyOf": [
            {
              "format": "date-time"
            },
            {
              "format": "date"
            }
          ]
        },
        "surfaceCategory": {
          "$ref": "#/definitions/SurfaceCategoryEnum"
        },
        "tennisOfficialIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "tieFormat": {
          "$ref": "#/definitions/TieFormat"
        },
        "tieFormatId": {
          "type": "string"
        },
        "tieFormats": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TieFormat"
          }
        },
        "wheelchairClass": {
          "$ref": "#/definitions/WheelchairClassEnum"
        },
        "activeDates": {
          "type": "array",
          "items": {
            "type": ["string", "object"]
          }
        },
        "competitionFormat": {
          "type": "object"
        },
        "prizeMoney": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PrizeMoney"
          }
        },
        "prizeMoneyAwards": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PrizeMoneyAward"
          }
        },
        "sanction": {
          "$ref": "#/definitions/TournamentSanction"
        },
        "eventOtherIds": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "eventTier": {
          "$ref": "#/definitions/TierClassification"
        },
        "weekdays": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": ["eventId"],
      "additionalProperties": false
    },
    "DrawTypeEnum": {
      "type": "string",
      "enum": [
        "ADAPTIVE",
        "COMPASS",
        "CURTIS_CONSOLATION",
        "DOUBLE_ELIMINATION",
        "SINGLE_ELIMINATION",
        "FEED_IN",
        "FEED_IN_CHAMPIONSHIP",
        "FEED_IN_CHAMPIONSHIP_TO_SF",
        "FEED_IN_CHAMPIONSHIP_TO_QF",
        "FEED_IN_CHAMPIONSHIP_TO_R16",
        "FIRST_MATCH_LOSER_CONSOLATION",
        "LUCKY_DRAW",
        "MODIFIED_FEED_IN_CHAMPIONSHIP",
        "OLYMPIC",
        "OTHER",
        "PLAYOFF",
        "ROUND_ROBIN",
        "ROUND_ROBIN_WITH_PLAYOFF",
        "FIRST_ROUND_LOSER_CONSOLATION",
        "AD_HOC"
      ]
    },
    "Category": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "ageCategoryCode": {
          "type": "string"
        },
        "ageMax": {
          "type": "number"
        },
        "ageMaxDate": {
          "type": "string",
          "anyOf": [
            {
              "format": "date-time"
            },
            {
              "format": "date"
            }
          ]
        },
        "ageMin": {
          "type": "number"
        },
        "ageMinDate": {
          "type": "string",
          "anyOf": [
            {
              "format": "date-time"
            },
            {
              "format": "date"
            }
          ]
        },
        "ballType": {
          "$ref": "#/definitions/BallTypeEnum"
        },
        "categoryName": {
          "type": "string"
        },
        "categoryType": {
          "type": "string"
        },
        "combinedRatingMax": {
          "type": "number"
        },
        "combinedRatingMin": {
          "type": "number"
        },
        "ratingMax": {
          "type": "number"
        },
        "ratingMin": {
          "type": "number"
        },
        "ratingType": {
          "type": "string"
        },
        "subType": {
          "type": "string"
        },
        "type": {
          "$ref": "#/definitions/CategoryEnum"
        }
      },
      "additionalProperties": false
    },
    "BallTypeEnum": {
      "type": "string",
      "enum": [
        "HIGH_ALTITUDE",
        "STAGE1GREEN",
        "STAGE2ORANGE",
        "STAGE3RED",
        "T2STANDARD_PRESSURELESS",
        "T2STANDARD_PRESSURISED",
        "TYPE1FAST",
        "TYPE3SLOW"
      ]
    },
    "CategoryEnum": {
      "type": "string",
      "enum": ["AGE", "BOTH", "LEVEL"]
    },
    "DisciplineEnum": {
      "type": "string",
      "description": "Sport/discipline. Open, sport-agnostic vocabulary \u2014 any well-formed value is accepted so new sports need no schema release (see disciplineConstants / planning/DISCIPLINE_EXTENSIBILITY.md). Constrain via the allowedDisciplines policy where a fixed list is required. Known values are listed in examples.",
      "examples": [
        "TENNIS",
        "BEACH_TENNIS",
        "WHEELCHAIR_TENNIS",
        "PADEL",
        "PICKLEBALL",
        "SQUASH",
        "BADMINTON",
        "VOLLEYBALL",
        "BEACH_VOLLEYBALL"
      ]
    },
    "DrawDefinition": {
      "type": "object",
      "properties": {
        "appliedPolicies": {
          "$ref": "#/definitions/PolicyDefinitions"
        },
        "lineUps": {
          "type": "object"
        },
        "draftState": {
          "type": "object"
        },
        "competitionState": {
          "type": "object"
        },
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "factory": {
          "type": "object",
          "description": "The factory version and engine clock of the last write to this draw, written only when the engine stamps what a mutation modified (stampScope 'modified').",
          "properties": {
            "version": {
              "type": "string",
              "description": "Factory version that last wrote the draw"
            },
            "timeStamp": {
              "type": "number",
              "description": "Engine clock (milliseconds since the epoch) at the last write"
            }
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "automated": {
          "type": "boolean"
        },
        "drawId": {
          "type": "string"
        },
        "drawName": {
          "type": "string"
        },
        "drawOrder": {
          "type": "number"
        },
        "drawRepresentativeIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "drawStatus": {
          "$ref": "#/definitions/DrawStatusEnum"
        },
        "drawType": {
          "$ref": "#/definitions/DrawTypeEnum"
        },
        "endDate": {
          "type": "string",
          "description": "Date on which the draw ends",
          "anyOf": [
            {
              "format": "date-time"
            },
            {
              "format": "date"
            }
          ]
        },
        "entries": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Entry"
          }
        },
        "links": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DrawLink"
          }
        },
        "matchUpFormat": {
          "type": "string"
        },
        "matchUpType": {
          "$ref": "#/definitions/MatchUpTypeEnum"
        },
        "matchUps": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/MatchUp"
          }
        },
        "processCodes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "startDate": {
          "type": "string",
          "description": "Date on which the draw begins",
          "anyOf": [
            {
              "format": "date-time"
            },
            {
              "format": "date"
            }
          ]
        },
        "structures": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Structure"
          }
        },
        "tieFormats": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TieFormat"
          }
        },
        "tieFormat": {
          "$ref": "#/definitions/TieFormat"
        },
        "tieFormatId": {
          "type": "string"
        },
        "competitionProfile": {
          "$ref": "#/definitions/CompetitionProfile"
        },
        "competitionRoster": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "competitionSettlements": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/RotatingPartnerSettlement"
          }
        },
        "competitionRounds": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/RotatingPartnerRoundRecord"
          }
        },
        "activeDates": {
          "type": "array",
          "items": {
            "type": ["string", "object"]
          }
        },
        "competitionFormat": {
          "type": "object"
        },
        "drawOtherIds": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "flightNumber": {
          "type": "number"
        }
      },
      "required": ["drawId"],
      "additionalProperties": false
    },
    "DrawStatusEnum": {
      "type": "string",
      "enum": ["COMPLETED", "IN_PROGRESS", "TO_BE_PLAYED"]
    },
    "Entry": {
      "type": "object",
      "properties": {
        "roundTarget": {
          "type": "integer"
        },
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "entryId": {
          "type": "string"
        },
        "entryPosition": {
          "type": "number"
        },
        "entryStage": {
          "$ref": "#/definitions/StageTypeEnum"
        },
        "entryStageSequence": {
          "type": "number"
        },
        "entryStatus": {
          "$ref": "#/definitions/EntryStatusEnum"
        },
        "participantId": {
          "type": "string"
        },
        "scaleValue": {
          "type": "number"
        }
      },
      "required": ["participantId"],
      "additionalProperties": false
    },
    "StageTypeEnum": {
      "type": "string",
      "enum": ["CONSOLATION", "MAIN", "PLAY_OFF", "QUALIFYING", "VOLUNTARY_CONSOLATION"]
    },
    "EntryStatusEnum": {
      "type": "string",
      "enum": [
        "ALTERNATE",
        "CONFIRMED",
        "DIRECT_ACCEPTANCE",
        "FEED_IN",
        "JUNIOR_EXEMPT",
        "LUCKY_LOSER",
        "ORGANISER_ACCEPTANCE",
        "QUALIFIER",
        "REGISTERED",
        "SPECIAL_EXEMPT",
        "WILDCARD",
        "WITHDRAWN",
        "UNPAIRED",
        "UNGROUPED"
      ]
    },
    "DrawLink": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "linkCondition": {
          "$ref": "#/definitions/LinkConditionEnum"
        },
        "linkType": {
          "$ref": "#/definitions/LinkTypeEnum"
        },
        "source": {
          "$ref": "#/definitions/DrawLinkSource"
        },
        "target": {
          "$ref": "#/definitions/DrawLinkTarget"
        }
      },
      "required": ["linkType", "source", "target"],
      "additionalProperties": false
    },
    "LinkConditionEnum": {
      "type": "string",
      "const": "FIRST_MATCHUP"
    },
    "LinkTypeEnum": {
      "type": "string",
      "enum": ["LOSER", "WINNER", "POSITION"]
    },
    "DrawLinkSource": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "drawId": {
          "type": "string"
        },
        "roundNumber": {
          "type": "number"
        },
        "finishingPositions": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "structureId": {
          "type": "string"
        },
        "bestOf": {
          "type": "number"
        },
        "qualifyingPositions": {
          "type": "number"
        },
        "rankBy": {
          "type": "string"
        },
        "remainder": {
          "type": "boolean"
        }
      },
      "required": ["structureId"],
      "additionalProperties": false
    },
    "DrawLinkTarget": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "drawId": {
          "type": "string"
        },
        "feedProfile": {
          "$ref": "#/definitions/PositioningProfileEnum"
        },
        "groupedOrder": {
          "type": "array",
          "items": {
            "type": "number"
          },
          "minItems": 1
        },
        "positionInterleave": {
          "$ref": "#/definitions/Interleave"
        },
        "roundNumber": {
          "type": "number"
        },
        "structureId": {
          "type": "string"
        }
      },
      "required": ["feedProfile", "roundNumber", "structureId"],
      "additionalProperties": false
    },
    "PositioningProfileEnum": {
      "type": "string",
      "enum": ["BOTTOM_UP", "DRAW", "LOSS_POSITION", "RANDOM", "TOP_DOWN", "WATERFALL"]
    },
    "SeedingProfileEnum": {
      "type": "string",
      "enum": ["ADJACENT", "CLUSTER", "SEPARATE", "WATERFALL"]
    },
    "Interleave": {
      "type": "object",
      "properties": {
        "offset": {
          "type": "number"
        },
        "interleave": {
          "type": "number"
        }
      },
      "required": ["offset", "interleave"],
      "additionalProperties": false
    },
    "MatchUp": {
      "type": "object",
      "properties": {
        "delegatedOutcome": {
          "type": "object"
        },
        "disableAutoCalc": {
          "type": "boolean"
        },
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "onlineResources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/OnlineResource"
          }
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "collectionId": {
          "type": "string"
        },
        "collectionPosition": {
          "type": "number"
        },
        "drawPositions": {
          "type": "array",
          "items": {
            "type": "number"
          },
          "maxItems": 2
        },
        "endDate": {
          "type": "string",
          "description": "Date on which the matchUp ends",
          "anyOf": [
            {
              "format": "date-time"
            },
            {
              "format": "date"
            }
          ]
        },
        "indoorOutdoor": {
          "$ref": "#/definitions/IndoorOutdoorEnum"
        },
        "finishingRound": {
          "type": "number"
        },
        "finishingPositionRange": {
          "$ref": "#/definitions/MatchUpFinishingPositionRange"
        },
        "loserMatchUpId": {
          "type": "string"
        },
        "matchUpDuration": {
          "type": "string"
        },
        "matchUpFormat": {
          "type": "string"
        },
        "matchUpId": {
          "type": "string"
        },
        "matchUpStatus": {
          "$ref": "#/definitions/MatchUpStatusEnum"
        },
        "matchUpStatusCodes": {
          "type": "array"
        },
        "matchUpType": {
          "$ref": "#/definitions/MatchUpTypeEnum"
        },
        "orderOfFinish": {
          "type": "number"
        },
        "processCodes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "roundName": {
          "type": "string"
        },
        "roundNumber": {
          "type": "number"
        },
        "roundPosition": {
          "type": "number"
        },
        "schedule": {
          "$ref": "#/definitions/MatchUpSchedule"
        },
        "score": {
          "$ref": "#/definitions/Score"
        },
        "sides": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Side"
          }
        },
        "startDate": {
          "type": "string",
          "description": "Date on which matchUp begins",
          "anyOf": [
            {
              "format": "date-time"
            },
            {
              "format": "date"
            }
          ]
        },
        "surfaceCategory": {
          "$ref": "#/definitions/SurfaceCategoryEnum"
        },
        "tieFormatId": {
          "type": "string"
        },
        "tieFormat": {
          "$ref": "#/definitions/TieFormat"
        },
        "tieMatchUps": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/MatchUp"
          }
        },
        "winnerMatchUpId": {
          "type": "string"
        },
        "winningSide": {
          "type": "number"
        },
        "checkIns": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PresenceAttestation"
          }
        },
        "matchUpStatusCode": {
          "type": "string"
        },
        "sideExitProvenance": {
          "$ref": "#/definitions/SideExitProvenance"
        },
        "sideStatusCodes": {
          "type": "object",
          "propertyNames": {
            "enum": ["1", "2"]
          },
          "additionalProperties": {
            "type": "string"
          }
        }
      },
      "required": ["matchUpId"],
      "additionalProperties": false
    },
    "MatchUpSchedule": {
      "type": "object",
      "description": "CODES first-class schedule attributes on a matchUp, the canonical written shape since 5.0.0. Each field here was historically a timeItem of the corresponding itemType (SCHEDULED_DATE, ASSIGN_COURT, ...). START_TIME / STOP_TIME / RESUME_TIME / END_TIME / END_DATE remain timeItems because matchUpDuration() walks the ordered history.",
      "$comment": "CLOSED, and lists only what the engine WRITES into the record. The TypeScript MatchUpSchedule carries an index signature for hydration-time outputs (startTime, endTime, endDate, courtName, venueName, isoDateString, milliseconds, scheduleConflict, the recovery-time fields); those are never written into a stored record, so they are deliberately absent here. A field added to setFirstClassOrTimeItem's attribute set, or written directly onto matchUp.schedule, must be added here or schemaValidation.test.ts fails on a scheduled record.",
      "properties": {
        "allocatedCourts": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AllocatedCourt"
          }
        },
        "calledAt": {
          "type": "string",
          "format": "date-time",
          "description": "ISO timestamp captured when the matchUp is deliberately called to court. Distinct from scheduledTime (plan) and the START_TIME timeItem (actual start)."
        },
        "courtAnnotation": {
          "type": "string"
        },
        "courtId": {
          "type": "string"
        },
        "courtOrder": {
          "type": "integer"
        },
        "homeParticipantId": {
          "type": "string"
        },
        "lock": {
          "$ref": "#/definitions/ScheduleLock"
        },
        "official": {
          "type": "string",
          "description": "participantId of the assigned official"
        },
        "scheduledDate": {
          "type": "string",
          "anyOf": [
            {
              "format": "date-time"
            },
            {
              "format": "date"
            }
          ]
        },
        "scheduledTime": {
          "type": "string"
        },
        "scorekeeper": {
          "type": "string",
          "description": "participantId of the nominated scorekeeper"
        },
        "scoredTime": {
          "type": "string",
          "format": "date-time",
          "description": "ISO timestamp auto-captured the first time a matchUp receives a meaningful score or winningSide; cleared when the score is removed."
        },
        "timekeeper": {
          "type": "string",
          "description": "participantId of the assigned timekeeper"
        },
        "timeModifiers": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "venueId": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ScheduleLock": {
      "type": "object",
      "description": "A director's declaration that a matchUp's placement is deliberate and must not be moved by bulk or automated scheduling. Presence of the object is the lock; `attributes` narrows it to specific placement fields (absent means the whole placement).",
      "properties": {
        "attributes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": ["allocatedCourts", "courtId", "courtOrder", "scheduledDate", "scheduledTime", "venueId"]
          }
        },
        "lockedAt": {
          "type": "string",
          "format": "date-time"
        },
        "lockedBy": {
          "type": "string"
        },
        "reason": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "AllocatedCourt": {
      "type": "object",
      "properties": {
        "courtId": {
          "type": "string"
        },
        "venueId": {
          "type": "string"
        }
      },
      "required": ["courtId"],
      "additionalProperties": false
    },
    "IndoorOutdoorEnum": {
      "type": "string",
      "enum": ["INDOOR", "OUTDOOR", "MIXED"]
    },
    "MatchUpFinishingPositionRange": {
      "type": "object",
      "properties": {
        "loser": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "winner": {
          "type": "array",
          "items": {
            "type": "number"
          }
        }
      },
      "required": ["loser", "winner"],
      "additionalProperties": false
    },
    "MatchUpStatusEnum": {
      "type": "string",
      "enum": [
        "ABANDONED",
        "BYE",
        "COMPLETED",
        "DEAD_RUBBER",
        "DEFAULTED",
        "INCOMPLETE",
        "IN_PROGRESS",
        "NOT_PLAYED",
        "RETIRED",
        "SUSPENDED",
        "TO_BE_PLAYED",
        "WALKOVER",
        "DOUBLE_DEFAULT",
        "DOUBLE_WALKOVER",
        "CANCELLED",
        "AWAITING_RESULT"
      ]
    },
    "MatchUpTypeEnum": {
      "type": "string",
      "enum": ["DOUBLES", "SINGLES", "TEAM"]
    },
    "Score": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "scoreStringSide1": {
          "type": "string"
        },
        "scoreStringSide2": {
          "type": "string"
        },
        "side1PointScore": {
          "type": ["number", "string"]
        },
        "side2PointScore": {
          "type": ["number", "string"]
        },
        "sets": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Set"
          }
        }
      },
      "additionalProperties": false
    },
    "Set": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "games": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Game"
          }
        },
        "setDuration": {
          "type": "string"
        },
        "setFormat": {
          "type": "string"
        },
        "setNumber": {
          "type": "number"
        },
        "side1Score": {
          "type": "number"
        },
        "side1TiebreakScore": {
          "type": "number"
        },
        "side1PointScore": {
          "type": ["number", "string"]
        },
        "side2Score": {
          "type": "number"
        },
        "side2TiebreakScore": {
          "type": "number"
        },
        "side2PointScore": {
          "type": ["number", "string"]
        },
        "winningSide": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "Game": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "gameDuration": {
          "type": "string"
        },
        "gameFormat": {
          "type": "string"
        },
        "gameNumber": {
          "type": "number"
        },
        "points": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Point"
          }
        },
        "winReason": {
          "$ref": "#/definitions/WinReasonEnum"
        },
        "winningSide": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "Point": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "pointDuration": {
          "type": "string"
        },
        "pointNumber": {
          "type": "number"
        },
        "shots": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Shot"
          }
        },
        "side1Score": {
          "type": "string"
        },
        "side2Score": {
          "type": "string"
        },
        "winReason": {
          "$ref": "#/definitions/WinReasonEnum"
        },
        "winningSide": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "Shot": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "bounceAt": {
          "$ref": "#/definitions/CourtPosition"
        },
        "participantId": {
          "type": "string"
        },
        "shotDetail": {
          "$ref": "#/definitions/ShotDetailEnum"
        },
        "shotMadeFrom": {
          "$ref": "#/definitions/CourtPosition"
        },
        "shotNumber": {
          "type": "number"
        },
        "shotOutcome": {
          "$ref": "#/definitions/ShotOutcomeEnum"
        },
        "shotType": {
          "$ref": "#/definitions/ShotTypeEnum"
        },
        "sideNumber": {
          "type": "number"
        },
        "speed": {
          "type": "number"
        },
        "spin": {
          "type": "string"
        }
      },
      "required": ["participantId"],
      "additionalProperties": false
    },
    "CourtPosition": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "positionName": {
          "$ref": "#/definitions/CourtPositionEnum"
        },
        "timeAtPosition": {
          "type": "string",
          "format": "date-time"
        },
        "x": {
          "type": "number"
        },
        "y": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "CourtPositionEnum": {
      "type": "string",
      "enum": ["BASELINE", "LEFT_SERVICE_COURT", "NET", "RIGHT_SERVICE_COURT", "SERVICELINE"]
    },
    "ShotDetailEnum": {
      "type": "string",
      "enum": [
        "DRIVE",
        "DRIVE_VOLLEY",
        "DROP_SHOT",
        "GROUND_STROKE",
        "HALF_VOLLEY",
        "LOB",
        "PASSING_SHOT",
        "SMASH",
        "TRICK",
        "VOLLEY"
      ]
    },
    "ShotOutcomeEnum": {
      "type": "string",
      "enum": ["IN", "LET", "OUT", "NET"]
    },
    "ShotTypeEnum": {
      "type": "string",
      "enum": ["BACKHAND", "FOREHAND", "SERVE"]
    },
    "WinReasonEnum": {
      "type": "string",
      "enum": ["ACE", "DOUBLE_FAULT", "ERROR", "FORCED", "NET_CORD", "PENALTY", "UNFORCED", "WINNER"]
    },
    "Side": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "participantId": {
          "type": "string"
        },
        "lineUp": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TeamCompetitor"
          }
        },
        "sideNumber": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "TeamCompetitor": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "collectionAssignments": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CollectionAssignment"
          }
        },
        "participantId": {
          "type": "string"
        }
      },
      "required": ["participantId"],
      "additionalProperties": false
    },
    "CollectionAssignment": {
      "type": "object",
      "properties": {
        "collectionId": {
          "type": "string"
        },
        "collectionPosition": {
          "type": "number"
        },
        "previousParticipantId": {
          "type": "string"
        },
        "substitutionOrder": {
          "type": "number"
        }
      },
      "required": ["collectionId", "collectionPosition"],
      "additionalProperties": false
    },
    "SurfaceCategoryEnum": {
      "type": "string",
      "enum": ["ARTIFICIAL", "CARPET", "CLAY", "GRASS", "HARD"]
    },
    "TieFormat": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "tieFormatId": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "collectionDefinitions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CollectionDefinition"
          }
        },
        "collectionGroups": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CollectionGroup"
          }
        },
        "tieFormatName": {
          "type": "string"
        },
        "winCriteria": {
          "$ref": "#/definitions/WinCriteria"
        },
        "scoreSource": {
          "type": "string",
          "enum": ["DERIVED", "REPORTED"]
        }
      },
      "required": ["collectionDefinitions", "winCriteria"],
      "additionalProperties": false
    },
    "CollectionDefinition": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "category": {
          "$ref": "#/definitions/Category"
        },
        "collectionId": {
          "type": "string"
        },
        "collectionName": {
          "type": "string"
        },
        "collectionGroupNumber": {
          "type": "number"
        },
        "collectionOrder": {
          "type": "number"
        },
        "collectionValue": {
          "type": "number"
        },
        "collectionValueProfiles": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CollectionValueProfile"
          }
        },
        "gender": {
          "$ref": "#/definitions/GenderEnum"
        },
        "matchUpCount": {
          "type": "number"
        },
        "matchUpFormat": {
          "type": "string"
        },
        "matchUpType": {
          "$ref": "#/definitions/MatchUpTypeEnum"
        },
        "matchUpTypeOptions": {
          "description": "Permitted encounter choices; no concrete matchUpType means the choice is unresolved.",
          "type": "array",
          "minItems": 2,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "enum": ["SINGLES", "DOUBLES"]
          }
        },
        "matchUpValue": {
          "type": "number"
        },
        "processCodes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "setValue": {
          "type": "number"
        },
        "scoreValue": {
          "type": "number"
        },
        "winCriteria": {
          "$ref": "#/definitions/WinCriteria"
        }
      },
      "allOf": [
        {
          "if": {
            "required": ["matchUpTypeOptions"]
          },
          "then": {
            "properties": {
              "matchUpType": {
                "enum": ["SINGLES", "DOUBLES"]
              }
            }
          }
        }
      ],
      "required": ["collectionId"],
      "additionalProperties": false
    },
    "CollectionValueProfile": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "collectionPosition": {
          "type": "number"
        },
        "matchUpValue": {
          "type": "number"
        }
      },
      "required": ["collectionPosition", "matchUpValue"],
      "additionalProperties": false
    },
    "GenderEnum": {
      "type": "string",
      "enum": ["ANY", "FEMALE", "MALE", "MIXED"]
    },
    "WinCriteria": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "aggregateValue": {
          "type": "boolean"
        },
        "valueGoal": {
          "type": "number"
        }
      },
      "required": ["valueGoal"],
      "additionalProperties": false
    },
    "CollectionGroup": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "groupNumber": {
          "type": "number"
        },
        "groupName": {
          "type": "string"
        },
        "groupValue": {
          "type": "number"
        },
        "winCriteria": {
          "$ref": "#/definitions/WinCriteria"
        }
      },
      "required": ["groupNumber"],
      "additionalProperties": false
    },
    "Structure": {
      "type": "object",
      "properties": {
        "appliedPolicies": {
          "$ref": "#/definitions/PolicyDefinitions"
        },
        "roundTarget": {
          "type": "integer"
        },
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "roundOffset": {
          "type": "number"
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "finishingPosition": {
          "$ref": "#/definitions/FinishingPositionEnum"
        },
        "matchUps": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/MatchUp"
          }
        },
        "matchUpFormat": {
          "type": "string"
        },
        "matchUpType": {
          "$ref": "#/definitions/MatchUpTypeEnum"
        },
        "positionAssignments": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PositionAssignment"
          }
        },
        "processCodes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "qualifyingRoundNumber": {
          "type": "number"
        },
        "roundLimit": {
          "type": "number"
        },
        "seedAssignments": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SeedAssignment"
          }
        },
        "seedingProfile": {
          "$ref": "#/definitions/PositioningProfileEnum"
        },
        "seedLimit": {
          "type": "number"
        },
        "stage": {
          "$ref": "#/definitions/StageTypeEnum"
        },
        "stageSequence": {
          "type": "number"
        },
        "structures": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Structure"
          }
        },
        "structureId": {
          "type": "string"
        },
        "structureName": {
          "type": "string"
        },
        "structureOrder": {
          "type": "number"
        },
        "structureAbbreviation": {
          "type": "string"
        },
        "structureType": {
          "$ref": "#/definitions/StructureTypeEnum"
        },
        "tieFormat": {
          "$ref": "#/definitions/TieFormat"
        },
        "tieFormatId": {
          "type": "string"
        },
        "competitionFormat": {
          "type": "object"
        }
      },
      "required": ["structureId"],
      "additionalProperties": false
    },
    "FinishingPositionEnum": {
      "type": "string",
      "enum": ["ROUND_OUTCOME", "WIN_RATIO"]
    },
    "PositionAssignment": {
      "type": "object",
      "properties": {
        "tally": {
          "type": "object"
        },
        "subOrder": {
          "type": "integer"
        },
        "disableLinks": {
          "type": "boolean"
        },
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "bye": {
          "type": "boolean"
        },
        "drawPosition": {
          "type": "number"
        },
        "participantId": {
          "type": "string"
        },
        "qualifier": {
          "type": "boolean"
        },
        "byeFromPropagation": {
          "type": "boolean"
        }
      },
      "required": ["drawPosition"],
      "additionalProperties": false
    },
    "SeedAssignment": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "seedNumber": {
          "type": "number"
        },
        "seedValue": {
          "type": ["integer", "string"]
        },
        "participantId": {
          "type": "string"
        },
        "seedingBasis": {
          "type": "string",
          "enum": ["ORGANISER_DISCRETION", "PROTECTED_RANKING", "RANKING", "RATING"]
        }
      },
      "required": ["seedNumber", "seedValue"],
      "additionalProperties": false
    },
    "StructureTypeEnum": {
      "type": "string",
      "enum": ["CONTAINER", "ITEM"]
    },
    "TournamentLevelEnum": {
      "type": "string",
      "enum": ["INTERNATIONAL", "ZONAL", "LOCAL", "NATIONAL", "REGIONAL", "DISTRICT", "CLUB", "RECREATIONAL"]
    },
    "TournamentStatusEnum": {
      "type": "string",
      "enum": ["ACTIVE", "IN_PROGRESS", "COMPLETED", "ABANDONED", "CANCELLED"]
    },
    "EventTypeEnum": {
      "type": "string",
      "enum": ["DOUBLES", "SINGLES", "TEAM"]
    },
    "WheelchairClassEnum": {
      "type": "string",
      "enum": ["STANDARD", "QUAD"]
    },
    "CountryCodeEnum": {
      "type": "string",
      "enum": [
        "ABW",
        "AFG",
        "AGO",
        "AIA",
        "ALA",
        "ALB",
        "AND",
        "ANT",
        "ARE",
        "ARG",
        "ARM",
        "ASM",
        "ATA",
        "ATF",
        "ATG",
        "AUS",
        "AUT",
        "AZE",
        "BDI",
        "BEL",
        "BEN",
        "BFA",
        "BGD",
        "BGR",
        "BHR",
        "BHS",
        "BIH",
        "BLM",
        "BLR",
        "BLZ",
        "BMU",
        "BOL",
        "BRA",
        "BRB",
        "BRN",
        "BTN",
        "BVT",
        "BWA",
        "CAF",
        "CAN",
        "CCK",
        "CGD",
        "CHE",
        "CHL",
        "CHN",
        "CIV",
        "CMR",
        "COD",
        "COG",
        "COK",
        "COL",
        "COM",
        "CPV",
        "CRI",
        "CUB",
        "CUW",
        "CXR",
        "CYM",
        "CYP",
        "CZE",
        "DEU",
        "DJI",
        "DMA",
        "DNK",
        "DOM",
        "DZA",
        "ECU",
        "EGY",
        "ERI",
        "ESE",
        "ESH",
        "ESP",
        "ETH",
        "FIN",
        "FJI",
        "FLK",
        "FRA",
        "FRO",
        "FSM",
        "GAB",
        "GBR",
        "GEO",
        "GGY",
        "GHA",
        "GIB",
        "GIN",
        "GLP",
        "GMB",
        "GNB",
        "GNQ",
        "GRC",
        "GRD",
        "GRL",
        "GTM",
        "GUF",
        "GUM",
        "GUY",
        "HKG",
        "HMD",
        "HND",
        "HRV",
        "HTI",
        "HUN",
        "IDN",
        "IMN",
        "IND",
        "IOT",
        "IRL",
        "IRN",
        "IRQ",
        "ISL",
        "ISR",
        "ITA",
        "JAM",
        "JEY",
        "JOR",
        "JPN",
        "KAZ",
        "KEN",
        "KGZ",
        "KHM",
        "KIR",
        "KNA",
        "KOR",
        "KOS",
        "KRI",
        "KWT",
        "LAO",
        "LBN",
        "LBR",
        "LBY",
        "LCA",
        "LIE",
        "LKA",
        "LSO",
        "LTU",
        "LUX",
        "LVA",
        "MAC",
        "MAF",
        "MAR",
        "MCO",
        "MDA",
        "MDG",
        "MDV",
        "MEX",
        "MHL",
        "MKD",
        "MLI",
        "MLT",
        "MMR",
        "MNE",
        "MNG",
        "MNP",
        "MOZ",
        "MRT",
        "MSR",
        "MTQ",
        "MUS",
        "MWI",
        "MYS",
        "MYT",
        "NAM",
        "NCL",
        "NER",
        "NFK",
        "NGA",
        "NIC",
        "NIU",
        "NLD",
        "NMP",
        "NOR",
        "NPL",
        "NRU",
        "NZL",
        "OMN",
        "PAK",
        "PAN",
        "PCN",
        "PER",
        "PHL",
        "PLW",
        "PNG",
        "POL",
        "PRI",
        "PRK",
        "PRT",
        "PRY",
        "PSE",
        "PYF",
        "QAT",
        "REU",
        "ROU",
        "RUS",
        "RWA",
        "SAU",
        "SDN",
        "SEN",
        "SGP",
        "SGS",
        "SHN",
        "SJM",
        "SLB",
        "SLE",
        "SLV",
        "SMR",
        "SMX",
        "SOM",
        "SPM",
        "SRB",
        "SSD",
        "STP",
        "SUR",
        "SVK",
        "SVN",
        "SWE",
        "SWZ",
        "SYC",
        "SYR",
        "TCA",
        "TCD",
        "TGO",
        "THA",
        "TJK",
        "TKL",
        "TKM",
        "TLS",
        "TON",
        "TTO",
        "TUN",
        "TUR",
        "TUV",
        "TWN",
        "TZA",
        "UGA",
        "UKR",
        "UMI",
        "URY",
        "USA",
        "UZB",
        "VAT",
        "VCT",
        "VEN",
        "VGB",
        "VIR",
        "VNM",
        "VUT",
        "WLF",
        "WSM",
        "YEM",
        "ZAF",
        "ZMB",
        "ZWE"
      ]
    },
    "OnlineResource": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "identifier": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "provider": {
          "type": "string"
        },
        "resourceSubType": {
          "type": "string"
        },
        "resourceType": {
          "$ref": "#/definitions/OnlineResourceTypeEnum"
        }
      },
      "additionalProperties": false
    },
    "OnlineResourceTypeEnum": {
      "type": "string",
      "enum": ["SOCIAL_MEDIA", "URL", "EMAIL", "OTHER"]
    },
    "Organisation": {
      "type": "object",
      "properties": {
        "addresses": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Address"
          }
        },
        "contacts": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Contact"
          }
        },
        "organisationName": {
          "type": "string"
        },
        "organisationAbbreviation": {
          "type": "string"
        },
        "organisationId": {
          "type": "string"
        },
        "organisationType": {
          "$ref": "#/definitions/OrganisationTypeEnum"
        },
        "onlineResources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/OnlineResource"
          }
        },
        "parentOrganisationId": {
          "type": "string"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        }
      },
      "$comment": "OPEN, and this is a KNOWN GAP rather than a decision \u2014 closing it is blocked, not declined. Measured 2026-08-28 against the 16 TODS fixtures: records carry `createdAt`, `updatedAt` and a nested `parentOrganisation`. Closing this definition today fails 14 of 16 fixtures. Each undeclared field must first be resolved as either a real CODES concept (declare it in `types/tournamentTypes.ts` AND here) or as legacy data (correct the fixtures), after which this should become `false` to match the other 51.",
      "additionalProperties": true
    },
    "Participant": {
      "type": "object",
      "properties": {
        "teamColors": { "$ref": "#/definitions/TeamColors" },
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "contacts": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Contact"
          }
        },
        "individualParticipantIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "onlineResources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/OnlineResource"
          }
        },
        "participantName": {
          "type": "string"
        },
        "participantOtherName": {
          "type": "string"
        },
        "participantId": {
          "type": "string"
        },
        "participantRole": {
          "$ref": "#/definitions/ParticipantRoleEnum"
        },
        "participantStatus": {
          "$ref": "#/definitions/ParticipantStatusEnum"
        },
        "penalties": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Penalty"
          }
        },
        "personId": {
          "type": "string"
        },
        "person": {
          "$ref": "#/definitions/Person"
        },
        "representing": {
          "$ref": "#/definitions/CountryCodeEnum"
        },
        "participantRoleResponsibilities": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "teamId": {
          "type": "string"
        },
        "participantType": {
          "$ref": "#/definitions/ParticipantTypeEnum"
        },
        "useOtherName": {
          "type": "boolean"
        },
        "contactParticipantIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "homeVenueIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "participantOtherIds": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "presence": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PresenceAttestation"
          }
        }
      },
      "required": ["participantId"],
      "additionalProperties": false
    },
    "Contact": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "emailAddress": {
          "type": "string"
        },
        "fax": {
          "type": "string"
        },
        "isPublic": {
          "type": "boolean"
        },
        "mobileTelephone": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "telephone": {
          "type": "string"
        },
        "relationship": {
          "type": "string",
          "enum": ["CHAPERONE", "EMERGENCY", "GUARDIAN", "OTHER", "PARENT", "SELF"]
        }
      },
      "additionalProperties": false
    },
    "ParticipantRoleEnum": {
      "type": "string",
      "enum": [
        "ADMINISTRATION",
        "CAPTAIN",
        "COACH",
        "COMPETITOR",
        "DIRECTOR",
        "HOSPITALITY",
        "MEDIA",
        "MEDICAL",
        "OFFICIAL",
        "OTHER",
        "SECURITY",
        "STRINGER",
        "SUPERVISOR",
        "TRANSPORT",
        "VOLUNTEER"
      ]
    },
    "ParticipantStatusEnum": {
      "type": "string",
      "enum": ["ACTIVE", "WITHDRAWN"]
    },
    "Penalty": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "issuedAt": {
          "type": "string"
        },
        "matchUpId": {
          "type": "string"
        },
        "penaltyCode": {
          "type": "string"
        },
        "penaltyId": {
          "type": "string"
        },
        "penaltyType": {
          "$ref": "#/definitions/PenaltyTypeEnum"
        },
        "refereeParticipantId": {
          "type": "string"
        }
      },
      "required": ["penaltyId", "penaltyType"],
      "additionalProperties": false
    },
    "PenaltyTypeEnum": {
      "type": "string",
      "enum": [
        "AUDIBLE_OBSCENITY",
        "BALL_ABUSE",
        "COACHING",
        "DRESS_CODE_VIOLATION",
        "EQUIMENT_VIOLATION",
        "EQUIPMENT_VIOLATION",
        "FAILUIRE_TO_SIGN_IN",
        "FAILURE_TO_SIGN_IN",
        "FAILURE_TO_SIGN_OUT",
        "FAILURE_TO_COMPLETE",
        "INELIGIBILITY",
        "LEAVING_THE_COURT",
        "NO_SHOW",
        "PHYSICAL_ABUSE",
        "PROHIBITED_SUBSTANCE",
        "PUNCTUALITY",
        "RACKET_ABUSE",
        "REFUSAL_TO_PLAY",
        "TIME_VIOLATION",
        "UNSPORTSMANLIKE_CONDUCT",
        "VERBAL_ABUSE",
        "VISIBLE_OBSCENITY",
        "OTHER"
      ]
    },
    "Person": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "addresses": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Address"
          }
        },
        "biographicalInformation": {
          "$ref": "#/definitions/BiographicalInformation"
        },
        "birthDate": {
          "type": "string",
          "anyOf": [
            {
              "format": "date-time"
            },
            {
              "format": "date"
            }
          ]
        },
        "birthYear": {
          "type": "integer",
          "minimum": 1900,
          "maximum": 2200
        },
        "contacts": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Contact"
          }
        },
        "nationalityCode": {
          "type": "string"
        },
        "nativeFamilyName": {
          "type": "string"
        },
        "nativeGivenName": {
          "type": "string"
        },
        "onlineResources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/OnlineResource"
          }
        },
        "otherNames": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "parentOrganisationId": {
          "type": "string"
        },
        "passportFamilyName": {
          "type": "string"
        },
        "passportGivenName": {
          "type": "string"
        },
        "personId": {
          "type": "string"
        },
        "personOtherIds": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/UnifiedPersonId"
          }
        },
        "previousNames": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "sectionId": {
          "type": "string"
        },
        "sex": {
          "$ref": "#/definitions/SexEnum"
        },
        "standardFamilyName": {
          "type": "string"
        },
        "standardGivenName": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "tennisId": {
          "type": "string"
        },
        "wheelchair": {
          "type": "boolean"
        }
      },
      "required": ["personId"],
      "additionalProperties": false
    },
    "Address": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "addressLine1": {
          "type": "string"
        },
        "addressLine2": {
          "type": "string"
        },
        "addressLine3": {
          "type": "string"
        },
        "addressName": {
          "type": "string"
        },
        "addressType": {
          "$ref": "#/definitions/AddressTypeEnum"
        },
        "city": {
          "type": "string"
        },
        "countryCode": {
          "$ref": "#/definitions/CountryCodeEnum"
        },
        "latitude": {
          "type": "string"
        },
        "longitude": {
          "type": "string"
        },
        "postalCode": {
          "type": "string"
        },
        "state": {
          "type": "string"
        },
        "timeZone": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "AddressTypeEnum": {
      "type": "string",
      "enum": ["HOME", "MAIL", "RESIDENTIAL", "VENUE", "WORK", "PRIMARY"]
    },
    "BiographicalInformation": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "ageBeganTennis": {
          "type": "number"
        },
        "ageTurnedPro": {
          "type": "number"
        },
        "birthCountryCode": {
          "$ref": "#/definitions/CountryCodeEnum"
        },
        "coachId": {
          "type": "string"
        },
        "doublePlayingHand": {
          "$ref": "#/definitions/PlayingDoubleHandCodeEnum"
        },
        "height": {
          "type": "number"
        },
        "heightUnit": {
          "$ref": "#/definitions/LengthUnitEnum"
        },
        "organisationIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "placeOfResidence": {
          "type": "string"
        },
        "playingHand": {
          "$ref": "#/definitions/PlayingHandCodeEnum"
        },
        "residenceCountryCode": {
          "$ref": "#/definitions/CountryCodeEnum"
        },
        "weight": {
          "type": "number"
        },
        "weightUnit": {
          "$ref": "#/definitions/WeightUnitEnum"
        },
        "teamAttributes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TeamAttribute"
          }
        }
      },
      "additionalProperties": false
    },
    "TeamPaletteColor": {
      "type": "object",
      "additionalProperties": false,
      "required": ["colorId", "value"],
      "properties": {
        "colorId": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,63}$" },
        "value": { "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$" },
        "name": { "type": "string", "minLength": 1, "maxLength": 100, "pattern": "\\S" },
        "group": { "type": "string", "minLength": 1, "maxLength": 100, "pattern": "\\S" }
      }
    },
    "TeamColors": {
      "type": "object",
      "additionalProperties": false,
      "required": ["palette"],
      "properties": {
        "palette": {
          "type": "array",
          "minItems": 1,
          "items": {
            "$ref": "#/definitions/TeamPaletteColor"
          }
        },
        "display": {
          "type": "object",
          "additionalProperties": false,
          "required": ["roles"],
          "properties": {
            "roles": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "team.surface": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,63}$"
                },
                "team.text": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,63}$"
                },
                "team.accent": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,63}$"
                },
                "score.surface": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,63}$"
                },
                "score.text": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,63}$"
                }
              }
            }
          }
        }
      }
    },
    "TeamAttribute": {
      "type": "object",
      "properties": {
        "teamId": {
          "type": "string"
        },
        "teamName": {
          "type": "string"
        },
        "jerseyNumber": {
          "type": "string"
        },
        "jerseyName": {
          "type": "string"
        },
        "position": {
          "type": "string"
        },
        "captain": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "PlayingDoubleHandCodeEnum": {
      "type": "string",
      "enum": ["BACKHAND", "BOTH", "FOREHAND", "NONE"]
    },
    "LengthUnitEnum": {
      "type": "string",
      "enum": ["CENTIMETER", "METER", "MILLIMETER"]
    },
    "PlayingHandCodeEnum": {
      "type": "string",
      "enum": ["AMBIDEXTROUS", "LEFT", "RIGHT"]
    },
    "WeightUnitEnum": {
      "type": "string",
      "enum": ["GRAM", "KILOGRAM"]
    },
    "UnifiedPersonId": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "organisationId": {
          "type": "string"
        },
        "uniqueOrganisationName": {
          "type": "string"
        },
        "personId": {
          "type": "string"
        }
      },
      "required": ["organisationId", "personId"],
      "additionalProperties": false
    },
    "SexEnum": {
      "type": "string",
      "enum": ["FEMALE", "MALE", "OTHER"]
    },
    "ParticipantTypeEnum": {
      "type": "string",
      "enum": ["INDIVIDUAL", "PAIR", "TEAM", "GROUP"]
    },
    "OrganisationTypeEnum": {
      "type": "string",
      "enum": ["NATIONAL_ASSOCIATION", "SCHOOL", "SECTION", "AREA", "DISTRICT", "CLUB", "OTHER"]
    },
    "RegistrationProfile": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "entriesClose": {
          "type": "string",
          "format": "date-time"
        },
        "entriesOpen": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "withdrawalDeadline": {
          "type": "string",
          "format": "date-time"
        },
        "eligibilityNotes": {
          "type": "string"
        },
        "entryFees": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/RegistrationEntryFee"
          }
        },
        "entryMethod": {
          "type": "string"
        },
        "entryUrl": {
          "type": "string"
        },
        "accommodation": {
          "$ref": "#/definitions/LogisticsSection"
        },
        "hospitality": {
          "$ref": "#/definitions/LogisticsSection"
        },
        "medicalInfo": {
          "$ref": "#/definitions/LogisticsSection"
        },
        "transportation": {
          "$ref": "#/definitions/LogisticsSection"
        },
        "contingencyPlan": {
          "type": "string"
        },
        "dressCode": {
          "type": "string"
        },
        "awardsCeremonyDate": {
          "type": "string"
        },
        "awardsDescription": {
          "type": "string"
        },
        "drawCeremonyDate": {
          "type": "string"
        },
        "socialEvents": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SocialEvent"
          }
        },
        "codeOfConduct": {
          "$ref": "#/definitions/DocumentLink"
        },
        "regulations": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DocumentLink"
          }
        },
        "sponsors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Sponsor"
          }
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "isMock": {
          "type": "boolean"
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        }
      },
      "additionalProperties": false
    },
    "LogisticsSection": {
      "type": "object",
      "properties": {
        "notes": {
          "type": "string"
        },
        "options": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LogisticsOption"
          }
        }
      },
      "additionalProperties": false
    },
    "LogisticsOption": {
      "type": "object",
      "properties": {
        "address": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "name": {
          "type": "string"
        },
        "notes": {
          "type": "string"
        },
        "phone": {
          "type": "string"
        },
        "priceRange": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      },
      "required": ["name"],
      "additionalProperties": false
    },
    "SanctionDecisionEnum": {
      "type": "string",
      "enum": [
        "PENDING",
        "APPROVED",
        "CONDITIONAL",
        "DENIED",
        "WITHDRAWN",
        "REVOKED",
        "SUSPENDED",
        "EXPIRED",
        "DOWNGRADED"
      ]
    },
    "RecognitionEnum": {
      "type": "string",
      "enum": ["SANCTIONED", "APPROVED", "OBSERVED", "RECOGNISED", "LICENSED", "UNSANCTIONED"]
    },
    "AuthorityRoleEnum": {
      "type": "string",
      "enum": [
        "INTERNATIONAL",
        "NATIONAL",
        "ZONE",
        "SECTION",
        "REGION",
        "PROVINCE",
        "STATE",
        "COUNTY",
        "DISTRICT",
        "LEAGUE",
        "CONFERENCE",
        "CLUB",
        "PROVIDER"
      ]
    },
    "SanctionEnforcementEnum": {
      "type": "string",
      "enum": ["ENFORCE", "AUDIT", "WARN"]
    },
    "SanctionFeeKindEnum": {
      "type": "string",
      "enum": ["SANCTION", "HEAD_TAX", "LATE", "ENTRY"]
    },
    "SanctioningAuthority": {
      "type": "object",
      "properties": {
        "organisationAbbreviation": {
          "type": "string"
        },
        "organisationName": {
          "type": "string"
        },
        "organisationId": {
          "type": "string"
        },
        "role": {
          "$ref": "#/definitions/AuthorityRoleEnum"
        },
        "regionCode": {
          "type": "string"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        }
      },
      "additionalProperties": false
    },
    "SanctionFee": {
      "type": "object",
      "properties": {
        "feeKind": {
          "$ref": "#/definitions/SanctionFeeKindEnum"
        },
        "fee": {
          "$ref": "#/definitions/MonetaryAmount"
        },
        "percentage": {
          "type": "number"
        },
        "perParticipant": {
          "type": "boolean"
        },
        "maximum": {
          "$ref": "#/definitions/MonetaryAmount"
        },
        "appliesTo": {
          "type": "string"
        },
        "note": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "SanctionConferral": {
      "type": "object",
      "properties": {
        "rankingEligible": {
          "type": "boolean"
        },
        "rankingPointsProfile": {
          "type": "string"
        },
        "recordEligible": {
          "type": "boolean"
        },
        "officialResults": {
          "type": "boolean"
        },
        "insured": {
          "type": "boolean"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        }
      },
      "additionalProperties": false
    },
    "SanctionRuleset": {
      "type": "object",
      "properties": {
        "rulesetId": {
          "type": "string"
        },
        "edition": {
          "type": "string"
        },
        "enforcement": {
          "$ref": "#/definitions/SanctionEnforcementEnum"
        },
        "appliedRules": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        }
      },
      "additionalProperties": false
    },
    "SanctionDecisionRecord": {
      "type": "object",
      "properties": {
        "decidedAt": {
          "type": "string"
        },
        "decidedByPersonId": {
          "type": "string"
        },
        "decidedByName": {
          "type": "string"
        },
        "appealable": {
          "type": "boolean"
        },
        "reason": {
          "type": "string"
        },
        "note": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "SanctionIdentifier": {
      "type": "object",
      "properties": {
        "organisationId": {
          "type": "string"
        },
        "identifier": {
          "type": "string"
        },
        "identifierType": {
          "type": "string"
        }
      },
      "required": ["identifier"],
      "additionalProperties": false
    },
    "SanctionSubmissionWindow": {
      "type": "object",
      "properties": {
        "from": {
          "type": "string"
        },
        "to": {
          "type": "string"
        },
        "timeZone": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "SanctionConstraints": {
      "description": "Limits a sanctioning provider's rules set for one tournament: provider-defined, enforced by the factory, never derived by it.",
      "type": "object",
      "properties": {
        "definedBy": {
          "type": "object",
          "properties": {
            "providerId": {
              "type": "string",
              "minLength": 1,
              "pattern": "\\S"
            },
            "organisationName": {
              "type": "string"
            }
          },
          "required": ["providerId"],
          "additionalProperties": false
        },
        "source": {
          "type": "object",
          "properties": {
            "policyName": {
              "type": "string"
            },
            "policyVersion": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "events": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SanctionEventConstraints"
          }
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        }
      },
      "required": ["definedBy", "events"],
      "additionalProperties": false
    },
    "SanctionEventConstraints": {
      "description": "The limits for the events an entry matches: eventType always; eventName and categoryName when stated.",
      "type": "object",
      "properties": {
        "overrideLimits": {
          "description": "Explicit sanction-record permission ceilings. A director request above a base limit must not exceed this value; absent permission denies the override.",
          "type": "object",
          "properties": {
            "drawSize": {
              "type": "integer",
              "minimum": 0
            },
            "maxWildcards": {
              "type": "integer",
              "minimum": 0
            },
            "maxAlternates": {
              "type": "integer",
              "minimum": 0
            },
            "maxQualifiers": {
              "type": "integer",
              "minimum": 0
            }
          },
          "additionalProperties": false
        },
        "match": {
          "type": "object",
          "properties": {
            "eventType": {
              "$ref": "#/definitions/EventTypeEnum"
            },
            "eventName": {
              "type": "string"
            },
            "categoryName": {
              "type": "string"
            }
          },
          "required": ["eventType"],
          "additionalProperties": false
        },
        "drawSize": {
          "type": "integer",
          "minimum": 0
        },
        "maxWildcards": {
          "type": "integer",
          "minimum": 0
        },
        "maxAlternates": {
          "type": "integer",
          "minimum": 0
        },
        "maxQualifiers": {
          "type": "integer",
          "minimum": 0
        }
      },
      "required": ["match"],
      "additionalProperties": false
    },
    "TournamentScheduling": {
      "description": "The tournament's scheduling state. profile, dailyLimits and timing were the schedulingProfile, scheduleLimits and scheduleTiming extensions (read either way).",
      "type": "object",
      "properties": {
        "profile": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ScheduleProfileDate"
          },
          "description": "The scheduling profile: which rounds are scheduled on which date at which venue, in order."
        },
        "dailyLimits": {
          "$ref": "#/definitions/TournamentScheduleLimits"
        },
        "timing": {
          "$ref": "#/definitions/TournamentScheduleTiming"
        },
        "venueTransits": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/VenueTransitEntry"
          }
        },
        "scenarios": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ScheduleScenario"
          }
        },
        "practice": {
          "type": "object",
          "properties": {
            "defaultCapacity": {
              "type": ["number", "null"]
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "ScheduleProfileDate": {
      "type": "object",
      "properties": {
        "scheduleDate": {
          "type": "string"
        },
        "venues": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ScheduleProfileVenue"
          }
        }
      },
      "required": ["scheduleDate"],
      "additionalProperties": false
    },
    "ScheduleProfileVenue": {
      "type": "object",
      "properties": {
        "venueId": {
          "type": "string"
        },
        "rounds": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ScheduleProfileRound"
          }
        }
      },
      "required": ["venueId"],
      "additionalProperties": false
    },
    "ScheduleProfileRound": {
      "description": "A round (or one segment of it) in a scheduling profile. eventName, roundName and sortOrder are display attributes.",
      "type": "object",
      "properties": {
        "tournamentId": {
          "type": "string"
        },
        "eventId": {
          "type": "string"
        },
        "drawId": {
          "type": "string"
        },
        "structureId": {
          "type": "string"
        },
        "roundNumber": {
          "type": "number"
        },
        "roundSegment": {
          "type": "object",
          "properties": {
            "segmentNumber": {
              "type": "number"
            },
            "segmentsCount": {
              "type": "number"
            }
          },
          "required": ["segmentNumber", "segmentsCount"],
          "additionalProperties": false
        },
        "notBeforeTime": {
          "type": "string",
          "description": "'HH:MM': the earliest time the round may start."
        },
        "periodLength": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "matchUpIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "containerStructureId": {
          "type": "string"
        },
        "isRoundRobin": {
          "type": "boolean"
        },
        "eventName": {
          "type": "string"
        },
        "roundName": {
          "type": "string"
        },
        "sortOrder": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "TournamentScheduleLimits": {
      "type": "object",
      "properties": {
        "dailyLimits": {
          "$ref": "#/definitions/SchedulingDailyLimits"
        }
      },
      "additionalProperties": false
    },
    "TournamentScheduleTiming": {
      "description": "The tournament's own matchUp format timing, consulted before its scheduling policy.",
      "type": "object",
      "properties": {
        "matchUpAverageTimes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SchedulingFormatAverageTimes"
          }
        },
        "matchUpRecoveryTimes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SchedulingFormatRecoveryTimes"
          }
        },
        "overnightTimes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SchedulingCategoryTimes"
          }
        }
      },
      "additionalProperties": false
    },
    "VenueTransitEntry": {
      "description": "Minutes to get between two venues; symmetric unless oneWay.",
      "type": "object",
      "properties": {
        "venueIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 2,
          "maxItems": 2
        },
        "minutes": {
          "type": "number",
          "minimum": 0
        },
        "oneWay": {
          "type": "boolean"
        },
        "sanctioned": {
          "type": "object",
          "properties": {
            "minutes": {
              "type": "number",
              "minimum": 0
            },
            "sanctioningId": {
              "type": "string"
            }
          },
          "required": ["minutes"],
          "additionalProperties": false
        }
      },
      "required": ["venueIds", "minutes"],
      "additionalProperties": false
    },
    "ScheduleScenario": {
      "description": "A named alternate scheduling plan.",
      "type": "object",
      "properties": {
        "scenarioId": {
          "type": "string"
        },
        "scenarioName": {
          "type": "string"
        },
        "scheduledDates": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "createdAt": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string"
        },
        "notes": {
          "type": "string"
        },
        "basedOnHash": {
          "type": "string"
        },
        "placements": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ScenarioPlacement"
          }
        }
      },
      "required": ["scenarioId", "scenarioName", "placements"],
      "additionalProperties": false
    },
    "ScenarioPlacement": {
      "type": "object",
      "properties": {
        "tournamentId": {
          "type": "string"
        },
        "matchUpId": {
          "type": "string"
        },
        "schedule": {
          "$ref": "#/definitions/MatchUpSchedule"
        }
      },
      "required": ["tournamentId", "matchUpId", "schedule"],
      "additionalProperties": false
    },
    "TournamentSanction": {
      "$comment": "What a governing body DECIDED about a competition \u2014 the instance model from #4710. Three orthogonal axes: decision (did the application succeed), recognition (what the body asserts), classification (what grade is conferred). Before this definition existed the property was declared {\"type\": \"object\"}, so a record carrying decision: 'BANANA' validated.",
      "type": "object",
      "properties": {
        "decision": {
          "$ref": "#/definitions/SanctionDecisionEnum"
        },
        "recognition": {
          "$ref": "#/definitions/RecognitionEnum"
        },
        "classification": {
          "$ref": "#/definitions/TierClassification"
        },
        "authority": {
          "$ref": "#/definitions/SanctioningAuthority"
        },
        "approvalChain": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SanctioningAuthority"
          }
        },
        "decisionRecord": {
          "$ref": "#/definitions/SanctionDecisionRecord"
        },
        "confers": {
          "$ref": "#/definitions/SanctionConferral"
        },
        "ruleset": {
          "$ref": "#/definitions/SanctionRuleset"
        },
        "sanctioningId": {
          "type": "string"
        },
        "identifiers": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SanctionIdentifier"
          }
        },
        "fees": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SanctionFee"
          }
        },
        "submissionWindow": {
          "$ref": "#/definitions/SanctionSubmissionWindow"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "constraints": {
          "$ref": "#/definitions/SanctionConstraints"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        }
      },
      "additionalProperties": false
    },
    "SocialEvent": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "location": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "time": {
          "type": "string"
        }
      },
      "required": ["name"],
      "additionalProperties": false
    },
    "Sponsor": {
      "type": "object",
      "properties": {
        "logoUrl": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "tier": {
          "type": "string"
        },
        "websiteUrl": {
          "type": "string"
        }
      },
      "required": ["name"],
      "additionalProperties": false
    },
    "DocumentLink": {
      "type": "object",
      "properties": {
        "description": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      },
      "required": ["name"],
      "additionalProperties": false
    },
    "RegistrationEntryFee": {
      "type": "object",
      "properties": {
        "amount": {
          "type": "number"
        },
        "currencyCode": {
          "type": "string"
        },
        "unit": {
          "type": "string",
          "enum": ["MINOR", "MAJOR"]
        },
        "eventId": {
          "type": "string"
        },
        "category": {
          "type": "string"
        },
        "eventType": {
          "type": "string",
          "enum": ["SINGLES", "DOUBLES", "TEAM", "HYBRID"]
        },
        "appliesFrom": {
          "type": "string"
        },
        "appliesTo": {
          "type": "string"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        }
      },
      "required": ["amount", "currencyCode", "unit"],
      "additionalProperties": false
    },
    "CurrencyUnitEnum": {
      "type": "string",
      "enum": ["MINOR", "MAJOR"]
    },
    "MonetaryAmount": {
      "$comment": "All three fields are required together: an amount with no stated scale is readable at two scales 100x apart. NOTE this definition is $ref'd where a whole VALUE is a monetary amount (SanctionFee.fee, SanctionFee.maximum). It is deliberately NOT composed into PrizeMoney, PrizeMoneyAward or RegistrationEntryFee via allOf, even though those extend it in TypeScript: `allOf` + `additionalProperties: false` REJECTS the inherited fields, because additionalProperties only sees the properties declared alongside it. Those three inline the triple instead. Verified against ajv before choosing.",
      "type": "object",
      "properties": {
        "amount": {
          "type": "number"
        },
        "currencyCode": {
          "type": "string"
        },
        "unit": {
          "$ref": "#/definitions/CurrencyUnitEnum"
        }
      },
      "required": ["amount", "currencyCode", "unit"],
      "additionalProperties": false
    },
    "PrizeMoney": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "amount": {
          "type": "number"
        },
        "currencyCode": {
          "type": "string"
        },
        "unit": {
          "type": "string",
          "enum": ["MINOR", "MAJOR"]
        }
      },
      "required": ["amount", "currencyCode", "unit"],
      "additionalProperties": false
    },
    "UnifiedTournamentId": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "organisationId": {
          "type": "string"
        },
        "uniqueOrganisationName": {
          "type": "string"
        },
        "tournamentId": {
          "type": "string"
        }
      },
      "required": ["organisationId", "tournamentId"],
      "additionalProperties": false
    },
    "Venue": {
      "type": "object",
      "properties": {
        "disabled": {
          "$ref": "#/definitions/Disabled"
        },
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "addresses": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Address"
          }
        },
        "contacts": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Contact"
          }
        },
        "courts": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Court"
          }
        },
        "venueAbbreviation": {
          "type": "string"
        },
        "onlineResources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/OnlineResource"
          }
        },
        "parentOrganisationId": {
          "type": "string"
        },
        "roles": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "subVenues": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Venue"
          }
        },
        "venueId": {
          "type": "string"
        },
        "venueName": {
          "type": "string"
        },
        "facilityId": {
          "type": "string"
        },
        "venueOtherIds": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/UnifiedVenueId"
          }
        },
        "venueType": {
          "type": "string"
        },
        "defaultStartTime": {
          "type": "string"
        },
        "defaultEndTime": {
          "type": "string"
        },
        "dateAvailability": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Availability"
          }
        }
      },
      "required": ["venueId"],
      "additionalProperties": true,
      "$comment": "OPEN, and this is a KNOWN GAP rather than a decision \u2014 closing it is blocked, not declined. Measured 2026-08-28 against the 16 TODS fixtures: 7 records carry `parentOrganisation`, which `Venue` does not declare. Closing this definition today fails 14 of 16 fixtures. Each undeclared field must first be resolved as either a real CODES concept (declare it in `types/tournamentTypes.ts` AND here) or as legacy data (correct the fixtures), after which this should become `false` to match the other 51."
    },
    "Disabled": {
      "description": "Closed outright (true), or closed on the dates it names ({ dates }): disableCourts writes either on a court, disableVenues writes true on a venue",
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "object",
          "properties": {
            "dates": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "required": ["dates"],
          "additionalProperties": false
        }
      ]
    },
    "Court": {
      "type": "object",
      "properties": {
        "disabled": {
          "$ref": "#/definitions/Disabled"
        },
        "discipline": {
          "$ref": "#/definitions/DisciplineEnum"
        },
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "altitude": {
          "type": "number"
        },
        "courtDimensions": {
          "type": "string"
        },
        "courtId": {
          "type": "string"
        },
        "courtName": {
          "type": "string"
        },
        "dateAvailability": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Availability"
          }
        },
        "latitude": {
          "type": "string"
        },
        "longitude": {
          "type": "string"
        },
        "onlineResources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/OnlineResource"
          }
        },
        "pace": {
          "type": "string"
        },
        "surfaceCategory": {
          "$ref": "#/definitions/SurfaceCategoryEnum"
        },
        "surfaceType": {
          "type": "string"
        },
        "surfacedDate": {
          "type": "string",
          "anyOf": [
            {
              "format": "date-time"
            },
            {
              "format": "date"
            }
          ]
        },
        "indoorOutdoor": {
          "$ref": "#/definitions/IndoorOutdoorEnum"
        },
        "floodlit": {
          "type": "boolean"
        },
        "venueId": {
          "type": "string",
          "description": "The venue this court belongs to. Written by addCourt on every court; declared here so a real record validates."
        }
      },
      "required": ["courtId"],
      "additionalProperties": false
    },
    "Availability": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "bookings": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Booking"
          }
        },
        "date": {
          "type": "string",
          "anyOf": [
            {
              "format": "date-time"
            },
            {
              "format": "date"
            }
          ]
        },
        "startTime": {
          "type": "string"
        },
        "endTime": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "Booking": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "bookingType": {
          "type": "string"
        },
        "startTime": {
          "type": "string"
        },
        "endTime": {
          "type": "string"
        },
        "courtOrder": {
          "type": "number"
        },
        "rowCount": {
          "type": "number"
        },
        "bookingId": {
          "type": "string"
        },
        "capacity": {
          "type": ["number", "null"]
        },
        "registrations": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PracticeRegistration"
          }
        }
      },
      "additionalProperties": false
    },
    "UnifiedVenueId": {
      "type": "object",
      "properties": {
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "isMock": {
          "type": "boolean"
        },
        "organisationId": {
          "type": "string"
        },
        "uniqueOrganisationName": {
          "type": "string"
        },
        "venueId": {
          "type": "string"
        }
      },
      "required": ["organisationId", "venueId"],
      "additionalProperties": false
    },
    "PrizeMoneyAward": {
      "type": "object",
      "properties": {
        "amount": {
          "type": "number"
        },
        "currencyCode": {
          "type": "string"
        },
        "unit": {
          "type": "string",
          "enum": ["MINOR", "MAJOR"]
        },
        "finishingPosition": {
          "type": "number"
        },
        "roundName": {
          "type": "string"
        },
        "roundCode": {
          "type": "string"
        },
        "notes": {
          "type": "string"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        }
      },
      "required": ["amount", "currencyCode", "unit", "finishingPosition"],
      "additionalProperties": false
    },
    "FlightProfile": {
      "$comment": "Stored as event.flightProfile (CODES first-class; the flightProfile extension on older records). A draw's flight is the entry in flights whose drawId matches it; the draw carries only its flightNumber.",
      "type": "object",
      "additionalProperties": false,
      "required": ["flights"],
      "properties": {
        "scaleAttributes": {
          "$ref": "#/definitions/FlightScaleAttributes"
        },
        "splitMethod": {
          "type": "string"
        },
        "flights": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Flight"
          }
        },
        "links": {
          "$comment": "LEGACY: flight-based voluntary consolation (removed 2022-04-13); nothing writes it now.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/FlightLink"
          }
        }
      }
    },
    "Flight": {
      "type": "object",
      "additionalProperties": false,
      "required": ["drawEntries", "flightNumber", "drawId"],
      "properties": {
        "manuallyAdded": {
          "type": "boolean"
        },
        "drawEntries": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Entry"
          }
        },
        "flightNumber": {
          "type": "number"
        },
        "drawOrder": {
          "type": "number"
        },
        "drawName": {
          "type": "string"
        },
        "drawId": {
          "type": "string"
        },
        "stage": {
          "$ref": "#/definitions/StageTypeEnum"
        },
        "qualifyingPositions": {
          "type": "number"
        }
      }
    },
    "FlightLink": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "source": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "drawId": {
              "type": "string"
            }
          }
        },
        "target": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "drawId": {
              "type": "string"
            }
          }
        }
      }
    },
    "FlightScaleAttributes": {
      "type": "object",
      "additionalProperties": false,
      "required": ["scaleType"],
      "properties": {
        "eventType": {
          "$ref": "#/definitions/EventTypeEnum"
        },
        "scaleName": {
          "type": "string"
        },
        "scaleType": {
          "type": "string"
        },
        "accessor": {
          "type": "string"
        },
        "ascending": {
          "type": "boolean"
        }
      }
    },
    "RotatingPartnerStatusTreatment": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "enum": ["UNRESOLVED", "EXCLUDE", "PLAYED_POINTS"]
            }
          },
          "required": ["kind"],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "CREDIT"
            },
            "winningPoints": {
              "type": "integer",
              "maximum": 9007199254740991,
              "minimum": 0
            },
            "losingPoints": {
              "type": "integer",
              "maximum": 9007199254740991,
              "minimum": 0
            }
          },
          "required": ["kind", "winningPoints", "losingPoints"],
          "additionalProperties": false
        }
      ]
    },
    "RotatingPartnerTallyPolicy": {
      "type": "object",
      "properties": {
        "version": {
          "const": 1
        },
        "decidingPoints": {
          "enum": ["INCLUDE", "EXCLUDE"]
        },
        "overtimePoints": {
          "enum": ["INCLUDE", "EXCLUDE"]
        },
        "statusTreatments": {
          "type": "object",
          "properties": {
            "ABANDONED": {
              "$ref": "#/definitions/RotatingPartnerStatusTreatment"
            },
            "CANCELLED": {
              "$ref": "#/definitions/RotatingPartnerStatusTreatment"
            },
            "DEAD_RUBBER": {
              "$ref": "#/definitions/RotatingPartnerStatusTreatment"
            },
            "DEFAULTED": {
              "$ref": "#/definitions/RotatingPartnerStatusTreatment"
            },
            "DOUBLE_DEFAULT": {
              "$ref": "#/definitions/RotatingPartnerStatusTreatment"
            },
            "DOUBLE_WALKOVER": {
              "$ref": "#/definitions/RotatingPartnerStatusTreatment"
            },
            "RETIRED": {
              "$ref": "#/definitions/RotatingPartnerStatusTreatment"
            },
            "WALKOVER": {
              "$ref": "#/definitions/RotatingPartnerStatusTreatment"
            }
          },
          "additionalProperties": false
        }
      },
      "required": ["version", "decidingPoints", "overtimePoints", "statusTreatments"],
      "additionalProperties": false
    },
    "RotatingPartnerSettlement": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "version",
        "requestId",
        "matchUpId",
        "roundNumber",
        "expectedOutcome",
        "treatment",
        "reason",
        "recordedBy",
        "recordedAt"
      ],
      "properties": {
        "version": {
          "const": 1
        },
        "requestId": {
          "type": "string",
          "minLength": 1,
          "pattern": "\\S"
        },
        "matchUpId": {
          "type": "string",
          "minLength": 1,
          "pattern": "\\S"
        },
        "roundNumber": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "expectedOutcome": {
          "type": "object",
          "additionalProperties": false,
          "required": ["matchUpStatus"],
          "properties": {
            "matchUpStatus": {
              "enum": [
                "ABANDONED",
                "CANCELLED",
                "DEAD_RUBBER",
                "DEFAULTED",
                "DOUBLE_DEFAULT",
                "DOUBLE_WALKOVER",
                "RETIRED",
                "WALKOVER"
              ]
            },
            "winningSide": {
              "enum": [1, 2]
            },
            "score": {
              "$ref": "#/definitions/Score"
            }
          }
        },
        "treatment": {
          "$ref": "#/definitions/RotatingPartnerStatusTreatment"
        },
        "reason": {
          "type": "string",
          "pattern": "\\S"
        },
        "recordedBy": {
          "type": "string",
          "pattern": "\\S"
        },
        "recordedAt": {
          "type": "string",
          "pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])T([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d{1,9})?(?:Z|[+-](?:[01]\\d|2[0-3]):[0-5]\\d)$",
          "format": "date-time"
        },
        "supersedesRequestId": {
          "type": "string",
          "pattern": "\\S"
        }
      }
    },
    "RotatingPartnerRoundRecord": {
      "type": "object",
      "properties": {
        "version": {
          "const": 1
        },
        "requestId": {
          "type": "string",
          "minLength": 1
        },
        "roundNumber": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "structureId": {
          "type": "string"
        },
        "format": {
          "enum": ["AMERICANO", "MEXICANO"]
        },
        "algorithmVersion": {
          "const": 1
        },
        "baseSeed": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "seedUsed": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "matchUpIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "pairings": {
          "type": "array",
          "items": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "items": {
              "type": "array",
              "minItems": 2,
              "maxItems": 2,
              "items": {
                "type": "string"
              }
            }
          }
        },
        "tallyContract": {
          "$ref": "#/definitions/RotatingPartnerTallyPolicy"
        },
        "standingsThroughRoundNumber": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "standingsSnapshot": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "participantId": {
                "type": "string"
              },
              "pointsScored": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": ["participantId", "pointsScored"],
            "additionalProperties": false
          }
        },
        "scoringContract": {
          "$ref": "#/definitions/RotatingPartnerScoreContract"
        }
      },
      "required": [
        "version",
        "requestId",
        "roundNumber",
        "structureId",
        "format",
        "algorithmVersion",
        "baseSeed",
        "seedUsed",
        "matchUpIds",
        "pairings",
        "scoringContract",
        "tallyContract"
      ],
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "properties": {
              "format": {
                "const": "MEXICANO"
              }
            }
          },
          "then": {
            "required": ["standingsSnapshot", "standingsThroughRoundNumber"]
          }
        }
      ]
    },
    "CompetitionProfileScoring": {
      "oneOf": [
        {
          "$ref": "#/definitions/CombinedPointRotatingPartnerConfiguration"
        },
        {
          "$ref": "#/definitions/TimedRotatingPartnerConfiguration"
        }
      ]
    },
    "CompetitionProfileStandings": {
      "type": "object",
      "properties": {
        "metric": {
          "const": "SIDE_POINTS"
        },
        "attribution": {
          "const": "EACH_INDIVIDUAL"
        }
      },
      "required": ["metric", "attribution"],
      "additionalProperties": false
    },
    "AmericanoCompetitionProfilePairing": {
      "type": "object",
      "properties": {
        "seed": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "algorithmVersion": {
          "const": 1
        }
      },
      "required": ["seed", "algorithmVersion"],
      "additionalProperties": false
    },
    "MexicanoCompetitionProfilePairing": {
      "type": "object",
      "properties": {
        "seed": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "algorithmVersion": {
          "const": 1
        },
        "groupBy": {
          "const": "ADJACENT_STANDINGS"
        },
        "partners": {
          "const": "FIRST_FOURTH_SECOND_THIRD"
        }
      },
      "required": ["seed", "algorithmVersion", "groupBy", "partners"],
      "additionalProperties": false
    },
    "AmericanoCompetitionProfileCompletion": {
      "type": "object",
      "properties": {
        "kind": {
          "const": "PARTNERSHIP_COVERAGE"
        }
      },
      "required": ["kind"],
      "additionalProperties": false
    },
    "MexicanoCompetitionProfileCompletion": {
      "type": "object",
      "properties": {
        "kind": {
          "const": "ROUND_COUNT"
        },
        "rounds": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        }
      },
      "required": ["kind", "rounds"],
      "additionalProperties": false
    },
    "AmericanoCompetitionProfile": {
      "type": "object",
      "properties": {
        "version": {
          "const": 1
        },
        "entrantScope": {
          "const": "INDIVIDUAL"
        },
        "matchUpType": {
          "const": "DOUBLES"
        },
        "scoring": {
          "$ref": "#/definitions/CompetitionProfileScoring"
        },
        "standings": {
          "$ref": "#/definitions/CompetitionProfileStandings"
        },
        "format": {
          "const": "AMERICANO"
        },
        "pairing": {
          "$ref": "#/definitions/AmericanoCompetitionProfilePairing"
        },
        "completion": {
          "$ref": "#/definitions/AmericanoCompetitionProfileCompletion"
        }
      },
      "required": ["version", "entrantScope", "matchUpType", "scoring", "standings", "format", "pairing", "completion"],
      "additionalProperties": false
    },
    "MexicanoCompetitionProfile": {
      "type": "object",
      "properties": {
        "version": {
          "const": 1
        },
        "entrantScope": {
          "const": "INDIVIDUAL"
        },
        "matchUpType": {
          "const": "DOUBLES"
        },
        "scoring": {
          "$ref": "#/definitions/CompetitionProfileScoring"
        },
        "standings": {
          "$ref": "#/definitions/CompetitionProfileStandings"
        },
        "format": {
          "const": "MEXICANO"
        },
        "pairing": {
          "$ref": "#/definitions/MexicanoCompetitionProfilePairing"
        },
        "completion": {
          "$ref": "#/definitions/MexicanoCompetitionProfileCompletion"
        }
      },
      "required": ["version", "entrantScope", "matchUpType", "scoring", "standings", "format", "pairing", "completion"],
      "additionalProperties": false
    },
    "LadderCompetitionProfile": {
      "type": "object",
      "properties": {
        "version": {
          "const": 1
        },
        "format": {
          "const": "LADDER"
        }
      },
      "required": ["version", "format"],
      "additionalProperties": false
    },
    "CompetitionProfile": {
      "oneOf": [
        {
          "$ref": "#/definitions/AmericanoCompetitionProfile"
        },
        {
          "$ref": "#/definitions/MexicanoCompetitionProfile"
        },
        {
          "$ref": "#/definitions/LadderCompetitionProfile"
        }
      ]
    },
    "RotatingPartnerScoringVariant": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "tieResolution": {
              "enum": ["ALLOW", "DECIDING_POINT"]
            }
          },
          "required": ["tieResolution"]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "tieResolution": {
              "const": "WIN_BY_MARGIN"
            },
            "winningMargin": {
              "type": "integer",
              "minimum": 2,
              "maximum": 9007199254740991
            }
          },
          "required": ["tieResolution", "winningMargin"]
        }
      ]
    },
    "SideExitProvenanceEntry": {
      "type": "object",
      "description": "Why one side of a matchUp holds an exit it did not play: the status it was given, the upstream status that produced it, the matchUp that produced it, and every matchUp whose double exit claims a BYE on that side's drawPosition.",
      "properties": {
        "matchUpStatus": {
          "$ref": "#/definitions/MatchUpStatusEnum"
        },
        "previousMatchUpStatus": {
          "$ref": "#/definitions/MatchUpStatusEnum"
        },
        "sourceMatchUpId": {
          "type": "string"
        },
        "byeClaims": {
          "type": "array",
          "description": "Retired (Mentat P58, 2026-10-22): no longer written or read; accepted so that stored records still validate.",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "SideExitProvenance": {
      "type": "object",
      "description": "Keyed by sideNumber.",
      "propertyNames": {
        "enum": ["1", "2"]
      },
      "additionalProperties": {
        "$ref": "#/definitions/SideExitProvenanceEntry"
      }
    },
    "PresenceAttestation": {
      "type": "object",
      "description": "One recorded presence fact: an individual participant, present or gone, at a time, attested by someone.",
      "properties": {
        "attestationId": {
          "type": "string"
        },
        "participantId": {
          "type": "string"
        },
        "state": {
          "type": "string"
        },
        "occurredAt": {
          "type": "string"
        },
        "recordedAt": {
          "type": "string"
        },
        "attributedTo": {
          "type": "object",
          "properties": {
            "attributionType": {
              "type": "string"
            }
          },
          "required": ["attributionType"]
        },
        "notes": {
          "type": "string"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        }
      },
      "required": ["attestationId", "participantId", "state", "occurredAt"],
      "additionalProperties": false
    },
    "PracticeRegistration": {
      "type": "object",
      "properties": {
        "cancelledAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "createdAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "endTime": {
          "type": "string"
        },
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension"
          }
        },
        "notes": {
          "type": "string"
        },
        "participantId": {
          "type": "string"
        },
        "registeredAt": {
          "type": ["string", "object"],
          "format": "date-time"
        },
        "registrationId": {
          "type": "string"
        },
        "startTime": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": ["CONFIRMED", "CANCELLED"]
        },
        "timeItems": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimeItem"
          }
        },
        "updatedAt": {
          "type": ["string", "object"],
          "format": "date-time"
        }
      },
      "required": ["endTime", "participantId", "registrationId", "startTime"],
      "additionalProperties": false
    },
    "RatingsExpectationRule": {
      "description": "A side's expected result against its opponent: LOGISTIC, 1 / (1 + base^((O - R) / spread)) (base 10, spread 400 in most published methods; FIFA's men's ranking 600); LINEAR, 0.5 + the gap \u00d7 slope with the gap clamped to \u00b1cap (World Rugby: 0.05, 10); ORDERED_PROBIT, the expected value of the set result, \u03a3 P(i) \u00d7 resultValues(i), P from the standard normal at the cut-points shifted by scale \u00d7 the gap (FIVB: 0.008).",
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "rule": {
              "const": "LOGISTIC"
            },
            "base": {
              "type": "number",
              "exclusiveMinimum": 1
            },
            "spread": {
              "type": "number",
              "exclusiveMinimum": 0
            }
          },
          "required": ["rule", "base", "spread"],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "rule": {
              "const": "LINEAR"
            },
            "slope": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "cap": {
              "type": "number",
              "exclusiveMinimum": 0
            }
          },
          "required": ["rule", "slope", "cap"],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "rule": {
              "const": "ORDERED_PROBIT"
            },
            "scale": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "cutPoints": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 1
            },
            "resultValues": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 2
            }
          },
          "required": ["rule", "scale", "cutPoints", "resultValues"],
          "additionalProperties": false
        }
      ]
    },
    "RatingsKRule": {
      "description": "K: one value for both sides (zero-sum), or FiveThirtyEight's numerator / (m + offset)^shape by the player's career matches m, which the caller passes as matchesPlayed.",
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "rule": {
              "const": "CONSTANT"
            },
            "value": {
              "type": "number",
              "exclusiveMinimum": 0
            }
          },
          "required": ["rule", "value"],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "rule": {
              "const": "MATCHES_PLAYED"
            },
            "numerator": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "offset": {
              "type": "number",
              "minimum": 0
            },
            "shape": {
              "type": "number",
              "exclusiveMinimum": 0
            }
          },
          "required": ["rule", "numerator", "offset", "shape"],
          "additionalProperties": false
        }
      ]
    },
    "RatingsActualRule": {
      "description": "A side's actual result: WIN_LOSS (1 / 0.5 / 0), SETS_PLAYED_SHARE (Huang 2014: best of 3 1 or 2/3, best of 5 1, 0.8 or 0.6) or SCORE_SHARE (the share of the points, else games, else sets won).",
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "rule": {
              "const": "WIN_LOSS"
            }
          },
          "required": ["rule"],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "rule": {
              "const": "SETS_PLAYED_SHARE"
            }
          },
          "required": ["rule"],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "rule": {
              "const": "SCORE_SHARE"
            }
          },
          "required": ["rule"],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "rule": {
              "const": "SET_SCORE_VALUE"
            },
            "values": {
              "type": "object",
              "propertyNames": {
                "pattern": "^[0-9]+-[0-9]+$"
              },
              "additionalProperties": {
                "type": "number"
              }
            }
          },
          "required": ["rule", "values"],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "rule": {
              "const": "GOAL_TABLE"
            },
            "table": {
              "type": "array",
              "minItems": 1,
              "items": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                }
              }
            }
          },
          "required": ["rule", "table"],
          "additionalProperties": false
        }
      ]
    },
    "RatingsMarginRule": {
      "description": "A K multiplier by the margin of victory: World Football Elo's goal-difference steps, FiveThirtyEight's autocorrelation-corrected log margin (NHL, NFL) or power margin (NBA), Weighted Elo's winner game share, or World Rugby's threshold (\u00d7 1.5 above 15 points).",
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "rule": {
              "const": "GOAL_DIFFERENCE_STEPS"
            }
          },
          "required": ["rule"],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "rule": {
              "const": "LOG_MOV_AUTOCORRECTED"
            },
            "scale": {
              "type": "number"
            },
            "offset": {
              "type": "number",
              "minimum": 0
            },
            "intercept": {
              "type": "number"
            },
            "autocorrelation": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "drawMultiplier": {
              "type": "number",
              "exclusiveMinimum": 0
            }
          },
          "required": ["rule", "scale", "offset", "intercept", "autocorrelation"],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "rule": {
              "const": "POWER_MOV_AUTOCORRECTED"
            },
            "offset": {
              "type": "number",
              "minimum": 0
            },
            "power": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "intercept": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "slope": {
              "type": "number"
            }
          },
          "required": ["rule", "offset", "power", "intercept", "slope"],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "rule": {
              "const": "WINNER_GAME_SHARE"
            }
          },
          "required": ["rule"],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "rule": {
              "const": "THRESHOLD"
            },
            "above": {
              "type": "number",
              "minimum": 0
            },
            "multiplier": {
              "type": "number",
              "exclusiveMinimum": 0
            }
          },
          "required": ["rule", "above", "multiplier"],
          "additionalProperties": false
        }
      ]
    },
    "RatingsFullResultRule": {
      "type": "object",
      "properties": {
        "rule": {
          "const": "FULL_RESULT"
        },
        "margin": {
          "type": "number",
          "minimum": 0
        }
      },
      "required": ["rule"],
      "additionalProperties": false
    },
    "RatingsShootoutRule": {
      "description": "A win in a shootout: a full win (FiveThirtyEight NHL, by one goal), or partial actual results (FIFA's men's ranking: 0.75 and 0.5).",
      "oneOf": [
        {
          "$ref": "#/definitions/RatingsFullResultRule"
        },
        {
          "type": "object",
          "properties": {
            "rule": {
              "const": "PARTIAL"
            },
            "winner": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            "loser": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            }
          },
          "required": ["rule", "winner", "loser"],
          "additionalProperties": false
        }
      ]
    },
    "RatingsPolicy": {
      "description": "A ratings policy (POLICY_TYPE_RATINGS): how a dynamic rating moves on a result. Each rule encodes a published rating method, which source names.",
      "type": "object",
      "properties": {
        "policyName": {
          "type": "string",
          "minLength": 1
        },
        "source": {
          "type": "string",
          "minLength": 1,
          "description": "The published method the policy encodes."
        },
        "expectation": {
          "$ref": "#/definitions/RatingsExpectationRule"
        },
        "k": {
          "$ref": "#/definitions/RatingsKRule"
        },
        "actual": {
          "$ref": "#/definitions/RatingsActualRule"
        },
        "walkovers": {
          "enum": ["RATE_AS_WIN", "EXCLUDE"]
        },
        "draws": {
          "enum": ["RATE_AS_HALF", "EXCLUDE"]
        },
        "kByTier": {
          "type": "object",
          "description": "K by the event's tier, then the tournament's, keyed system:value.",
          "propertyNames": {
            "pattern": "^[^:]+:.+$"
          },
          "additionalProperties": {
            "type": "number",
            "exclusiveMinimum": 0
          }
        },
        "margin": {
          "$ref": "#/definitions/RatingsMarginRule"
        },
        "overtimeResult": {
          "$ref": "#/definitions/RatingsFullResultRule"
        },
        "shootoutResult": {
          "$ref": "#/definitions/RatingsShootoutRule"
        },
        "protections": {
          "type": "array",
          "items": {
            "enum": ["KNOCKOUT_LOSS_PROTECTION"]
          },
          "uniqueItems": true
        },
        "winnerMinimumGain": {
          "type": "number",
          "exclusiveMinimum": 0,
          "description": "FIVB: a winner who would lose points gains this instead, and the loser loses it (0.01)."
        }
      },
      "required": ["policyName", "source", "expectation", "k", "actual"],
      "additionalProperties": false
    },
    "PolicyDefinitions": {
      "$comment": "Policies keyed by policy type, the shape of the appliedPolicies extension value on a Tournament, Event, DrawDefinition or Structure (resolved tournament, then event, then draw, then structure; a later level replaces a policy type whole). Its keys are the policy types the factory defines (policyConstants). A policy type described only as an object is not yet modelled here; the modelled ones are closed. Not yet referenced by any record definition: policies are stored in the extension, whose value is unconstrained. See Mentat/planning/CODES_POLICY_DEFINITIONS.md for the path to a first-class attribute.",
      "type": "object",
      "properties": {
        "audit": {
          "type": "object"
        },
        "avoidance": {
          "$ref": "#/definitions/AvoidancePolicy"
        },
        "competition": {
          "$ref": "#/definitions/CompetitionPolicy"
        },
        "competitiveBands": {
          "type": "object"
        },
        "display": {
          "type": "object"
        },
        "draws": {
          "type": "object"
        },
        "feedIn": {
          "type": "object"
        },
        "ladder": {
          "type": "object"
        },
        "matchUpActions": {
          "$ref": "#/definitions/MatchUpActionsPolicy"
        },
        "officiatingConflict": {
          "type": "object"
        },
        "participant": {
          "type": "object"
        },
        "positionActions": {
          "type": "object"
        },
        "print": {
          "type": "object"
        },
        "progression": {
          "type": "object"
        },
        "rankingPoints": {
          "type": "object",
          "$comment": "Described by rankingPolicy.schema.json, a separate schema document; not repeated here."
        },
        "ratings": {
          "$ref": "#/definitions/RatingsPolicy"
        },
        "rotatingPartnerTally": {
          "$ref": "#/definitions/RotatingPartnerTallyPolicy"
        },
        "roundNaming": {
          "$ref": "#/definitions/RoundNamingPolicy"
        },
        "roundRobinTally": {
          "$ref": "#/definitions/RoundRobinTallyPolicy"
        },
        "sanctioning": {
          "type": "object"
        },
        "scheduling": {
          "$ref": "#/definitions/SchedulingPolicy"
        },
        "scoring": {
          "type": "object"
        },
        "seeding": {
          "$ref": "#/definitions/SeedingPolicy"
        },
        "voluntaryConsolation": {
          "type": "object"
        }
      },
      "additionalProperties": false
    },
    "SchedulingPolicy": {
      "description": "A scheduling policy: matchUp timing, recovery, daily limits and the default scheduling period.",
      "type": "object",
      "properties": {
        "policyName": {
          "type": "string"
        },
        "allowModificationWhenMatchUpsScheduled": {
          "type": "object",
          "properties": {
            "courts": {
              "type": "boolean"
            },
            "venues": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        },
        "defaultTimes": {
          "$ref": "#/definitions/SchedulingDefaultTimes"
        },
        "defaultPeriodLength": {
          "type": "number",
          "exclusiveMinimum": 0,
          "description": "Minutes per scheduling period (Garman's L) for a run that does not state one. A run's own periodLength wins, then a profile round's own periodLength, then this."
        },
        "defaultDailyLimits": {
          "$ref": "#/definitions/SchedulingDailyLimits"
        },
        "matchUpAverageTimes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SchedulingFormatAverageTimes"
          }
        },
        "matchUpRecoveryTimes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SchedulingFormatRecoveryTimes"
          }
        },
        "matchUpDailyLimits": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SchedulingParticipantDailyLimits"
          }
        }
      },
      "additionalProperties": false
    },
    "SchedulingMinutes": {
      "description": "Minutes by matchUp type: the matchUp's own type, else TEAM for a line of a TEAM event, else default. SINGLES_DOUBLES and DOUBLES_SINGLES are recovery minutes when the next matchUp changes type.",
      "type": "object",
      "properties": {
        "default": {
          "type": "number",
          "minimum": 0
        },
        "SINGLES": {
          "type": "number",
          "minimum": 0
        },
        "DOUBLES": {
          "type": "number",
          "minimum": 0
        },
        "TEAM": {
          "type": "number",
          "minimum": 0
        },
        "SINGLES_DOUBLES": {
          "type": "number",
          "minimum": 0
        },
        "DOUBLES_SINGLES": {
          "type": "number",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "SchedulingCategoryTimes": {
      "type": "object",
      "properties": {
        "categoryNames": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "categoryTypes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "minutes": {
          "$ref": "#/definitions/SchedulingMinutes"
        }
      },
      "required": ["minutes"],
      "additionalProperties": false
    },
    "SchedulingRecoveryBand": {
      "description": "A recovery band keyed on measured played minutes; the band without upTo is the catch-all.",
      "type": "object",
      "properties": {
        "upTo": {
          "type": "number",
          "minimum": 0
        },
        "minutes": {
          "type": "number",
          "minimum": 0
        }
      },
      "required": ["minutes"],
      "additionalProperties": false
    },
    "SchedulingRecoveryTimes": {
      "type": "object",
      "properties": {
        "categoryNames": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "categoryTypes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "minutes": {
          "$ref": "#/definitions/SchedulingMinutes"
        },
        "byPlayedMinutes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SchedulingRecoveryBand"
          }
        }
      },
      "required": ["minutes"],
      "additionalProperties": false
    },
    "SchedulingDefaultTimes": {
      "type": "object",
      "properties": {
        "averageTimes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SchedulingCategoryTimes"
          }
        },
        "recoveryTimes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SchedulingRecoveryTimes"
          }
        },
        "overnightTimes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SchedulingCategoryTimes"
          }
        },
        "transitMinutes": {
          "type": "number",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "SchedulingFormatAverageTimes": {
      "type": "object",
      "properties": {
        "matchUpFormatCodes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "averageTimes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SchedulingCategoryTimes"
          }
        }
      },
      "required": ["matchUpFormatCodes", "averageTimes"],
      "additionalProperties": false
    },
    "SchedulingFormatRecoveryTimes": {
      "type": "object",
      "properties": {
        "matchUpFormatCodes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "recoveryTimes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SchedulingRecoveryTimes"
          }
        }
      },
      "required": ["matchUpFormatCodes", "recoveryTimes"],
      "additionalProperties": false
    },
    "SchedulingDailyLimits": {
      "type": "object",
      "properties": {
        "SINGLES": {
          "type": "number",
          "minimum": 0
        },
        "DOUBLES": {
          "type": "number",
          "minimum": 0
        },
        "TEAM": {
          "type": "number",
          "minimum": 0
        },
        "total": {
          "type": "number",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "SchedulingParticipantDailyLimits": {
      "type": "object",
      "properties": {
        "participantId": {
          "type": "string"
        },
        "SINGLES": {
          "type": "number",
          "minimum": 0
        },
        "DOUBLES": {
          "type": "number",
          "minimum": 0
        },
        "TEAM": {
          "type": "number",
          "minimum": 0
        },
        "total": {
          "type": "number",
          "minimum": 0
        }
      },
      "required": ["participantId"],
      "additionalProperties": false
    },
    "SeedingPolicy": {
      "description": "A seeding policy: seeds count by draw size, seed positioning and additional seeds.",
      "type": "object",
      "properties": {
        "policyName": {
          "type": "string"
        },
        "seedsCountThresholds": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SeedsCountThreshold"
          }
        },
        "validSeedPositions": {
          "type": "object",
          "properties": {
            "ignore": {
              "type": "boolean"
            },
            "strict": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        },
        "seedingProfile": {
          "description": "The object form, or the legacy bare positioning string the readers still honour.",
          "anyOf": [
            {
              "$ref": "#/definitions/PolicySeedingProfile"
            },
            {
              "$ref": "#/definitions/SeedingProfileEnum"
            }
          ]
        },
        "additionalSeeds": {
          "$ref": "#/definitions/AdditionalSeedsAllowance"
        },
        "containerByesIgnoreSeeding": {
          "type": "boolean"
        },
        "duplicateSeedNumbers": {
          "type": "boolean"
        },
        "drawSizeProgression": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "SeedsCountThreshold": {
      "type": "object",
      "properties": {
        "minimumParticipantCount": {
          "type": "number"
        },
        "seedsCount": {
          "type": "number"
        },
        "drawSize": {
          "type": "number"
        }
      },
      "required": ["minimumParticipantCount", "seedsCount", "drawSize"],
      "additionalProperties": false
    },
    "SeedingProfile": {
      "type": "object",
      "properties": {
        "groupSeedingThreshold": {
          "type": "number"
        },
        "positioning": {
          "$ref": "#/definitions/SeedingProfileEnum"
        },
        "nonRandom": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "PolicySeedingProfile": {
      "type": "object",
      "properties": {
        "groupSeedingThreshold": {
          "type": "number"
        },
        "positioning": {
          "$ref": "#/definitions/SeedingProfileEnum"
        },
        "nonRandom": {
          "type": "boolean"
        },
        "drawTypes": {
          "type": "object",
          "description": "Per-drawType overrides, keyed by drawType; consulted before the outer profile.",
          "additionalProperties": {
            "anyOf": [
              {
                "$ref": "#/definitions/SeedingProfile"
              },
              {
                "$ref": "#/definitions/SeedingProfileEnum"
              }
            ]
          }
        }
      },
      "additionalProperties": false
    },
    "AdditionalSeedsAllowance": {
      "type": "object",
      "properties": {
        "maxCount": {
          "type": "number",
          "minimum": 0
        },
        "bases": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": ["ORGANISER_DISCRETION", "PROTECTED_RANKING", "RANKING", "RATING"]
          }
        }
      },
      "required": ["maxCount"],
      "additionalProperties": false
    },
    "CompetitionPolicy": {
      "description": "A competition policy: rating, pairing and victory rules for a dynamically paired competition.",
      "type": "object",
      "properties": {
        "policyName": {
          "type": "string"
        },
        "ratingPolicy": {
          "type": "object",
          "properties": {
            "baselineRating": {
              "type": "object",
              "properties": {
                "source": {
                  "enum": ["SCALE", "SEEDING", "MANUAL"]
                },
                "scaleName": {
                  "type": "string"
                },
                "frozenDuringEvent": {
                  "const": true
                }
              },
              "required": ["source", "frozenDuringEvent"],
              "additionalProperties": false
            },
            "dynamicFormRating": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "initializeFrom": {
                  "const": "BASELINE"
                },
                "kFactor": {
                  "type": "number"
                },
                "logisticScale": {
                  "type": "number"
                },
                "ratingsPolicy": {
                  "description": "A ratings preset by name, or a ratings policy inline with a CONSTANT K: the form rating's expectation, K and actual result. Without one, kFactor and logisticScale, else POLICY_RATINGS_COMPETITION_FORM's 24 and 400.",
                  "oneOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "$ref": "#/definitions/RatingsPolicy"
                    }
                  ]
                }
              },
              "required": ["enabled", "initializeFrom"],
              "additionalProperties": false
            },
            "pressureRating": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "expectationSource": {
                  "const": "BASELINE_ONLY"
                },
                "actualOutputMethod": {
                  "enum": ["POINT_SHARE", "WEIGHTED"]
                },
                "weights": {
                  "type": "object",
                  "properties": {
                    "pointShare": {
                      "type": "number"
                    },
                    "pointDifferential": {
                      "type": "number"
                    },
                    "contextFactor": {
                      "type": "number"
                    }
                  },
                  "required": ["pointShare"],
                  "additionalProperties": false
                }
              },
              "required": ["enabled", "expectationSource", "actualOutputMethod"],
              "additionalProperties": false
            },
            "ratingAggregation": {
              "enum": ["AVERAGE", "MIN", "MAX", "SUM"]
            }
          },
          "required": ["baselineRating", "dynamicFormRating"],
          "additionalProperties": false
        },
        "pairingPolicy": {
          "type": "object",
          "properties": {
            "method": {
              "enum": ["DRAW_MATIC", "SWISS", "LEVEL_BASED"]
            },
            "ratingSource": {
              "enum": ["DYNAMIC_FORM", "BASELINE"]
            },
            "laneSize": {
              "type": "number"
            },
            "avoidRepeatOpponents": {
              "type": "boolean"
            },
            "sameTeamValue": {
              "type": "number"
            }
          },
          "required": ["method", "ratingSource", "avoidRepeatOpponents"],
          "additionalProperties": false
        },
        "victoryPolicy": {
          "type": "object",
          "properties": {
            "primaryRanking": {
              "enum": ["PRESSURE_RATING", "DYNAMIC_FORM_RATING", "WINS", "POINTS"]
            },
            "tiebreakOrder": {
              "type": "array",
              "items": {
                "enum": [
                  "HEAD_TO_HEAD",
                  "HEAD_TO_HEAD_PRESSURE",
                  "POINT_DIFFERENTIAL",
                  "STRENGTH_OF_OPPOSITION",
                  "DYNAMIC_FORM_RATING",
                  "PRESSURE_RATING",
                  "BUCHHOLZ",
                  "SONNEBORN_BERGER"
                ]
              }
            }
          },
          "required": ["primaryRanking"],
          "additionalProperties": false
        },
        "processingGranularity": {
          "enum": ["PER_MATCHUP", "PER_ROUND"]
        }
      },
      "required": ["ratingPolicy", "pairingPolicy", "victoryPolicy", "processingGranularity"],
      "additionalProperties": false
    },
    "RoundNamingPolicy": {
      "description": "A round naming policy: how rounds are named and abbreviated.",
      "type": "object",
      "properties": {
        "policyName": {
          "type": "string"
        },
        "namingConventions": {
          "type": "object",
          "properties": {
            "round": {
              "type": "string"
            },
            "pre": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "roundNamingMap": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Round name by the number of matchUps in the round (1: Final)."
        },
        "abbreviatedRoundNamingMap": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Abbreviated round name by the number of matchUps in the round."
        },
        "qualifyingFinishMap": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "A qualifying structure's final round names, by the number of matchUps."
        },
        "affixes": {
          "type": "object",
          "properties": {
            "roundNumber": {
              "type": "string"
            },
            "preFeedRound": {
              "type": "string"
            },
            "preQualifying": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "stageConstants": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Prefix for each stage (MAIN, QUALIFYING, CONSOLATION, PLAY_OFF)."
        }
      },
      "additionalProperties": false
    },
    "ActionsStructurePolicy": {
      "description": "The structures an actions policy entry matches (an empty or absent list matches all) and the actions it allows.",
      "type": "object",
      "properties": {
        "stages": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "stageSequences": {
          "type": "array",
          "items": {
            "type": "number"
          }
        },
        "structureTypes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "feedProfiles": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "enabledActions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "disabledActions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "MatchUpActionsPolicy": {
      "description": "A matchUp actions policy: which actions are offered, and participant and substitution rules.",
      "type": "object",
      "properties": {
        "policyName": {
          "type": "string"
        },
        "enabledStructures": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ActionsStructurePolicy"
          }
        },
        "participants": {
          "type": "object",
          "properties": {
            "enforceCategory": {
              "type": "boolean"
            },
            "enforceGender": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        },
        "processCodes": {
          "type": "object",
          "properties": {
            "substitution": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "additionalProperties": false
        },
        "substituteAfterCompleted": {
          "type": "boolean"
        },
        "substituteWithoutScore": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "AvoidancePolicyAttribute": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "An accessor path into the participant, e.g. person.nationalityCode."
        },
        "directive": {
          "type": "string",
          "description": "An id collection to separate on (pairParticipants, teamParticipants, ...)."
        },
        "significantCharacters": {
          "type": "number"
        },
        "includeIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "groupings": {
          "type": "object",
          "additionalProperties": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "additionalProperties": false
    },
    "AvoidancePolicy": {
      "description": "An avoidance policy: which participant attributes are separated in positioning, and by how much.",
      "type": "object",
      "properties": {
        "policyName": {
          "type": "string"
        },
        "policyAttributes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AvoidancePolicyAttribute"
          }
        },
        "roundsToSeparate": {
          "type": "number"
        },
        "targetDivisions": {
          "type": "number"
        },
        "candidatesCount": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "RoundRobinTallyPolicy": {
      "$comment": "OPEN, and this is a decision: the TypeScript RoundRobinTallyPolicy is deliberately extensible ([key: string]: unknown), and the tally readers take more members than the stored policies show. The members listed are those the readers take; closing it would reject a policy the engine accepts.",
      "description": "A round robin tally (standings) policy. validateTallyPolicy checks its values where it is saved.",
      "type": "object",
      "properties": {
        "policyName": {
          "type": "string"
        },
        "groupOrderKey": {
          "type": "string"
        },
        "tallyDirectives": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "attribute": {
                "type": "string"
              },
              "idsFilter": {
                "type": "boolean"
              },
              "reversed": {
                "type": "boolean"
              },
              "groupTotals": {
                "type": "boolean"
              },
              "maxParticipants": {
                "type": "number"
              }
            },
            "required": ["attribute"]
          }
        },
        "headToHead": {
          "type": "object"
        },
        "GEMscore": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "excludeMatchUpStatuses": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "disqualifyDefaults": {
          "type": "boolean"
        },
        "disqualifyWalkovers": {
          "type": "boolean"
        },
        "gamesCreditForDefaults": {
          "type": "boolean"
        },
        "gamesCreditForRetirements": {
          "type": "boolean"
        },
        "gamesCreditForTiebreakSets": {
          "type": "boolean"
        },
        "gamesCreditForWalkovers": {
          "type": "boolean"
        },
        "setsCreditForDefaults": {
          "type": "boolean"
        },
        "setsCreditForRetirements": {
          "type": "boolean"
        },
        "setsCreditForWalkovers": {
          "type": "boolean"
        },
        "groupTotalGamesPlayed": {
          "type": "boolean"
        },
        "groupTotalSetsPlayed": {
          "type": "boolean"
        },
        "drawCredit": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "outcomePoints": {
          "type": "object",
          "properties": {
            "win": {
              "type": "number"
            },
            "draw": {
              "type": "number"
            },
            "loss": {
              "type": "number"
            }
          },
          "required": ["win", "draw", "loss"],
          "additionalProperties": false
        },
        "precision": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0
            },
            {
              "const": "EXACT"
            }
          ]
        },
        "resultPoints": {
          "type": "object"
        },
        "onSplit": {},
        "terminal": {},
        "crossGroup": {},
        "denominator": {}
      },
      "additionalProperties": true
    },
    "TimedRotatingPartnerVariant": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "tieResolution": {
          "enum": ["ALLOW", "DECIDING_POINT"]
        }
      },
      "required": ["tieResolution"]
    },
    "CombinedPointRotatingPartnerConfiguration": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": {
          "const": "COMBINED_POINTS"
        },
        "combinedPointTotal": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "selectedVariant": {
          "$ref": "#/definitions/RotatingPartnerScoringVariant"
        }
      },
      "required": ["combinedPointTotal"]
    },
    "TimedRotatingPartnerConfiguration": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": {
          "const": "TIMED"
        },
        "minutes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "selectedVariant": {
          "$ref": "#/definitions/TimedRotatingPartnerVariant"
        }
      },
      "required": ["kind", "minutes"]
    },
    "CombinedPointRotatingPartnerScoreContract": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "kind": {
              "const": "COMBINED_POINTS"
            },
            "combinedPointTotal": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "tieResolution": {
              "enum": ["ALLOW", "DECIDING_POINT"]
            }
          },
          "required": ["combinedPointTotal", "tieResolution"]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "kind": {
              "const": "COMBINED_POINTS"
            },
            "combinedPointTotal": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "tieResolution": {
              "const": "WIN_BY_MARGIN"
            },
            "winningMargin": {
              "type": "integer",
              "minimum": 2,
              "maximum": 9007199254740991
            }
          },
          "required": ["combinedPointTotal", "tieResolution", "winningMargin"]
        }
      ]
    },
    "TimedRotatingPartnerScoreContract": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": {
          "const": "TIMED"
        },
        "minutes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "tieResolution": {
          "enum": ["ALLOW", "DECIDING_POINT"]
        }
      },
      "required": ["kind", "minutes", "tieResolution"]
    },
    "RotatingPartnerScoreContract": {
      "oneOf": [
        {
          "$ref": "#/definitions/CombinedPointRotatingPartnerScoreContract"
        },
        {
          "$ref": "#/definitions/TimedRotatingPartnerScoreContract"
        }
      ]
    },
    "TimedRotatingPartnerPolicy": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "defaultVariant": {
          "$ref": "#/definitions/TimedRotatingPartnerVariant"
        },
        "permittedVariants": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TimedRotatingPartnerVariant"
          },
          "minItems": 1,
          "uniqueItems": true
        },
        "permittedMinutes": {
          "type": "array",
          "items": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "minItems": 1,
          "uniqueItems": true
        }
      },
      "required": ["defaultVariant", "permittedVariants"]
    },
    "RotatingPartnerScoringPolicy": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "defaultVariant": {
          "$ref": "#/definitions/RotatingPartnerScoringVariant"
        },
        "permittedVariants": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/RotatingPartnerScoringVariant"
          },
          "minItems": 1,
          "uniqueItems": true
        },
        "permittedPointTotals": {
          "type": "array",
          "items": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "minItems": 1,
          "uniqueItems": true
        },
        "timed": {
          "$ref": "#/definitions/TimedRotatingPartnerPolicy"
        }
      },
      "required": ["defaultVariant", "permittedVariants"]
    }
  },
  "$comment": "CONVENTION: every object definition states `additionalProperties` EXPLICITLY, and the default is `false`. Every definition but the open ones listed in that test is closed. A closed definition is what makes a CODES field added to the TypeScript types but never mirrored here a LOUD failure rather than a silent one \u2014 the drift fixed in #4718 went unnoticed for exactly this reason on the open definitions. The open definitions each carry a `$comment` saying why. `codesSchemaConvention.test.ts` enforces both halves: no definition may omit the keyword, and the open set may not grow without updating that test."
}
