{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/obraaberta-com-br/json-schema/obraaberta-com-br-construtora-schema.json",
  "title": "Construtora",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/obraaberta-com-br-openapi.yml#/components/schemas/Construtora",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "cnpj": {
      "type": [
        "string",
        "null"
      ]
    },
    "website": {
      "type": [
        "string",
        "null"
      ]
    },
    "phone": {
      "type": [
        "string",
        "null"
      ]
    },
    "founded_year": {
      "type": [
        "integer",
        "null"
      ]
    },
    "headquarters": {
      "type": [
        "string",
        "null"
      ]
    },
    "rating": {
      "type": "object",
      "properties": {
        "average": {
          "type": [
            "number",
            "null"
          ]
        },
        "count": {
          "type": "integer"
        }
      }
    },
    "reputation": {
      "$ref": "#/$defs/Reputacao"
    },
    "stock_info": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "ticker": {
          "type": "string"
        }
      }
    },
    "projects_count": {
      "type": "integer"
    }
  },
  "$defs": {
    "Reputacao": {
      "type": "object",
      "description": "ISE (Índice de Sinais de Estresse): parte de 100 e desconta obras atrasadas (peso 60) e paralisadas (peso 40) sobre o total.",
      "properties": {
        "ise_score": {
          "type": "integer"
        },
        "completed_projects": {
          "type": "integer"
        },
        "active_projects": {
          "type": "integer"
        },
        "stalled_projects": {
          "type": "integer"
        },
        "delayed_projects": {
          "type": "integer"
        },
        "total_projects": {
          "type": "integer"
        },
        "legal_issues": {
          "type": [
            "integer",
            "null"
          ]
        }
      }
    }
  }
}