# com.professorbutts.sports.play

> Record key is '<game rkey>-<source play id>', e.g. 'nfl-401772936-401772936101', so a game's plays sit together in key order. Created once per source play and updated only to correct it or set status. A play the source drops keeps its record with a status, so posts that link to it keep resolving.

- Kind: record
- Record key: any
- Authority: sports.professorbutts.com
- Lexicon: 1
- Published by [professorbutts.com](https://lexicon.garden/identity/did:plc:x6njyeyi47bqs2kueuv3mrg5), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:x6njyeyi47bqs2kueuv3mrg5/com.professorbutts.sports.play)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:x6njyeyi47bqs2kueuv3mrg5/com.professorbutts.sports.play/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:x6njyeyi47bqs2kueuv3mrg5/com.professorbutts.sports.play/analytics)

## Record (`com.professorbutts.sports.play`)

Type: record · key any

### Properties

- `abbreviation` (string): Scoring side's abbreviation, e.g. 'CIN'.
  - Constraints: maxLength: 8
- `awayScore` (integer): Away score after the play.
  - Constraints: minimum: 0
- `clock` (string): Game clock or match minute as shown, e.g. '4:12' or "67'".
  - Constraints: maxLength: 16
- `createdAt` (string · datetime, required)
- `externalIds` (array): The play's ID at the source, e.g. {scheme: 'espn', value: '401772936101'}.
  - Constraints: maxLength: 4
  - `items` (ref)
    - Reference: `com.professorbutts.sports.defs#externalId`
- `game` (string · at-uri, required): The com.professorbutts.sports.game record.
- `homeScore` (integer): Home score after the play.
  - Constraints: minimum: 0
- `kind` (string, required): What happened. Only scoring plays ('score') for now.
  - Constraints: maxLength: 32, knownValues: score
- `occurredAt` (string · datetime): Wall-clock time of the play, when the source gives it.
- `participants` (array): Players credited, scorer first.
  - Constraints: maxLength: 6
  - `items` (ref)
    - Reference: `#participant`
- `period` (ref): Period of the play, as on the game record, e.g. {number: 5, label: 'OT'}, {number: 7, label: 'Top 7th'}.
  - Reference: `com.professorbutts.sports.defs#period`
- `points` (integer): Points this play added, including a kick or conversion the source reports with it (7 for a touchdown plus kick).
  - Constraints: minimum: 0
- `replacedBy` (string · at-uri): The play record that replaces this one, when the source re-entered the play under a new ID.
- `scoreType` (string): Kind of score, e.g. 'touchdown', 'goal', 'home-run'. 'penalty-goal' covers soccer penalties and rugby penalty kicks.
  - Constraints: maxLength: 64, knownValues: touchdown | field-goal | safety | extra-point | two-point | defensive-two-point | goal | own-goal | penalty-goal | try | penalty-try | conversion | drop-goal | run | home-run
- `scoringSide` (string): Which side the points count for. Set it even when there's no team record.
  - Constraints: maxLength: 8, knownValues: home | away
- `sequence` (integer): Sort order among this game's plays. Gaps are fine; not renumbered when a play is removed.
  - Constraints: minimum: 0
- `source` (string): Where the data came from, e.g. 'espn'.
  - Constraints: maxLength: 64
- `status` (string): Leave out for a play that stands. 'overturned': reversed by the officials. 'removed': the source dropped or replaced it for another or unknown reason (see replacedBy). Readers treat any value, including ones they don't know, as a play that doesn't count.
  - Constraints: maxLength: 32, knownValues: overturned | removed
- `team` (string · at-uri): com.professorbutts.sports.team record of the side the points count for (for an own goal, the team that benefits).
- `text` (string): The play as the source describes it.
  - Constraints: maxLength: 3000, maxGraphemes: 300
- `updatedAt` (string · datetime)

## #participant (`com.professorbutts.sports.play#participant`)

Type: object

### Properties

- `name` (string, required)
  - Constraints: maxLength: 128
- `personRef` (string · at-uri): com.professorbutts.sports.person record.
- `role` (string)
  - Constraints: maxLength: 32, knownValues: scorer | assist | passer | kicker

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Record key is '<game rkey>-<source play id>', e.g. 'nfl-401772936-401772936101', so a game's plays sit together in key order. Created once per source play and updated only to correct it or set status. A play the source drops keeps its record with a status, so posts that link to it keep resolving.",
      "key": "any",
      "record": {
        "properties": {
          "abbreviation": {
            "description": "Scoring side's abbreviation, e.g. 'CIN'.",
            "maxLength": 8,
            "type": "string"
          },
          "awayScore": {
            "description": "Away score after the play.",
            "minimum": 0,
            "type": "integer"
          },
          "clock": {
            "description": "Game clock or match minute as shown, e.g. '4:12' or \"67'\".",
            "maxLength": 16,
            "type": "string"
          },
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "externalIds": {
            "description": "The play's ID at the source, e.g. {scheme: 'espn', value: '401772936101'}.",
            "items": {
              "ref": "com.professorbutts.sports.defs#externalId",
              "type": "ref"
            },
            "maxLength": 4,
            "type": "array"
          },
          "game": {
            "description": "The com.professorbutts.sports.game record.",
            "format": "at-uri",
            "type": "string"
          },
          "homeScore": {
            "description": "Home score after the play.",
            "minimum": 0,
            "type": "integer"
          },
          "kind": {
            "description": "What happened. Only scoring plays ('score') for now.",
            "knownValues": [
              "score"
            ],
            "maxLength": 32,
            "type": "string"
          },
          "occurredAt": {
            "description": "Wall-clock time of the play, when the source gives it.",
            "format": "datetime",
            "type": "string"
          },
          "participants": {
            "description": "Players credited, scorer first.",
            "items": {
              "ref": "#participant",
              "type": "ref"
            },
            "maxLength": 6,
            "type": "array"
          },
          "period": {
            "description": "Period of the play, as on the game record, e.g. {number: 5, label: 'OT'}, {number: 7, label: 'Top 7th'}.",
            "ref": "com.professorbutts.sports.defs#period",
            "type": "ref"
          },
          "points": {
            "description": "Points this play added, including a kick or conversion the source reports with it (7 for a touchdown plus kick).",
            "minimum": 0,
            "type": "integer"
          },
          "replacedBy": {
            "description": "The play record that replaces this one, when the source re-entered the play under a new ID.",
            "format": "at-uri",
            "type": "string"
          },
          "scoreType": {
            "description": "Kind of score, e.g. 'touchdown', 'goal', 'home-run'. 'penalty-goal' covers soccer penalties and rugby penalty kicks.",
            "knownValues": [
              "touchdown",
              "field-goal",
              "safety",
              "extra-point",
              "two-point",
              "defensive-two-point",
              "goal",
              "own-goal",
              "penalty-goal",
              "try",
              "penalty-try",
              "conversion",
              "drop-goal",
              "run",
              "home-run"
            ],
            "maxLength": 64,
            "type": "string"
          },
          "scoringSide": {
            "description": "Which side the points count for. Set it even when there's no team record.",
            "knownValues": [
              "home",
              "away"
            ],
            "maxLength": 8,
            "type": "string"
          },
          "sequence": {
            "description": "Sort order among this game's plays. Gaps are fine; not renumbered when a play is removed.",
            "minimum": 0,
            "type": "integer"
          },
          "source": {
            "description": "Where the data came from, e.g. 'espn'.",
            "maxLength": 64,
            "type": "string"
          },
          "status": {
            "description": "Leave out for a play that stands. 'overturned': reversed by the officials. 'removed': the source dropped or replaced it for another or unknown reason (see replacedBy). Readers treat any value, including ones they don't know, as a play that doesn't count.",
            "knownValues": [
              "overturned",
              "removed"
            ],
            "maxLength": 32,
            "type": "string"
          },
          "team": {
            "description": "com.professorbutts.sports.team record of the side the points count for (for an own goal, the team that benefits).",
            "format": "at-uri",
            "type": "string"
          },
          "text": {
            "description": "The play as the source describes it.",
            "maxGraphemes": 300,
            "maxLength": 3000,
            "type": "string"
          },
          "updatedAt": {
            "format": "datetime",
            "type": "string"
          }
        },
        "required": [
          "game",
          "kind",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "participant": {
      "properties": {
        "name": {
          "maxLength": 128,
          "type": "string"
        },
        "personRef": {
          "description": "com.professorbutts.sports.person record.",
          "format": "at-uri",
          "type": "string"
        },
        "role": {
          "knownValues": [
            "scorer",
            "assist",
            "passer",
            "kicker"
          ],
          "maxLength": 32,
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "type": "object"
    }
  },
  "description": "One scoring play in a game, as its own record linked to the game. Game records are updated in place; plays are kept, so together they are the game's scoring history (for scoring-play cards or game-thread replies). Basketball baskets are not written as plays.",
  "id": "com.professorbutts.sports.play",
  "lexicon": 1
}
```
