{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$ref": "#/definitions/Quote",
  "definitions": {
    "Quote": {
      "type": "object",
      "properties": {
        "resourceType": {
          "type": "string",
          "const": "Quote",
          "description": "Fixed resource type discriminator"
        },
        "id": {
          "type": "string",
          "description": "Logical id of this resource. Assigned by the server or originating system."
        },
        "meta": {
          "$ref": "#/definitions/Meta",
          "description": "Metadata about the resource"
        },
        "status": {
          "type": "string",
          "enum": [
            "draft",
            "offered",
            "accepted",
            "rejected",
            "expired",
            "bound",
            "superseded"
          ],
          "description": "Current status of the quote.\n\n- `draft` — Being prepared by the underwriter\n- `offered` — Sent to the broker as a formal offer\n- `accepted` — Broker/insured has accepted the quote\n- `rejected` — Broker/insured has declined the quote\n- `expired` — Quote validity period has passed\n- `bound` — Quote has been bound into a policy\n- `superseded` — Replaced by a newer version of the quote"
        },
        "submission": {
          "$ref": "#/definitions/Reference",
          "description": "Reference to the submission that triggered this quote"
        },
        "insured": {
          "$ref": "#/definitions/Reference",
          "description": "Reference to the insured entity"
        },
        "carrier": {
          "$ref": "#/definitions/Reference",
          "description": "Reference to the quoting carrier"
        },
        "underwriter": {
          "$ref": "#/definitions/Reference",
          "description": "Reference to the underwriter who prepared this quote"
        },
        "proposedEffective": {
          "$ref": "#/definitions/Period",
          "description": "Proposed policy effective period"
        },
        "totalPremium": {
          "$ref": "#/definitions/Money",
          "description": "Total annual premium for all coverages."
        },
        "premiumBreakdown": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PremiumLineItem"
          },
          "description": "Breakdown of premium by line of business"
        },
        "quoteDate": {
          "type": "string",
          "description": "Date/time the quote was issued.",
          "format": "date-time"
        },
        "validUntil": {
          "type": "string",
          "description": "Date after which this quote is no longer valid.",
          "format": "date"
        },
        "subjectivities": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Subjectivity"
          },
          "description": "Conditions or subjectivities that must be met before binding"
        },
        "termsAndConditions": {
          "type": "string",
          "description": "Free-text terms, conditions, or exclusions"
        },
        "resultingPolicy": {
          "$ref": "#/definitions/Reference",
          "description": "Reference to the resulting policy, if bound"
        },
        "version": {
          "type": "number",
          "description": "Quote version number. Incremented when the quote is revised.",
          "minimum": 1
        },
        "risks": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Reference"
          },
          "description": "References to Risk resources included in this quote"
        }
      },
      "required": [
        "carrier",
        "insured",
        "resourceType",
        "status"
      ],
      "additionalProperties": false,
      "description": "A quote represents a carrier's offer to provide insurance coverage at a specified premium. Quotes are produced in response to a Submission and contain the proposed terms, pricing, and conditions.",
      "examples": [
        {
          "resourceType": "Quote",
          "id": "qt-2025-042",
          "status": "offered",
          "submission": {
            "reference": "Submission/sub-2025-001"
          },
          "insured": {
            "reference": "Insured/ins-001",
            "display": "Acme Manufacturing Corp"
          },
          "carrier": {
            "reference": "Organization/carrier-200",
            "display": "Hartford Financial"
          },
          "proposedEffective": {
            "start": "2025-07-01",
            "end": "2026-07-01"
          },
          "totalPremium": {
            "value": 85000,
            "currency": "USD"
          },
          "quoteDate": "2025-05-01T14:30:00Z",
          "validUntil": "2025-06-15"
        }
      ]
    },
    "Meta": {
      "type": "object",
      "properties": {
        "versionId": {
          "type": "string",
          "description": "Version-specific identifier for this resource version. Changes each time the resource is updated."
        },
        "lastUpdated": {
          "type": "string",
          "description": "When this resource was last updated.",
          "format": "date-time"
        },
        "source": {
          "type": "string",
          "description": "URI identifying the originating system that created or last modified this resource.",
          "format": "uri"
        },
        "tag": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Coding"
          },
          "description": "Security or access control tags"
        }
      },
      "additionalProperties": false,
      "description": "Metadata about a resource instance. Tracks versioning, provenance, and timestamps."
    },
    "Coding": {
      "type": "object",
      "properties": {
        "system": {
          "type": "string",
          "description": "The code system URI that defines the code.",
          "format": "uri"
        },
        "code": {
          "type": "string",
          "description": "The code value from the code system"
        },
        "display": {
          "type": "string",
          "description": "Human-readable display text for the code"
        }
      },
      "required": [
        "code"
      ],
      "additionalProperties": false,
      "description": "A coded value from a defined code system. Used throughout BIND for standardized enumerations.",
      "examples": [
        {
          "system": "https://bind.codes/line-of-business",
          "code": "GL",
          "display": "General Liability"
        }
      ]
    },
    "Reference": {
      "type": "object",
      "properties": {
        "reference": {
          "type": "string",
          "description": "Relative or absolute reference to another resource. Format: `{ResourceType}/{id}` for relative references."
        },
        "type": {
          "type": "string",
          "description": "The resource type being referenced"
        },
        "display": {
          "type": "string",
          "description": "Text alternative for the reference (e.g. display name)"
        }
      },
      "additionalProperties": false,
      "description": "A reference from one BIND resource to another.",
      "examples": [
        {
          "reference": "Insured/ins-789",
          "display": "Acme Corp"
        }
      ]
    },
    "Period": {
      "type": "object",
      "properties": {
        "start": {
          "type": "string",
          "description": "Start of the period (inclusive).",
          "format": "date"
        },
        "end": {
          "type": "string",
          "description": "End of the period (inclusive).",
          "format": "date"
        }
      },
      "additionalProperties": false,
      "description": "A time period defined by a start and/or end date. Used for policy terms, coverage periods, etc.",
      "examples": [
        {
          "start": "2025-01-01",
          "end": "2026-01-01"
        }
      ]
    },
    "Money": {
      "type": "object",
      "properties": {
        "value": {
          "type": "number",
          "description": "Numeric amount. Represented as a number; precision should be maintained by the consuming system."
        },
        "currency": {
          "type": "string",
          "description": "ISO 4217 currency code.",
          "default": "USD"
        }
      },
      "required": [
        "value"
      ],
      "additionalProperties": false,
      "description": "A monetary amount with currency.",
      "examples": [
        {
          "value": 1000000,
          "currency": "USD"
        }
      ]
    },
    "PremiumLineItem": {
      "type": "object",
      "properties": {
        "lineOfBusiness": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Line of business this premium applies to."
        },
        "premium": {
          "$ref": "#/definitions/Money",
          "description": "Premium amount for this line"
        },
        "rateBasis": {
          "type": "string",
          "description": "Rate basis description (e.g. \"per $1,000 of payroll\")"
        },
        "rate": {
          "type": "number",
          "description": "The rate applied"
        },
        "exposureBase": {
          "type": "number",
          "description": "Exposure base value (e.g. total payroll, total sales)"
        }
      },
      "required": [
        "lineOfBusiness",
        "premium"
      ],
      "additionalProperties": false,
      "description": "A premium line item breaking down the cost by coverage line."
    },
    "CodeableConcept": {
      "type": "object",
      "properties": {
        "coding": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Coding"
          },
          "description": "Code(s) from formal code systems"
        },
        "text": {
          "type": "string",
          "description": "Plain text representation of the concept"
        }
      },
      "additionalProperties": false,
      "description": "A concept with a coding and optional text. Wraps one or more Coding values with a human-readable summary."
    },
    "Subjectivity": {
      "type": "object",
      "properties": {
        "description": {
          "type": "string",
          "description": "Description of what must be done or provided"
        },
        "type": {
          "type": "string",
          "enum": [
            "pre-bind",
            "post-bind"
          ],
          "description": "Whether this must be resolved before or after binding"
        },
        "status": {
          "type": "string",
          "enum": [
            "outstanding",
            "satisfied",
            "waived"
          ],
          "description": "Current status of the subjectivity"
        },
        "dueDate": {
          "type": "string",
          "description": "Deadline for satisfying this subjectivity.",
          "format": "date"
        }
      },
      "required": [
        "description",
        "type",
        "status"
      ],
      "additionalProperties": false,
      "description": "A condition that must be satisfied before a quote can be bound. Common in insurance — e.g., \"Provide updated loss runs\" or \"Install fire suppression system within 90 days.\"",
      "examples": [
        {
          "description": "Provide audited financial statements for last 3 years",
          "type": "pre-bind",
          "status": "outstanding"
        }
      ]
    }
  },
  "$id": "https://bind-standard.org/schema/Quote",
  "title": "Quote"
}
