{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://uwmd.org/schemas/lease-up-cash-flow-projection.schema.json",
  "title": "lease-up-cash-flow-projection",
  "description": "RFC 0044 / Protocol VIII.9.5. Cross-field coverage, ordering, source verification and digest agreement require semantic checks.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "source_envelope_digest",
    "source_variant",
    "series",
    "bindings"
  ],
  "properties": {
    "source_envelope_digest": {
      "type": "string",
      "pattern": "^sha256:[a-f0-9]{64}$"
    },
    "source_variant": {
      "type": "string",
      "minLength": 1
    },
    "series": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "label",
        "day_count",
        "series"
      ],
      "properties": {
        "label": {
          "const": "Lease-up receipts and TI/LC only"
        },
        "day_count": {
          "enum": [
            "actual/365f",
            "actual/360",
            "30/360us"
          ]
        },
        "series": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "date",
              "amount",
              "kind",
              "label"
            ],
            "properties": {
              "date": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                "format": "date"
              },
              "amount": {
                "type": "number"
              },
              "kind": {
                "const": "other"
              },
              "label": {
                "type": "string",
                "pattern": "^lease_up_schedule\\.schedule@\\d{4}-(Q[1-4]|0[1-9]|1[0-2])\\.net_cash_flow$"
              }
            }
          }
        }
      }
    },
    "bindings": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "source_path",
          "date",
          "amount"
        ],
        "properties": {
          "source_path": {
            "type": "string",
            "pattern": "^lease_up_schedule\\.schedule@\\d{4}-(Q[1-4]|0[1-9]|1[0-2])\\.net_cash_flow$"
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "format": "date"
          },
          "amount": {
            "type": "number"
          }
        }
      }
    }
  }
}
