{
  "lexicon": 1,
  "id": "net.bisks.subatomic.vote",
  "defs": {
    "main": {
      "type": "record",
      "description": "One vote on a subatomic post or comment. rkey is deterministic per (voter, subject) — see public/lib/oauth.js's voteRkey — so casting a new vote on the same subject overwrites this record rather than creating a second one, and deleting it withdraws the vote entirely. Written to the voter's own repo; src/index.ts's /api/vote and /api/unvote read it back (or confirm its absence) before applying it to the shared score at https://subatomic.bisks.net.",
      "key": "any",
      "record": {
        "type": "object",
        "required": ["subject", "value", "createdAt"],
        "properties": {
          "subject": {
            "type": "string",
            "format": "at-uri",
            "description": "The at-uri of the net.bisks.subatomic.post being voted on."
          },
          "value": {
            "type": "integer",
            "enum": [1, -1],
            "description": "1 for upvote, -1 for downvote."
          },
          "createdAt": {
            "type": "string",
            "format": "datetime",
            "description": "When this vote was cast (or last changed), as an ISO 8601 datetime."
          }
        }
      }
    }
  }
}
