{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://vindicaseneca.com/assets/starter-kit/schemas/starter-mapping.schema.json",
  "title": "Seneca Starter Kit column mapping (0.1)",
  "description": "Maps an export's own column names (CSV, or a JSON array of rows) and value labels onto the kit's CSV columns. Columns that are not mapped stay in Product A and are listed by name.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "format",
    "columns"
  ],
  "properties": {
    "format": {
      "const": "seneca-starter-mapping@0.1"
    },
    "input": {
      "enum": [
        "csv",
        "json-rows"
      ],
      "description": "What the mapping was made for. A mapping works on either, since both read as rows."
    },
    "columns": {
      "type": "object",
      "description": "Kit column -> the column name in your export.",
      "additionalProperties": false,
      "required": [
        "learner_id",
        "item_id",
        "occurred_at"
      ],
      "properties": {
        "learner_id": {
          "type": "string",
          "minLength": 1
        },
        "session_id": {
          "type": "string",
          "minLength": 1
        },
        "item_id": {
          "type": "string",
          "minLength": 1
        },
        "skill_tag": {
          "type": "string",
          "minLength": 1
        },
        "skill_label": {
          "type": "string",
          "minLength": 1
        },
        "aligned_to": {
          "type": "string",
          "minLength": 1
        },
        "item_type": {
          "type": "string",
          "minLength": 1
        },
        "outcome": {
          "type": "string",
          "minLength": 1
        },
        "points": {
          "type": "string",
          "minLength": 1
        },
        "max_points": {
          "type": "string",
          "minLength": 1
        },
        "seconds": {
          "type": "string",
          "minLength": 1
        },
        "attempt": {
          "type": "string",
          "minLength": 1
        },
        "assistance": {
          "type": "string",
          "minLength": 1
        },
        "setting": {
          "type": "string",
          "minLength": 1
        },
        "timed": {
          "type": "string",
          "minLength": 1
        },
        "occurred_at": {
          "type": "string",
          "minLength": 1
        },
        "self_rating": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "values": {
      "type": "object",
      "description": "Kit column -> { your value: kit value }. Matching ignores case and surrounding spaces.",
      "additionalProperties": false,
      "properties": {
        "learner_id": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "session_id": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "item_id": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "skill_tag": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "skill_label": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "aligned_to": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "item_type": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "outcome": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "points": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "max_points": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "seconds": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "attempt": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "assistance": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "setting": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "timed": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "occurred_at": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "self_rating": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    },
    "constants": {
      "type": "object",
      "description": "Kit column -> a value used for every row, for columns your export does not have.",
      "additionalProperties": false,
      "properties": {
        "learner_id": {
          "type": "string"
        },
        "session_id": {
          "type": "string"
        },
        "item_id": {
          "type": "string"
        },
        "skill_tag": {
          "type": "string"
        },
        "skill_label": {
          "type": "string"
        },
        "aligned_to": {
          "type": "string"
        },
        "item_type": {
          "type": "string"
        },
        "outcome": {
          "type": "string"
        },
        "points": {
          "type": "string"
        },
        "max_points": {
          "type": "string"
        },
        "seconds": {
          "type": "string"
        },
        "attempt": {
          "type": "string"
        },
        "assistance": {
          "type": "string"
        },
        "setting": {
          "type": "string"
        },
        "timed": {
          "type": "string"
        },
        "occurred_at": {
          "type": "string"
        },
        "self_rating": {
          "type": "string"
        }
      }
    },
    "timezone": {
      "type": "string",
      "pattern": "^(Z|[+-]\\d{2}:\\d{2})$",
      "description": "Applied to timestamps that have no timezone, such as \"2026-09-16 15:04:10\"."
    }
  }
}
