{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$ref": "#/definitions/Organization",
  "definitions": {
    "Organization": {
      "type": "object",
      "properties": {
        "resourceType": {
          "type": "string",
          "const": "Organization",
          "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": [
            "active",
            "inactive"
          ],
          "description": "Whether this organization record is active"
        },
        "name": {
          "type": "string",
          "description": "Official name of the organization"
        },
        "type": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Type of organization in the insurance ecosystem. Common types: carrier, broker, mga, tpa, reinsurer, surplus-lines-broker"
        },
        "naic": {
          "$ref": "#/definitions/Coding",
          "description": "NAIC (National Association of Insurance Commissioners) company code. Uniquely identifies insurance companies in the US."
        },
        "fein": {
          "$ref": "#/definitions/Coding",
          "description": "FEIN (Federal Employer Identification Number)."
        },
        "amBestRating": {
          "$ref": "#/definitions/Coding",
          "description": "AM Best financial strength rating"
        },
        "spRating": {
          "$ref": "#/definitions/Coding",
          "description": "S&P financial strength rating"
        },
        "address": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Address"
          },
          "description": "Physical and mailing addresses"
        },
        "contact": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ContactPoint"
          },
          "description": "Contact information"
        },
        "licensedStates": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "States in which this carrier is licensed to write business"
        },
        "linesOfBusiness": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CodeableConcept"
          },
          "description": "Lines of business this organization writes or handles."
        },
        "admittedStatus": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Whether this is an admitted or non-admitted (surplus lines) carrier."
        },
        "partOf": {
          "$ref": "#/definitions/Reference",
          "description": "Reference to a parent organization"
        },
        "financialRatings": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/FinancialRating"
          },
          "description": "Structured financial strength ratings (supersedes amBestRating, spRating for richer detail)"
        },
        "appointments": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CarrierAppointment"
          },
          "description": "Carrier appointments for brokers and MGAs"
        },
        "eAndOPolicy": {
          "$ref": "#/definitions/Reference",
          "description": "Reference to the broker's E&O policy"
        },
        "entityType": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Business entity type (LLC, Corp, Mutual, Reciprocal, etc.)"
        },
        "organizationLevel": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Organizational hierarchy level."
        },
        "specialties": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/InsuranceSpecialty"
          },
          "description": "Insurance specialties and lines of business for departments"
        },
        "licenses": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/License"
          },
          "description": "Insurance licenses held by this organization"
        },
        "territories": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Geographic territories where this organization operates (supersedes licensedStates for richer detail)"
        },
        "bindingAuthority": {
          "type": "object",
          "properties": {
            "maxPremium": {
              "$ref": "#/definitions/Money",
              "description": "Maximum premium amount this organization can bind"
            },
            "maxLimit": {
              "$ref": "#/definitions/Money",
              "description": "Maximum limit of insurance this organization can bind"
            },
            "linesOfBusiness": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/CodeableConcept"
              },
              "description": "Lines of business this organization can bind."
            }
          },
          "additionalProperties": false,
          "description": "Binding authority limits for MGAs and delegated underwriting authorities"
        }
      },
      "required": [
        "name",
        "resourceType",
        "status",
        "type"
      ],
      "additionalProperties": false,
      "description": "An organization involved in the insurance ecosystem. This includes carriers, brokers, MGAs, TPAs, reinsurers, and other entities.",
      "examples": [
        {
          "resourceType": "Organization",
          "id": "org-carrier-200",
          "status": "active",
          "name": "Hartford Financial Services",
          "type": {
            "coding": [
              {
                "code": "carrier",
                "display": "Insurance Carrier"
              }
            ]
          },
          "naic": {
            "code": "29459",
            "display": "Hartford Fire Insurance Company"
          },
          "amBestRating": {
            "code": "A+",
            "display": "Superior"
          },
          "address": [
            {
              "line": [
                "One Hartford Plaza"
              ],
              "city": "Hartford",
              "state": "CT",
              "postalCode": "06155"
            }
          ]
        }
      ]
    },
    "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"
        }
      ]
    },
    "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."
    },
    "Address": {
      "type": "object",
      "properties": {
        "use": {
          "type": "string",
          "enum": [
            "work",
            "mailing",
            "billing",
            "loss-location",
            "home",
            "old"
          ],
          "description": "Purpose of this address"
        },
        "type": {
          "type": "string",
          "enum": [
            "postal",
            "physical",
            "both"
          ],
          "description": "The type of address (postal, physical, or both)"
        },
        "text": {
          "type": "string",
          "description": "Full unstructured text representation of the address"
        },
        "line": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Street address lines"
        },
        "city": {
          "type": "string",
          "description": "City or municipality"
        },
        "district": {
          "type": "string",
          "description": "County or district. Critical for insurance rating territories and jurisdiction determination."
        },
        "state": {
          "type": "string",
          "description": "State, province, or region"
        },
        "postalCode": {
          "type": "string",
          "description": "Postal / ZIP code"
        },
        "country": {
          "type": "string",
          "description": "ISO 3166-1 alpha-2 country code.",
          "default": "US"
        },
        "period": {
          "$ref": "#/definitions/Period",
          "description": "Period during which this address was/is in use"
        },
        "geoPoint": {
          "$ref": "#/definitions/GeoPoint",
          "description": "Geographic coordinates of this address"
        }
      },
      "additionalProperties": false,
      "description": "A physical or mailing address.",
      "examples": [
        {
          "use": "work",
          "type": "both",
          "line": [
            "123 Main St",
            "Suite 400"
          ],
          "city": "Hartford",
          "state": "CT",
          "postalCode": "06103",
          "country": "US",
          "district": "Hartford County"
        }
      ]
    },
    "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"
        }
      ]
    },
    "GeoPoint": {
      "type": "object",
      "properties": {
        "latitude": {
          "type": "number",
          "description": "Latitude in decimal degrees.",
          "minimum": -90,
          "maximum": 90
        },
        "longitude": {
          "type": "number",
          "description": "Longitude in decimal degrees.",
          "minimum": -180,
          "maximum": 180
        },
        "altitude": {
          "type": "number",
          "description": "Altitude in meters above sea level"
        }
      },
      "required": [
        "latitude",
        "longitude"
      ],
      "additionalProperties": false,
      "description": "A geographic point in WGS84 coordinates. Used for precise location of insured properties, loss locations, etc."
    },
    "ContactPoint": {
      "type": "object",
      "properties": {
        "system": {
          "type": "string",
          "enum": [
            "phone",
            "fax",
            "email",
            "url"
          ],
          "description": "The type of contact point"
        },
        "value": {
          "type": "string",
          "description": "The actual contact value (phone number, email address, etc.)"
        },
        "use": {
          "type": "string",
          "enum": [
            "work",
            "home",
            "mobile"
          ],
          "description": "Purpose of this contact point"
        }
      },
      "required": [
        "value"
      ],
      "additionalProperties": false,
      "description": "Contact information for a person or organization."
    },
    "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"
        }
      ]
    },
    "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"
        }
      ]
    },
    "CarrierAppointment": {
      "type": "object",
      "properties": {
        "carrier": {
          "$ref": "#/definitions/Reference",
          "description": "Reference to the carrier organization"
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "inactive",
            "pending",
            "terminated"
          ],
          "description": "Current status of the appointment"
        },
        "linesOfBusiness": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CodeableConcept"
          },
          "description": "Lines of business authorized under this appointment."
        },
        "effectivePeriod": {
          "$ref": "#/definitions/Period",
          "description": "Period during which this appointment is/was effective"
        },
        "commissionType": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Type of commission arrangement under this appointment."
        }
      },
      "required": [
        "carrier",
        "status"
      ],
      "additionalProperties": false,
      "description": "An appointment between a broker/MGA and a carrier. Tracks which carriers an agency is authorized to write business with.",
      "examples": [
        {
          "carrier": {
            "reference": "Organization/carrier-200",
            "display": "Hartford"
          },
          "status": "active",
          "linesOfBusiness": [
            {
              "coding": [
                {
                  "code": "GL"
                }
              ]
            }
          ]
        }
      ]
    },
    "InsuranceSpecialty": {
      "type": "object",
      "properties": {
        "line": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Primary line of business (GL, Property, WC, Auto, etc.)"
        },
        "subLine": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Sub-line or coverage part (Products/Completed Ops, Premises, etc.)"
        },
        "ratingBureau": {
          "$ref": "#/definitions/Coding",
          "description": "Rating bureau or advisory organization (ISO, NCCI, AAIS)."
        },
        "formNumber": {
          "type": "string",
          "description": "Standard form number (e.g., CG 00 01, CP 00 10)"
        },
        "program": {
          "type": "string",
          "description": "Named program, if applicable"
        }
      },
      "required": [
        "line"
      ],
      "additionalProperties": false,
      "description": "A specialty or line-of-business classification. Describes the specific insurance products, forms, and rating bureaus associated with a coverage, department, or person's expertise.",
      "examples": [
        {
          "line": {
            "coding": [
              {
                "code": "GL",
                "display": "General Liability"
              }
            ]
          },
          "ratingBureau": {
            "code": "ISO",
            "display": "Insurance Services Office"
          },
          "formNumber": "CG 00 01"
        }
      ]
    },
    "License": {
      "type": "object",
      "properties": {
        "state": {
          "type": "string",
          "description": "State or jurisdiction of the license (two-letter state code)"
        },
        "licenseNumber": {
          "type": "string",
          "description": "License number assigned by the state"
        },
        "lineOfAuthority": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Line of authority covered by this license."
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "inactive",
            "expired",
            "suspended",
            "revoked"
          ],
          "description": "Current status of the license"
        },
        "expirationDate": {
          "type": "string",
          "description": "License expiration date.",
          "format": "date"
        },
        "issueDate": {
          "type": "string",
          "description": "Date the license was issued.",
          "format": "date"
        }
      },
      "required": [
        "state",
        "licenseNumber",
        "status"
      ],
      "additionalProperties": false,
      "description": "An insurance license held by a person. Tracks state-level licensing, lines of authority, and license status.",
      "examples": [
        {
          "state": "CT",
          "licenseNumber": "LIC-2345678",
          "status": "active",
          "lineOfAuthority": {
            "text": "Property & Casualty"
          },
          "expirationDate": "2026-12-31"
        }
      ]
    },
    "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"
        }
      ]
    }
  },
  "$id": "https://bind-standard.org/schema/Organization",
  "title": "Organization"
}
