{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "category": {
      "knownValues": [
        "mobility",
        "health",
        "interests",
        "contentTaste",
        "schedule"
      ],
      "type": "string"
    },
    "categoryView": {
      "properties": {
        "completedAt": {
          "format": "datetime",
          "type": "string"
        },
        "completedBy": {
          "format": "did",
          "type": "string"
        },
        "key": {
          "ref": "#category",
          "type": "ref"
        },
        "missing": {
          "description": "Question keys of this category without a value and not answered 'not sure' (the missing-items list).",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "state": {
          "knownValues": [
            "notStarted",
            "inProgress",
            "complete"
          ],
          "type": "string"
        }
      },
      "required": [
        "key",
        "state",
        "missing"
      ],
      "type": "object"
    },
    "collection": {
      "description": "A My Data collection ILLI writes for a parent (dev-spec 21 §8.1).",
      "knownValues": [
        "ai.newnal.mydata.healthFunctionalAbilities",
        "ai.newnal.mydata.healthMedicalEvents",
        "ai.newnal.mydata.healthAllergies",
        "ai.newnal.mydata.healthMedications",
        "ai.newnal.mydata.healthHealthStatus",
        "ai.newnal.mydata.interestsAndTastesTravel",
        "ai.newnal.mydata.interestsAndTastesHobbies",
        "ai.newnal.mydata.interestsAndTastesFood",
        "ai.newnal.mydata.interestsAndTastesGeneral",
        "ai.newnal.mydata.interestsAndTastesMedia",
        "ai.newnal.mydata.interestsAndTastesNews",
        "ai.newnal.mydata.interestsAndTastesFavoriteWorks",
        "ai.newnal.mydata.interestsAndTastesFavoriteCreators",
        "ai.newnal.mydata.capabilitiesSkillsAndKnowledge",
        "ai.newnal.mydata.valuesAndGoalsGoals",
        "ai.newnal.mydata.profileScheduleActivities",
        "ai.newnal.mydata.lifestyleHabits",
        "ai.newnal.mydata.profileIdentity",
        "ai.newnal.mydata.profileBirth",
        "ai.newnal.mydata.profileRepresentation"
      ],
      "type": "string"
    },
    "itemState": {
      "properties": {
        "at": {
          "format": "datetime",
          "type": "string"
        },
        "by": {
          "format": "did",
          "type": "string"
        },
        "key": {
          "type": "string"
        },
        "state": {
          "knownValues": [
            "skipped",
            "notSure"
          ],
          "type": "string"
        }
      },
      "required": [
        "key",
        "state",
        "at",
        "by"
      ],
      "type": "object"
    },
    "parentDataView": {
      "properties": {
        "categories": {
          "description": "Only the categories the caller may read (dataSharing for a general manager).",
          "items": {
            "ref": "#categoryView",
            "type": "ref"
          },
          "type": "array"
        },
        "items": {
          "items": {
            "ref": "#itemState",
            "type": "ref"
          },
          "type": "array"
        },
        "profile": {
          "ref": "#profileView",
          "type": "ref"
        },
        "readOnly": {
          "description": "True for a general manager: the caller may not write.",
          "type": "boolean"
        },
        "records": {
          "description": "Every readable record of the parent across the collections, each with its collection.",
          "items": {
            "ref": "#recordView",
            "type": "ref"
          },
          "type": "array"
        },
        "slot": {
          "description": "The parent slot, 1 or 2.",
          "maximum": 2,
          "minimum": 1,
          "type": "integer"
        },
        "stories": {
          "items": {
            "ref": "#story",
            "type": "ref"
          },
          "type": "array"
        }
      },
      "required": [
        "slot",
        "profile",
        "categories",
        "items",
        "stories",
        "records",
        "readOnly"
      ],
      "type": "object"
    },
    "profileView": {
      "properties": {
        "birthDate": {
          "maxLength": 10,
          "type": "string"
        },
        "birthYear": {
          "type": "integer"
        },
        "birthday": {
          "ref": "#yearlyDate",
          "type": "ref"
        },
        "honorific": {
          "type": "string"
        },
        "linked": {
          "description": "Whether the parent has a Newnal ID linked; E04 data can be written only then.",
          "type": "boolean"
        },
        "name": {
          "type": "string"
        },
        "photoUrl": {
          "type": "string"
        },
        "slot": {
          "description": "The parent slot, 1 or 2.",
          "maximum": 2,
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "slot",
        "name",
        "honorific",
        "linked"
      ],
      "type": "object"
    },
    "provenanceView": {
      "properties": {
        "agent": {
          "format": "did",
          "type": "string"
        },
        "method": {
          "knownValues": [
            "user_stated",
            "inferred",
            "imported",
            "issued",
            "observed",
            "reported_by_other"
          ],
          "type": "string"
        },
        "recordedAt": {
          "format": "datetime",
          "type": "string"
        }
      },
      "required": [
        "agent",
        "method",
        "recordedAt"
      ],
      "type": "object"
    },
    "recordView": {
      "properties": {
        "cid": {
          "format": "cid",
          "type": "string"
        },
        "collection": {
          "ref": "#collection",
          "type": "ref"
        },
        "createdAt": {
          "description": "The record's _meta.createdAt.",
          "format": "datetime",
          "type": "string"
        },
        "data": {
          "description": "The `data` of one My Data record: the collection's #section (one record at rkey self) or #entry (one record per item), as the platform's published lexicon defines it. $type names the def.",
          "refs": [
            "ai.newnal.mydata.healthFunctionalAbilities#entry",
            "ai.newnal.mydata.healthMedicalEvents#section",
            "ai.newnal.mydata.healthMedicalEvents#entry",
            "ai.newnal.mydata.healthAllergies#section",
            "ai.newnal.mydata.healthAllergies#entry",
            "ai.newnal.mydata.healthMedications#section",
            "ai.newnal.mydata.healthMedications#entry",
            "ai.newnal.mydata.healthHealthStatus#section",
            "ai.newnal.mydata.healthHealthStatus#entry",
            "ai.newnal.mydata.interestsAndTastesTravel#section",
            "ai.newnal.mydata.interestsAndTastesHobbies#section",
            "ai.newnal.mydata.interestsAndTastesHobbies#entry",
            "ai.newnal.mydata.interestsAndTastesFood#section",
            "ai.newnal.mydata.interestsAndTastesGeneral#entry",
            "ai.newnal.mydata.interestsAndTastesMedia#section",
            "ai.newnal.mydata.interestsAndTastesNews#section",
            "ai.newnal.mydata.interestsAndTastesFavoriteWorks#entry",
            "ai.newnal.mydata.interestsAndTastesFavoriteCreators#entry",
            "ai.newnal.mydata.capabilitiesSkillsAndKnowledge#entry",
            "ai.newnal.mydata.valuesAndGoalsGoals#entry",
            "ai.newnal.mydata.profileScheduleActivities#entry",
            "ai.newnal.mydata.lifestyleHabits#entry",
            "ai.newnal.mydata.profileIdentity#section",
            "ai.newnal.mydata.profileBirth#section",
            "ai.newnal.mydata.profileRepresentation#section"
          ],
          "type": "union"
        },
        "provenance": {
          "ref": "#provenanceView",
          "type": "ref"
        },
        "rkey": {
          "format": "record-key",
          "type": "string"
        },
        "uri": {
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "uri",
        "cid",
        "collection",
        "rkey",
        "data",
        "createdAt"
      ],
      "type": "object"
    },
    "sharingCategories": {
      "properties": {
        "contentTaste": {
          "type": "boolean"
        },
        "health": {
          "type": "boolean"
        },
        "interests": {
          "type": "boolean"
        },
        "mobility": {
          "type": "boolean"
        },
        "schedule": {
          "type": "boolean"
        }
      },
      "required": [
        "mobility",
        "health",
        "interests",
        "contentTaste",
        "schedule"
      ],
      "type": "object"
    },
    "sharingView": {
      "properties": {
        "generalManagers": {
          "ref": "#sharingCategories",
          "type": "ref"
        },
        "updatedAt": {
          "format": "datetime",
          "type": "string"
        },
        "updatedBy": {
          "format": "did",
          "type": "string"
        }
      },
      "required": [
        "generalManagers"
      ],
      "type": "object"
    },
    "story": {
      "properties": {
        "at": {
          "format": "datetime",
          "type": "string"
        },
        "by": {
          "format": "did",
          "type": "string"
        },
        "questionKey": {
          "type": "string"
        },
        "text": {
          "type": "string"
        }
      },
      "required": [
        "questionKey",
        "text",
        "at",
        "by"
      ],
      "type": "object"
    },
    "yearlyDate": {
      "properties": {
        "calendar": {
          "knownValues": [
            "gregorian",
            "chinese_lunar",
            "dangi"
          ],
          "type": "string"
        },
        "day": {
          "maximum": 31,
          "minimum": 1,
          "type": "integer"
        },
        "leapMonth": {
          "type": "boolean"
        },
        "month": {
          "maximum": 12,
          "minimum": 1,
          "type": "integer"
        }
      },
      "type": "object"
    }
  },
  "id": "ai.newnal.illi.mydata.defs",
  "lexicon": 1
}
