{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "categoryState": {
      "properties": {
        "completedAt": {
          "format": "datetime",
          "type": "string"
        },
        "completedBy": {
          "format": "did",
          "type": "string"
        },
        "key": {
          "knownValues": [
            "mobility",
            "health",
            "interests",
            "contentTaste",
            "schedule"
          ],
          "type": "string"
        },
        "state": {
          "description": "complete only when a guardian pressed complete; it stays complete after later edits.",
          "knownValues": [
            "notStarted",
            "inProgress",
            "complete"
          ],
          "type": "string"
        }
      },
      "required": [
        "key",
        "state"
      ],
      "type": "object"
    },
    "itemState": {
      "properties": {
        "at": {
          "format": "datetime",
          "type": "string"
        },
        "by": {
          "format": "did",
          "type": "string"
        },
        "key": {
          "description": "The question key, e.g. mobility.walking, health.allergies, interests.travel.regions.",
          "maxLength": 100,
          "type": "string"
        },
        "state": {
          "knownValues": [
            "skipped",
            "notSure"
          ],
          "type": "string"
        }
      },
      "required": [
        "key",
        "state",
        "at",
        "by"
      ],
      "type": "object"
    },
    "main": {
      "description": "ILLI's own state of one parent's E04 data: how far each category has been entered, which questions were skipped or answered 'not sure', and the family's story answers. Record key = the parent slot (1 or 2). Written by the root admin's session into the root admin's repo of the family sphere; the parent's data itself are ai.newnal.mydata.* records in the parent's own repo (dev-spec 21 §4.2).",
      "key": "any",
      "record": {
        "properties": {
          "categories": {
            "items": {
              "ref": "#categoryState",
              "type": "ref"
            },
            "maxLength": 10,
            "type": "array"
          },
          "items": {
            "description": "Questions without a value that were skipped or answered 'not sure'. An item disappears when a value is written for it.",
            "items": {
              "ref": "#itemState",
              "type": "ref"
            },
            "maxLength": 200,
            "type": "array"
          },
          "slot": {
            "description": "The parent slot, 1 or 2.",
            "maximum": 2,
            "minimum": 1,
            "type": "integer"
          },
          "stories": {
            "items": {
              "ref": "#story",
              "type": "ref"
            },
            "maxLength": 100,
            "type": "array"
          },
          "updatedAt": {
            "format": "datetime",
            "type": "string"
          }
        },
        "required": [
          "slot",
          "categories",
          "items",
          "stories",
          "updatedAt"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "story": {
      "properties": {
        "at": {
          "format": "datetime",
          "type": "string"
        },
        "by": {
          "format": "did",
          "type": "string"
        },
        "questionKey": {
          "description": "The story question of the interests screen (A-E04-09) this answer belongs to.",
          "maxLength": 100,
          "type": "string"
        },
        "text": {
          "maxGraphemes": 300,
          "maxLength": 3000,
          "type": "string"
        }
      },
      "required": [
        "questionKey",
        "text",
        "at",
        "by"
      ],
      "type": "object"
    }
  },
  "id": "ai.newnal.illi.family.parentData",
  "lexicon": 1
}
