{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ctlsurf-com/json-schema/ctlsurf-com-organization-contribution-report-schema.json",
  "title": "OrganizationContributionReport",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ctlsurf-com-reports-api-openapi.yml#/components/schemas/OrganizationContributionReport",
  "properties": {
    "organization": {
      "$ref": "#/$defs/ReportingOrganization"
    },
    "period": {
      "$ref": "#/$defs/ReportingPeriod"
    },
    "members": {
      "items": {
        "$ref": "#/$defs/ReportingMember"
      },
      "type": "array",
      "title": "Members"
    },
    "projects": {
      "items": {
        "$ref": "#/$defs/ReportingProject"
      },
      "type": "array",
      "title": "Projects"
    },
    "rows": {
      "items": {
        "$ref": "#/$defs/MemberContributions"
      },
      "type": "array",
      "title": "Rows"
    },
    "totals": {
      "$ref": "#/$defs/ContributionMetrics"
    }
  },
  "type": "object",
  "required": [
    "organization",
    "period",
    "members",
    "projects",
    "rows",
    "totals"
  ],
  "$defs": {
    "ContributionMetrics": {
      "properties": {
        "total_minutes": {
          "type": "number",
          "title": "Total Minutes",
          "default": 0
        },
        "session_count": {
          "type": "integer",
          "title": "Session Count",
          "default": 0
        },
        "contribution_count": {
          "type": "integer",
          "title": "Contribution Count",
          "default": 0
        },
        "tasks_created": {
          "type": "integer",
          "title": "Tasks Created",
          "default": 0
        },
        "tasks_completed": {
          "type": "integer",
          "title": "Tasks Completed",
          "default": 0
        },
        "notes_added": {
          "type": "integer",
          "title": "Notes Added",
          "default": 0
        },
        "human_contributions": {
          "type": "integer",
          "title": "Human Contributions",
          "default": 0
        },
        "agent_contributions": {
          "type": "integer",
          "title": "Agent Contributions",
          "default": 0
        },
        "last_active_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Last Active At"
        }
      },
      "type": "object",
      "title": "ContributionMetrics"
    },
    "MemberContributions": {
      "properties": {
        "total_minutes": {
          "type": "number",
          "title": "Total Minutes",
          "default": 0
        },
        "session_count": {
          "type": "integer",
          "title": "Session Count",
          "default": 0
        },
        "contribution_count": {
          "type": "integer",
          "title": "Contribution Count",
          "default": 0
        },
        "tasks_created": {
          "type": "integer",
          "title": "Tasks Created",
          "default": 0
        },
        "tasks_completed": {
          "type": "integer",
          "title": "Tasks Completed",
          "default": 0
        },
        "notes_added": {
          "type": "integer",
          "title": "Notes Added",
          "default": 0
        },
        "human_contributions": {
          "type": "integer",
          "title": "Human Contributions",
          "default": 0
        },
        "agent_contributions": {
          "type": "integer",
          "title": "Agent Contributions",
          "default": 0
        },
        "last_active_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Last Active At"
        },
        "user_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "User Id"
        },
        "email": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Email"
        },
        "role": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Role"
        },
        "seat_status": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Seat Status"
        }
      },
      "type": "object",
      "title": "MemberContributions"
    },
    "ReportingMember": {
      "properties": {
        "user_id": {
          "type": "string",
          "format": "uuid",
          "title": "User Id"
        },
        "email": {
          "type": "string",
          "title": "Email"
        },
        "role": {
          "type": "string",
          "title": "Role"
        },
        "seat_status": {
          "type": "string",
          "title": "Seat Status"
        }
      },
      "type": "object",
      "required": [
        "user_id",
        "email",
        "role",
        "seat_status"
      ],
      "title": "ReportingMember"
    },
    "ReportingOrganization": {
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "role": {
          "type": "string",
          "title": "Role"
        }
      },
      "type": "object",
      "required": [
        "id",
        "name",
        "role"
      ],
      "title": "ReportingOrganization"
    },
    "ReportingPeriod": {
      "properties": {
        "start": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Start"
        },
        "end": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "End"
        }
      },
      "type": "object",
      "title": "ReportingPeriod"
    },
    "ReportingProject": {
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "name": {
          "type": "string",
          "title": "Name"
        }
      },
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "title": "ReportingProject"
    }
  }
}