{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rentrollapi-com/json-schema/rentrollapi-com-operating-statement-result-schema.json",
  "title": "OperatingStatementResult",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rentrollapi-com-openapi.json#/components/schemas/OperatingStatementResult",
  "type": "object",
  "properties": {
    "propertyName": {
      "$ref": "#/$defs/StringField"
    },
    "basis": {
      "$ref": "#/$defs/StringField"
    },
    "months": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Reporting periods as yyyy-MM, e.g. [\"2025-08\", ..., \"2026-07\"]."
    },
    "lineItems": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/StatementLineItem"
      }
    },
    "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"
          ]
        }
      }
    },
    "StatementLineItem": {
      "type": "object",
      "description": "One line item of the operating statement.",
      "properties": {
        "label": {
          "$ref": "#/$defs/StringField"
        },
        "kind": {
          "type": "string",
          "enum": [
            "Income",
            "Expense",
            "Subtotal",
            "Other"
          ]
        },
        "category": {
          "type": "string",
          "description": "Normalized category bucket, e.g. GrossPotentialRent, VacancyLoss, RealEstateTaxes, Insurance, Utilities, RepairsMaintenance, Payroll, ManagementFee, EffectiveGrossIncome, TotalOperatingExpenses, NetOperatingIncome."
        },
        "monthlyValues": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/NumberField"
          },
          "description": "Aligned index-for-index with the document-level months array. Empty for annual-only statements."
        },
        "total": {
          "$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"
        }
      }
    },
    "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"
        }
      }
    }
  }
}