{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/floodbase/json-schema/floodbase-policy-with-details-schema.json",
  "title": "PolicyWithDetails",
  "x-generated": "2026-12-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/floodbase-openapi.json#/components/schemas/PolicyWithDetails",
  "properties": {
    "name": {
      "type": "string",
      "title": "Name"
    },
    "broker_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Broker Name"
    },
    "carrier_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Carrier Name"
    },
    "program_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Program Name"
    },
    "portfolio_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Portfolio Name"
    },
    "end_buyer_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "End Buyer Name"
    },
    "policy_limit": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Policy Limit"
    },
    "gross_written_premium": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Gross Written Premium"
    },
    "policy_metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Policy Metadata"
    },
    "policy_group_id": {
      "type": "integer",
      "title": "Policy Group Id"
    },
    "id": {
      "type": "integer",
      "title": "Id"
    },
    "lat_long": {
      "$ref": "#/$defs/GeojsonPointGeometry"
    },
    "has_ongoing_event": {
      "type": "boolean",
      "title": "Has Ongoing Event"
    },
    "has_under_validation_visible_event": {
      "type": "boolean",
      "title": "Has Under Validation Visible Event"
    },
    "most_recent_triggering_event_date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date"
        },
        {
          "type": "null"
        }
      ],
      "title": "Most Recent Triggering Event Date"
    },
    "triggering_event_count": {
      "type": "integer",
      "title": "Triggering Event Count"
    },
    "start_date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date"
        },
        {
          "type": "null"
        }
      ],
      "title": "Start Date"
    },
    "end_date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date"
        },
        {
          "type": "null"
        }
      ],
      "title": "End Date"
    },
    "show_payout_events": {
      "type": "boolean",
      "title": "Show Payout Events",
      "default": true
    },
    "show_thresholds": {
      "type": "boolean",
      "title": "Show Thresholds",
      "default": true
    },
    "show_legend": {
      "type": "boolean",
      "title": "Show Legend",
      "default": true
    },
    "show_events": {
      "type": "boolean",
      "title": "Show Events",
      "default": true
    },
    "event_window_length_in_days": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Event Window Length In Days"
    },
    "show_disclaimer": {
      "type": "boolean",
      "title": "Show Disclaimer",
      "default": true
    }
  },
  "type": "object",
  "required": [
    "name",
    "policy_group_id",
    "id",
    "lat_long",
    "has_ongoing_event",
    "has_under_validation_visible_event",
    "triggering_event_count"
  ],
  "$defs": {
    "GeojsonPointGeometry": {
      "properties": {
        "type": {
          "type": "string",
          "title": "Type"
        },
        "coordinates": {
          "items": {
            "type": "number"
          },
          "type": "array",
          "title": "Coordinates"
        }
      },
      "type": "object",
      "required": [
        "type",
        "coordinates"
      ],
      "title": "GeojsonPointGeometry"
    }
  }
}