{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://cover-desk.pages.dev/open-cover/schemas/quote-offer.json",
  "title": "Open Cover 0.1: quote-offer",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "profile",
    "ok",
    "insurer",
    "product",
    "quote_id",
    "currency",
    "premium",
    "excesses",
    "total_excess_this_driver",
    "benefits",
    "exclusions",
    "valid_until",
    "assumptions"
  ],
  "properties": {
    "profile": {
      "type": "string",
      "enum": [
        "open-cover/0.1"
      ]
    },
    "ok": {
      "type": "boolean",
      "enum": [
        true
      ]
    },
    "insurer": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "product": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "quote_id": {
      "type": "string",
      "minLength": 4,
      "maxLength": 24
    },
    "currency": {
      "type": "string",
      "minLength": 3,
      "maxLength": 3
    },
    "premium": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "monthly",
        "annual",
        "basis"
      ],
      "properties": {
        "monthly": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000
        },
        "annual": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000
        },
        "basis": {
          "type": "string",
          "minLength": 1,
          "maxLength": 300
        }
      }
    },
    "excesses": {
      "type": "array",
      "minItems": 1,
      "maxItems": 12,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "situation",
          "amount",
          "applies_to_this_driver",
          "clause"
        ],
        "properties": {
          "situation": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "amount": {
            "type": "number",
            "minimum": 0,
            "maximum": 1000000
          },
          "applies_to_this_driver": {
            "type": "boolean"
          },
          "clause": {
            "type": "string",
            "minLength": 1,
            "maxLength": 12
          }
        }
      }
    },
    "total_excess_this_driver": {
      "type": "number",
      "minimum": 0,
      "maximum": 1000000
    },
    "benefits": {
      "type": "array",
      "minItems": 0,
      "maxItems": 12,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "included",
          "detail",
          "clause"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "included": {
            "type": "boolean"
          },
          "detail": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "clause": {
            "type": "string",
            "minLength": 1,
            "maxLength": 12
          }
        }
      }
    },
    "exclusions": {
      "type": "array",
      "minItems": 0,
      "maxItems": 12,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "summary",
          "relevant_to_this_driver",
          "clause"
        ],
        "properties": {
          "summary": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "relevant_to_this_driver": {
            "type": "boolean"
          },
          "clause": {
            "type": "string",
            "minLength": 1,
            "maxLength": 12
          }
        }
      }
    },
    "valid_until": {
      "type": "string",
      "format": "date"
    },
    "assumptions": {
      "type": "array",
      "minItems": 0,
      "maxItems": 8,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
      }
    }
  }
}
