{
"id": "org.cannadb.growPhoto",
"defs": {
"main": {
"key": "tid",
"type": "record",
"record": {
"type": "object",
"required": [
"image",
"createdAt"
],
"properties": {
"grow": {
"type": "string",
"format": "at-uri",
"description": "AT-URI reference to the `org.cannadb.grow` this photo belongs to. Used for grow-wide shots (room, canopy, cover) or as a denormalized cache of the plant's grow. At least one of `plant` or `grow` SHOULD be present. (Consumers should validate the ref resolves to an `org.cannadb.grow` record.)"
},
"entry": {
"type": "string",
"format": "at-uri",
"description": "Optional AT-URI reference to the `org.cannadb.growEntry` this photo documents (e.g., the photo taken at a given check-up or transition). Lets clients show photos inline on the timeline event. (Consumers should validate the ref resolves to an `org.cannadb.growEntry` record.)"
},
"image": {
"type": "blob",
"accept": [
"image/png",
"image/jpeg",
"image/webp"
],
"maxSize": 2000000,
"description": "The photo. Accepts common web image formats; capped at 2 MB — larger than review images (1 MB) because documenting a full run with day-by-day galleries is the point, but still bounded to keep PDS storage burden reasonable. SVG is excluded for XSS safety."
},
"order": {
"type": "integer",
"minimum": 0,
"description": "Optional manual sort order within the gallery. Lower sorts first. When absent, consumers fall back to `takenAt` then `createdAt`."
},
"plant": {
"type": "string",
"format": "at-uri",
"description": "AT-URI reference to the `org.cannadb.plant` this photo is of. Optional, but at least one of `plant` or `grow` SHOULD be present so the photo has a home; consumers should ignore a photo that references neither. (Consumers should validate the ref resolves to an `org.cannadb.plant` record.)"
},
"caption": {
"type": "string",
"maxLength": 20000,
"description": "Optional plain-or-markdown caption for the photo.",
"maxGraphemes": 2000
},
"takenAt": {
"type": "string",
"format": "datetime",
"description": "When the photo was taken, if different from `createdAt`. Used to order galleries chronologically."
},
"createdAt": {
"type": "string",
"format": "datetime",
"description": "Client-declared timestamp when this photo record was created."
}
}
},
"description": "A single photo in a grow's gallery. Modeled as its own record (rather than blobs embedded in entries) so galleries can grow without bloating other records and so each photo carries its own caption, ordering, and capture date. A photo attaches to a plant (the usual case — per-plant galleries) and/or to the grow (group/room shots, the cover), and may optionally link to the `org.cannadb.growEntry` it documents. The image blob lives on the publishing PDS; the record carries the blob ref plus metadata. Publishing this record IS the claim — contextualized by the publisher DID at display time. Visibility follows the parent grow's `listed` preference, gated by the AppView."
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}