# com.professorbutts.sports.bracket

> Recommended key: the contest's rkey, so a fan has one bracket per contest. Any key is accepted; if several exist, the newest counts.

- 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.bracket)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:x6njyeyi47bqs2kueuv3mrg5/com.professorbutts.sports.bracket/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:x6njyeyi47bqs2kueuv3mrg5/com.professorbutts.sports.bracket/analytics)

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

Type: record · key any

### Properties

- `contest` (string · at-uri, required): The com.professorbutts.sports.contest record.
- `createdAt` (string · datetime, required)
- `group` (string · at-uri): Optional com.professorbutts.sports.list of accounts (a friends group) to be ranked within.
- `picks` (array, required)
  - Constraints: maxLength: 64
  - `items` (ref)
    - Reference: `#pick`
- `tiebreaker` (integer): Guess of the combined final score of the contest's tiebreaker slot.
  - Constraints: minimum: 0, maximum: 999
- `updatedAt` (string · datetime)

## #pick (`com.professorbutts.sports.bracket#pick`)

Type: object

### Properties

- `confidence` (integer)
  - Constraints: minimum: 1, maximum: 64
- `slot` (string, required)
  - Constraints: maxLength: 32
- `team` (string · at-uri, required): com.professorbutts.sports.team record picked to win the slot.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Recommended key: the contest's rkey, so a fan has one bracket per contest. Any key is accepted; if several exist, the newest counts.",
      "key": "any",
      "record": {
        "properties": {
          "contest": {
            "description": "The com.professorbutts.sports.contest record.",
            "format": "at-uri",
            "type": "string"
          },
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "group": {
            "description": "Optional com.professorbutts.sports.list of accounts (a friends group) to be ranked within.",
            "format": "at-uri",
            "type": "string"
          },
          "picks": {
            "items": {
              "ref": "#pick",
              "type": "ref"
            },
            "maxLength": 64,
            "type": "array"
          },
          "tiebreaker": {
            "description": "Guess of the combined final score of the contest's tiebreaker slot.",
            "maximum": 999,
            "minimum": 0,
            "type": "integer"
          },
          "updatedAt": {
            "format": "datetime",
            "type": "string"
          }
        },
        "required": [
          "contest",
          "picks",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "pick": {
      "properties": {
        "confidence": {
          "maximum": 64,
          "minimum": 1,
          "type": "integer"
        },
        "slot": {
          "maxLength": 32,
          "type": "string"
        },
        "team": {
          "description": "com.professorbutts.sports.team record picked to win the slot.",
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "slot",
        "team"
      ],
      "type": "object"
    }
  },
  "description": "One player's whole bracket for a bracket-format com.professorbutts.sports.contest, kept in the player's own repo: a predicted winner for every slot, later rounds included. Updated in place; a slot's pick only counts if an indexer saw it before that slot locked.",
  "id": "com.professorbutts.sports.bracket",
  "lexicon": 1
}
```
