{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Sovereign Credit Memo",
  "type": "object",
  "properties": {
    "memo_id": { "type": "string", "format": "uuid" },
    "date": { "type": "string", "format": "date" },
    "author": { "type": "string" },
    "entities": {
      "type": "array",
      "items": { "type": "string" }
    },
    "executive_summary": { "type": "string" },
    "risk_factors": {
      "type": "array",
      "items": { "type": "string" }
    },
    "financial_analysis": {
      "type": "object",
      "properties": {
        "text": { "type": "string" },
        "key_metrics": { "type": "object" }
      },
      "required": ["text"]
    },
    "conclusion": { "type": "string" },
    "audit_trail": {
      "type": "array",
      "items": {
        "$ref": "./audit_log.json"
      }
    }
  },
  "required": ["memo_id", "date", "executive_summary", "conclusion"]
}
