{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rentrollapi-com/json-schema/rentrollapi-com-extraction-result-schema.json",
  "title": "ExtractionResult",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rentrollapi-com-openapi.json#/components/schemas/ExtractionResult",
  "type": "object",
  "properties": {
    "propertyName": {
      "$ref": "#/$defs/StringField"
    },
    "asOfDate": {
      "$ref": "#/$defs/StringField"
    },
    "units": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Unit"
      }
    },
    "statedTotals": {
      "$ref": "#/$defs/StatedTotals"
    },
    "verification": {
      "$ref": "#/$defs/Verification"
    }
  },
  "$defs": {
    "NumberField": {
      "type": "object",
      "description": "An extracted numeric field with status, confidence, and flag reason.",
      "properties": {
        "value": {
          "type": [
            "number",
            "null"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "Extracted",
            "Derived",
            "Flagged",
            "Missing"
          ]
        },
        "confidence": {
          "type": [
            "number",
            "null"
          ],
          "format": "double",
          "minimum": 0,
          "maximum": 1
        },
        "flag": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "StatedTotals": {
      "type": "object",
      "description": "Totals as stated on the document itself, used for reconciliation.",
      "properties": {
        "unitCount": {
          "$ref": "#/$defs/NumberField"
        },
        "totalMonthlyRent": {
          "$ref": "#/$defs/NumberField"
        },
        "totalSquareFeet": {
          "$ref": "#/$defs/NumberField"
        },
        "occupancyRate": {
          "$ref": "#/$defs/NumberField"
        }
      }
    },
    "StringField": {
      "type": "object",
      "description": "An extracted string field with status, confidence, and flag reason.",
      "properties": {
        "value": {
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "Extracted",
            "Derived",
            "Flagged",
            "Missing"
          ]
        },
        "confidence": {
          "type": [
            "number",
            "null"
          ],
          "format": "double",
          "minimum": 0,
          "maximum": 1
        },
        "flag": {
          "type": [
            "string",
            "null"
          ],
          "description": "Reason the field was flagged instead of trusted"
        }
      }
    },
    "Unit": {
      "type": "object",
      "description": "One row of the rent roll: a unit/lease.",
      "properties": {
        "unitNumber": {
          "$ref": "#/$defs/StringField"
        },
        "tenantName": {
          "$ref": "#/$defs/StringField"
        },
        "unitType": {
          "$ref": "#/$defs/StringField"
        },
        "squareFeet": {
          "$ref": "#/$defs/NumberField"
        },
        "leaseStart": {
          "$ref": "#/$defs/StringField"
        },
        "leaseEnd": {
          "$ref": "#/$defs/StringField"
        },
        "monthlyRent": {
          "$ref": "#/$defs/NumberField"
        },
        "marketRent": {
          "$ref": "#/$defs/NumberField"
        },
        "securityDeposit": {
          "$ref": "#/$defs/NumberField"
        },
        "occupancy": {
          "$ref": "#/$defs/StringField"
        }
      }
    },
    "Verification": {
      "type": "object",
      "description": "Deterministic verification report: recomputed values reconciled against stated totals.",
      "properties": {
        "documentConfidence": {
          "type": "number",
          "format": "double",
          "minimum": 0,
          "maximum": 1
        },
        "flaggedFieldCount": {
          "type": "integer"
        },
        "allChecksPassed": {
          "type": "boolean"
        },
        "checks": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/VerificationCheck"
          }
        }
      }
    },
    "VerificationCheck": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "result": {
          "type": "string",
          "enum": [
            "Pass",
            "Fail",
            "Skipped"
          ]
        },
        "detail": {
          "type": "string"
        }
      }
    }
  }
}