{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Fictional teaching-policy shape, not an investing.md standard",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "version",
    "fictional",
    "valuation_currency",
    "review_date",
    "holdings_as_of",
    "effective_from",
    "owner",
    "authority",
    "human_approval_required",
    "assumptions",
    "rules"
  ],
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1
    },
    "version": {
      "type": "integer",
      "minimum": 1
    },
    "fictional": {
      "const": true
    },
    "valuation_currency": {
      "const": "EUR"
    },
    "review_date": {
      "type": "string",
      "format": "date"
    },
    "holdings_as_of": {
      "type": "string",
      "format": "date"
    },
    "effective_from": {
      "type": "string",
      "format": "date"
    },
    "owner": {
      "const": "FICTIONAL_OWNER"
    },
    "authority": {
      "const": "analysis_only"
    },
    "human_approval_required": {
      "const": true
    },
    "assumptions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "rules": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "equity_fraction",
        "bond_fraction",
        "cash_fraction",
        "max_instrument_fraction",
        "max_direct_stock_fraction",
        "max_issuer_fraction_of_equities",
        "max_snapshot_age_days"
      ],
      "properties": {
        "equity_fraction": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "min",
            "max",
            "denominator"
          ],
          "properties": {
            "min": {
              "type": "string",
              "pattern": "^(?:0(?:\\.[0-9]+)?|1(?:\\.0+)?)$"
            },
            "max": {
              "type": "string",
              "pattern": "^(?:0(?:\\.[0-9]+)?|1(?:\\.0+)?)$"
            },
            "denominator": {
              "const": "total_portfolio_value"
            }
          }
        },
        "bond_fraction": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "min",
            "max",
            "denominator"
          ],
          "properties": {
            "min": {
              "type": "string",
              "pattern": "^(?:0(?:\\.[0-9]+)?|1(?:\\.0+)?)$"
            },
            "max": {
              "type": "string",
              "pattern": "^(?:0(?:\\.[0-9]+)?|1(?:\\.0+)?)$"
            },
            "denominator": {
              "const": "total_portfolio_value"
            }
          }
        },
        "cash_fraction": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "min",
            "max",
            "denominator"
          ],
          "properties": {
            "min": {
              "type": "string",
              "pattern": "^(?:0(?:\\.[0-9]+)?|1(?:\\.0+)?)$"
            },
            "max": {
              "type": "string",
              "pattern": "^(?:0(?:\\.[0-9]+)?|1(?:\\.0+)?)$"
            },
            "denominator": {
              "const": "total_portfolio_value"
            }
          }
        },
        "max_instrument_fraction": {
          "type": "string",
          "pattern": "^(?:0(?:\\.[0-9]+)?|1(?:\\.0+)?)$"
        },
        "max_direct_stock_fraction": {
          "type": "string",
          "pattern": "^(?:0(?:\\.[0-9]+)?|1(?:\\.0+)?)$"
        },
        "max_issuer_fraction_of_equities": {
          "type": "string",
          "pattern": "^(?:0(?:\\.[0-9]+)?|1(?:\\.0+)?)$"
        },
        "max_snapshot_age_days": {
          "type": "integer",
          "minimum": 0
        }
      }
    }
  }
}
