{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/asap-cool/json-schema/asap-cool-agenda-item-view-schema.json",
  "title": "AgendaItemView",
  "description": "One item of the agenda.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/asap-cool-calendar-api-openapi.yml#/components/schemas/AgendaItemView",
  "type": "object",
  "required": [
    "source",
    "id",
    "start",
    "all_day",
    "busy",
    "recurring"
  ],
  "properties": {
    "all_day": {
      "type": "boolean",
      "description": "Whether the item spans whole days."
    },
    "busy": {
      "type": "boolean",
      "description": "Someone else's private event: a busy slot, nothing more."
    },
    "contact_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Contact reached."
    },
    "deal_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Deal concerned."
    },
    "document_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Invoice document concerned."
    },
    "end": {
      "type": [
        "string",
        "null"
      ],
      "description": "RFC3339 instant, or `YYYY-MM-DD` (exclusive) when `all_day`; `null`\nfor a point in time."
    },
    "envelope_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Signature envelope concerned."
    },
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id of the row in its source table."
    },
    "kind": {
      "type": [
        "string",
        "null"
      ],
      "description": "Source-specific kind (event kind, reminder kind, deal stage, …)."
    },
    "occurrence_start": {
      "type": [
        "string",
        "null"
      ],
      "description": "For an event occurrence: its identity in the series (RFC3339)."
    },
    "owner_user_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Owner or assignee."
    },
    "recurring": {
      "type": "boolean",
      "description": "Whether the item belongs to a recurring series."
    },
    "recurring_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Recurring invoice template concerned."
    },
    "reschedule": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/RescheduleView",
          "description": "How to move it, or `null` when it cannot be moved from the agenda."
        }
      ]
    },
    "source": {
      "type": "string",
      "description": "`event`, `task`, `deal`, `reminder`, `scheduled_send`, `quote`,\n`invoice`, `recurring` or `envelope`."
    },
    "start": {
      "type": "string",
      "description": "RFC3339 instant, or `YYYY-MM-DD` when `all_day`."
    },
    "title": {
      "type": [
        "string",
        "null"
      ],
      "description": "Label; `null` for someone else's private event."
    }
  },
  "$defs": {
    "RescheduleView": {
      "type": "object",
      "description": "How to move an item, through the route of the module that owns it.",
      "required": [
        "method",
        "path",
        "granularity"
      ],
      "properties": {
        "granularity": {
          "type": "string",
          "description": "`datetime` (an instant) or `date` (a civil day)."
        },
        "method": {
          "type": "string",
          "description": "HTTP method."
        },
        "path": {
          "type": "string",
          "description": "Path, ids filled in."
        }
      }
    }
  }
}