{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://uwmd.org/schemas/document-facts-offering-memorandum.schema.json",
  "title": "offering-memorandum-v1 logical payload (RFC0129)",
  "description": "Closed source facts, not adopted underwriting inputs. Inventory resolution, unique unmapped labels, non-self supersedes and package history require the profile validator. Dates are real calendar dates. No financial conversion or selection.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "document_id",
    "artifact_kind",
    "as_of",
    "currency_code",
    "governing_documents",
    "facts"
  ],
  "properties": {
    "document_id": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S"
    },
    "artifact_kind": {
      "enum": [
        "offering_memorandum",
        "amendment"
      ]
    },
    "as_of": {
      "type": "string",
      "format": "date",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "currency_code": {
      "type": "string",
      "pattern": "^[A-Z]{3}$"
    },
    "governing_documents": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "minLength": 1,
        "pattern": "\\S"
      }
    },
    "facts": {
      "type": "object",
      "minProperties": 1,
      "additionalProperties": false,
      "properties": {
        "property.year_built": {
          "allOf": [
            {
              "$ref": "document-fact-term.schema.json"
            },
            {
              "properties": {
                "value": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          ]
        },
        "property.total_units": {
          "allOf": [
            {
              "$ref": "document-fact-term.schema.json"
            },
            {
              "properties": {
                "value": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          ]
        },
        "property.total_nra_sqft": {
          "allOf": [
            {
              "$ref": "document-fact-term.schema.json"
            },
            {
              "properties": {
                "value": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          ]
        },
        "valuation.appraised_value": {
          "allOf": [
            {
              "$ref": "document-fact-term.schema.json"
            },
            {
              "properties": {
                "value": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          ]
        },
        "valuation.appraised_as_of": {
          "allOf": [
            {
              "$ref": "document-fact-term.schema.json"
            },
            {
              "properties": {
                "value": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          ]
        },
        "valuation.appraisal_report_date": {
          "allOf": [
            {
              "$ref": "document-fact-term.schema.json"
            },
            {
              "properties": {
                "value": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          ]
        }
      }
    },
    "unmapped_facts": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "label",
          "term"
        ],
        "properties": {
          "label": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S"
          },
          "term": {
            "$ref": "document-fact-term.schema.json"
          }
        }
      }
    },
    "findings": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "supersedes": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S"
    }
  }
}
