{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$ref": "#/definitions/Classification",
  "definitions": {
    "Classification": {
      "type": "object",
      "properties": {
        "classCode": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "The classification or class code"
        },
        "exposure": {
          "$ref": "#/definitions/Quantity",
          "description": "Exposure measure for this classification"
        },
        "rate": {
          "type": "number",
          "description": "Rate applied to this classification"
        },
        "premium": {
          "$ref": "#/definitions/Money",
          "description": "Premium for this classification"
        },
        "location": {
          "$ref": "#/definitions/Reference",
          "description": "Location reference, if class is location-specific"
        },
        "description": {
          "type": "string",
          "description": "Description of operations at this classification"
        }
      },
      "required": [
        "classCode"
      ],
      "additionalProperties": false,
      "description": "A classification or class code within a coverage. Used to categorize exposure units, particularly in GL and WC.",
      "examples": [
        {
          "classCode": {
            "code": "91580",
            "display": "Machine Shop NOC"
          },
          "exposure": {
            "value": 1500000,
            "unit": "payroll"
          },
          "rate": 2.45,
          "premium": {
            "value": 36750,
            "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"
        }
      ]
    },
    "Quantity": {
      "type": "object",
      "properties": {
        "value": {
          "type": "number",
          "description": "Numeric value"
        },
        "unit": {
          "type": "string",
          "description": "Unit of measure (e.g. \"sqft\", \"vehicles\", \"employees\")"
        },
        "system": {
          "type": "string",
          "description": "Code system URI for the unit.",
          "format": "uri"
        },
        "code": {
          "type": "string",
          "description": "Coded form of the unit"
        }
      },
      "required": [
        "value"
      ],
      "additionalProperties": false,
      "description": "A quantity with a value and unit.",
      "examples": [
        {
          "value": 50000,
          "unit": "sqft"
        }
      ]
    },
    "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"
        }
      ]
    },
    "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"
        }
      ]
    }
  },
  "$id": "https://bind-standard.org/schema/Classification",
  "title": "Classification"
}
