{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Legacy report record retained for compatibility with reports previously written to reporters' PDSs. New client reports are submitted to private AppView storage through POST /reports and are not written to this collection. The AppView may continue to display and manage these legacy reports using AppView-side state, without modifying or deleting their source records. The reporter's DID is implicit in the record URI (at://<reporterDid>/app.studynext.report/<rkey>). rkey is server-assigned.",
      "key": "tid",
      "record": {
        "properties": {
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "message": {
            "ref": "#message",
            "type": "ref"
          },
          "reason": {
            "description": "Free-text reason from the reporter.",
            "maxLength": 2000,
            "type": "string"
          },
          "reasonType": {
            "knownValues": [
              "com.atproto.moderation.defs#reasonSpam",
              "com.atproto.moderation.defs#reasonViolation",
              "com.atproto.moderation.defs#reasonMisleading",
              "com.atproto.moderation.defs#reasonSexual",
              "com.atproto.moderation.defs#reasonRude",
              "com.atproto.moderation.defs#reasonOther"
            ],
            "type": "string"
          },
          "status": {
            "description": "Status preserved on legacy reporter-PDS records; current moderation status is managed separately in AppView storage.",
            "knownValues": [
              "open",
              "actioned",
              "dismissed"
            ],
            "type": "string"
          },
          "subject": {
            "description": "DID of the reported user.",
            "format": "did",
            "maxLength": 512,
            "type": "string"
          },
          "subjectHandle": {
            "description": "Handle of the reported user, snapshotted for the admin panel.",
            "maxLength": 256,
            "type": "string"
          }
        },
        "required": [
          "subject",
          "reasonType",
          "reason",
          "status",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "message": {
      "description": "Snapshot of the reported content, captured at report time (e.g. a room comment, which otherwise expires).",
      "properties": {
        "cid": {
          "maxLength": 256,
          "type": "string"
        },
        "createdAt": {
          "format": "datetime",
          "maxLength": 64,
          "type": "string"
        },
        "room": {
          "description": "AT-URI of the room the message was posted in, for context.",
          "maxLength": 512,
          "type": "string"
        },
        "text": {
          "maxLength": 2000,
          "type": "string"
        },
        "uri": {
          "description": "AT-URI of the reported record, if any.",
          "maxLength": 512,
          "type": "string"
        }
      },
      "required": [
        "text"
      ],
      "type": "object"
    }
  },
  "id": "app.studynext.report",
  "lexicon": 1
}
