{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/stream-estate/json-schema/stream-estate-property-document-schema.json",
  "title": "PropertyDocument",
  "description": "A real estate property aggregated from one or more adverts.",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/stream-estate-openapi.json#/components/schemas/PropertyDocument",
  "type": "object",
  "properties": {
    "@context": {
      "type": "string"
    },
    "@id": {
      "type": "string"
    },
    "@type": {
      "type": "string"
    },
    "adverts": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Advert"
      }
    },
    "bedroom": {
      "type": "integer"
    },
    "city": {
      "$ref": "#/$defs/CityDetails"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "description": {
      "type": "string"
    },
    "elevator": {
      "type": "boolean"
    },
    "expired": {
      "type": "boolean",
      "description": "A property is considered expired when all its adverts are expired."
    },
    "expiredAt": {
      "type": "string",
      "format": "date-time"
    },
    "floor": {
      "type": "integer"
    },
    "furnished": {
      "type": "boolean"
    },
    "landSurface": {
      "type": "number"
    },
    "lastCrawledAdvert": {
      "type": "string",
      "format": "uuid"
    },
    "lastCrawledAt": {
      "type": "string",
      "format": "date-time"
    },
    "locations": {
      "$ref": "#/$defs/GeoPoint"
    },
    "pictures": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      }
    },
    "price": {
      "type": "number"
    },
    "pricePerMeter": {
      "type": "number"
    },
    "property": {
      "type": "string"
    },
    "propertyType": {
      "type": "integer",
      "description": "Apartment `0`, House `1`, Building `2`, Parking `3`, Office `4`, Land `5`, Shop `6`.",
      "enum": [
        0,
        1,
        2,
        3,
        4,
        5,
        6
      ]
    },
    "publisherTypes": {
      "type": "array",
      "description": "Individual `0`, Professional `1`.",
      "items": {
        "type": "integer",
        "enum": [
          0,
          1
        ]
      }
    },
    "room": {
      "type": "integer"
    },
    "stations": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Station"
      }
    },
    "surface": {
      "type": "number"
    },
    "title": {
      "type": "string"
    },
    "transactionType": {
      "type": "integer",
      "description": "Sell `0`, Rent `1`.",
      "enum": [
        0,
        1
      ]
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "uuid": {
      "type": "string",
      "format": "uuid"
    }
  },
  "$defs": {
    "Advert": {
      "type": "object",
      "description": "A published listing of the property on a source site.",
      "properties": {
        "condominiumFees": {
          "type": "number"
        },
        "constructionYear": {
          "type": "integer"
        },
        "contact": {
          "$ref": "#/$defs/Contact"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "description": {
          "type": "string"
        },
        "elevator": {
          "type": "boolean"
        },
        "energy": {
          "$ref": "#/$defs/EnergyRating"
        },
        "events": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AdvertEvent"
          }
        },
        "features": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "feesPercentage": {
          "type": "number"
        },
        "feesResponsibility": {
          "type": "integer",
          "description": "Responsibility for fees. `0` for seller, `1` for buyer.",
          "enum": [
            0,
            1
          ]
        },
        "floor": {
          "type": "integer"
        },
        "floorQuantity": {
          "type": "integer"
        },
        "furnished": {
          "type": "boolean"
        },
        "greenHouseGas": {
          "$ref": "#/$defs/EnergyRating"
        },
        "inventoryPrice": {
          "type": "number"
        },
        "landSurface": {
          "type": "number"
        },
        "lastCrawledAt": {
          "type": "string",
          "format": "date-time"
        },
        "lotCount": {
          "type": "integer"
        },
        "pictures": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          }
        },
        "picturesRemote": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          }
        },
        "price": {
          "type": "number"
        },
        "priceExcludingFees": {
          "type": "number"
        },
        "publisher": {
          "$ref": "#/$defs/Publisher"
        },
        "rentalCharges": {
          "type": "number"
        },
        "rentalPledge": {
          "type": "number"
        },
        "renterFees": {
          "type": "number"
        },
        "surface": {
          "type": "number"
        },
        "title": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "uuid": {
          "type": "string",
          "format": "uuid"
        },
        "virtualTour": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "AdvertEvent": {
      "type": "object",
      "description": "A change recorded on an advert (price update, surface update, ...).",
      "properties": {
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "fieldName": {
          "type": "string"
        },
        "fieldNewValue": {
          "type": "string"
        },
        "fieldOldValue": {
          "type": "string"
        },
        "percentVariation": {
          "type": "number"
        }
      }
    },
    "CityDetails": {
      "type": "object",
      "description": "City the property belongs to.",
      "properties": {
        "cityParentId": {
          "type": "integer"
        },
        "country": {
          "$ref": "#/$defs/CodeIdName"
        },
        "department": {
          "$ref": "#/$defs/CodeIdName"
        },
        "groupedCityNames": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "groupedCityZipcodes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "hasGroupedByName": {
          "type": "boolean"
        },
        "hasGroupedByZipcode": {
          "type": "boolean"
        },
        "id": {
          "type": "integer"
        },
        "insee": {
          "type": "string"
        },
        "location": {
          "$ref": "#/$defs/GeoPoint"
        },
        "name": {
          "type": "string"
        },
        "open": {
          "type": "boolean"
        },
        "originalName": {
          "type": "string"
        },
        "region": {
          "$ref": "#/$defs/CodeIdName"
        },
        "zipcode": {
          "type": "string"
        }
      }
    },
    "CodeIdName": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "Contact": {
      "type": "object",
      "properties": {
        "agency": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "fax": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "phone": {
          "type": "string"
        },
        "reference": {
          "type": "string"
        }
      }
    },
    "EnergyRating": {
      "type": "object",
      "description": "Energy / greenhouse-gas performance rating.",
      "properties": {
        "category": {
          "type": "string",
          "enum": [
            "A",
            "B",
            "C",
            "D",
            "E",
            "F",
            "G"
          ]
        },
        "value": {
          "type": "number"
        }
      }
    },
    "GeoPoint": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number"
        },
        "lon": {
          "type": "number"
        }
      }
    },
    "Publisher": {
      "type": "object",
      "properties": {
        "category": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "type": {
          "type": "integer",
          "description": "Publisher type. Individual `0`, Professional `1`.",
          "enum": [
            0,
            1
          ]
        }
      }
    },
    "Station": {
      "type": "object",
      "description": "Nearby public transport station.",
      "properties": {
        "id": {
          "type": "integer"
        },
        "lines": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/StationLine"
          }
        },
        "name": {
          "type": "string"
        }
      }
    },
    "StationLine": {
      "type": "object",
      "properties": {
        "color": {
          "type": "string"
        },
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "number": {
          "type": "string"
        },
        "routeName": {
          "type": "string"
        }
      }
    }
  }
}