{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$ref": "#/definitions/Deductible",
  "definitions": {
    "Deductible": {
      "type": "object",
      "properties": {
        "amount": {
          "$ref": "#/definitions/Money",
          "description": "The deductible amount (required for fixed-amount deductibles, optional for percentage-based)"
        },
        "type": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "How the deductible applies."
        },
        "application": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "How loss adjustment expenses (ALAE/LAE) interact with the deductible."
        },
        "isSIR": {
          "type": "boolean",
          "description": "Whether this is a Self-Insured Retention (SIR) rather than a traditional deductible. SIRs require the insured to handle claims within the retention before the carrier responds."
        },
        "aggregateAmount": {
          "$ref": "#/definitions/Money",
          "description": "Aggregate cap on deductible obligations in a policy period"
        },
        "corridorPercentage": {
          "type": "number",
          "description": "Corridor percentage (used in corridor deductible structures). Expressed as a percentage of the loss amount."
        },
        "franchiseAmount": {
          "$ref": "#/definitions/Money",
          "description": "Franchise deductible threshold — losses below this are fully retained; above, fully covered"
        },
        "disappearingThreshold": {
          "$ref": "#/definitions/Money",
          "description": "Disappearing deductible threshold — deductible phases out above this loss amount"
        },
        "percentage": {
          "type": "number",
          "description": "Percentage-based deductible (e.g., 2% hurricane deductible).",
          "minimum": 0,
          "maximum": 100
        },
        "percentageBasis": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "What the percentage is applied to (e.g., \"Coverage A dwelling value\", \"total insured value\")"
        },
        "description": {
          "type": "string",
          "description": "Free-text description of deductible terms"
        }
      },
      "required": [
        "type"
      ],
      "additionalProperties": false,
      "description": "A structured deductible definition for a coverage section. Replaces the inline `Money` deductible and separate `deductibleType` fields, capturing the full complexity of insurance deductible structures including SIRs, corridors, franchises, and disappearing deductibles.",
      "examples": [
        {
          "amount": {
            "value": 25000,
            "currency": "USD"
          },
          "type": "per-occurrence",
          "application": "loss-only",
          "isSIR": false,
          "aggregateAmount": {
            "value": 100000,
            "currency": "USD"
          }
        }
      ]
    },
    "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"
        }
      ]
    },
    "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."
    },
    "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"
        }
      ]
    }
  },
  "$id": "https://bind-standard.org/schema/Deductible",
  "title": "Deductible"
}
