{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/obraaberta-com-br/json-schema/obraaberta-com-br-obra-schema.json",
  "title": "Obra",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/obraaberta-com-br-openapi.yml#/components/schemas/Obra",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "slug": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "address": {
      "type": [
        "string",
        "null"
      ]
    },
    "neighborhood": {
      "type": [
        "string",
        "null"
      ]
    },
    "city": {
      "type": "string"
    },
    "state": {
      "type": "string"
    },
    "cep": {
      "type": [
        "string",
        "null"
      ]
    },
    "phone": {
      "type": [
        "string",
        "null"
      ]
    },
    "geolocation": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "latitude": {
          "type": "number"
        },
        "longitude": {
          "type": "number"
        },
        "precision": {
          "type": [
            "string",
            "null"
          ],
          "description": "Precisão do ponto: exata, endereco e rua apontam o imóvel; aproximada (faixa de CEP) e cidade (centro do município) NÃO apontam; nulo = não declarada."
        }
      }
    },
    "status": {
      "type": "string",
      "enum": [
        "lancamento",
        "em_construcao",
        "paralisada",
        "entregue"
      ]
    },
    "completion_percentage": {
      "type": "number"
    },
    "total_units": {
      "type": "integer"
    },
    "available_units": {
      "type": [
        "integer",
        "null"
      ]
    },
    "price_from": {
      "type": [
        "number",
        "null"
      ]
    },
    "price_to": {
      "type": [
        "number",
        "null"
      ]
    },
    "price_per_m2": {
      "type": [
        "number",
        "null"
      ]
    },
    "total_area": {
      "type": [
        "number",
        "null"
      ]
    },
    "bedrooms": {
      "type": [
        "integer",
        "null"
      ]
    },
    "bathrooms": {
      "type": [
        "integer",
        "null"
      ]
    },
    "parking_spaces": {
      "type": [
        "integer",
        "null"
      ]
    },
    "amenities": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "cover_url": {
      "type": [
        "string",
        "null"
      ]
    },
    "floor_plans": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "constructor": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "launch_date": {
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "completion_date": {
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "status_observed": {
      "type": "boolean",
      "description": "false quando a origem grava o status como constante, sem observar a obra (coleta automática). Nesse caso `status` não sustenta atraso nem entrega."
    },
    "data_sources": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "data_quality_score": {
      "type": [
        "number",
        "null"
      ],
      "description": "0 a 1 — completude dos dados."
    },
    "last_enriched_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "last_updated_at": {
      "type": "string",
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "url": {
      "type": "string",
      "description": "URL canônica pública da obra."
    }
  }
}