{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/capepartners-fr/json-schema/capepartners-fr-activity-response-schema.json",
  "title": "ActivityResponse",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/capepartners-fr-activity-api-openapi.yml#/components/schemas/ActivityResponse",
  "type": "object",
  "properties": {
    "events": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ActivityEvent"
      }
    },
    "todo": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/TodoItem"
      },
      "description": "Pending required actions for this session: agreement review if unsigned, profile completion, parked suggestions awaiting action, and unreviewed counterparty interaction signals (a pairing created on this profile, or a phase change on it). Each item carries {type, action, label, detail, priority}. Items of type='interest' are cleared by POST /api/interest-signals/{session_id}/ack; the others clear when the underlying condition is resolved. Array empty when nothing is pending."
    },
    "nda_signed": {
      "type": "boolean",
      "description": "True when a server-side NDA signature exist for this session."
    }
  },
  "$defs": {
    "ActivityEvent": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "detail": {
          "type": "string"
        },
        "time": {
          "type": "string"
        }
      }
    },
    "TodoItem": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "One of: nda, profile, matches, interest"
        },
        "action": {
          "type": "string",
          "description": "Surface/behaviour: nda (sign modal), settings, pipeline, ack (mark this signal reviewed), ack_all (mark every pending signal reviewed)"
        },
        "label": {
          "type": "string"
        },
        "detail": {
          "type": "string"
        },
        "priority": {
          "type": "integer"
        },
        "event": {
          "type": "string",
          "description": "For type=interest: the interaction event behind the item (pairing_created, phase_advanced, pairing_abandoned, pairing_closed, or rollup)."
        },
        "event_ids": {
          "type": "array",
          "items": {
            "type": "integer"
          },
          "description": "For type=interest: the interaction-ledger event ids to send to POST /api/interest-signals/{session_id}/ack. Empty for the ack_all rollup."
        }
      }
    }
  }
}