# social.dracome.library.collection.item

> Published by [dracome.social](https://lexicon.garden/identity/did:plc:66dyrt2bmghwlmdteyizs5l3)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:66dyrt2bmghwlmdteyizs5l3/social.dracome.library.collection.item)
- [Documentation](https://lexicon.garden/lexicon/did:plc:66dyrt2bmghwlmdteyizs5l3/social.dracome.library.collection.item/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:66dyrt2bmghwlmdteyizs5l3/social.dracome.library.collection.item/examples)

## Definitions

### `social.dracome.library.collection.item#collectionRef`

**Type**: `object`

A reference to the custom collection (social.dracome.library.collection record) that owns this membership item.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cid` | `string` (cid) | No | Optional content hash (CID) of the owning collection record at the time this reference was written. Informational only; not part of the logical membership identity. |
| `uri` | `string` (at-uri) | Yes | AT-URI of the owning social.dracome.library.collection record. |

### `social.dracome.library.collection.item`

**Type**: `record`

A membership item placing one edition in a custom collection. Duplicate convention: the rkey is a TID minted once at first create and never changes. Several records may exist for one actor and edition (for example from out-of-band writers); consumers SHOULD treat the record with the greatest `addedAt` as the winner and break ties by the lowest TID, ignoring the others. This is a convention, not an enforced contract: AppViews MUST tolerate a differing winner, and may see a record's catalogTarget change over time.

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `addedAt` | `string` (datetime) | Yes | Canonical UTC instant serialized as ISO 8601 with a trailing Z suffix. |
| `catalogSnapshot` | `ref` → `social.dracome.work.defs#catalogSnapshot` | Yes | Point-in-time catalog metadata for the added work or edition, captured when this record was last written. Refreshed on every update. |
| `catalogTarget` | `ref` → `social.dracome.work.defs#catalogTarget` | Yes | The work and edition that this membership item represents. Mutable. |
| `collection` | `ref` → `#collectionRef` | Yes | Reference to the custom collection this item belongs to. |
| `position` | `integer` | Yes | Sparse integer ordering within one custom collection. Gaps are allowed so reorder writes can stay bounded. |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "collectionRef": {
      "description": "A reference to the custom collection (social.dracome.library.collection record) that owns this membership item.",
      "properties": {
        "cid": {
          "description": "Optional content hash (CID) of the owning collection record at the time this reference was written. Informational only; not part of the logical membership identity.",
          "format": "cid",
          "type": "string"
        },
        "uri": {
          "description": "AT-URI of the owning social.dracome.library.collection record.",
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "uri"
      ],
      "type": "object"
    },
    "main": {
      "description": "A membership item placing one edition in a custom collection. Duplicate convention: the rkey is a TID minted once at first create and never changes. Several records may exist for one actor and edition (for example from out-of-band writers); consumers SHOULD treat the record with the greatest `addedAt` as the winner and break ties by the lowest TID, ignoring the others. This is a convention, not an enforced contract: AppViews MUST tolerate a differing winner, and may see a record's catalogTarget change over time.",
      "key": "tid",
      "record": {
        "properties": {
          "addedAt": {
            "description": "Canonical UTC instant serialized as ISO 8601 with a trailing Z suffix.",
            "format": "datetime",
            "type": "string"
          },
          "catalogSnapshot": {
            "description": "Point-in-time catalog metadata for the added work or edition, captured when this record was last written. Refreshed on every update.",
            "ref": "social.dracome.work.defs#catalogSnapshot",
            "type": "ref"
          },
          "catalogTarget": {
            "description": "The work and edition that this membership item represents. Mutable.",
            "ref": "social.dracome.work.defs#catalogTarget",
            "type": "ref"
          },
          "collection": {
            "description": "Reference to the custom collection this item belongs to.",
            "ref": "#collectionRef",
            "type": "ref"
          },
          "position": {
            "description": "Sparse integer ordering within one custom collection. Gaps are allowed so reorder writes can stay bounded.",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "collection",
          "catalogTarget",
          "catalogSnapshot",
          "position",
          "addedAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "social.dracome.library.collection.item",
  "lexicon": 1
}
```
