{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "SRS review history record",
  "type": "object",
  "additionalProperties": true,
  "required": ["srsCardId", "occurredAtUtc", "reviewPeriodKey", "rating"],
  "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
    },
    "srsCardId": { "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}$"
    },
    "rating": { "enum": ["again", "hard", "good", "easy"] },
    "logType": {
      "description": "Omitted logType defaults to native. Explicit null is invalid.",
      "enum": ["native", "archive"]
    },
    "reviewDurationMs": { "type": ["integer", "null"] },
    "stability": { "type": ["number", "null"] },
    "difficulty": { "type": ["number", "null"] },
    "decay": {
      "description": "Positive, finite FSRS forgetting-curve parameter immediately after this review; null means unknown. Import does not consult a manifest.",
      "type": ["number", "null"],
      "exclusiveMinimum": 0
    },
    "srsState": {
      "description": "Use new, learn, review, or relearn, or omit the state. suspended, disabled, and struggle are not importable history states.",
      "enum": ["new", "learn", "review", "relearn", null]
    },
    "wasSuspended": { "type": ["boolean", "null"] },
    "nextReviewIntervalMs": { "type": ["integer", "null"] }
  }
}
