{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$ref": "#/definitions/FinancialRating",
  "definitions": {
    "FinancialRating": {
      "type": "object",
      "properties": {
        "agency": {
          "$ref": "#/definitions/Coding",
          "description": "Rating agency (am-best, sp, moodys, fitch)."
        },
        "rating": {
          "type": "string",
          "description": "The rating value (e.g., \"A+\", \"AA-\", \"Aa3\")"
        },
        "outlook": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Rating outlook."
        },
        "financialSizeCategory": {
          "type": "string",
          "description": "AM Best Financial Size Category (I through XV)"
        },
        "effectiveDate": {
          "type": "string",
          "description": "Date the rating was issued or last affirmed.",
          "format": "date"
        }
      },
      "required": [
        "agency",
        "rating"
      ],
      "additionalProperties": false,
      "description": "A financial strength rating from a recognized rating agency. Supersedes inline `Coding` fields like `amBestRating` and `spRating` on Organization, providing richer context including outlook and effective date.",
      "examples": [
        {
          "agency": {
            "code": "am-best",
            "display": "A.M. Best"
          },
          "rating": "A+",
          "outlook": "stable",
          "financialSizeCategory": "XV",
          "effectiveDate": "2025-01-15"
        }
      ]
    },
    "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"
        }
      ]
    },
    "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."
    }
  },
  "$id": "https://bind-standard.org/schema/FinancialRating",
  "title": "FinancialRating"
}
