{
  "lexicon": 1,
  "id": "net.bisks.rateyourbuild.subscription",
  "defs": {
    "main": {
      "type": "record",
      "description": "A \"notify me\" subscription: a specific rated site (alert on a new rating/review), a genre/subgenre/super-genre (alert on a new site release in scope), or (kind \"replies\") any reply landing on the subscriber's own reviews or comments. One record per subscribed thing — unsubscribing deletes the record. Written and read by rateyourbuild (https://rateyourbuild.bisks.net).",
      "key": "any",
      "record": {
        "type": "object",
        "required": ["kind", "target", "createdAt"],
        "properties": {
          "kind": {
            "type": "string",
            "enum": ["site", "genre", "subgenre", "super", "replies"],
            "description": "What this subscription watches: a site's own ratings, a genre/subgenre/super-genre's new releases, or (kind \"replies\") any reply landing on one of the subscriber's own reviews or comments."
          },
          "target": {
            "type": "string",
            "maxLength": 200,
            "maxGraphemes": 100,
            "description": "The bare site name, genre key, subgenre value, or super-genre key being watched, depending on kind. Always the literal \"self\" when kind is \"replies\" (there's only one thing to watch: replies aimed at the subscriber)."
          },
          "genre": {
            "type": "string",
            "maxLength": 200,
            "maxGraphemes": 100,
            "description": "Required when kind is \"subgenre\" (subgenre names aren't unique across genres, e.g. \"leaderboard\"), so a subgenre subscription is always scoped to a (genre, subgenre) pair. Unused for other kinds."
          },
          "createdAt": {
            "type": "string",
            "format": "datetime",
            "description": "When this subscription was created, as an ISO 8601 datetime."
          }
        }
      }
    }
  }
}
