{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://disclosures.agiscorecard.com/input.schema.json",
  "title": "RWA Notes input structure",
  "description": "Structural contract. The engine additionally validates ranges, dates, amounts, uniqueness and cross-field constraints; passing this schema is not a complete validation.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "asOf",
    "maxAgeDays",
    "before",
    "after"
  ],
  "properties": {
    "asOf": {
      "type": "string"
    },
    "maxAgeDays": {
      "type": "number"
    },
    "before": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "asset",
          "field",
          "value",
          "unit",
          "date",
          "source"
        ],
        "properties": {
          "asset": {
            "type": "string"
          },
          "field": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "date": {
            "type": "string"
          },
          "source": {
            "type": "string"
          }
        }
      }
    },
    "after": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "asset",
          "field",
          "value",
          "unit",
          "date",
          "source"
        ],
        "properties": {
          "asset": {
            "type": "string"
          },
          "field": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "date": {
            "type": "string"
          },
          "source": {
            "type": "string"
          }
        }
      }
    }
  }
}
