# app.studynext.material

> A learning material (textbook, course, etc.) with chapter divisions. rkey is the client's localId (see the `localId` property below), written via putRecord — this makes a retried push idempotent (a network-timeout retry overwrites the same rkey instead of creating a duplicate) rather than requiring the client to track which pushes already succeeded.

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

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:nstib2qjcu3tyun7cxz4dxcm/app.studynext.material)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:nstib2qjcu3tyun7cxz4dxcm/app.studynext.material/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:nstib2qjcu3tyun7cxz4dxcm/app.studynext.material/analytics)

## Record (`app.studynext.material`)

Type: record · key any

### Properties

- `accent` (string, required): Accent color (hex code)
  - Constraints: maxLength: 7
- `backgroundImage` (blob): User-selected image blob. ISBN-derived cover bytes are never uploaded.
  - Constraints: maxSize: 5000000, accept: image/*
- `backgroundImageRemoved` (boolean)
- `backgroundImageUri` (string): Legacy remote image URL only. New selected images use a blob; local URIs are never written.
- `chapters` (array): List of chapters in this material
  - Constraints: maxLength: 500
  - `items` (ref)
    - Reference: `#chapter`
- `createdAt` (string, required): Material creation date (YYYY-MM-DD)
- `description` (string)
  - Constraints: maxLength: 1500
- `isbn` (string): ISBN of the tracked book. The cover image itself is never stored here; it is resolved on-device from this ISBN.
  - Constraints: maxLength: 20
- `isbnRemoved` (boolean)
- `localId` (string, required): Matches local Material.id and equals this record's own rkey (see the record-level description above).
  - Constraints: maxLength: 100
- `pdsRkey` (string · tid): Canonical migrated TID rkey. It points to a create-only copy while the legacy source record remains readable.
- `subjectId` (string): Associated subject ID if any
  - Constraints: maxLength: 100
- `subjectName` (string): Subject name snapshot
  - Constraints: maxLength: 300
- `syncedAt` (string · datetime)
- `title` (string, required): Material title
  - Constraints: maxLength: 600

## #chapter (`app.studynext.material#chapter`)

Type: object

### Properties

- `estMin` (integer)
  - Constraints: minimum: 0
- `id` (string, required)
  - Constraints: maxLength: 100
- `pageCount` (integer)
  - Constraints: minimum: 0
- `prefix` (string)
  - Constraints: maxLength: 150
- `rangeFrom` (integer)
  - Constraints: minimum: 0
- `rangeTo` (integer)
  - Constraints: minimum: 0
- `title` (string, required)
  - Constraints: maxLength: 600
- `unit` (string)
  - Constraints: maxLength: 60

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "chapter": {
      "properties": {
        "estMin": {
          "minimum": 0,
          "type": "integer"
        },
        "id": {
          "maxLength": 100,
          "type": "string"
        },
        "pageCount": {
          "minimum": 0,
          "type": "integer"
        },
        "prefix": {
          "maxLength": 150,
          "type": "string"
        },
        "rangeFrom": {
          "minimum": 0,
          "type": "integer"
        },
        "rangeTo": {
          "minimum": 0,
          "type": "integer"
        },
        "title": {
          "maxLength": 600,
          "type": "string"
        },
        "unit": {
          "maxLength": 60,
          "type": "string"
        }
      },
      "required": [
        "id",
        "title"
      ],
      "type": "object"
    },
    "main": {
      "description": "A learning material (textbook, course, etc.) with chapter divisions. rkey is the client's localId (see the `localId` property below), written via putRecord — this makes a retried push idempotent (a network-timeout retry overwrites the same rkey instead of creating a duplicate) rather than requiring the client to track which pushes already succeeded.",
      "key": "any",
      "record": {
        "properties": {
          "accent": {
            "description": "Accent color (hex code)",
            "maxLength": 7,
            "type": "string"
          },
          "backgroundImage": {
            "accept": [
              "image/*"
            ],
            "description": "User-selected image blob. ISBN-derived cover bytes are never uploaded.",
            "maxSize": 5000000,
            "type": "blob"
          },
          "backgroundImageRemoved": {
            "type": "boolean"
          },
          "backgroundImageUri": {
            "description": "Legacy remote image URL only. New selected images use a blob; local URIs are never written.",
            "type": "string"
          },
          "chapters": {
            "description": "List of chapters in this material",
            "items": {
              "ref": "#chapter",
              "type": "ref"
            },
            "maxLength": 500,
            "type": "array"
          },
          "createdAt": {
            "description": "Material creation date (YYYY-MM-DD)",
            "type": "string"
          },
          "description": {
            "maxLength": 1500,
            "type": "string"
          },
          "isbn": {
            "description": "ISBN of the tracked book. The cover image itself is never stored here; it is resolved on-device from this ISBN.",
            "maxLength": 20,
            "type": "string"
          },
          "isbnRemoved": {
            "type": "boolean"
          },
          "localId": {
            "description": "Matches local Material.id and equals this record's own rkey (see the record-level description above).",
            "maxLength": 100,
            "type": "string"
          },
          "pdsRkey": {
            "description": "Canonical migrated TID rkey. It points to a create-only copy while the legacy source record remains readable.",
            "format": "tid",
            "type": "string"
          },
          "subjectId": {
            "description": "Associated subject ID if any",
            "maxLength": 100,
            "type": "string"
          },
          "subjectName": {
            "description": "Subject name snapshot",
            "maxLength": 300,
            "type": "string"
          },
          "syncedAt": {
            "format": "datetime",
            "type": "string"
          },
          "title": {
            "description": "Material title",
            "maxLength": 600,
            "type": "string"
          }
        },
        "required": [
          "localId",
          "title",
          "accent",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "app.studynext.material",
  "lexicon": 1
}
```
