{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fareeqy-com/json-schema/fareeqy-com-task-collection-schema.json",
  "title": "TaskCollection",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fareeqy-com-tasks-api-openapi.yml#/components/schemas/TaskCollection",
  "allOf": [
    {
      "$ref": "#/$defs/CollectionMeta"
    },
    {
      "type": "object",
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Task"
          }
        }
      }
    }
  ],
  "$defs": {
    "CollectionMeta": {
      "type": "object",
      "properties": {
        "meta": {
          "type": "object",
          "properties": {
            "total": {
              "type": "integer",
              "description": "The full unfiltered count."
            },
            "limit": {
              "type": "integer"
            },
            "offset": {
              "type": "integer"
            },
            "count": {
              "type": "integer",
              "description": "Records in the returned page."
            }
          }
        }
      }
    },
    "Task": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The task ref. A slug is still accepted anywhere this is passed back."
        },
        "url": {
          "type": [
            "string",
            "null"
          ],
          "description": "Absolute address of the page a person opens in فريقي."
        },
        "title": {
          "type": "string"
        },
        "notes": {
          "type": [
            "string",
            "null"
          ],
          "description": "Plain-text rendering of the rich-text notes."
        },
        "completed": {
          "type": "boolean"
        },
        "completed_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "due_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date",
          "description": "Due DATE (no time component)."
        },
        "time_spent_minutes": {
          "type": [
            "integer",
            "null"
          ],
          "description": "How long the task took, in whole minutes. Always present, null when nobody has measured it — null is not zero. Reading it is ungated; writing needs a plan that carries time tracking."
        },
        "project_slug": {
          "type": "string",
          "description": "The project ref. Named _slug for compatibility."
        },
        "task_list_slug": {
          "type": "string",
          "description": "The task-list ref. Named _slug for compatibility."
        },
        "assignee": {
          "oneOf": [
            {
              "$ref": "#/$defs/UserRef"
            },
            {
              "type": "null"
            }
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "UserRef": {
      "type": "object",
      "description": "A user reference — name for humans, email as the write handle.",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string",
          "format": "email"
        }
      }
    }
  }
}