# pics.2bit.challenge.entry

> Published by [2bit.pics](https://lexicon.garden/identity/did:plc:sbmntiflmknij2axeck3w6u7)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:sbmntiflmknij2axeck3w6u7/pics.2bit.challenge.entry)
- [Documentation](https://lexicon.garden/lexicon/did:plc:sbmntiflmknij2axeck3w6u7/pics.2bit.challenge.entry/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:sbmntiflmknij2axeck3w6u7/pics.2bit.challenge.entry/examples)

## Definitions

### `pics.2bit.challenge.entry`

**Type**: `record`

One of the author's own photos entered into a challenge for one of its prompts. One entry per person per prompt is enforced by this app's AppView rather than the record key: its write path deletes an author's earlier entry for a prompt before writing the new one, and where another client leaves several, the newest counts.

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `challenge` | `ref` → `com.atproto.repo.strongRef` | Yes | Strong ref to the pics.2bit.challenge.list being entered. The AppView matches entries to their challenge by uri alone, so an organizer's later edit to the list (a fixed typo, a new prompt) doesn't detach the entries already made; the cid only records which version of the list the entry was made against. |
| `createdAt` | `string` (datetime) | Yes |  |
| `prompt` | `string` | Yes | Which prompt this entry answers, given as that prompt's `key` - one of the challenge list's `prompts[].key` values (pics.2bit.challenge.list#prompt), e.g. `6` - never its title, so the organizer can reword a title without detaching entries. An entry whose key the list doesn't have is skipped. |
| `subject` | `ref` → `com.atproto.repo.strongRef` | Yes | Strong ref to the photo being entered: a pics.2bit.feed.photo in the same repo as this entry. A strongRef carries no type, so both are enforced by the AppView, which skips an entry for anyone else's photo. A photo that is later deleted or can't be shown leaves its prompt empty. |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "One of the author's own photos entered into a challenge for one of its prompts. One entry per person per prompt is enforced by this app's AppView rather than the record key: its write path deletes an author's earlier entry for a prompt before writing the new one, and where another client leaves several, the newest counts.",
      "key": "tid",
      "record": {
        "properties": {
          "challenge": {
            "description": "Strong ref to the pics.2bit.challenge.list being entered. The AppView matches entries to their challenge by uri alone, so an organizer's later edit to the list (a fixed typo, a new prompt) doesn't detach the entries already made; the cid only records which version of the list the entry was made against.",
            "ref": "com.atproto.repo.strongRef",
            "type": "ref"
          },
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "prompt": {
            "description": "Which prompt this entry answers, given as that prompt's `key` - one of the challenge list's `prompts[].key` values (pics.2bit.challenge.list#prompt), e.g. `6` - never its title, so the organizer can reword a title without detaching entries. An entry whose key the list doesn't have is skipped.",
            "maxLength": 32,
            "minLength": 1,
            "type": "string"
          },
          "subject": {
            "description": "Strong ref to the photo being entered: a pics.2bit.feed.photo in the same repo as this entry. A strongRef carries no type, so both are enforced by the AppView, which skips an entry for anyone else's photo. A photo that is later deleted or can't be shown leaves its prompt empty.",
            "ref": "com.atproto.repo.strongRef",
            "type": "ref"
          }
        },
        "required": [
          "subject",
          "challenge",
          "prompt",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "pics.2bit.challenge.entry",
  "lexicon": 1
}
```
