{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$ref": "#/definitions/Location",
  "definitions": {
    "Location": {
      "type": "object",
      "properties": {
        "resourceType": {
          "type": "string",
          "const": "Location",
          "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 location is currently active/insured"
        },
        "name": {
          "type": "string",
          "description": "Descriptive name for this location"
        },
        "address": {
          "$ref": "#/definitions/Address",
          "description": "Physical address of the location"
        },
        "occupancy": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Type of occupancy at this location."
        },
        "constructionType": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Construction type (frame, masonry, fire-resistive, etc.)"
        },
        "yearBuilt": {
          "type": "number",
          "description": "Year the building was constructed.",
          "minimum": 1600,
          "maximum": 2100
        },
        "yearRenovated": {
          "type": "number",
          "description": "Year of last major renovation, if applicable.",
          "minimum": 1600,
          "maximum": 2100
        },
        "squareFootage": {
          "$ref": "#/definitions/Quantity",
          "description": "Total square footage"
        },
        "stories": {
          "type": "number",
          "description": "Number of stories"
        },
        "buildingValue": {
          "$ref": "#/definitions/Money",
          "description": "Insured value of the building/structure"
        },
        "contentsValue": {
          "$ref": "#/definitions/Money",
          "description": "Insured value of contents/inventory"
        },
        "businessIncomeValue": {
          "$ref": "#/definitions/Money",
          "description": "Business income / business interruption value"
        },
        "protectionClass": {
          "type": "string",
          "description": "Protection class (ISO fire protection rating)"
        },
        "sprinklered": {
          "type": "boolean",
          "description": "Whether the location has fire sprinklers"
        },
        "fireAlarm": {
          "type": "boolean",
          "description": "Whether the location has a fire alarm system"
        },
        "securitySystem": {
          "type": "boolean",
          "description": "Whether the location has a security system"
        },
        "distanceToFireStation": {
          "type": "number",
          "description": "Distance to nearest fire station in miles"
        },
        "distanceToHydrant": {
          "type": "number",
          "description": "Distance to nearest fire hydrant in feet"
        },
        "floodZone": {
          "type": "string",
          "description": "Flood zone designation (e.g., Zone A, Zone X)"
        },
        "windExposed": {
          "type": "boolean",
          "description": "Whether the location is in a wind/hurricane-prone area"
        },
        "insured": {
          "$ref": "#/definitions/Reference",
          "description": "Reference to the insured who owns/occupies this location"
        },
        "policy": {
          "$ref": "#/definitions/Reference",
          "description": "Reference to the policy covering this location"
        },
        "values": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AssetValuation"
          },
          "description": "Structured asset valuations for this location. Supersedes buildingValue, contentsValue, businessIncomeValue for richer detail including valuation method and provenance."
        },
        "dwellingType": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Type of dwelling at this location."
        },
        "roofType": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Roof material type."
        },
        "roofYear": {
          "type": "number",
          "description": "Year the roof was installed or last replaced.",
          "minimum": 1600,
          "maximum": 2100
        },
        "roofShape": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Roof shape (gable, hip, flat, mansard, gambrel)."
        },
        "plumbingType": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Plumbing material type (copper, PVC, PEX, galvanized, polybutylene)."
        },
        "plumbingYear": {
          "type": "number",
          "description": "Year the plumbing was installed or last updated.",
          "minimum": 1600,
          "maximum": 2100
        },
        "heatingType": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Heating system type (forced-air, radiant, heat-pump, boiler, electric)."
        },
        "heatingYear": {
          "type": "number",
          "description": "Year the heating system was installed or last updated.",
          "minimum": 1600,
          "maximum": 2100
        },
        "electricalType": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Electrical system type (circuit-breaker, fuse-box + amperage)."
        },
        "electricalYear": {
          "type": "number",
          "description": "Year the electrical system was installed or last updated.",
          "minimum": 1600,
          "maximum": 2100
        },
        "foundationType": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Foundation type (slab, crawl-space, basement, piers, stilts)."
        },
        "hasBasement": {
          "type": "boolean",
          "description": "Whether the dwelling has a basement"
        },
        "basementType": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Basement finish level."
        },
        "hasPool": {
          "type": "boolean",
          "description": "Whether the property has a swimming pool"
        },
        "poolType": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Type of swimming pool."
        },
        "poolFenced": {
          "type": "boolean",
          "description": "Whether the pool area is fenced"
        },
        "fireplaces": {
          "type": "number",
          "description": "Number of fireplaces in the dwelling"
        },
        "detachedStructures": {
          "type": "string",
          "description": "Free-text description of detached structures on the property"
        },
        "deadbolts": {
          "type": "boolean",
          "description": "Whether the dwelling has deadbolt locks"
        },
        "smokeDetectors": {
          "type": "boolean",
          "description": "Whether the dwelling has smoke detectors"
        },
        "waterLeakDetection": {
          "type": "boolean",
          "description": "Whether the dwelling has a water leak detection system"
        },
        "burglarAlarm": {
          "type": "boolean",
          "description": "Whether the dwelling has a burglar alarm"
        },
        "fireExtinguisher": {
          "type": "boolean",
          "description": "Whether the dwelling has fire extinguishers"
        },
        "backupGenerator": {
          "type": "boolean",
          "description": "Whether the dwelling has a backup generator"
        },
        "protectionClassCode": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Protection class (ISO fire protection rating)."
        },
        "propertyCondition": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Overall physical condition of the property."
        },
        "sprinklerDetail": {
          "$ref": "#/definitions/SprinklerDetail",
          "description": "Detailed sprinkler system information (supplements the `sprinklered` boolean)"
        },
        "alarmType": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Fire alarm classification."
        },
        "dogBreed": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Dog breeds present on the property"
        },
        "hasTrampoline": {
          "type": "boolean",
          "description": "Whether the property has a trampoline"
        },
        "lienholders": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Lienholder"
          },
          "description": "Mortgage holders and other financial interest parties"
        }
      },
      "required": [
        "address",
        "resourceType",
        "status"
      ],
      "additionalProperties": false,
      "description": "A physical location or premises that is insured or relevant to a policy. Used in property, GL, and other location-based coverages. Locations form the basis of a Statement of Values (SOV).",
      "examples": [
        {
          "resourceType": "Location",
          "id": "loc-001",
          "status": "active",
          "name": "Main Manufacturing Plant",
          "address": {
            "line": [
              "123 Industrial Blvd"
            ],
            "city": "Hartford",
            "state": "CT",
            "postalCode": "06103"
          },
          "occupancy": {
            "coding": [
              {
                "code": "manufacturing",
                "display": "Manufacturing"
              }
            ]
          },
          "constructionType": {
            "coding": [
              {
                "code": "fire-resistive",
                "display": "Fire Resistive"
              }
            ]
          },
          "yearBuilt": 1995,
          "squareFootage": {
            "value": 50000,
            "unit": "sqft"
          },
          "buildingValue": {
            "value": 5000000,
            "currency": "USD"
          },
          "contentsValue": {
            "value": 2000000,
            "currency": "USD"
          }
        }
      ]
    },
    "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"
        }
      ]
    },
    "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."
    },
    "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."
    },
    "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"
        }
      ]
    },
    "AssetValuation": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Valuation method (replacement-cost, actual-cash-value, agreed-value, stated-value, market-value)."
        },
        "amount": {
          "$ref": "#/definitions/Money",
          "description": "The valuation amount"
        },
        "effectiveDate": {
          "type": "string",
          "description": "Date this valuation was effective or determined.",
          "format": "date"
        },
        "source": {
          "type": "string",
          "description": "Source of the valuation (appraisal, insured-stated, index-adjusted, market-comparable)"
        },
        "notes": {
          "type": "string",
          "description": "Notes about the valuation methodology or caveats"
        }
      },
      "required": [
        "type",
        "amount"
      ],
      "additionalProperties": false,
      "description": "A financial valuation of a risk or location asset. Captures different valuation methods (replacement cost, ACV, agreed value, etc.) and their provenance.",
      "examples": [
        {
          "type": {
            "coding": [
              {
                "code": "replacement-cost",
                "display": "Replacement Cost"
              }
            ]
          },
          "amount": {
            "value": 5000000,
            "currency": "USD"
          },
          "effectiveDate": "2025-01-15",
          "source": "appraisal"
        }
      ]
    },
    "SprinklerDetail": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Type of sprinkler system."
        },
        "coveragePercentage": {
          "type": "number",
          "description": "Percentage of building covered by sprinklers"
        },
        "agent": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Suppression agent type"
        }
      },
      "additionalProperties": false,
      "description": "Detailed sprinkler system information for fire protection rating."
    },
    "Lienholder": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the lienholder or mortgagee"
        },
        "type": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Type of financial interest."
        },
        "loanNumber": {
          "type": "string",
          "description": "Loan or mortgage number"
        },
        "address": {
          "$ref": "#/definitions/Address",
          "description": "Mailing address for the lienholder"
        },
        "contact": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ContactPoint"
          },
          "description": "Contact information for the lienholder"
        },
        "isaoa": {
          "type": "boolean",
          "description": "Whether the ISAOA/ATIMA (Its Successors and/or Assigns as Their Interests May Appear) clause applies"
        }
      },
      "required": [
        "name",
        "type"
      ],
      "additionalProperties": false,
      "description": "A party with a financial interest in an insured asset. Shared by both auto (vehicle lienholders) and home (mortgagees). Attached to Risk and Location resources.",
      "examples": [
        {
          "name": "First National Bank",
          "type": "mortgagee",
          "loanNumber": "MORT-2024-56789",
          "address": {
            "line": [
              "PO Box 12345"
            ],
            "city": "Charlotte",
            "state": "NC",
            "postalCode": "28201"
          },
          "isaoa": true
        }
      ]
    },
    "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."
    }
  },
  "$id": "https://bind-standard.org/schema/Location",
  "title": "Location"
}
