{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/housingfax-com/json-schema/housingfax-com-check-coverage-output-schema.json",
  "title": "CheckCoverageOutput",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/housingfax-com-api-openapi.json#/components/schemas/CheckCoverageOutput",
  "type": "object",
  "properties": {
    "contract": {
      "type": "string",
      "const": "agent-api-1.3.0"
    },
    "language": {
      "type": "string",
      "enum": [
        "es",
        "en",
        "de",
        "nl",
        "fr"
      ]
    },
    "provinces": {
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "provinceCode": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "provinceLabel": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ]
          },
          "territoryCode": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "covered",
              "not_yet_covered",
              "unrecognized"
            ]
          },
          "foral": {
            "type": "boolean"
          },
          "addressSource": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "dgc",
                  "nora_foral_cadastres"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "unitSelection": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "dwelling_or_building",
                  "building_only"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "buildingConditionRegistry": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "integrated",
                  "not_integrated"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "reason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "foral_adapter_pending",
                  "not_a_spanish_province"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "note": {
            "type": "string",
            "minLength": 1,
            "maxLength": 600
          }
        },
        "required": [
          "provinceCode",
          "provinceLabel",
          "territoryCode",
          "status",
          "foral",
          "addressSource",
          "unitSelection",
          "buildingConditionRegistry",
          "reason",
          "note"
        ],
        "additionalProperties": false
      }
    },
    "municipalities": {
      "anyOf": [
        {
          "maxItems": 20,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "provinceCode": {
                "type": "string",
                "pattern": "^\\d{2}$"
              },
              "municipalityDgcCode": {
                "type": "string",
                "pattern": "^\\d{1,3}$"
              },
              "municipalityIneCode": {
                "type": "string",
                "pattern": "^\\d{3}$"
              },
              "officialLabel": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              }
            },
            "required": [
              "provinceCode",
              "municipalityDgcCode",
              "municipalityIneCode",
              "officialLabel"
            ],
            "additionalProperties": false
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "municipalityLookup": {
      "type": "string",
      "enum": [
        "not_requested",
        "found",
        "not_found",
        "unavailable"
      ]
    },
    "coverageNote": {
      "type": "string",
      "minLength": 1,
      "maxLength": 600
    }
  },
  "required": [
    "contract",
    "language",
    "provinces",
    "municipalities",
    "municipalityLookup",
    "coverageNote"
  ],
  "additionalProperties": false
}