{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "activity": {
      "properties": {
        "completed": {
          "minimum": 0,
          "type": "integer"
        },
        "date": {
          "description": "Calendar date in the user's local study timezone, formatted as YYYY-MM-DD; not a timestamp.",
          "type": "string"
        },
        "monthMinutes": {
          "description": "Total minutes; each source study record is rounded to an integer minute before aggregation.",
          "minimum": 0,
          "type": "integer"
        },
        "monthStart": {
          "description": "Local calendar date at the start of the summarized month, formatted as YYYY-MM-DD; not a timestamp.",
          "type": "string"
        },
        "planned": {
          "minimum": 0,
          "type": "integer"
        },
        "streak": {
          "minimum": 0,
          "type": "integer"
        },
        "weekMinutes": {
          "description": "Total minutes; each source study record is rounded to an integer minute before aggregation.",
          "minimum": 0,
          "type": "integer"
        },
        "weekStart": {
          "description": "Local calendar date at the start of the summarized week, formatted as YYYY-MM-DD; not a timestamp.",
          "type": "string"
        }
      },
      "required": [
        "date",
        "weekStart",
        "monthStart",
        "weekMinutes",
        "monthMinutes",
        "streak",
        "completed",
        "planned"
      ],
      "type": "object"
    },
    "appearance": {
      "properties": {
        "badge": {
          "maxLength": 100,
          "type": "string"
        },
        "frame": {
          "maxLength": 100,
          "type": "string"
        },
        "title": {
          "maxLength": 100,
          "type": "string"
        }
      },
      "type": "object"
    },
    "main": {
      "description": "A user's StudyNext social profile and optional public activity summary. One record per user at rkey=self. PDS repository records are publicly readable; rankingOptIn is a product preference, not an access-control boundary.",
      "key": "literal:self",
      "record": {
        "properties": {
          "activity": {
            "ref": "#activity",
            "type": "ref"
          },
          "appearance": {
            "ref": "#appearance",
            "type": "ref"
          },
          "availability": {
            "maxLength": 640,
            "type": "string"
          },
          "claimedQuests": {
            "items": {
              "maxLength": 100,
              "minLength": 1,
              "type": "string"
            },
            "maxLength": 100,
            "type": "array"
          },
          "purpose": {
            "maxLength": 1200,
            "type": "string"
          },
          "rankingOptIn": {
            "description": "Whether the user opts into StudyNext ranking and activity display. This flag does not make the PDS record private.",
            "type": "boolean"
          },
          "rankingUpdatedAt": {
            "format": "datetime",
            "type": "string"
          },
          "subjects": {
            "items": {
              "maxLength": 160,
              "minLength": 1,
              "type": "string"
            },
            "maxLength": 12,
            "type": "array"
          },
          "updatedAt": {
            "format": "datetime",
            "type": "string"
          },
          "version": {
            "maximum": 1,
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "version",
          "subjects",
          "availability",
          "purpose",
          "claimedQuests",
          "appearance",
          "rankingOptIn",
          "updatedAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "app.studynext.socialProfile",
  "lexicon": 1
}
