{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://xcathletes.org/contract/schemas/rollup-row.json",
  "title": "rollup_row",
  "description": "GET /v1/rollups?team&from&to&week_start: one (person, week, origin team) total. Response schema, PRIN-04 open. No enum-bearing fields.",
  "type": "object",
  "additionalProperties": true,
  "required": [
    "person_id",
    "week_start",
    "week_end",
    "origin_team_id",
    "duration_seconds"
  ],
  "properties": {
    "person_id": {
      "type": "string",
      "description": "A pre-existing platform id (a legacy person predating the /v1/ contract) or a new PRIN-05 128-bit hex id may both appear here; format is not otherwise constrained."
    },
    "week_start": {
      "type": "string",
      "format": "date"
    },
    "week_end": {
      "type": "string",
      "format": "date"
    },
    "origin_team_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "null only for a legacy row minted before origin stamping shipped. A pre-existing platform id (a legacy team predating the /v1/ contract) or a new PRIN-05 128-bit hex id may both appear here; format is not otherwise constrained."
    },
    "duration_seconds": {
      "type": "integer",
      "minimum": 0,
      "description": "ENT-02: the integer-seconds sum for this person's sessions in this week, originated by this team. Each session contributes its own stored duration_seconds when present, else (ENT-05) the sum of its blocks' duration_seconds times reps. dedupe=clustered subtracts MW-06 non-representative cluster members before summing."
    }
  }
}
