# app.winesky.collectionItem

> Published by [winesky.app](https://lexicon.garden/identity/did:plc:kg77b5troxbtudevqnfvqba7)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:kg77b5troxbtudevqnfvqba7/app.winesky.collectionItem)
- [Documentation](https://lexicon.garden/lexicon/did:plc:kg77b5troxbtudevqnfvqba7/app.winesky.collectionItem/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:kg77b5troxbtudevqnfvqba7/app.winesky.collectionItem/examples)

## Definitions

### `app.winesky.collectionItem`

**Type**: `record`

A drink in a user's Collection. References the parent Collection via at-uri and embeds the drink description.

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `drink` | `ref` → `#drink` | Yes |  |
| `createdAt` | `string` (datetime) | Yes |  |
| `collection` | `string` (at-uri) | Yes |  |

### `app.winesky.collectionItem#drink`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `name` | `string` | Yes |  |
| `region` | `string` | No |  |
| `country` | `string` | Yes |  |
| `drinkId` | `string` | No |  |
| `vintage` | `integer` | No |  |
| `category` | `string` | Yes |  |
| `producer` | `string` | Yes |  |
| `varietals` | `array` | No |  |
| `appellation` | `string` | No |  |
| `alcoholContent` | `integer` | No |  |

## Raw Schema

```json
{
  "id": "app.winesky.collectionItem",
  "defs": {
    "main": {
      "key": "tid",
      "type": "record",
      "record": {
        "type": "object",
        "required": [
          "collection",
          "drink",
          "createdAt"
        ],
        "properties": {
          "drink": {
            "ref": "#drink",
            "type": "ref"
          },
          "createdAt": {
            "type": "string",
            "format": "datetime"
          },
          "collection": {
            "type": "string",
            "format": "at-uri"
          }
        }
      },
      "description": "A drink in a user's Collection. References the parent Collection via at-uri and embeds the drink description."
    },
    "drink": {
      "type": "object",
      "required": [
        "category",
        "country",
        "producer",
        "name"
      ],
      "properties": {
        "name": {
          "type": "string",
          "maxLength": 512
        },
        "region": {
          "type": "string",
          "maxLength": 256
        },
        "country": {
          "type": "string",
          "maxLength": 128
        },
        "drinkId": {
          "type": "string",
          "maxLength": 64
        },
        "vintage": {
          "type": "integer"
        },
        "category": {
          "enum": [
            "BEER",
            "WINE",
            "SPIRIT",
            "CIDER",
            "RTD",
            "SAKE",
            "OTHER"
          ],
          "type": "string",
          "maxLength": 64
        },
        "producer": {
          "type": "string",
          "maxLength": 512
        },
        "varietals": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 128
          }
        },
        "appellation": {
          "type": "string",
          "maxLength": 256
        },
        "alcoholContent": {
          "type": "integer",
          "maximum": 1000,
          "minimum": 0
        }
      }
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
