{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Normal review history record",
  "type": "object",
  "additionalProperties": true,
  "required": ["cardId", "deckId", "occurredAtUtc", "reviewPeriodKey", "studyMode", "isCorrect"],
  "properties": {
    "id": {
      "description": "Optional. Omit the key to generate a source identity; null and empty strings are invalid. Repeated anonymous imports create new events.",
      "type": "string",
      "minLength": 1
    },
    "cardId": { "type": "string", "minLength": 1 },
    "deckId": { "type": "string", "minLength": 1 },
    "occurredAtUtc": {
      "description": "Actual answer instant, serialized in UTC.",
      "type": "string",
      "format": "date-time"
    },
    "reviewPeriodKey": {
      "description": "Assigned review day; preserved independently of the occurrence instant's UTC date.",
      "type": "string",
      "format": "date",
      "minLength": 10,
      "maxLength": 10,
      "pattern": "^(?!0000)[0-9]{4}-[0-9]{2}-[0-9]{2}$"
    },
    "studyMode": { "enum": ["flashcards", "matching"] },
    "isCorrect": { "type": "boolean" },
    "reviewDurationMs": { "type": ["integer", "null"] }
  }
}
