{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/asap-cool/json-schema/asap-cool-previews-view-schema.json",
  "title": "PreviewsView",
  "description": "The locked preview of the org.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/asap-cool-automation-api-openapi.yml#/components/schemas/PreviewsView",
  "type": "object",
  "required": [
    "locked",
    "previews",
    "count_cap"
  ],
  "properties": {
    "count_cap": {
      "type": "integer",
      "format": "int32",
      "description": "A counter equal to this value means \"at least this many\": it is the room\nof an org with no open proposal, the most a first scan would raise.",
      "minimum": 0
    },
    "locked": {
      "type": "boolean",
      "description": "`true` on Starter, where the counters below are given and nothing is\nprepared; `false` on a plan that prepares proposals (no counter then)."
    },
    "previews": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PreviewCountView"
      },
      "description": "One counter per previewed kind, in display order. Empty unless `locked`."
    }
  },
  "$defs": {
    "PreviewCountView": {
      "type": "object",
      "description": "One counter of the locked preview.",
      "required": [
        "action_kind",
        "count"
      ],
      "properties": {
        "action_kind": {
          "type": "string",
          "description": "The action kind the counter belongs to (`invoice_overdue_reminder` or\n`quote_expiring_task`)."
        },
        "count": {
          "type": "integer",
          "format": "int32",
          "description": "How many proposals of this kind a plan that prepares them would have\nraised. Never above `count_cap`.",
          "minimum": 0
        }
      }
    }
  }
}