{
  "openapi": "3.0.3",
  "info": {
    "title": "Verus Valuation API",
    "version": "0.1.0",
    "description": "Verus is a deterministic private credit valuation platform. The API exposes the DCF + multi-factor pricing engine, deal and assumption management, portfolio analytics, covenant monitoring, and IFRS 9 / IFRS 13 reporting.\n\n**Authentication.** All endpoints require an `X-API-Key` header. Keys are issued per user from the Verus app (Settings \u2192 API keys) or from your onboarding welcome email. Rotate them at any time without operational impact.\n\n**Determinism.** Same inputs, same engine version, same outputs \u2014 byte-for-byte. Every valuation run carries an immutable audit record with the exact deal version, assumption version, and engine configuration used.\n\n**Rate limits.** 30 requests/minute/key for interactive endpoints; 300 requests/minute for bulk analytics. Contact info@markst.com for higher limits.",
    "contact": {
      "name": "markst",
      "email": "info@markst.com",
      "url": "https://markst.com"
    },
    "license": {
      "name": "Commercial \u2014 all rights reserved"
    }
  },
  "paths": {
    "/intake/uploads": {
      "get": {
        "tags": [
          "intake"
        ],
        "summary": "List Uploads",
        "description": "List upload metadata (no content), scoped to the caller.\n\nPrivileged users (admin/ceo/env keys) see everything. Regular users see\ntheir own uploads + legacy NULL-owner rows. Without this, any user could\nenumerate every other user's filenames \u2014 and filenames are MNPI in this\ndomain.",
        "operationId": "list_uploads_intake_uploads_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_list_UploadSummary__"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      },
      "post": {
        "tags": [
          "intake"
        ],
        "summary": "Upload Files",
        "description": "Upload one or more files. Stored with source/timestamp + owner for lineage.\n\nFilenames in private credit are themselves MNPI (\"Project_Falcon_TLB_2030.pdf\"\nleaks an active deal). owner_user_id stamps the row so list/get scope to\nthe calling user. Env-key (operator) uploads stay unowned (NULL) so they\nbehave as shared/system uploads, matching the deals.create_deal pattern.",
        "operationId": "upload_files_intake_uploads_post",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_files_intake_uploads_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_UploadIdResult_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/intake/uploads/{upload_id}": {
      "get": {
        "tags": [
          "intake"
        ],
        "summary": "Get Upload",
        "description": "Get upload metadata. Omit content for large responses; include on demand later if needed.",
        "operationId": "get_upload_intake_uploads__upload_id__get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "upload_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Upload Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_UploadSummary_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/intake/suggest-deal": {
      "post": {
        "tags": [
          "intake"
        ],
        "summary": "Suggest Deal",
        "description": "Extract Deal (direct lending v1) from uploaded files using local Ollama.\nFalls back to template if Ollama is unavailable or extraction fails.",
        "operationId": "suggest_deal_intake_suggest_deal_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SuggestDealRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_SuggestDealResponse_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/intake/suggest-and-create-deal": {
      "post": {
        "tags": [
          "intake"
        ],
        "summary": "Suggest And Create Deal",
        "description": "Extract a deal from uploaded files and create it in the deals database in one step.\nReturns deal_id so the client can go straight to Suggest price.",
        "operationId": "suggest_and_create_deal_intake_suggest_and_create_deal_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SuggestDealRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_SuggestAndCreateDealResponse_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/intake/prompt-preview": {
      "post": {
        "tags": [
          "intake"
        ],
        "summary": "Prompt Preview",
        "description": "Preview deal candidate(s) from a natural-language prompt.\n\nUses Anthropic's structured `tool_use` extraction when available \u2014 returning\nevery candidate facility discovered for the borrower plus web-search\ncitations. Falls back to the Ollama/OpenAI-compatible path if Claude is\nunreachable or declines to invoke the tool.",
        "operationId": "prompt_preview_intake_prompt_preview_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PromptCreateDealWithSearchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_PromptPreviewResponse_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/intake/prompt-create-deal-search": {
      "post": {
        "tags": [
          "intake"
        ],
        "summary": "Prompt Create Deal Search",
        "description": "Create a deal from a free-text prompt, enriched with live web search results.\nWeb search fetches public deal context (press releases, tombstones, league tables)\nbefore passing everything to the Verus LLM for structured extraction.",
        "operationId": "prompt_create_deal_search_intake_prompt_create_deal_search_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PromptCreateDealWithSearchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_SuggestAndCreateDealResponse_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/intake/prompt-create-deal": {
      "post": {
        "tags": [
          "intake"
        ],
        "summary": "Prompt Create Deal",
        "description": "Create a deal from a free-text natural language prompt using the Verus engine.\nThe prompt is passed directly to the LLM with the deal JSON schema hint.",
        "operationId": "prompt_create_deal_intake_prompt_create_deal_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PromptCreateDealRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_SuggestAndCreateDealResponse_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/deals": {
      "post": {
        "tags": [
          "deals"
        ],
        "summary": "Create Deal",
        "operationId": "create_deal_deals_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Deal"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "deals"
        ],
        "summary": "List Deals",
        "description": "List deals from the database. Supports ?fund_id= and ?scope= filters.\n\nWithout fund_id: returns all deals accessible to the caller (owned +\ndeals in the caller's funds). With fund_id: returns only deals assigned\nto that specific fund (caller must have fund access).\n\n``scope='mine'`` further restricts the result to deals sitting in funds\nthe caller is a member of \u2014 meaningful for privileged principals who\nwould otherwise see every deal. ``scope='FUND-\u2026'`` restricts to that\nfund's assignments (what the app's fund selector sends); it 404s when\nthe fund is unknown or the caller cannot read it.",
        "operationId": "list_deals_deals_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "fund_id",
            "in": "query",
            "required": false,
            "schema": {
              "title": "Fund Id",
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "all",
              "title": "Scope"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/classify": {
      "post": {
        "tags": [
          "deals"
        ],
        "summary": "Classify Deal Preview",
        "description": "Read-only classifier preview for the manual-entry form.\n\nThe DealForm posts a partial deal payload (whatever the user has\nentered so far) and gets back the classifier's suggested asset_type\n+ confidence + reason + signals \u2014 without persisting anything. The\nUI then shows the suggestion in step 4 with a select dropdown so\nthe user can affirm or override before submitting (POLISH-08\nfollow-up: ``user should affirm``).\n\nThe persistence path (``POST /deals``) keeps its own classifier\nfallback for non-UI callers (script-driven backfills, demo seeds,\ndirect API users); this route is the human-affirm pre-flight.\n\nTolerates the same partial-shape inputs as ``classify_deal`` \u2014\nsector, borrower_name, status, deal_type, facility.rate_type,\nfacility.fees.* are the load-bearing signals.",
        "operationId": "classify_deal_preview_deals_classify_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": true,
                "type": "object",
                "title": "Payload"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/deals/{deal_id}": {
      "get": {
        "tags": [
          "deals"
        ],
        "summary": "Get Deal",
        "operationId": "get_deal_deals__deal_id__get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "deals"
        ],
        "summary": "Patch Deal",
        "operationId": "patch_deal_deals__deal_id__patch",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchDealRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "deals"
        ],
        "summary": "Delete Deal",
        "description": "Delete a deal and every record that references it.\n\nAuthorisation rules:\n  * admin / ceo / env_key: always allowed \u2014 platform operators and the\n    deal's own legal owners.\n  * portfolio_manager: only allowed when they **own** the deal.\n    ``ensure_deal_access`` on its own grants fund-membership access,\n    which would let a PM on Fund A delete a deal that is also assigned\n    to Fund B. The canonical deal record is global, so deletion has\n    to be gated on ownership, not just visibility.\n  * other roles: 403.\n\nApproved deals are immutable regardless of role (409).",
        "operationId": "delete_deal_deals__deal_id__delete",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/tranches/{tranche_index}/value": {
      "post": {
        "tags": [
          "deals"
        ],
        "summary": "Value Tranche Indicative",
        "description": "Indicative valuation of one capital-structure tranche.\n\nDeterministic and server-side: issuer fundamentals \u2192 implied rating +\nEV-waterfall recovery (``derive_credit_assumptions``), then the seniority\ncredit curve (``lookup_credit_curve``) for an indicative spread range.\nA first-order indicative price is returned only for the subject tranche,\nwhere the deal's carried spread genuinely describes the instrument.",
        "operationId": "value_tranche_indicative_deals__deal_id__tranches__tranche_index__value_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          },
          {
            "name": "tranche_index",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Tranche Index"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/tranches/{tranche_index}/promote": {
      "post": {
        "tags": [
          "deals"
        ],
        "summary": "Promote Tranche To Deal",
        "description": "Scaffold a full standalone Deal from a chosen capital-structure tranche.\n\nCopies the parent's terms (currency, jurisdiction, dates, day-count,\nconventions, facility rate structure, financials + capital structure) and\noverrides the facility notional with the tranche size. The parent's rate\nstructure is inherited as a STARTING POINT \u2014 the tranche's own coupon /\nmaturity aren't carried on the capital-structure row, so the analyst should\nreview the Terms tab on the new deal. The parent deal is left untouched.",
        "operationId": "promote_tranche_to_deal_deals__deal_id__tranches__tranche_index__promote_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          },
          {
            "name": "tranche_index",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Tranche Index"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/runs/latest": {
      "get": {
        "tags": [
          "deals"
        ],
        "summary": "Get Deal Latest Run",
        "description": "Return the most recent valuation run for this deal, or 404 if none.\n\nUsed by the frontend's DealDetail page to seed cross-tab subject context\n(e.g. Compare > Peer Benchmark) on a fresh page load \u2014 without it, the\npeer panel says \"Run a valuation to compare against peers\" until the\nuser re-runs in this session, even if a recent run exists in the DB.\n\nOutput shape matches GET /valuation-runs/{run_id} so the frontend hook\ncan treat both responses identically.",
        "operationId": "get_deal_latest_run_deals__deal_id__runs_latest_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/transfer": {
      "post": {
        "tags": [
          "deals"
        ],
        "summary": "Transfer Deal",
        "description": "Reassign deal ownership to another user. Admin-only.\n\nCompanion to the CD-03 tightening: NULL-owner deals (seed corpus,\npre-migration data) are now admin-only on the read path. This\nendpoint is the documented way for an admin to hand a seeded deal\nto a specific user, after which the deal becomes visible to that\nuser (and only that user, plus fund-mates).\n\nSecurity model:\n  * Admin / CEO / env-key only \u2014 non-privileged callers get 403.\n    Letting users transfer their own deals to other users is a\n    future feature; for now, only operators can change ownership.\n  * The new_owner_user_id must exist in platform_users (or be null).\n    422 otherwise \u2014 protects against typos that would orphan\n    the deal under an unreachable account.\n  * Documents stay attached. Their per-row owner_user_id (CD-02) is\n    a historical \"who uploaded this\" field and stays unchanged\n    across transfer. Only deal access changes.\n  * change_log row written for audit.",
        "operationId": "transfer_deal_deals__deal_id__transfer_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferDealRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/clone-to-user": {
      "post": {
        "tags": [
          "deals"
        ],
        "summary": "Clone Deal To User",
        "description": "Clone a deal to a target user, preserving the source.\n\nCompanion to ``POST /deals/{id}/transfer``: where transfer mutates\nthe source's owner (admin-only handover, source no longer in the\nseed corpus), clone leaves the source intact and creates a fresh\ndeal for the target user. The intended seed-distribution flow:\n\n  * Admin maintains a corpus of seed deals (NULL owner, admin-only\n    per CD-03).\n  * For each new beta user, admin clones the relevant subset of\n    the corpus to them. The user gets their own editable copies.\n  * The seeds remain in the corpus and can be cloned again to the\n    next user \u2014 many-to-one fan-out from one curated seed.\n\nSecurity model:\n  * Admin / CEO / env-key only \u2014 non-privileged callers get 403.\n  * target_user_id must exist in platform_users (422 otherwise).\n  * Source deal access requires admin via ensure_deal_access (CD-03\n    already gates NULL-owner deals to admin only \u2014 clones of an\n    already-owned deal still require admin authority).\n  * change_log row written for audit on both source (cloned-to) and\n    new deal (cloned-from).\n\nDocument handling:\n  * include_documents=true (default): every deal_documents row on\n    the source is re-stamped onto the new deal with a fresh doc_id\n    and target_user_id as owner. file_path is reused (no byte copy).\n  * include_documents=false: clone the deal terms only.",
        "operationId": "clone_deal_to_user_deals__deal_id__clone_to_user_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CloneDealToUserRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/versions": {
      "get": {
        "tags": [
          "deals"
        ],
        "summary": "List Deal Versions",
        "description": "List all versioned snapshots for a deal (newest first).",
        "operationId": "list_deal_versions_deals__deal_id__versions_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "deals"
        ],
        "summary": "Snapshot Deal",
        "operationId": "snapshot_deal_deals__deal_id__versions_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/versions/{deal_version_id}": {
      "get": {
        "tags": [
          "deals"
        ],
        "summary": "Get Deal Version",
        "operationId": "get_deal_version_deals__deal_id__versions__deal_version_id__get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          },
          {
            "name": "deal_version_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Version Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/calibrate": {
      "post": {
        "tags": [
          "deals"
        ],
        "summary": "Calibrate Deal Spread",
        "description": "Solve the implied spread (bps) for the given issuance price under the\nsupplied assumption set \u2014 the yield-calibration step.\n\nThe caller subsequently stores ``implied_spread_bps`` as\n``ValuationAssumptions.calibrated_spread_bps`` on the assumption set so\nsubsequent valuations use it as the anchor.",
        "operationId": "calibrate_deal_spread_deals__deal_id__calibrate_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalibrateSpreadRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_CalibrateSpreadResponse_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/documents": {
      "get": {
        "tags": [
          "deals"
        ],
        "summary": "List Documents",
        "description": "List all documents in a deal's data room.",
        "operationId": "list_documents_deals__deal_id__documents_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "deals"
        ],
        "summary": "Upload Document",
        "description": "Upload one or more documents directly into a deal's data room.",
        "operationId": "upload_document_deals__deal_id__documents_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_document_deals__deal_id__documents_post"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/documents/purge-auto-cached": {
      "post": {
        "tags": [
          "deals"
        ],
        "summary": "Purge Auto Cached Documents",
        "description": "Bulk-remove every web_search auto-cached document from a deal's data room.\n\nThe web_search citation auto-cache (PR #219) writes\nsource_type='web_search' on every fetched citation. This route deletes\nthem all in one shot \u2014 the all-or-nothing pressure-release valve.\n\nUser-uploaded docs (source_type='upload'), seed/data-room docs\n('dataroom'), and SEC filings ('sec_filing') are NOT touched.\n\nSame bytes-on-disk policy as the single-doc DELETE: rows go, files\nstay (clones may share file_paths).\n\n--- Companion route: relevance gate ---\nAs of Phase 26, POST /deals/{deal_id}/documents/purge-orphan-web-search\nships alongside this endpoint. The new gate is the default hygiene\naction \u2014 it reads persisted ProvenanceRecord rows (deal_provenance\ntable) and deletes only web_search docs NOT currently cited.\nDeterministic; no LLM on the relevance path.\n\nThis route remains as the pressure-release valve for two cases:\n\n  1. Pre-Phase-26 deals whose extractions ran before the write hook\n     (credit_analysis.py:~1018) populated deal_provenance. Their\n     provenance table is empty until the next 'Complete with AI' run,\n     so the relevance gate fail-opens to a no-op (PURGE-02). If the\n     analyst still wants to clear the web_search cache, they call here.\n  2. Hygiene emergencies (corrupt provenance, mis-cited cache, etc.)\n     where the analyst explicitly wants to start over.\n\nDeprecation of this route belongs to a follow-up phase, after telemetry\nshows the new gate covers the same hygiene cases.",
        "operationId": "purge_auto_cached_documents_deals__deal_id__documents_purge_auto_cached_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/documents/purge-orphan-web-search": {
      "post": {
        "tags": [
          "deals"
        ],
        "summary": "Purge Orphan Web Search",
        "description": "Relevance-gated purge: delete only the web_search docs NOT currently cited.\n\nSuccessor to purge_auto_cached_documents (which deletes EVERY web_search\nrow). This route reads the deal_provenance table to compute the set of\nURLs currently cited by any persisted ProvenanceRecord on the deal, then\ndeletes only the web_search docs whose provenance_url is NOT in that\nkeep-list. Cited cache stays; orphans go.\n\nThe relevance decision is deterministic \u2014 a set-membership query against\npersisted provenance. No LLM on the deletion path (Verus-aligned). Same\ndeal state always produces the same orphan set.\n\nBehaviour:\n  - Deal absent  -> 404 DEAL_NOT_FOUND.\n  - Provenance empty / absent (PURGE-02 fail-open) -> 200,\n    mode='no_provenance_available', deleted=0, kept=0, no rows touched.\n    This pairs with forward-only backfill \u2014 pre-Phase-26 deals see empty\n    provenance until their next 'Complete with AI' run; the gate refuses\n    to evict on no signal rather than nuking legitimate cached docs.\n  - Provenance present -> orphan rows deleted, response reports the counts\n    and mode='provenance'.\n\nSame bytes-on-disk policy as the legacy route + the single-doc DELETE:\nonly deal_documents rows are removed; file_paths are left intact\nbecause clones may share them. Provenance is read-only on this path\n(PURGE-05) \u2014 the route never writes/updates/deletes from deal_provenance.\n\nAuth + rate-limit + audit mirror the legacy route (PURGE-04). The\nchange_type strings on the audit-log entries differ from the legacy\n('bulk_purge_orphan' / 'bulk_purge_orphan_noop' vs legacy\n'bulk_deleted') so the audit trail can distinguish relevance-gate\npurges from all-or-nothing purges.",
        "operationId": "purge_orphan_web_search_deals__deal_id__documents_purge_orphan_web_search_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/documents/{doc_id}": {
      "delete": {
        "tags": [
          "deals"
        ],
        "summary": "Delete Document",
        "description": "Remove a single document from a deal's data room.\n\nAuthorisation: ``ensure_deal_access`` \u2014 anyone with read access to\nthe deal can remove its documents. This mirrors the upload route's\nauth model (no extra role gate). We intentionally don't require\nownership of the doc; data-room hygiene is a shared chore and the\naudit-log entry below records who did the delete either way.\n\nBytes on disk are NOT removed \u2014 the file_path may be shared with\ncloned deals (see ``clone_deal_documents``). The storage helper\ndeletes only the deal_documents row; orphan-byte cleanup is a\nbackground concern.",
        "operationId": "delete_document_deals__deal_id__documents__doc_id__delete",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          },
          {
            "name": "doc_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Doc Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/documents/{doc_id}/download": {
      "get": {
        "tags": [
          "deals"
        ],
        "summary": "Download Document",
        "description": "Serve a document from a deal's data room.\n\n``disposition=attachment`` (default) forces a download. ``disposition=inline``\nasks the browser to render the file in place \u2014 only honoured for known-safe\nMIME types (PDF, text/*, images); unsafe or unknown types silently fall\nback to attachment to avoid XSS via uploaded HTML/SVG.",
        "operationId": "download_document_deals__deal_id__documents__doc_id__download_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          },
          {
            "name": "doc_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Doc Id"
            }
          },
          {
            "name": "disposition",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "attachment",
              "title": "Disposition"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/compare": {
      "get": {
        "tags": [
          "deals"
        ],
        "summary": "Compare Valuations",
        "description": "Compare two valuation runs for the same deal.\n\nReturns summary-level field deltas, cashflow-level deltas, and input\n(deal + assumption) diffs.",
        "operationId": "compare_valuations_deals__deal_id__compare_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          },
          {
            "name": "run_a",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Run A"
            }
          },
          {
            "name": "run_b",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Run B"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/submit": {
      "post": {
        "tags": [
          "deals"
        ],
        "summary": "Submit Deal",
        "description": "Submit a deal for approval. Deal must be in draft or rejected status.",
        "operationId": "submit_deal_deals__deal_id__submit_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/approve": {
      "post": {
        "tags": [
          "deals"
        ],
        "summary": "Approve Deal",
        "description": "Approve a deal. Four-eyes principle enforced: submitter cannot be reviewer.",
        "operationId": "approve_deal_deals__deal_id__approve_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DealReviewRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/reject": {
      "post": {
        "tags": [
          "deals"
        ],
        "summary": "Reject Deal",
        "description": "Reject a deal. Requires a reviewer note.",
        "operationId": "reject_deal_deals__deal_id__reject_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DealReviewRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/asset-type": {
      "get": {
        "tags": [
          "deals"
        ],
        "summary": "Get Deal Asset Type",
        "description": "Classify a deal into one of the seven asset types:\ndirect_lending, mezzanine, distressed, distressed_bond, cre,\nilliquid_public, secured_borrowing.",
        "operationId": "get_deal_asset_type_deals__deal_id__asset_type_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/classifications/all": {
      "get": {
        "tags": [
          "deals"
        ],
        "summary": "List All Classifications",
        "description": "Bulk-classify every deal visible to the principal.\nReturns deal_id \u2192 asset_type + confidence per deal, plus a summary tally.",
        "operationId": "list_all_classifications_deals_classifications_all_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/deals/{deal_id}/value-auto": {
      "post": {
        "tags": [
          "deals"
        ],
        "summary": "Value Deal Auto",
        "description": "Classify a deal and run the matching multi-factor valuation engine.\nReturns {asset_type, classification, valuation_response}.",
        "operationId": "value_deal_auto_deals__deal_id__value_auto_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/search-public-financials": {
      "post": {
        "tags": [
          "deals"
        ],
        "summary": "Search Public Financials",
        "description": "Search public sources for borrower financial data using Anthropic web_search.\n\nProposal-only (D-16): never writes to the deal. Returns a structured candidate\nwith per-field provenance keyed by double-`financials` JSON Pointer paths.",
        "operationId": "search_public_financials_deals__deal_id__search_public_financials_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchPublicFinancialsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_SearchPublicFinancialsResponse_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/import-public-financials": {
      "post": {
        "tags": [
          "deals"
        ],
        "summary": "Import Public Financials",
        "operationId": "import_public_financials_deals__deal_id__import_public_financials_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportPublicFinancialsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_ImportPublicFinancialsResponse_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/assumptionsets": {
      "get": {
        "tags": [
          "assumptionsets"
        ],
        "summary": "List Assumptionsets",
        "description": "List all assumption sets (id and name) for selection in valuation.",
        "operationId": "list_assumptionsets_assumptionsets_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_list_"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      },
      "post": {
        "tags": [
          "assumptionsets"
        ],
        "summary": "Create Assumptionset",
        "operationId": "create_assumptionset_assumptionsets_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssumptionSet"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_dict_"
                }
              }
            }
          },
          "503": {
            "description": "Cannot fill default risk_free_curve \u2014 daily FRED Treasury ingest has not populated market_history yet. Clients should either provide an explicit curve or retry after the daily ingest has run."
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/assumptionsets/default-curve": {
      "get": {
        "tags": [
          "assumptionsets"
        ],
        "summary": "Get Default Curve",
        "description": "Return the most-recent UST par yield curve assembled from market_history.\n\nClients call this before POST /assumptionsets to merge the default\ncurve into their create-form state. The POST handler also enforces\nD-07 server-side as a defence against forgetful clients (see\ncreate_assumptionset below).\n\nD-09: ``CurveSpec.as_of_date`` is the FRED data date, not the request\ndate.",
        "operationId": "get_default_curve_assumptionsets_default_curve_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_dict_"
                }
              }
            }
          },
          "503": {
            "description": "Market data unavailable \u2014 daily FRED Treasury ingest has not populated market_history yet (e.g. on a fresh deploy or in CI without the FRED scheduler enabled)."
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/assumptionsets/snapshot-adhoc": {
      "post": {
        "tags": [
          "assumptionsets"
        ],
        "summary": "Snapshot Adhoc Assumptionset",
        "description": "Snapshot a transient assumption set and return its version id \u2014\nwithout persisting a discoverable parent row in `assumption_sets`.\n\nThe live-rates valuation path needs a content-addressed\n``assumption_set_version_id`` to run (and re-run, e.g. risk\ndecomposition) a DCF, but the cloned \"[Live] \u2026\" set behind it is\nthrowaway. Routing it through ``POST /assumptionsets`` used to leave a\npermanent parent row behind on every run \u2014 they accumulated unbounded.\nThis endpoint persists only the version snapshot, which is what runs\nand the audit trail actually reference.\n\n``assumption_set_id`` is normalised to a sentinel before hashing so the\nsame base set + same live curve dedupes to a single version row rather\nthan minting a new one per run.",
        "operationId": "snapshot_adhoc_assumptionset_assumptionsets_snapshot_adhoc_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssumptionSet"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_dict_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/assumptionsets/{assumption_set_id}": {
      "get": {
        "tags": [
          "assumptionsets"
        ],
        "summary": "Get Assumptionset",
        "operationId": "get_assumptionset_assumptionsets__assumption_set_id__get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "assumption_set_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Assumption Set Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_dict_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "assumptionsets"
        ],
        "summary": "Update Assumptionset",
        "description": "Overwrite an existing assumption set. The path id must match the body id.",
        "operationId": "update_assumptionset_assumptionsets__assumption_set_id__put",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "assumption_set_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Assumption Set Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssumptionSet"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_dict_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "assumptionsets"
        ],
        "summary": "Delete Assumptionset",
        "description": "Delete an assumption set and all of its version snapshots.",
        "operationId": "delete_assumptionset_assumptionsets__assumption_set_id__delete",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "assumption_set_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Assumption Set Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_dict_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/assumptionsets/{assumption_set_id}/versions": {
      "post": {
        "tags": [
          "assumptionsets"
        ],
        "summary": "Snapshot Assumptionset",
        "operationId": "snapshot_assumptionset_assumptionsets__assumption_set_id__versions_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "assumption_set_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Assumption Set Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_dict_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/assumptionsets/{assumption_set_id}/versions/{version_id}": {
      "get": {
        "tags": [
          "assumptionsets"
        ],
        "summary": "Get Assumptionset Version",
        "operationId": "get_assumptionset_version_assumptionsets__assumption_set_id__versions__version_id__get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "assumption_set_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Assumption Set Id"
            }
          },
          {
            "name": "version_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Version Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_dict_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/valuation-runs": {
      "post": {
        "tags": [
          "valuation-runs"
        ],
        "summary": "Create Run",
        "operationId": "create_run_valuation_runs_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateValuationRunRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_dict_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/valuation-runs/{run_id}": {
      "get": {
        "tags": [
          "valuation-runs"
        ],
        "summary": "Get Run",
        "operationId": "get_run_valuation_runs__run_id__get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Run Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_dict_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/valuation-runs/{run_id}/cashflows": {
      "get": {
        "tags": [
          "valuation-runs"
        ],
        "summary": "Get Run Cashflows",
        "operationId": "get_run_cashflows_valuation_runs__run_id__cashflows_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Run Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_list_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/valuation-runs/suggest-price": {
      "post": {
        "tags": [
          "valuation-runs"
        ],
        "summary": "Suggest Price",
        "operationId": "suggest_price_valuation_runs_suggest_price_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SuggestPriceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_PriceRangeResult_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/valuation-runs/valuation-range": {
      "post": {
        "tags": [
          "valuation-runs"
        ],
        "summary": "Post Valuation Range",
        "operationId": "post_valuation_range_valuation_runs_valuation_range_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ValuationRangeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_dict_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/valuation-runs/{run_id}/submit": {
      "post": {
        "tags": [
          "valuation-runs"
        ],
        "summary": "Submit Run",
        "description": "Submit a valuation run for approval. Run must be in preliminary or rejected status.",
        "operationId": "submit_run_valuation_runs__run_id__submit_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Run Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_dict_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/valuation-runs/{run_id}/approve": {
      "post": {
        "tags": [
          "valuation-runs"
        ],
        "summary": "Approve Run",
        "description": "Approve a valuation run. Four-eyes principle enforced.",
        "operationId": "approve_run_valuation_runs__run_id__approve_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Run Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunReviewRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_dict_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/valuation-runs/{run_id}/reject": {
      "post": {
        "tags": [
          "valuation-runs"
        ],
        "summary": "Reject Run",
        "description": "Reject a valuation run. Requires a reviewer note.",
        "operationId": "reject_run_valuation_runs__run_id__reject_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Run Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunReviewRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_dict_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/valuation-runs/bulk-approve": {
      "post": {
        "tags": [
          "valuation-runs"
        ],
        "summary": "Bulk Approve Runs",
        "description": "Approve multiple valuation runs in one call. Four-eyes enforced per run.",
        "operationId": "bulk_approve_runs_valuation_runs_bulk_approve_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkApproveRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_dict_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/value": {
      "post": {
        "tags": [
          "value"
        ],
        "summary": "Post Value",
        "description": "Run valuation from simplified request. Returns ValuationRecord with PV range,\nspread decomposition, range width drivers, cashflows, and full inputs snapshot.\n\nIf `market.ois_curve` is omitted, it is auto-populated from live market data\n(FRED SOFR + CME Term SOFR + US Treasuries).",
        "operationId": "post_value_value_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ValuationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_ValuationRecord_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/value/from-deal": {
      "post": {
        "tags": [
          "value"
        ],
        "summary": "Post Value From Deal",
        "description": "Run full valuation from a deal version + market env ref + optional credit basis.\nReturns full ValuationRecord (same as POST /value) for report generation.\n\npersist=True (default): gate sandbox writes, snapshot resolved content, persist run.\npersist=False: compute-on-open headline recompute \u2014 no write, sandbox-safe (D-08).",
        "operationId": "post_value_from_deal_value_from_deal_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FromDealRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_ValuationRecord_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/value/full": {
      "post": {
        "tags": [
          "value"
        ],
        "summary": "Post Value Full",
        "operationId": "post_value_full_value_full_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FullValuationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_FullValuationResponse_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/value/monte-carlo": {
      "post": {
        "tags": [
          "value"
        ],
        "summary": "Post Monte Carlo",
        "description": "Run Monte Carlo stress testing simulation on a deal.\n\nGenerates correlated rate + spread shocks, reprices via the deterministic\nDCF engine on each path, and returns risk statistics (VaR, CVaR,\ndistribution histogram, worst paths).\n\nCore pricing remains fully deterministic \u2014 Monte Carlo is for stress\ntesting only.",
        "operationId": "post_monte_carlo_value_monte_carlo_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MonteCarloRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_MonteCarloResponse_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/value/generate-report": {
      "post": {
        "tags": [
          "value"
        ],
        "summary": "Post Generate Report",
        "description": "Generate an AI-composed narrative report from a ValuationRecord.\nUses local LLM (Ollama or OpenAI-compatible) if available.\nReturns markdown narrative; falls back to empty if LLM unavailable.",
        "operationId": "post_generate_report_value_generate_report_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/app__api__value__GenerateReportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_dict_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/value/solve-dm": {
      "post": {
        "tags": [
          "value"
        ],
        "summary": "Post Solve Dm",
        "description": "Solve for the implied discount margin (spread in bps) that reprices\nthe loan to the given target clean price per 100.\n\nUses bisection on the monotonically-decreasing price(spread) function.\nReturns the solved spread, achieved price, and a full valuation snapshot\nat the solution.",
        "operationId": "post_solve_dm_value_solve_dm_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SolveDMRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_SolveDMResponse_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/analytics/sensitivity": {
      "post": {
        "tags": [
          "analytics"
        ],
        "summary": "Post Sensitivity",
        "operationId": "post_sensitivity_analytics_sensitivity_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SensitivityRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_dict_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/analytics/sensitivity/ladder": {
      "post": {
        "tags": [
          "analytics"
        ],
        "summary": "Post Sensitivity Ladder",
        "operationId": "post_sensitivity_ladder_analytics_sensitivity_ladder_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LadderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_dict_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/analytics/validation": {
      "post": {
        "tags": [
          "analytics"
        ],
        "summary": "Post Validation",
        "operationId": "post_validation_analytics_validation_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ValidationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_dict_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/analytics/audit": {
      "get": {
        "tags": [
          "analytics"
        ],
        "summary": "List Audit Records",
        "description": "List audit records (metadata only) for deals the caller can access.",
        "operationId": "list_audit_records_analytics_audit_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_dict_"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/analytics/audit/{run_id}": {
      "get": {
        "tags": [
          "analytics"
        ],
        "summary": "Get Audit Record",
        "description": "Get a full audit record by run ID (deal-scoped).",
        "operationId": "get_audit_record_analytics_audit__run_id__get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Run Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_dict_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/analytics/audit/{run_id}/verify": {
      "get": {
        "tags": [
          "analytics"
        ],
        "summary": "Verify Audit Integrity",
        "description": "Verify tamper-detection hashes for an audit record (deal-scoped).",
        "operationId": "verify_audit_integrity_analytics_audit__run_id__verify_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Run Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_dict_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/analytics/sensitivity/blended": {
      "post": {
        "tags": [
          "analytics"
        ],
        "summary": "Post Blended Sensitivity",
        "description": "Run the blended valuation for a grid of market-drift bumps.\n\nEach result row carries the blended PV, the approach tag, the EV-coverage\nratio, and a per-scenario breakdown \u2014 so callers can see exactly how the\nweights translate into the headline price.",
        "operationId": "post_blended_sensitivity_analytics_sensitivity_blended_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BlendedSensitivityRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_dict_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/analytics/scenarios": {
      "get": {
        "tags": [
          "analytics"
        ],
        "summary": "List Scenarios",
        "description": "List all available regulatory stress scenarios.",
        "operationId": "list_scenarios_analytics_scenarios_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_dict_"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/value/multi-factor/strategies": {
      "get": {
        "tags": [
          "multi-factor"
        ],
        "summary": "List Strategies",
        "operationId": "list_strategies_value_multi_factor_strategies_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_dict_"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/value/multi-factor": {
      "post": {
        "tags": [
          "multi-factor"
        ],
        "summary": "Value Multi Factor",
        "operationId": "value_multi_factor_value_multi_factor_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "query",
            "required": false,
            "schema": {
              "title": "Deal Id",
              "type": "string",
              "nullable": true
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/DirectLendingRequest"
                  },
                  {
                    "$ref": "#/components/schemas/MezzanineRequest"
                  },
                  {
                    "$ref": "#/components/schemas/DistressedRequest"
                  },
                  {
                    "$ref": "#/components/schemas/DistressedBondRequest"
                  },
                  {
                    "$ref": "#/components/schemas/CRERequest"
                  },
                  {
                    "$ref": "#/components/schemas/IlliquidBondRequest"
                  },
                  {
                    "$ref": "#/components/schemas/SecuredBorrowingRequest"
                  }
                ],
                "discriminator": {
                  "propertyName": "strategy",
                  "mapping": {
                    "direct_lending": "#/components/schemas/DirectLendingRequest",
                    "mezzanine": "#/components/schemas/MezzanineRequest",
                    "distressed": "#/components/schemas/DistressedRequest",
                    "distressed_bond": "#/components/schemas/DistressedBondRequest",
                    "cre": "#/components/schemas/CRERequest",
                    "illiquid_public": "#/components/schemas/IlliquidBondRequest",
                    "secured_borrowing": "#/components/schemas/SecuredBorrowingRequest"
                  }
                },
                "title": "Body"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_Union_DirectLendingResponse__MezzanineResponse__DistressedResponse__DistressedBondResponse__CREResponse__IlliquidBondResponse__SecuredBorrowingResponse__"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/value/multi-factor/cycle-stage": {
      "post": {
        "tags": [
          "multi-factor"
        ],
        "summary": "Detect Cycle Stage Endpoint",
        "description": "Derive the credit cycle stage \u03a9 from a market spread time series.\n\nAccepts a list of spread index observations (compatible with LSTA/LCD format)\nand returns the detected stage, a confidence score, and a per-signal breakdown.\n\nThe detected stage is informational.  To price a deal using this stage, pass\nthe returned ``stage`` value as ``cycle_stage`` in the relevant strategy request.\nIf you supply ``cycle_stage`` explicitly in a strategy request it always takes\nprecedence \u2014 this endpoint lets you inspect the market-implied \u03a9 alongside\nyour manual override for full transparency.",
        "operationId": "detect_cycle_stage_endpoint_value_multi_factor_cycle_stage_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CycleStageRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_CycleStageResponse_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/value/multi-factor/cycle-stage/auto": {
      "get": {
        "tags": [
          "multi-factor"
        ],
        "summary": "Detect Cycle Stage Auto Endpoint",
        "description": "Auto-detect the credit cycle stage \u03a9 from live market data.\n\nPulls Verus composite HY/BB/CCC level histories and feeds them into\ndetect_cycle_stage(). Applies a UST 2s10s tiebreaker (inverted curve for\nthe last 3 months pushes the stage one level later). Returns the detected\nstage, confidence, and signal breakdown. On fetch failure, falls back to\nMID with confidence 0.30.",
        "operationId": "detect_cycle_stage_auto_endpoint_value_multi_factor_cycle_stage_auto_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_CycleStageResponse_"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/value/multi-factor/calibrate": {
      "post": {
        "tags": [
          "multi-factor"
        ],
        "summary": "Calibrate Multi Factor",
        "description": "Estimate empirical factor weights and breakpoints from a labelled default dataset.\n\nAddresses methodology limitation L1: current weights and scoring breakpoints are\nset by expert judgement.  This endpoint fits logistic regression weights and\nisotonic breakpoints from observed default data, runs 5-fold cross-validation,\nand returns a side-by-side comparison against expert parameters.\n\n**Live parameters are NOT modified** unless ``confirm=True`` is set.\nWhen ``confirm=True`` the fitted calibration is registered as the active\noverride for the strategy \u2014 all subsequent scoring calls for that strategy\nwill use empirical weights until the override is cleared via the engine's\n``clear_calibration()`` function.\n\nTo test the pipeline before real data is available, set ``use_synthetic=True``\nto generate observations from the expert breakpoints as the data-generating\nprocess.\n\nRate limited to 5 requests/minute (calibration is CPU-intensive).",
        "operationId": "calibrate_multi_factor_value_multi_factor_calibrate_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalibrateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_CalibrateResponse_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/value/unified": {
      "post": {
        "tags": [
          "unified"
        ],
        "summary": "Post Value Unified",
        "operationId": "post_value_unified_value_unified_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnifiedValuationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_UnifiedValuationResponse_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/portfolio/scenarios": {
      "get": {
        "tags": [
          "portfolio"
        ],
        "summary": "List Scenarios",
        "description": "List all available macro scenarios (predefined + custom).",
        "operationId": "list_scenarios_portfolio_scenarios_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_Any_"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      },
      "post": {
        "tags": [
          "portfolio"
        ],
        "summary": "Create Scenario",
        "description": "Create a custom macro scenario.",
        "operationId": "create_scenario_portfolio_scenarios_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateScenarioRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_Any_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/portfolio/stress-test": {
      "post": {
        "tags": [
          "portfolio"
        ],
        "summary": "Post Stress Test",
        "description": "Run portfolio-level macro stress test across selected deals and scenarios.",
        "operationId": "post_stress_test_portfolio_stress_test_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PortfolioStressRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_Any_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/portfolio/concentration": {
      "get": {
        "tags": [
          "portfolio"
        ],
        "summary": "Portfolio Concentration",
        "description": "Portfolio concentration risk metrics: HHI by borrower/sector,\ntop-N exposures, maturity ladder, breakdowns, and risk flags.\n\n``scope='mine'`` restricts the rollup to deals that sit in funds the\ncaller is a member of \u2014 meaningful for privileged principals who\notherwise see every deal.",
        "operationId": "portfolio_concentration_portfolio_concentration_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "all",
              "title": "Scope"
            }
          },
          {
            "name": "base",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Reporting currency to express every amount in (e.g. GBP). Amounts are converted per deal at the H.10 rate pinned to as_of_date; deals whose currency has no rate are excluded and listed under fx.unconverted. Omit to leave amounts in their own currencies (summed as-is).",
              "title": "Base",
              "type": "string",
              "nullable": true
            },
            "description": "Reporting currency to express every amount in (e.g. GBP). Amounts are converted per deal at the H.10 rate pinned to as_of_date; deals whose currency has no rate are excluded and listed under fx.unconverted. Omit to leave amounts in their own currencies (summed as-is)."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_Any_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/portfolio/fund-metrics": {
      "get": {
        "tags": [
          "portfolio"
        ],
        "summary": "Portfolio Fund Metrics",
        "description": "Fund-level return metrics: IRR, MOIC, TVPI, DPI, RVPI, PIC.\nFair values sourced from the most recent valuation run per deal (if any).\n\n``scope='mine'`` restricts the calculation to deals sitting in funds\nthe caller is a member of.",
        "operationId": "portfolio_fund_metrics_portfolio_fund_metrics_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "all",
              "title": "Scope"
            }
          },
          {
            "name": "base",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Reporting currency to express every amount in (e.g. GBP). Amounts are converted per deal at the H.10 rate pinned to as_of_date; deals whose currency has no rate are excluded and listed under fx.unconverted. Omit to leave amounts in their own currencies (summed as-is).",
              "title": "Base",
              "type": "string",
              "nullable": true
            },
            "description": "Reporting currency to express every amount in (e.g. GBP). Amounts are converted per deal at the H.10 rate pinned to as_of_date; deals whose currency has no rate are excluded and listed under fx.unconverted. Omit to leave amounts in their own currencies (summed as-is)."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_Any_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/portfolio/summary": {
      "get": {
        "tags": [
          "portfolio"
        ],
        "summary": "Portfolio Summary",
        "description": "Lightweight portfolio summary: deal count, total notional, sectors, currencies.\n\nWith ``?base=`` the total is expressed in that currency (per-deal H.10\nconversion, unquoted currencies excluded and listed); ``currencies`` and\n``sectors`` always count every deal.",
        "operationId": "portfolio_summary_portfolio_summary_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "base",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Reporting currency to express every amount in (e.g. GBP). Amounts are converted per deal at the H.10 rate pinned to as_of_date; deals whose currency has no rate are excluded and listed under fx.unconverted. Omit to leave amounts in their own currencies (summed as-is).",
              "title": "Base",
              "type": "string",
              "nullable": true
            },
            "description": "Reporting currency to express every amount in (e.g. GBP). Amounts are converted per deal at the H.10 rate pinned to as_of_date; deals whose currency has no rate are excluded and listed under fx.unconverted. Omit to leave amounts in their own currencies (summed as-is)."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_Any_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/credit-analysis": {
      "post": {
        "tags": [
          "credit-analysis"
        ],
        "summary": "Run Credit Analysis",
        "operationId": "run_credit_analysis_deals__deal_id__credit_analysis_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FundamentalCreditInputs"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_FundamentalCreditResult_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "credit-analysis"
        ],
        "summary": "Get Credit Analysis",
        "operationId": "get_credit_analysis_deals__deal_id__credit_analysis_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_FundamentalCreditResult_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/apply-company-factor-delta": {
      "post": {
        "tags": [
          "credit-analysis"
        ],
        "summary": "Apply Company Factor Delta",
        "description": "Explicitly apply the multi-factor composite's company delta to the mark.\n\nThe analyst supplies the composite score they are looking at on the\nMulti-Factor tab; the bps delta is recomputed server-side from that score\n(pure, deterministic, bounded \u2014 app/engine/company_spread_delta.py) and\npersisted on the deal's CreditBasisState. Same trust model as\nManualOverrides: an explicit, audited analyst action. The yield-path\nresolver stamps it onto the resolved assumption set on the next Run, so\nthe Spread Recipe's \"Company-factor delta\" row moves only on this action \u2014\nthe shared Market Env assumption set is never mutated.\n\nRefused for manual_override deals (the hand-set spread is already the\nfull mark; composing a delta on top would double-count).",
        "operationId": "apply_company_factor_delta_deals__deal_id__apply_company_factor_delta_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplyCompanyDeltaRequest",
                "default": {
                  "clear": false
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/credit-analysis/apply-to-assumptions": {
      "post": {
        "tags": [
          "credit-analysis"
        ],
        "summary": "Apply Credit Analysis To Assumptions",
        "description": "Write the deal's fundamental credit analysis into a deal-specific\nassumption set so the DCF prices the curve the issuer analysis implies.\n\n- Re-runs ``derive_credit_assumptions`` from the persisted inputs.\n- Clones MARKET + VALUATION assumptions (risk-free curve, spread,\n  deltas) from ``base_assumption_set_id`` untouched \u2014 only the CREDIT\n  block (hazard term + recovery) is set from the analysis. This keeps the\n  market spread separate from the fundamental PD/recovery view.\n- Idempotent: writes to ``{deal_id}-CREDIT`` so re-applying updates the\n  same set rather than spawning duplicates.",
        "operationId": "apply_credit_analysis_to_assumptions_deals__deal_id__credit_analysis_apply_to_assumptions_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplyToAssumptionsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_dict_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/extract-credit-data": {
      "post": {
        "tags": [
          "credit-analysis"
        ],
        "summary": "Extract Credit Data",
        "operationId": "extract_credit_data_deals__deal_id__extract_credit_data_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ExtractCreditDataRequest"
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                ],
                "title": "Body"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_ExtractCreditDataResponse_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/liquidation-analysis": {
      "post": {
        "tags": [
          "liquidation"
        ],
        "summary": "Run Liquidation Analysis",
        "description": "Run the liquidation approach on a deal.\n\n- Line-item haircuts on balance-sheet assets\n- Forced-sale ``liquidation_discount_pct`` applied on top\n- Waterfall distribution through the capital structure read from\n  ``deal.observations.financials.capital_structure``\n- PV discounted at risk-free + distressed spread over recovery lag\n\nPersists the raw inputs to ``deal.observations.liquidation_inputs``.",
        "operationId": "run_liquidation_analysis_deals__deal_id__liquidation_analysis_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LiquidationInputs"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Run Liquidation Analysis Deals  Deal Id  Liquidation Analysis Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/impairment-review": {
      "post": {
        "tags": [
          "impairment"
        ],
        "summary": "Create Impairment Review",
        "operationId": "create_impairment_review_deals__deal_id__impairment_review_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImpairmentReviewIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImpairmentReview"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "impairment"
        ],
        "summary": "Get Latest Impairment Review",
        "operationId": "get_latest_impairment_review_deals__deal_id__impairment_review_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImpairmentReview"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/impairment-reviews": {
      "get": {
        "tags": [
          "impairment"
        ],
        "summary": "List Impairment Reviews",
        "operationId": "list_impairment_reviews_deals__deal_id__impairment_reviews_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/comparables": {
      "get": {
        "tags": [
          "comparables"
        ],
        "summary": "List Comparables",
        "description": "Return every comparable, newest-first by ``as_of_date``.",
        "operationId": "list_comparables_comparables_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 10000,
              "minimum": 1,
              "default": 1000,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000000000,
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response List Comparables Comparables Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "comparables"
        ],
        "summary": "Create Comparable",
        "operationId": "create_comparable_comparables_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ComparableDealIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComparableDeal"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/comparables/{comp_id}": {
      "get": {
        "tags": [
          "comparables"
        ],
        "summary": "Get Comparable",
        "operationId": "get_comparable_comparables__comp_id__get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "comp_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Comp Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComparableDeal"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "comparables"
        ],
        "summary": "Delete Comparable",
        "operationId": "delete_comparable_comparables__comp_id__delete",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "comp_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Comp Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Delete Comparable Comparables  Comp Id  Delete"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/comparables/query": {
      "post": {
        "tags": [
          "comparables"
        ],
        "summary": "Query Comparables",
        "description": "Run feature-weighted nearest-neighbour search against the pool.",
        "operationId": "query_comparables_comparables_query_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ComparableQuery"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComparableQueryResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/deals/{deal_id}/comparables": {
      "post": {
        "tags": [
          "comparables"
        ],
        "summary": "Deal Comparables",
        "description": "Derive a query from ``deal_id`` and return the nearest comparables.",
        "operationId": "deal_comparables_deals__deal_id__comparables_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          },
          {
            "name": "k",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 10,
              "title": "K"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComparableQueryResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/reports": {
      "post": {
        "tags": [
          "reports"
        ],
        "summary": "Generate Report",
        "operationId": "generate_report_deals__deal_id__reports_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/app__api__reports__GenerateReportRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_ReportDetail_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "reports"
        ],
        "summary": "List Reports",
        "operationId": "list_reports_deals__deal_id__reports_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_list_ReportSummary__"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/reports/{report_id}": {
      "get": {
        "tags": [
          "reports"
        ],
        "summary": "Get Report",
        "operationId": "get_report_deals__deal_id__reports__report_id__get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          },
          {
            "name": "report_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Report Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_ReportDetail_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "reports"
        ],
        "summary": "Delete Report",
        "operationId": "delete_report_deals__deal_id__reports__report_id__delete",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          },
          {
            "name": "report_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Report Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/reports/{report_id}/download": {
      "get": {
        "tags": [
          "reports"
        ],
        "summary": "Download Report",
        "operationId": "download_report_deals__deal_id__reports__report_id__download_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          },
          {
            "name": "report_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Report Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/reports/{report_id}/pdf": {
      "get": {
        "tags": [
          "reports"
        ],
        "summary": "Download Report Pdf",
        "operationId": "download_report_pdf_deals__deal_id__reports__report_id__pdf_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          },
          {
            "name": "report_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Report Id"
            }
          },
          {
            "name": "inline",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Set Content-Disposition to 'inline' for iframe / new-tab preview rendering instead of forcing a save-as. The frontend PDF viewer (ReportsTab.tsx) passes this; download buttons do not. Without inline=true some browsers download the file even when the user only wanted to view it inside a blob iframe.",
              "default": false,
              "title": "Inline"
            },
            "description": "Set Content-Disposition to 'inline' for iframe / new-tab preview rendering instead of forcing a save-as. The frontend PDF viewer (ReportsTab.tsx) passes this; download buttons do not. Without inline=true some browsers download the file even when the user only wanted to view it inside a blob iframe."
          },
          {
            "name": "fund_id",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Optional fund whose white-label branding is applied to the PDF.",
              "title": "Fund Id",
              "type": "string",
              "nullable": true
            },
            "description": "Optional fund whose white-label branding is applied to the PDF."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/market-data/curves": {
      "get": {
        "tags": [
          "market-data"
        ],
        "summary": "Get Live Curves",
        "description": "Return current SOFR OIS curve, Term SOFR, and EURIBOR pillars.\nResults cached 1 hour. Use ?refresh=true to force re-fetch.",
        "operationId": "get_live_curves_market_data_curves_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "refresh",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Force bypass cache",
              "default": false,
              "title": "Refresh"
            },
            "description": "Force bypass cache"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/market-data/rates": {
      "get": {
        "tags": [
          "market-data"
        ],
        "summary": "Get Stored Rates",
        "description": "Return latest stored market rates from DB.\nIncludes Term SOFR, EURIBOR, and SOFR OIS pillars.",
        "operationId": "get_stored_rates_market_data_rates_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "index",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Filter by index: TERM_SOFR, EURIBOR, SOFR_OIS",
              "title": "Index"
            },
            "description": "Filter by index: TERM_SOFR, EURIBOR, SOFR_OIS"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/market-data/rates/history": {
      "get": {
        "tags": [
          "market-data"
        ],
        "summary": "Get Rate History",
        "description": "Return historical daily rates for a specific index and tenor.",
        "operationId": "get_rate_history_market_data_rates_history_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "index",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Index name: TERM_SOFR, EURIBOR, SOFR_OIS",
              "title": "Index"
            },
            "description": "Index name: TERM_SOFR, EURIBOR, SOFR_OIS"
          },
          {
            "name": "tenor",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Tenor: 1M, 3M, 6M, 1Y, etc.",
              "title": "Tenor"
            },
            "description": "Tenor: 1M, 3M, 6M, 1Y, etc."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 365,
              "minimum": 1,
              "default": 90,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/market-data/history/coverage": {
      "get": {
        "tags": [
          "market-data"
        ],
        "summary": "Get History Coverage",
        "description": "Per-series row count + date range from the persistent market_history table.",
        "operationId": "get_history_coverage_market_data_history_coverage_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/market-data/history/series": {
      "get": {
        "tags": [
          "market-data"
        ],
        "summary": "Get History Series",
        "description": "Return the full persisted history for a FRED series.",
        "operationId": "get_history_series_market_data_history_series_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "series_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "FRED series ID (e.g. DGS10)",
              "title": "Series Id"
            },
            "description": "FRED series ID (e.g. DGS10)"
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "description": "ISO date; null = all",
              "title": "Start Date",
              "type": "string",
              "nullable": true
            },
            "description": "ISO date; null = all"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/market-data/rates/refresh": {
      "post": {
        "tags": [
          "market-data"
        ],
        "summary": "Refresh Rates",
        "description": "Force a fresh fetch of all market rates and persist to DB.",
        "operationId": "refresh_rates_market_data_rates_refresh_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/market-data/credit/live": {
      "get": {
        "tags": [
          "market-data"
        ],
        "summary": "Get Live Credit",
        "description": "Live credit spreads & hazard rates per rating, derived from FRED OAS.\nSource: Verus composite buckets (BBB, BB, B, CCC). Hazards via credit triangle.\nCache: 4 hours (FRED updates daily).",
        "operationId": "get_live_credit_market_data_credit_live_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "refresh",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Force bypass 4h cache",
              "default": false,
              "title": "Refresh"
            },
            "description": "Force bypass 4h cache"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/market-data/credit/hazard/{rating}": {
      "get": {
        "tags": [
          "market-data"
        ],
        "summary": "Get Live Hazard For Rating",
        "description": "Live hazard term structure for a given rating, derived from FRED OAS.\nReturns 3-segment piecewise-constant hazard (0-2y, 2-5y, 5-Ny).",
        "operationId": "get_live_hazard_for_rating_market_data_credit_hazard__rating__get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "rating",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Rating"
            }
          },
          {
            "name": "horizon_years",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "default": 7.0,
              "title": "Horizon Years"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/market-data/credit/refresh": {
      "post": {
        "tags": [
          "market-data"
        ],
        "summary": "Refresh Credit",
        "description": "Refresh the multi-factor CalibrationSet registry with live FRED OAS.\nOverwrites \u03c3 (credit spread) and \u03c0 (illiquidity premium) bounds for every\nstrategy in each target market. Affects all subsequent multi-factor valuations.",
        "operationId": "refresh_credit_market_data_credit_refresh_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "markets",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Comma-separated markets (e.g. 'USD,EUR'). Default all.",
              "title": "Markets",
              "type": "string",
              "nullable": true
            },
            "description": "Comma-separated markets (e.g. 'USD,EUR'). Default all."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/market-data/curves/{currency}": {
      "get": {
        "tags": [
          "market-data"
        ],
        "summary": "Get Currency Curve",
        "description": "Return the current rate curve for a given currency (USD, EUR, GBP).\n\nChecks in-memory cache, then SQLite, then fetches live from FRED / ECB / BoE.\nDefault cache window is 24 hours.\n\nCurve types returned:\n- USD: SOFR term structure (1D overnight, 1M/3M/6M averages)\n- EUR: EURIBOR fixings (ESTR overnight, 1M/3M/6M/1Y)\n- GBP: SONIA (overnight + term OIS where available)",
        "operationId": "get_currency_curve_market_data_curves__currency__get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "currency",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Currency"
            }
          },
          {
            "name": "max_age_hours",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 168,
              "minimum": 1,
              "description": "Max cache age in hours",
              "default": 24,
              "title": "Max Age Hours"
            },
            "description": "Max cache age in hours"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/market-data/equity/{ticker}": {
      "get": {
        "tags": [
          "market-data"
        ],
        "summary": "Get Equity Market Value",
        "description": "Return per-year equity market caps for a public issuer ticker.\n\nThin pass-through to equity_market_value.fetch_market_values() \u2014 the\nsingle chokepoint that owns the 4h cache, 2-concurrency throttle, and\nJUNO_MARKETDATA_OFFLINE short-circuit. This endpoint duplicates none\nof that.\n\nOn EquityMarketValueUnavailable (offline, invalid ticker, fetch\nfailure, stale data) returns HTTP 200 with available=False so the\nfrontend can cleanly distinguish \"ticker set but fetch failed\" from\n\"no ticker\" (the latter never calls this endpoint at all).",
        "operationId": "get_equity_market_value_market_data_equity__ticker__get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "years",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Comma-separated year whitelist, e.g. '2022,2023,2024'",
              "title": "Years",
              "type": "string",
              "nullable": true
            },
            "description": "Comma-separated year whitelist, e.g. '2022,2023,2024'"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/market-data/ingest/fred": {
      "post": {
        "tags": [
          "market-data"
        ],
        "summary": "Trigger Fred Daily Ingest",
        "description": "Manually trigger the FRED daily ingest (public-domain Treasury par yields).\nUpdates the market_history table and clears the stale-data banner.\nAdmin only, rate-limited.\n\nWorks with or without FRED_API_KEY: Treasury series fall back to the\nanonymous CSV endpoint when the key is absent.",
        "operationId": "trigger_fred_daily_ingest_market_data_ingest_fred_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/market-data/curves/refresh": {
      "post": {
        "tags": [
          "market-data"
        ],
        "summary": "Refresh All Market Curves",
        "description": "Force refresh all registered rate curves (SOFR, EURIBOR, SONIA, Treasuries)\nand persist to SQLite.  Admin only, rate-limited.",
        "operationId": "refresh_all_market_curves_market_data_curves_refresh_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/market-data/rates/sofr": {
      "get": {
        "tags": [
          "market-data"
        ],
        "summary": "Get Sofr Rate",
        "description": "Return current SOFR rates (overnight + term averages).\n\nSources: FRED SOFR (overnight), SOFR 30/90/180-day averages.\nCached for 24 hours.",
        "operationId": "get_sofr_rate_market_data_rates_sofr_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/market-data/rates/euribor": {
      "get": {
        "tags": [
          "market-data"
        ],
        "summary": "Get Euribor Rate",
        "description": "Return current EURIBOR rates (ESTR overnight + term fixings).\n\nSources: ECB SDW, FRED monthly averages as fallback.\nCached for 24 hours.",
        "operationId": "get_euribor_rate_market_data_rates_euribor_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/market-data/freshness": {
      "get": {
        "tags": [
          "market-data"
        ],
        "summary": "Get Market Freshness",
        "description": "Return the freshness of the daily-FRED-series market_history rows.\n\nShape::\n\n    {\n        \"as_of_date\":         \"YYYY-MM-DD\" | null,   # OLDEST series obs\n        \"business_days_old\":  int | null,            # age of the oldest\n        \"is_stale\":           bool,\n        \"newest_as_of_date\":  \"YYYY-MM-DD\" | null,\n        \"series_total\":       int,\n        \"stale_series_count\": int,   # series individually stale or absent\n    }\n\nThe pinned par curve consumes ALL of DAILY_FRED_SERIES (see\nvaluation_runs pin_market_context), so freshness is governed by the\nOLDEST series date \u2014 one freshly-ingested tenor must not mask ten\nstale ones. ``is_stale`` is True when the oldest series is more than\n``STALE_AFTER_BUSINESS_DAYS`` business days old OR any series has no\ndata at all \u2014 empty market_history is treated as stale-equivalent.\n\n``business_days_old`` is reported unchanged; only the threshold moved.\nA healthy pipeline reads 2 during business hours \u2014 see the constant for\nwhy that is the floor and not a symptom.",
        "operationId": "get_market_freshness_market_data_freshness_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Get Market Freshness Market Data Freshness Get"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/market-data/cds/history": {
      "get": {
        "tags": [
          "cds"
        ],
        "summary": "Cds History",
        "operationId": "cds_history_market_data_cds_history_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "CDS index ticker, e.g. CDX.NA.HY",
              "title": "Ticker"
            },
            "description": "CDS index ticker, e.g. CDX.NA.HY"
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1825,
              "minimum": 1,
              "default": 90,
              "title": "Days"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Cds History Market Data Cds History Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/market-data/cds/refresh": {
      "post": {
        "tags": [
          "cds"
        ],
        "summary": "Cds Refresh",
        "operationId": "cds_refresh_market_data_cds_refresh_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1825,
              "minimum": 1,
              "default": 365,
              "title": "Days"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Cds Refresh Market Data Cds Refresh Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/market-data/sector-validation": {
      "get": {
        "tags": [
          "sector-validation",
          "market-data"
        ],
        "summary": "Get Sector Validation",
        "operationId": "get_sector_validation_market_data_sector_validation_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "sector",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Internal sector name",
              "title": "Sector"
            },
            "description": "Internal sector name"
          },
          {
            "name": "lookback_days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 2000,
              "minimum": 30,
              "default": 365,
              "title": "Lookback Days"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Sector Validation Market Data Sector Validation Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/market-data/sector-validation/all": {
      "get": {
        "tags": [
          "sector-validation",
          "market-data"
        ],
        "summary": "Get All Sector Validation",
        "operationId": "get_all_sector_validation_market_data_sector_validation_all_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "lookback_days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 2000,
              "minimum": 30,
              "default": 365,
              "title": "Lookback Days"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get All Sector Validation Market Data Sector Validation All Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/benchmark/cohort": {
      "get": {
        "tags": [
          "benchmark"
        ],
        "summary": "Get Cohort",
        "description": "Sector \u00d7 vintage \u00d7 seniority cohort median + p25/p75 spread bands (bps).\n\nDispersion-first contract: every response includes per-BDC attribution\nplus an as-of-date range watermark so the UI can never silently surface\na stale or blended figure.",
        "operationId": "get_cohort_benchmark_cohort_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "sector",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Sector filter (case-insensitive exact match). Measured state as of the 2026-08-19 snapshot: bdc_holdings.sector is non-null on 16 of 44,601 rows, all carrying the single value 'healthcare' \u2014 the Phase 4 HARD-02 matched-deal lookup this once promised never populated it, and ingest does not write it. Any sector-filtered query therefore returns cohort_too_small in practice. The column is kept because this filter and the peer-benchmark cohort below both read it, so reviving it is a data problem, not a code one; note that exact equality would also need a controlled vocabulary on both sides, since deal sectors are free-text compounds ('Healthcare / Veterinary Services') that equal nothing here.",
              "title": "Sector",
              "type": "string",
              "nullable": true
            },
            "description": "Sector filter (case-insensitive exact match). Measured state as of the 2026-08-19 snapshot: bdc_holdings.sector is non-null on 16 of 44,601 rows, all carrying the single value 'healthcare' \u2014 the Phase 4 HARD-02 matched-deal lookup this once promised never populated it, and ingest does not write it. Any sector-filtered query therefore returns cohort_too_small in practice. The column is kept because this filter and the peer-benchmark cohort below both read it, so reviving it is a data problem, not a code one; note that exact equality would also need a controlled vocabulary on both sides, since deal sectors are free-text compounds ('Healthcare / Veterinary Services') that equal nothing here."
          },
          {
            "name": "vintage_year",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Vintage year with \u00b11yr window (vintage_year \u2212 1 \u2026 vintage_year + 1)",
              "title": "Vintage Year",
              "type": "integer",
              "maximum": 2035,
              "minimum": 2000,
              "nullable": true
            },
            "description": "Vintage year with \u00b11yr window (vintage_year \u2212 1 \u2026 vintage_year + 1)"
          },
          {
            "name": "seniority",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Seniority bucket \u2014 must be one of the canonical enum values",
              "title": "Seniority",
              "enum": [
                "senior_secured",
                "mezzanine",
                "subordinated",
                "equity",
                "unsecured",
                "unknown"
              ],
              "type": "string",
              "nullable": true
            },
            "description": "Seniority bucket \u2014 must be one of the canonical enum values"
          },
          {
            "name": "min_cohort_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 50,
              "minimum": 5,
              "description": "Minimum spread-bearing holdings to return stats (<5 returns cohort_too_small)",
              "default": 5,
              "title": "Min Cohort Size"
            },
            "description": "Minimum spread-bearing holdings to return stats (<5 returns cohort_too_small)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CohortResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/benchmark/portfolio": {
      "get": {
        "tags": [
          "benchmark"
        ],
        "summary": "Portfolio Benchmark",
        "description": "Notional-weighted book WAS vs unweighted BDC median for the cohort.\n\nPrivileged principals (admin/CEO/env keys) without a ``user_id`` see no\nbook deals \u2014 the endpoint is per-user by construction. To inspect a\nspecific user's book, an admin tool can impersonate (out of scope for\nthis surface).",
        "operationId": "portfolio_benchmark_benchmark_portfolio_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "sector",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Sector filter (case-insensitive exact match)",
              "title": "Sector",
              "type": "string",
              "maxLength": 64,
              "nullable": true
            },
            "description": "Sector filter (case-insensitive exact match)"
          },
          {
            "name": "vintage_year",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Vintage year. Book filter is exact match on the deal's origination_date year; BDC filter uses \u00b11yr window per Phase 2 cohort precedent.",
              "title": "Vintage Year",
              "type": "integer",
              "maximum": 2035,
              "minimum": 2000,
              "nullable": true
            },
            "description": "Vintage year. Book filter is exact match on the deal's origination_date year; BDC filter uses \u00b11yr window per Phase 2 cohort precedent."
          },
          {
            "name": "rating",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Implied rating bucket (book side only \u2014 bdc_holdings carries no rating column at this Phase).",
              "title": "Rating",
              "type": "string",
              "maxLength": 8,
              "nullable": true
            },
            "description": "Implied rating bucket (book side only \u2014 bdc_holdings carries no rating column at this Phase)."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_PortfolioBenchmarkResponse_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/benchmark-variance": {
      "get": {
        "tags": [
          "benchmark-variance",
          "benchmark-variance"
        ],
        "summary": "BDC-filed benchmark marks for a deal (HARD-02)",
        "description": "Returns BDC 10-Q portfolio holdings matched to this deal, with per-BDC attribution, match-confidence badges, and as-of-date watermark. Never mutates ValuationOutputs (D-14 / HARD-02). Performs an idempotent first-touch backfill into bdc_holdings the first time a deal is queried; subsequent calls are pure reads.",
        "operationId": "get_benchmark_variance_deals__deal_id__benchmark_variance_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_BenchmarkVarianceResponse_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/calibration/spread-bounds": {
      "get": {
        "tags": [
          "calibration"
        ],
        "summary": "Get Spread Bounds",
        "description": "Returns market-calibrated spread bounds for each private credit strategy,\nanchored to the live Verus spread composite. Also compares against the\ncurrent hardcoded defaults so you can see how market conditions have shifted.\n\nResults are cached for 4 hours. Use ?refresh=true to force a new fetch.",
        "operationId": "get_spread_bounds_calibration_spread_bounds_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "refresh",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Force bypass cache and re-fetch from FRED",
              "default": false,
              "title": "Refresh"
            },
            "description": "Force bypass cache and re-fetch from FRED"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalibrationResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/calibration/console": {
      "get": {
        "tags": [
          "calibration"
        ],
        "summary": "Get Calibration Console",
        "description": "Read-only ops snapshot of the Verus spread composite: live curve levels,\nCDS-overlay freshness (business-day staleness), active-vintage lineage, and\nscheduler job state. Composite **levels only** \u2014 no FRED/BAML OAS. Sections\ndegrade independently; a missing source reports empty, never 500s.",
        "operationId": "get_calibration_console_calibration_console_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompositeConsoleResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/calibration/overlays": {
      "get": {
        "tags": [
          "calibration"
        ],
        "summary": "List Curve Overlays",
        "description": "Active (in the live vintage, unexpired) and staged (awaiting second\nsign-off) curve overlays.",
        "operationId": "list_curve_overlays_calibration_overlays_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OverlayStateResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      },
      "post": {
        "tags": [
          "calibration"
        ],
        "summary": "Stage Curve Overlay",
        "description": "Stage a curve overlay for second sign-off (dual control). The proposer\nis the AUTHENTICATED identity \u2014 a different identity must approve.",
        "operationId": "stage_curve_overlay_calibration_overlays_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OverlayStageRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CurveOverlayOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/calibration/overlays/{bucket}/approve": {
      "post": {
        "tags": [
          "calibration"
        ],
        "summary": "Approve Curve Overlay",
        "description": "Second sign-off: writes a vintage VARIANT carrying the overlay and\npromotes it through the completeness gate. Rejects self-approval.",
        "operationId": "approve_curve_overlay_calibration_overlays__bucket__approve_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "bucket",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Bucket"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/calibration/overlays/{bucket}": {
      "delete": {
        "tags": [
          "calibration"
        ],
        "summary": "Withdraw Curve Overlay",
        "description": "Withdraw a STAGED (not yet approved) overlay.\n\nReturns a JSON body rather than 204: the frontend ``request()`` helper\nunconditionally parses JSON, and an empty 204 body would reject the\nmutation promise \u2014 the withdraw would succeed server-side while the UI\nrow never refreshes (found in browser UAT).",
        "operationId": "withdraw_curve_overlay_calibration_overlays__bucket__delete",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "bucket",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Bucket"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Withdraw Curve Overlay Calibration Overlays  Bucket  Delete"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/calibration/actions/cds-refresh": {
      "post": {
        "tags": [
          "calibration"
        ],
        "summary": "Action Cds Refresh",
        "description": "Re-pull DTCC SDR prints for all overlay factors ahead of the nightly\njob. Same fetch+persist path as the scheduler's cds_daily_ingest.",
        "operationId": "action_cds_refresh_calibration_actions_cds_refresh_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1825,
              "minimum": 1,
              "default": 30,
              "title": "Days"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CdsRefreshResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/calibration/actions/rebuild": {
      "post": {
        "tags": [
          "calibration"
        ],
        "summary": "Action Rebuild Dry Run",
        "description": "Dry-run composite rebuild: assemble a candidate from current BDC\nholdings + persisted CDS history, hash it, and diff it against the\nactive vintage. Writes NOTHING \u2014 promotion is a separate confirmed step\nthat requires the returned candidate_id.",
        "operationId": "action_rebuild_dry_run_calibration_actions_rebuild_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RebuildRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RebuildCandidateResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/calibration/actions/promote": {
      "post": {
        "tags": [
          "calibration"
        ],
        "summary": "Action Promote Candidate",
        "description": "Promote a previously previewed candidate. Re-assembles from source\ndata and REFUSES when the content hash differs from candidate_id (data\nmoved since the preview), when the completeness gate fails, or when the\nvintage file already exists.",
        "operationId": "action_promote_candidate_calibration_actions_promote_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PromoteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromoteResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/calibration/overrides/deals": {
      "get": {
        "tags": [
          "calibration"
        ],
        "summary": "List Deal Overrides",
        "description": "Assumption sets carrying a non-zero ``company_spread_delta_bps`` \u2014 the\nper-deal override path. Read-only surfacing: the field itself is already\ncontent-versioned and audited on the CalibrationTrace.",
        "operationId": "list_deal_overrides_calibration_overrides_deals_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DealOverridesResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/export/nav-report": {
      "get": {
        "tags": [
          "export"
        ],
        "summary": "Export Nav Report",
        "description": "Generate an XLSX NAV report from all stored audit records.\nWorkbook has 3 sheets:\n  1. Summary  \u2014 fund-level totals\n  2. Positions \u2014 deal-by-deal fair value, accrued, dirty price, IFRS13 level\n  3. Methodology \u2014 model parameters and version info",
        "operationId": "export_nav_report_export_nav_report_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/export/aifmd-annex-iv": {
      "get": {
        "tags": [
          "export"
        ],
        "summary": "Export Aifmd Annex Iv",
        "description": "Generate AIFMD Annex IV-structured XLSX template.\nSections:\n  Section 1: Fund identification\n  Section 2: Portfolio composition (positions)\n  Section 3: Risk metrics (VaR proxies, leverage, concentration)\n  Section 4: Liquidity profile\n  Section 5: Methodology disclosure",
        "operationId": "export_aifmd_annex_iv_export_aifmd_annex_iv_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/export/form-pf": {
      "get": {
        "tags": [
          "export"
        ],
        "summary": "Export Form Pf",
        "description": "Generate SEC Form PF Section 1 + Section 2 (private credit) XLSX template.\nPre-populated with portfolio data from audit records.",
        "operationId": "export_form_pf_export_form_pf_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/export/ic-pack/{deal_id}": {
      "get": {
        "tags": [
          "export"
        ],
        "summary": "Export Ic Pack",
        "description": "Generate an Investment Committee pack for a single deal.\nMulti-sheet XLSX: Cover, Valuation, Credit Analysis, Risk Metrics, Recommendation.",
        "operationId": "export_ic_pack_export_ic_pack__deal_id__get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/export/ilpa-report": {
      "get": {
        "tags": [
          "export"
        ],
        "summary": "Export Ilpa Report",
        "description": "Generate ILPA Quarterly Reporting Template v3 (simplified) XLSX.\nSections: Capital Account, Fund Performance, Portfolio Summary, Fees & Expenses.",
        "operationId": "export_ilpa_report_export_ilpa_report_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/covenants/test": {
      "post": {
        "tags": [
          "covenants"
        ],
        "summary": "Test Covenants",
        "operationId": "test_covenants_covenants_test_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CovenantTestRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CovenantStatusResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/covenants/portfolio/status": {
      "get": {
        "tags": [
          "covenants"
        ],
        "summary": "Get Portfolio Covenant Status",
        "description": "Latest covenant status for every deal with recorded tests.\n\nAccess model:\n  * privileged + scope='all'  \u2192 full tenant view (admin / ceo / env key)\n  * privileged + scope='mine' \u2192 restrict to the caller's fund memberships\n  * regular    + scope='all'  \u2192 owned deals + deals in caller's funds\n  * regular    + scope='mine' \u2192 caller's fund memberships only\n\n``apply_scope`` returns ``None`` for scope='all' meaning \"no extra\nfilter needed beyond baseline access control\" \u2014 but the baseline\nfilter has to be applied here, not assumed. Previously it wasn't,\nwhich leaked tenant-wide covenant data to regular users.",
        "operationId": "get_portfolio_covenant_status_covenants_portfolio_status_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "all",
              "title": "Scope"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/covenants/{deal_id}/history": {
      "get": {
        "tags": [
          "covenants"
        ],
        "summary": "Get Covenant History",
        "operationId": "get_covenant_history_covenants__deal_id__history_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {},
                  "title": "Response Get Covenant History Covenants  Deal Id  History Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/covenants/{deal_id}/breach-summary": {
      "get": {
        "tags": [
          "covenants"
        ],
        "summary": "Get Breach Summary",
        "operationId": "get_breach_summary_covenants__deal_id__breach_summary_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/covenants": {
      "get": {
        "tags": [
          "covenants"
        ],
        "summary": "List Covenants",
        "operationId": "list_covenants_deals__deal_id__covenants_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "covenants"
        ],
        "summary": "Create Covenant",
        "operationId": "create_covenant_deals__deal_id__covenants_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCovenantRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/covenants/{covenant_id}": {
      "delete": {
        "tags": [
          "covenants"
        ],
        "summary": "Delete Covenant",
        "operationId": "delete_covenant_deals__deal_id__covenants__covenant_id__delete",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          },
          {
            "name": "covenant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Covenant Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/covenants/{covenant_id}/tests": {
      "get": {
        "tags": [
          "covenants"
        ],
        "summary": "List Tests",
        "operationId": "list_tests_deals__deal_id__covenants__covenant_id__tests_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          },
          {
            "name": "covenant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Covenant Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "covenants"
        ],
        "summary": "Record Test",
        "operationId": "record_test_deals__deal_id__covenants__covenant_id__tests_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          },
          {
            "name": "covenant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Covenant Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordTestRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/covenant-status": {
      "get": {
        "tags": [
          "covenant-monitor"
        ],
        "summary": "Get Deal Covenant Status",
        "description": "Full covenant monitoring summary for a deal.",
        "operationId": "get_deal_covenant_status_deals__deal_id__covenant_status_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DealCovenantSummary"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/covenant-status/{covenant_id}": {
      "get": {
        "tags": [
          "covenant-monitor"
        ],
        "summary": "Get Single Covenant Status",
        "description": "Status and trend for a single covenant.",
        "operationId": "get_single_covenant_status_deals__deal_id__covenant_status__covenant_id__get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          },
          {
            "name": "covenant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Covenant Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/covenant-monitor/portfolio": {
      "get": {
        "tags": [
          "covenant-monitor"
        ],
        "summary": "Get Portfolio Covenant Overview",
        "description": "Portfolio-wide covenant monitoring dashboard.\n\nScoped per caller: privileged principals (admin / ceo / env key) see the\nfull tenant view; everyone else is restricted to deals they own or can\nreach through a fund. Mirrors GET /covenants/portfolio/status \u2014 without\nthis scoping any authenticated user saw every tenant's covenant data.",
        "operationId": "get_portfolio_covenant_overview_covenant_monitor_portfolio_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortfolioCovenantSummary"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/covenant-monitor/alerts": {
      "get": {
        "tags": [
          "covenant-monitor"
        ],
        "summary": "List Alerts",
        "description": "List covenant alerts, optionally filtered by deal and acknowledgement status.\n\nScoped per caller: privileged principals see all alerts; everyone else\nonly sees alerts on deals they can access. The optional ``deal_id`` query\nfilter narrows the DB query; the access filter is then applied on top, so\nrequesting a deal you can't reach yields an empty list rather than a leak.",
        "operationId": "list_alerts_covenant_monitor_alerts_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          },
          {
            "name": "acknowledged",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "title": "Acknowledged"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/covenant-monitor/alerts/acknowledge": {
      "post": {
        "tags": [
          "covenant-monitor"
        ],
        "summary": "Acknowledge Alerts",
        "description": "Acknowledge one or more covenant alerts.\n\nEnforces per-alert deal access before mutating anything: a caller can\nonly acknowledge alerts on deals they can reach. Access is validated for\nthe whole batch up front, so a single foreign alert_id fails the request\n(404) without acknowledging any of the others (no partial mutation).\nUnknown alert_ids are skipped \u2014 the acknowledge update no-ops on them.",
        "operationId": "acknowledge_alerts_covenant_monitor_alerts_acknowledge_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcknowledgeAlertRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/ecl/compute": {
      "post": {
        "tags": [
          "ecl"
        ],
        "summary": "Compute Ecl",
        "operationId": "compute_ecl_ecl_compute_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ECLRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ECLResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/risk/decomposition": {
      "post": {
        "tags": [
          "risk"
        ],
        "summary": "Post Risk Decomposition",
        "operationId": "post_risk_decomposition_risk_decomposition_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RiskDecompositionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/risk/portfolio-factors": {
      "get": {
        "tags": [
          "risk"
        ],
        "summary": "Portfolio Factor Report",
        "description": "Portfolio-level factor risk report:\n- Total spread duration (sum of position spread durations weighted by notional)\n- Total rate duration\n- Sector contribution to undiversified spread DV01\n- Capital structure contribution\n- Top 5 largest spread risk contributors",
        "operationId": "portfolio_factor_report_risk_portfolio_factors_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "valuation_date",
            "in": "query",
            "required": false,
            "schema": {
              "title": "Valuation Date",
              "type": "string",
              "nullable": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/var/portfolio": {
      "get": {
        "tags": [
          "var"
        ],
        "summary": "Portfolio Var",
        "description": "Compute MSCI-aligned portfolio spread + rate VaR.\n\nUses:\n- Exact bump-and-reprice DV01 when deal version + assumption set available\n- Rating-specific spread vol surface (Cliffwater/LCD calibrated)\n- Sector-rating correlation matrix (S&P/Moody's calibrated)\n- Separate rate VaR with rate-spread correlation\n- Three historical stressed scenarios (GFC 2008, COVID 2020, Rate shock 2022)\n- Exact CVaR (Expected Shortfall) via normal PDF formula\n- Incremental VaR per position",
        "operationId": "portfolio_var_var_portfolio_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "valuation_date",
            "in": "query",
            "required": false,
            "schema": {
              "title": "Valuation Date",
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "confidence",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "maximum": 0.9999,
              "minimum": 0.5,
              "default": 0.95,
              "title": "Confidence"
            }
          },
          {
            "name": "rate_spread_correlation",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "maximum": 1.0,
              "minimum": -1.0,
              "default": 0.25,
              "title": "Rate Spread Correlation"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "all",
              "title": "Scope"
            }
          },
          {
            "name": "base",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Reporting currency to express notionals, DV01s and VaR in (e.g. GBP). Positions are scaled per deal at the H.10 rate pinned to the valuation date; deals whose currency has no rate are excluded and listed under fx.unconverted. Omit to leave amounts in their own currencies.",
              "title": "Base",
              "type": "string",
              "nullable": true
            },
            "description": "Reporting currency to express notionals, DV01s and VaR in (e.g. GBP). Positions are scaled per deal at the H.10 rate pinned to the valuation date; deals whose currency has no rate are excluded and listed under fx.unconverted. Omit to leave amounts in their own currencies."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/var/advanced": {
      "get": {
        "tags": [
          "var"
        ],
        "summary": "Portfolio Var Advanced",
        "description": "Advanced VaR: historical simulation + Monte Carlo with correlated spread shocks.\nBoth methods use the live FRED spread vol surface when available.\nmethod: \"historical\" | \"montecarlo\" | \"both\"",
        "operationId": "portfolio_var_advanced_var_advanced_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "method",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "both",
              "title": "Method"
            }
          },
          {
            "name": "simulations",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 50000,
              "minimum": 100,
              "default": 5000,
              "title": "Simulations"
            }
          },
          {
            "name": "lookback",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 2520,
              "minimum": 10,
              "default": 504,
              "title": "Lookback"
            }
          },
          {
            "name": "confidence",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "maximum": 0.9999,
              "minimum": 0.5,
              "default": 0.95,
              "title": "Confidence"
            }
          },
          {
            "name": "valuation_date",
            "in": "query",
            "required": false,
            "schema": {
              "title": "Valuation Date",
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "all",
              "title": "Scope"
            }
          },
          {
            "name": "base",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Reporting currency to express notionals, DV01s and VaR in (e.g. GBP). Positions are scaled per deal at the H.10 rate pinned to the valuation date; deals whose currency has no rate are excluded and listed under fx.unconverted. Omit to leave amounts in their own currencies.",
              "title": "Base",
              "type": "string",
              "nullable": true
            },
            "description": "Reporting currency to express notionals, DV01s and VaR in (e.g. GBP). Positions are scaled per deal at the H.10 rate pinned to the valuation date; deals whose currency has no rate are excluded and listed under fx.unconverted. Omit to leave amounts in their own currencies."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/var/benchmark": {
      "get": {
        "tags": [
          "var"
        ],
        "summary": "Get Benchmark Comparison",
        "description": "Compare portfolio spread vs Cliffwater DLI proxy (Verus B composite + SOFR 3M).\nReturns spread premium/discount vs benchmark and market regime label.\n\nThe benchmark comparison reads the caller's accessible portfolio only \u2014\nnever the tenant-wide deal list.",
        "operationId": "get_benchmark_comparison_var_benchmark_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/var/vol-surface": {
      "get": {
        "tags": [
          "var"
        ],
        "summary": "Get Vol Surface Endpoint",
        "description": "Return the current live spread vol surface built from Verus composite histories.\nShows empirical daily/annual vol by rating, cross-rating correlations, and data quality.\nCache TTL: 4 hours. Use ?force=true to refresh immediately.",
        "operationId": "get_vol_surface_endpoint_var_vol_surface_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "force",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Force"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/liquidity/deals/{deal_id}": {
      "get": {
        "tags": [
          "liquidity"
        ],
        "summary": "Deal Liquidity",
        "operationId": "deal_liquidity_liquidity_deals__deal_id__get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          },
          {
            "name": "valuation_date",
            "in": "query",
            "required": false,
            "schema": {
              "title": "Valuation Date",
              "type": "string",
              "nullable": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/liquidity/waterfall": {
      "get": {
        "tags": [
          "liquidity"
        ],
        "summary": "Portfolio Liquidity Waterfall",
        "description": "Portfolio liquidity waterfall: what % can be sold within each horizon at what haircut.\n\nOutput per horizon (30d, 90d, 180d, 365d, 365d+):\n- sellable_pct: % of portfolio notional potentially exitable\n- sellable_notional: $ amount\n- avg_haircut_bps: estimated bid-ask haircut for sellable portion\n- estimated_proceeds: sellable_notional \u00d7 (1 - avg_haircut_bps/10000)\n- positions: list of deals in this horizon bucket",
        "operationId": "portfolio_liquidity_waterfall_liquidity_waterfall_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "valuation_date",
            "in": "query",
            "required": false,
            "schema": {
              "title": "Valuation Date",
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "all",
              "title": "Scope"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/liquidity/portfolio": {
      "get": {
        "tags": [
          "liquidity"
        ],
        "summary": "Portfolio Liquidity",
        "operationId": "portfolio_liquidity_liquidity_portfolio_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "valuation_date",
            "in": "query",
            "required": false,
            "schema": {
              "title": "Valuation Date",
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "all",
              "title": "Scope"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/performance/deals/{deal_id}/economics": {
      "post": {
        "tags": [
          "performance"
        ],
        "summary": "Set Economics",
        "operationId": "set_economics_performance_deals__deal_id__economics_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EconomicsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "performance"
        ],
        "summary": "Get Economics",
        "operationId": "get_economics_performance_deals__deal_id__economics_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          },
          {
            "name": "valuation_date",
            "in": "query",
            "required": false,
            "schema": {
              "title": "Valuation Date",
              "type": "string",
              "nullable": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/performance/deals/{deal_id}/distributions": {
      "post": {
        "tags": [
          "performance"
        ],
        "summary": "Add Distribution",
        "operationId": "add_distribution_performance_deals__deal_id__distributions_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DistributionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "performance"
        ],
        "summary": "List Distributions",
        "operationId": "list_distributions_performance_deals__deal_id__distributions_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/performance/portfolio": {
      "get": {
        "tags": [
          "performance"
        ],
        "summary": "Portfolio Performance",
        "description": "Portfolio-level aggregated performance \u2014 scoped to the caller.",
        "operationId": "portfolio_performance_performance_portfolio_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "valuation_date",
            "in": "query",
            "required": false,
            "schema": {
              "title": "Valuation Date",
              "type": "string",
              "nullable": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/nav/snapshot/{deal_id}": {
      "post": {
        "tags": [
          "nav-history"
        ],
        "summary": "Create Snapshot",
        "operationId": "create_snapshot_nav_snapshot__deal_id__post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SnapshotRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/nav/history/{deal_id}": {
      "get": {
        "tags": [
          "nav-history"
        ],
        "summary": "Get History",
        "operationId": "get_history_nav_history__deal_id__get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/nav/periods": {
      "get": {
        "tags": [
          "nav-history"
        ],
        "summary": "List Periods",
        "operationId": "list_periods_nav_periods_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "all",
              "title": "Scope"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/nav/portfolio": {
      "get": {
        "tags": [
          "nav-history"
        ],
        "summary": "Portfolio Nav",
        "description": "Latest-per-deal NAV for a period.\n\n``scope`` is the fund selector (``all`` / ``mine`` / a fund id), matching\nthe Performance tab. ``base`` expresses every amount in that reporting\ncurrency at the period-end H.10 rate; deals with no rate are excluded and\nlisted under ``fx.unconverted``. Without ``base`` amounts are summed in\ntheir own currencies, as before.",
        "operationId": "portfolio_nav_nav_portfolio_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "period_label",
            "in": "query",
            "required": false,
            "schema": {
              "title": "Period Label",
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 200,
              "title": "Limit"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "all",
              "title": "Scope"
            }
          },
          {
            "name": "base",
            "in": "query",
            "required": false,
            "schema": {
              "title": "Base",
              "type": "string",
              "nullable": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/nav/rating-migration": {
      "get": {
        "tags": [
          "nav-history"
        ],
        "summary": "Rating Migration",
        "description": "Compute rating migration matrix across the last N periods.\nReturns: from_rating -> to_rating counts, plus upgraded/downgraded/stable counts.",
        "operationId": "rating_migration_nav_rating_migration_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "periods",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 50,
              "minimum": 1,
              "default": 4,
              "title": "Periods"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/nav/snapshot-portfolio": {
      "post": {
        "tags": [
          "nav-history"
        ],
        "summary": "Snapshot Portfolio",
        "description": "Auto-snapshot every carried deal using latest audit record prices.\nCall this at quarter end to capture the official marks.",
        "operationId": "snapshot_portfolio_nav_snapshot_portfolio_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "period_end_date",
            "in": "query",
            "required": false,
            "schema": {
              "title": "Period End Date",
              "type": "string",
              "nullable": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/funds": {
      "post": {
        "tags": [
          "funds"
        ],
        "summary": "Create Fund",
        "operationId": "create_fund_funds_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFundRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_Any_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "funds"
        ],
        "summary": "List Funds",
        "description": "List funds.\n\n``scope='all'`` (default) \u2014 every fund in the tenant. Matches legacy\nbehavior so dropdowns and pickers still list every fund regardless of\nthe caller's membership.\n``scope='mine'`` \u2014 filtered to the caller's fund memberships, even for\nprivileged principals. Unauthenticated + scope=mine \u2192 empty list.",
        "operationId": "list_funds_funds_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "title": "Status",
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "all",
              "title": "Scope"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_List_Any__"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/funds/consolidated-nav": {
      "get": {
        "tags": [
          "funds"
        ],
        "summary": "Consolidated Nav",
        "description": "Consolidated NAV across all funds accessible to the caller.\n\n``scope='mine'`` filters to caller memberships even for privileged\nprincipals; ``scope='all'`` preserves legacy behavior (privileged \u2192\nevery fund; regular \u2192 their memberships).",
        "operationId": "consolidated_nav_funds_consolidated_nav_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "all",
              "title": "Scope"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_Any_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/funds/{fund_id}": {
      "get": {
        "tags": [
          "funds"
        ],
        "summary": "Get Fund",
        "operationId": "get_fund_funds__fund_id__get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "fund_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Fund Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_Any_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "funds"
        ],
        "summary": "Update Fund",
        "operationId": "update_fund_funds__fund_id__patch",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "fund_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Fund Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateFundRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_Any_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/funds/{fund_id}/positions": {
      "post": {
        "tags": [
          "funds"
        ],
        "summary": "Add Position",
        "operationId": "add_position_funds__fund_id__positions_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "fund_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Fund Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddPositionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_Any_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "funds"
        ],
        "summary": "List Positions",
        "operationId": "list_positions_funds__fund_id__positions_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "fund_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Fund Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_List_Any__"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/funds/{fund_id}/positions/{deal_id}": {
      "delete": {
        "tags": [
          "funds"
        ],
        "summary": "Remove Position",
        "operationId": "remove_position_funds__fund_id__positions__deal_id__delete",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "fund_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Fund Id"
            }
          },
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_Any_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/funds/{fund_id}/portfolio": {
      "get": {
        "tags": [
          "funds"
        ],
        "summary": "Fund Portfolio",
        "description": "Fund-level portfolio metrics: NAV, position count, weighted avg spread, ECL.",
        "operationId": "fund_portfolio_funds__fund_id__portfolio_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "fund_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Fund Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_Any_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/funds/{fund_id}/members": {
      "post": {
        "tags": [
          "funds"
        ],
        "summary": "Add Member",
        "operationId": "add_member_funds__fund_id__members_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "fund_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Fund Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddMemberRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_Any_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "funds"
        ],
        "summary": "List Members",
        "operationId": "list_members_funds__fund_id__members_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "fund_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Fund Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_List_Any__"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/funds/{fund_id}/members/{user_id}": {
      "delete": {
        "tags": [
          "funds"
        ],
        "summary": "Remove Member",
        "operationId": "remove_member_funds__fund_id__members__user_id__delete",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "fund_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Fund Id"
            }
          },
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "User Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_Any_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/funds/{fund_id}/deals": {
      "post": {
        "tags": [
          "funds"
        ],
        "summary": "Assign Deal",
        "operationId": "assign_deal_funds__fund_id__deals_post",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "fund_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Fund Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignDealRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_Any_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "funds"
        ],
        "summary": "List Fund Deals",
        "description": "List all deals assigned to a fund, with enriched deal data.",
        "operationId": "list_fund_deals_funds__fund_id__deals_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "fund_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Fund Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_List_Any__"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/funds/{fund_id}/deals/{deal_id}": {
      "delete": {
        "tags": [
          "funds"
        ],
        "summary": "Unassign Deal",
        "operationId": "unassign_deal_funds__fund_id__deals__deal_id__delete",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "fund_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Fund Id"
            }
          },
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_Any_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/funds/{fund_id}/nav": {
      "get": {
        "tags": [
          "funds"
        ],
        "summary": "Fund Nav",
        "description": "Fund-level NAV: aggregate fair values from audit records for assigned deals.",
        "operationId": "fund_nav_funds__fund_id__nav_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "fund_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Fund Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_Any_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{deal_id}/funds": {
      "get": {
        "tags": [
          "funds"
        ],
        "summary": "Deal Funds",
        "description": "Which funds hold this deal (positions + assignments).",
        "operationId": "deal_funds_deals__deal_id__funds_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse_Any_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/portfolio/optimise": {
      "get": {
        "tags": [
          "optimisation"
        ],
        "summary": "Optimise Portfolio",
        "description": "Compute efficient frontier, risk budgets, and optimal portfolio compositions.\n\nReturns:\n- frontier_points: n_points on the yield vs VaR frontier\n- risk_budgets: marginal VaR contribution per position\n- max_sharpe_weights: max yield/VaR ratio portfolio\n- min_var_weights: minimum variance portfolio\n- risk_parity_weights: equal risk contribution portfolio",
        "operationId": "optimise_portfolio_portfolio_optimise_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "w_min",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "maximum": 1.0,
              "minimum": 0.0,
              "default": 0.0,
              "title": "W Min"
            }
          },
          {
            "name": "w_max",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "maximum": 1.0,
              "minimum": 0.0,
              "default": 0.4,
              "title": "W Max"
            }
          },
          {
            "name": "n_points",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 50,
              "minimum": 2,
              "default": 8,
              "title": "N Points"
            }
          },
          {
            "name": "valuation_date",
            "in": "query",
            "required": false,
            "schema": {
              "title": "Valuation Date",
              "type": "string",
              "nullable": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/rwa/compute": {
      "post": {
        "tags": [
          "rwa",
          "rwa"
        ],
        "summary": "Compute Single Rwa",
        "description": "Compute RWA for a single exposure.\n\nSupports Standardized Approach (SA), Foundation IRB (F-IRB), and Advanced IRB (A-IRB).\nIf `deal_id` is provided, deal data is used to enrich the request.",
        "operationId": "compute_single_rwa_rwa_compute_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SingleRWARequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DealRWAOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/rwa/portfolio": {
      "get": {
        "tags": [
          "rwa",
          "rwa"
        ],
        "summary": "Portfolio Rwa",
        "description": "Compute portfolio RWA across the caller's active deals using stored deal data.\n\nDeal leverage/ratings are derived from stored financials where available.\nScoped to the principal's accessible deals \u2014 the regulatory-capital view\nmust not aggregate positions the caller has no fund membership for.",
        "operationId": "portfolio_rwa_rwa_portfolio_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "approach",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/BankingApproach",
              "description": "Basel approach",
              "default": "standardized"
            },
            "description": "Basel approach"
          },
          {
            "name": "default_lgd",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "maximum": 1.0,
              "minimum": 0.0,
              "description": "Default LGD for IRB if not in deal",
              "default": 0.4,
              "title": "Default Lgd"
            },
            "description": "Default LGD for IRB if not in deal"
          },
          {
            "name": "default_maturity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "maximum": 5.0,
              "minimum": 1.0,
              "default": 2.5,
              "title": "Default Maturity"
            }
          },
          {
            "name": "status_filter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Deal status filter",
              "default": "ACTIVE",
              "title": "Status Filter"
            },
            "description": "Deal status filter"
          },
          {
            "name": "as_of",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Reporting date for effective-maturity calc (defaults to today; pin for reproducible results)",
              "title": "As Of",
              "type": "string",
              "format": "date",
              "nullable": true
            },
            "description": "Reporting date for effective-maturity calc (defaults to today; pin for reproducible results)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortfolioRWAOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/rwa/deal/{deal_id}": {
      "get": {
        "tags": [
          "rwa",
          "rwa"
        ],
        "summary": "Deal Rwa",
        "description": "Compute RWA for a single stored deal.\n\nUses the same deal\u2192input derivation as GET /rwa/portfolio, so the result\nmatches that deal's row in the portfolio view exactly.",
        "operationId": "deal_rwa_rwa_deal__deal_id__get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "deal_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Deal Id"
            }
          },
          {
            "name": "approach",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/BankingApproach",
              "description": "Basel approach",
              "default": "standardized"
            },
            "description": "Basel approach"
          },
          {
            "name": "default_lgd",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "maximum": 1.0,
              "minimum": 0.0,
              "description": "Default LGD for IRB if not in deal",
              "default": 0.4,
              "title": "Default Lgd"
            },
            "description": "Default LGD for IRB if not in deal"
          },
          {
            "name": "default_maturity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "maximum": 5.0,
              "minimum": 1.0,
              "default": 2.5,
              "title": "Default Maturity"
            }
          },
          {
            "name": "as_of",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Reporting date for effective-maturity calc (defaults to today; pin for reproducible results)",
              "title": "As Of",
              "type": "string",
              "format": "date",
              "nullable": true
            },
            "description": "Reporting date for effective-maturity calc (defaults to today; pin for reproducible results)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DealRWAOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/rwa/portfolio/custom": {
      "post": {
        "tags": [
          "rwa",
          "rwa"
        ],
        "summary": "Portfolio Rwa Custom",
        "description": "Compute portfolio RWA from a user-supplied list of exposures.",
        "operationId": "portfolio_rwa_custom_rwa_portfolio_custom_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomPortfolioRWARequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortfolioRWAOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/rwa/capital-adequacy": {
      "post": {
        "tags": [
          "rwa",
          "rwa"
        ],
        "summary": "Capital Adequacy",
        "description": "Compute capital adequacy ratios.\n\nIf `total_rwa` is not provided, it is computed from the caller's active\ndeal portfolio (scoped to accessible deals) using the Standardized Approach.",
        "operationId": "capital_adequacy_rwa_capital_adequacy_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CapitalAdequacyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CapitalAdequacyOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/rwa/approaches": {
      "get": {
        "tags": [
          "rwa",
          "rwa"
        ],
        "summary": "List Approaches",
        "description": "Return available banking approaches, exposure classes, and regulatory thresholds.",
        "operationId": "list_approaches_rwa_approaches_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    },
    "/audit/log": {
      "get": {
        "tags": [
          "audit",
          "audit"
        ],
        "summary": "Get Audit Log",
        "description": "List change-log entries, most recent first. Non-privileged callers only\nsee entries they made; admins and operator keys see everything.",
        "operationId": "get_audit_log_audit_log_get",
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "parameters": [
          {
            "name": "entity_type",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Filter by entity type (e.g. 'deal', 'assumption_set')",
              "title": "Entity Type",
              "type": "string",
              "nullable": true
            },
            "description": "Filter by entity type (e.g. 'deal', 'assumption_set')"
          },
          {
            "name": "entity_id",
            "in": "query",
            "required": false,
            "schema": {
              "description": "Filter by entity id",
              "title": "Entity Id",
              "type": "string",
              "nullable": true
            },
            "description": "Filter by entity id"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 10000000,
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Audit Log Audit Log Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/audit/log/entity-types": {
      "get": {
        "tags": [
          "audit",
          "audit"
        ],
        "summary": "Get Audit Entity Types",
        "description": "Distinct entity types present in the change log, for filter dropdowns.",
        "operationId": "get_audit_entity_types_audit_log_entity_types_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "type": "object",
                  "title": "Response Get Audit Entity Types Audit Log Entity Types Get"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AcknowledgeAlertRequest": {
        "properties": {
          "alert_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Alert Ids"
          },
          "acknowledged_by": {
            "type": "string",
            "title": "Acknowledged By"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "alert_ids",
          "acknowledged_by"
        ],
        "title": "AcknowledgeAlertRequest",
        "description": "Request body for acknowledging alerts."
      },
      "AddMemberRequest": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "role": {
            "type": "string",
            "title": "Role",
            "description": "viewer | analyst | manager",
            "default": "viewer"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "user_id"
        ],
        "title": "AddMemberRequest"
      },
      "AddPositionRequest": {
        "properties": {
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "allocation_pct": {
            "type": "number",
            "maximum": 100.0,
            "exclusiveMinimum": 0.0,
            "title": "Allocation Pct",
            "default": 100.0
          },
          "allocated_notional": {
            "title": "Allocated Notional",
            "type": "number",
            "nullable": true
          },
          "notes": {
            "title": "Notes",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_id"
        ],
        "title": "AddPositionRequest"
      },
      "AdjustmentTable": {
        "properties": {
          "entries": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Entries"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "entries"
        ],
        "title": "AdjustmentTable"
      },
      "AiPreferences": {
        "properties": {
          "ai_intake_enabled": {
            "type": "boolean",
            "title": "Ai Intake Enabled"
          },
          "plan_includes_ai": {
            "type": "boolean",
            "title": "Plan Includes Ai"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "ai_intake_enabled",
          "plan_includes_ai"
        ],
        "title": "AiPreferences"
      },
      "AiPreferencesUpdate": {
        "properties": {
          "ai_intake_enabled": {
            "type": "boolean",
            "title": "Ai Intake Enabled"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "ai_intake_enabled"
        ],
        "title": "AiPreferencesUpdate"
      },
      "AmortEvent": {
        "properties": {
          "date": {
            "type": "string",
            "format": "date",
            "title": "Date"
          },
          "amount": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Amount"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "date",
          "amount"
        ],
        "title": "AmortEvent"
      },
      "ApiError": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "detail": {
            "title": "Detail",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "title": "ApiError"
      },
      "ApiResponse_Any_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "title": "Data"
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[Any]"
      },
      "ApiResponse_AskChatResponse_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "$ref": "#/components/schemas/AskChatResponse",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[AskChatResponse]"
      },
      "ApiResponse_BenchmarkVarianceResponse_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "$ref": "#/components/schemas/BenchmarkVarianceResponse",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[BenchmarkVarianceResponse]"
      },
      "ApiResponse_CalibrateResponse_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "$ref": "#/components/schemas/CalibrateResponse",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[CalibrateResponse]"
      },
      "ApiResponse_CalibrateSpreadResponse_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "$ref": "#/components/schemas/CalibrateSpreadResponse",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[CalibrateSpreadResponse]"
      },
      "ApiResponse_CycleStageResponse_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "$ref": "#/components/schemas/CycleStageResponse",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[CycleStageResponse]"
      },
      "ApiResponse_ExternalMark_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "$ref": "#/components/schemas/ExternalMark",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[ExternalMark]"
      },
      "ApiResponse_ExtractCreditDataResponse_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "$ref": "#/components/schemas/ExtractCreditDataResponse",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[ExtractCreditDataResponse]"
      },
      "ApiResponse_FetchFilingsResponse_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "$ref": "#/components/schemas/FetchFilingsResponse",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[FetchFilingsResponse]"
      },
      "ApiResponse_FilingDraftResponse_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "$ref": "#/components/schemas/FilingDraftResponse",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[FilingDraftResponse]"
      },
      "ApiResponse_FullValuationResponse_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "$ref": "#/components/schemas/FullValuationResponse",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[FullValuationResponse]"
      },
      "ApiResponse_FundamentalCreditResult_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "$ref": "#/components/schemas/FundamentalCreditResult",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[FundamentalCreditResult]"
      },
      "ApiResponse_ImportPublicFinancialsResponse_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "$ref": "#/components/schemas/ImportPublicFinancialsResponse",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[ImportPublicFinancialsResponse]"
      },
      "ApiResponse_List_Any__": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "title": "Data",
            "items": {},
            "type": "array",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[List[Any]]"
      },
      "ApiResponse_MarkComparison_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "$ref": "#/components/schemas/MarkComparison",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[MarkComparison]"
      },
      "ApiResponse_MonteCarloResponse_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "$ref": "#/components/schemas/MonteCarloResponse",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[MonteCarloResponse]"
      },
      "ApiResponse_NoteDetail_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "$ref": "#/components/schemas/NoteDetail",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[NoteDetail]"
      },
      "ApiResponse_PortfolioBenchmarkResponse_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "$ref": "#/components/schemas/PortfolioBenchmarkResponse",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[PortfolioBenchmarkResponse]"
      },
      "ApiResponse_PriceRangeResult_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "$ref": "#/components/schemas/PriceRangeResult",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[PriceRangeResult]"
      },
      "ApiResponse_PromptPreviewResponse_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "$ref": "#/components/schemas/PromptPreviewResponse",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[PromptPreviewResponse]"
      },
      "ApiResponse_ReportDetail_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "$ref": "#/components/schemas/ReportDetail",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[ReportDetail]"
      },
      "ApiResponse_SearchPublicFinancialsResponse_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "$ref": "#/components/schemas/SearchPublicFinancialsResponse",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[SearchPublicFinancialsResponse]"
      },
      "ApiResponse_SolveDMResponse_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "$ref": "#/components/schemas/SolveDMResponse",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[SolveDMResponse]"
      },
      "ApiResponse_SuggestAndCreateDealResponse_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "$ref": "#/components/schemas/SuggestAndCreateDealResponse",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[SuggestAndCreateDealResponse]"
      },
      "ApiResponse_SuggestDealResponse_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "$ref": "#/components/schemas/SuggestDealResponse",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[SuggestDealResponse]"
      },
      "ApiResponse_UnifiedValuationResponse_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "$ref": "#/components/schemas/UnifiedValuationResponse",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[UnifiedValuationResponse]"
      },
      "ApiResponse_Union_DirectLendingResponse__MezzanineResponse__DistressedResponse__DistressedBondResponse__CREResponse__IlliquidBondResponse__SecuredBorrowingResponse__": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DirectLendingResponse"
              },
              {
                "$ref": "#/components/schemas/MezzanineResponse"
              },
              {
                "$ref": "#/components/schemas/DistressedResponse"
              },
              {
                "$ref": "#/components/schemas/DistressedBondResponse"
              },
              {
                "$ref": "#/components/schemas/CREResponse"
              },
              {
                "$ref": "#/components/schemas/IlliquidBondResponse"
              },
              {
                "$ref": "#/components/schemas/SecuredBorrowingResponse"
              },
              {
                "nullable": true
              }
            ],
            "title": "Data"
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[Union[DirectLendingResponse, MezzanineResponse, DistressedResponse, DistressedBondResponse, CREResponse, IlliquidBondResponse, SecuredBorrowingResponse]]"
      },
      "ApiResponse_UploadIdResult_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "$ref": "#/components/schemas/UploadIdResult",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[UploadIdResult]"
      },
      "ApiResponse_UploadSummary_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "$ref": "#/components/schemas/UploadSummary",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[UploadSummary]"
      },
      "ApiResponse_ValuationRecord_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "$ref": "#/components/schemas/ValuationRecord",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[ValuationRecord]"
      },
      "ApiResponse_dict_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "title": "Data",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[dict]"
      },
      "ApiResponse_list_": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "title": "Data",
            "items": {},
            "type": "array",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[list]"
      },
      "ApiResponse_list_ExternalMark__": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "title": "Data",
            "items": {
              "$ref": "#/components/schemas/ExternalMark"
            },
            "type": "array",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[list[ExternalMark]]"
      },
      "ApiResponse_list_NoteSummary__": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "title": "Data",
            "items": {
              "$ref": "#/components/schemas/NoteSummary"
            },
            "type": "array",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[list[NoteSummary]]"
      },
      "ApiResponse_list_ReportSummary__": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "title": "Data",
            "items": {
              "$ref": "#/components/schemas/ReportSummary"
            },
            "type": "array",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[list[ReportSummary]]"
      },
      "ApiResponse_list_UploadSummary__": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "data": {
            "title": "Data",
            "items": {
              "$ref": "#/components/schemas/UploadSummary"
            },
            "type": "array",
            "nullable": true
          },
          "error": {
            "$ref": "#/components/schemas/ApiError",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ApiResponse[list[UploadSummary]]"
      },
      "ApplyCompanyDeltaRequest": {
        "properties": {
          "composite_score": {
            "title": "Composite Score",
            "description": "Multi-factor composite score to apply (required unless clear=true). The bps delta is recomputed server-side from this score \u2014 the client never supplies bps directly.",
            "type": "number",
            "maximum": 100.0,
            "minimum": 0.0,
            "nullable": true
          },
          "quality_label": {
            "title": "Quality Label",
            "description": "Composite quality label, for provenance.",
            "type": "string",
            "maxLength": 64,
            "nullable": true
          },
          "clear": {
            "type": "boolean",
            "title": "Clear",
            "description": "Remove a previously applied company-factor delta instead of applying one.",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ApplyCompanyDeltaRequest"
      },
      "ApplyToAssumptionsRequest": {
        "properties": {
          "base_assumption_set_id": {
            "type": "string",
            "title": "Base Assumption Set Id",
            "description": "Existing assumption set to clone market + valuation assumptions from."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "base_assumption_set_id"
        ],
        "title": "ApplyToAssumptionsRequest"
      },
      "AsOfDateRange": {
        "properties": {
          "min": {
            "type": "string",
            "title": "Min",
            "description": "Oldest period_of_report in cohort (YYYY-MM-DD)"
          },
          "max": {
            "type": "string",
            "title": "Max",
            "description": "Newest period_of_report in cohort (YYYY-MM-DD)"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "min",
          "max"
        ],
        "title": "AsOfDateRange",
        "description": "Watermark for the cohort \u2014 oldest and newest ``period_of_report``.\n\nPitfall 1-D: \"stale marks without caveat\" \u2014 the UI must be able to\nwatermark any displayed figure with the underlying data's as-of dates."
      },
      "AskChatRequest": {
        "properties": {
          "messages": {
            "items": {
              "$ref": "#/components/schemas/AskMessage"
            },
            "type": "array",
            "maxItems": 20,
            "minItems": 1,
            "title": "Messages"
          },
          "context": {
            "$ref": "#/components/schemas/AskContext",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "messages"
        ],
        "title": "AskChatRequest"
      },
      "AskChatResponse": {
        "properties": {
          "reply": {
            "type": "string",
            "title": "Reply"
          },
          "tool_trace": {
            "items": {
              "$ref": "#/components/schemas/ToolTraceEntry"
            },
            "type": "array",
            "title": "Tool Trace"
          },
          "model": {
            "type": "string",
            "title": "Model"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "reply",
          "tool_trace",
          "model"
        ],
        "title": "AskChatResponse"
      },
      "AskContext": {
        "properties": {
          "deal_id": {
            "title": "Deal Id",
            "type": "string",
            "nullable": true
          },
          "fund_id": {
            "title": "Fund Id",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "AskContext",
        "description": "Optional page context \u2014 lets the UI anchor questions like \"what's the\nspread duration here?\" to the deal/fund the user is looking at."
      },
      "AskMessage": {
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "user",
              "assistant"
            ],
            "title": "Role"
          },
          "content": {
            "type": "string",
            "maxLength": 4000,
            "minLength": 1,
            "title": "Content"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "role",
          "content"
        ],
        "title": "AskMessage"
      },
      "AssetTypeSlice": {
        "properties": {
          "asset_type": {
            "type": "string",
            "title": "Asset Type"
          },
          "notional": {
            "type": "number",
            "title": "Notional"
          },
          "pct": {
            "type": "number",
            "title": "Pct"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "asset_type",
          "notional",
          "pct"
        ],
        "title": "AssetTypeSlice"
      },
      "AssignDealRequest": {
        "properties": {
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_id"
        ],
        "title": "AssignDealRequest"
      },
      "AssignResponse": {
        "properties": {
          "approval_id": {
            "type": "string",
            "title": "Approval Id"
          },
          "entity_type": {
            "$ref": "#/components/schemas/EntityType"
          },
          "assigned_to": {
            "type": "string",
            "title": "Assigned To"
          },
          "assigned_at": {
            "type": "string",
            "format": "date-time",
            "title": "Assigned At"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "approval_id",
          "entity_type",
          "assigned_to",
          "assigned_at"
        ],
        "title": "AssignResponse"
      },
      "AssumptionSet": {
        "properties": {
          "assumption_set_id": {
            "type": "string",
            "title": "Assumption Set Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "created_by": {
            "type": "string",
            "title": "Created By",
            "default": "user"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "notes": {
            "title": "Notes",
            "type": "string",
            "nullable": true
          },
          "assumption_set_type": {
            "type": "string",
            "enum": [
              "full",
              "market_env"
            ],
            "title": "Assumption Set Type",
            "description": "'market_env' = shared, dated market environment (OIS + spread curve); 'full' = legacy per-deal bundled set (market + credit + valuation params).",
            "default": "full"
          },
          "valuation": {
            "$ref": "#/components/schemas/ValuationAssumptions"
          },
          "market": {
            "$ref": "#/components/schemas/MarketAssumptions"
          },
          "credit": {
            "$ref": "#/components/schemas/CreditAssumptions"
          },
          "provenance": {
            "title": "Provenance",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "assumption_set_id",
          "name",
          "valuation",
          "market",
          "credit"
        ],
        "title": "AssumptionSet"
      },
      "BDCAttribution": {
        "properties": {
          "bdc_cik": {
            "type": "string",
            "title": "Bdc Cik"
          },
          "bdc_name": {
            "type": "string",
            "title": "Bdc Name"
          },
          "contribution_count": {
            "type": "integer",
            "minimum": 1.0,
            "title": "Contribution Count",
            "description": "Number of holdings this BDC contributes to the cohort"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "bdc_cik",
          "bdc_name",
          "contribution_count"
        ],
        "title": "BDCAttribution",
        "description": "Per-source disclosure on every cohort response.\n\nResearch (FEATURES.md Theme 1) locks this as non-negotiable \u2014 the\nanti-pattern is \"Single proprietary index as the benchmark\" (i.e. a single\nblended number with no provenance). Every cohort response must list\ncontributing BDCs by name + CIK so the caller can audit dispersion."
      },
      "BDCSummary": {
        "properties": {
          "n_holdings": {
            "type": "integer",
            "title": "N Holdings"
          },
          "n_bdcs": {
            "type": "integer",
            "title": "N Bdcs"
          },
          "n_borrowers": {
            "type": "integer",
            "title": "N Borrowers"
          },
          "n_periods": {
            "type": "integer",
            "title": "N Periods"
          },
          "period_min": {
            "title": "Period Min",
            "type": "string",
            "nullable": true
          },
          "period_max": {
            "title": "Period Max",
            "type": "string",
            "nullable": true
          },
          "n_with_spread": {
            "type": "integer",
            "title": "N With Spread"
          },
          "n_with_fair_value": {
            "type": "integer",
            "title": "N With Fair Value"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "n_holdings",
          "n_bdcs",
          "n_borrowers",
          "n_periods",
          "period_min",
          "period_max",
          "n_with_spread",
          "n_with_fair_value"
        ],
        "title": "BDCSummary"
      },
      "BalanceSheetLine": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Line name (e.g. 'Inventory', 'Goodwill')"
          },
          "amount": {
            "type": "number",
            "minimum": 0.0,
            "title": "Amount",
            "description": "Book amount USD"
          },
          "recovery_rate": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Recovery Rate",
            "description": "Distressed recovery rate 0\u20131"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name",
          "amount",
          "recovery_rate"
        ],
        "title": "BalanceSheetLine",
        "description": "A single balance-sheet line item with a distressed recovery rate."
      },
      "BankingApproach": {
        "type": "string",
        "enum": [
          "standardized",
          "irb_foundation",
          "irb_advanced"
        ],
        "title": "BankingApproach"
      },
      "BatchNextActionRequest": {
        "properties": {
          "deal_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Deal Ids"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_ids"
        ],
        "title": "BatchNextActionRequest",
        "description": "Batch variant keyed by deal_id \u2014 used by the Portfolio table to\nrender severity dots for every row without fanning out N HTTP calls."
      },
      "BatchNextActionResponse": {
        "properties": {
          "items": {
            "additionalProperties": {
              "$ref": "#/components/schemas/NextAction"
            },
            "type": "object",
            "title": "Items"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "items"
        ],
        "title": "BatchNextActionResponse"
      },
      "BearCaseResponse": {
        "properties": {
          "applied": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Applied"
          },
          "combined_pv": {
            "type": "number",
            "title": "Combined Pv"
          },
          "combined_swing": {
            "type": "number",
            "title": "Combined Swing"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "applied",
          "combined_pv",
          "combined_swing"
        ],
        "title": "BearCaseResponse"
      },
      "BenchmarkVarianceResponse": {
        "properties": {
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "coverage_count": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Coverage Count",
            "description": "Number of matched BDC holdings"
          },
          "matched_holdings": {
            "items": {
              "$ref": "#/components/schemas/MatchedHolding"
            },
            "type": "array",
            "title": "Matched Holdings"
          },
          "attribution": {
            "items": {
              "$ref": "#/components/schemas/BDCAttribution"
            },
            "type": "array",
            "title": "Attribution"
          },
          "as_of_date_range": {
            "$ref": "#/components/schemas/AsOfDateRange",
            "nullable": true
          },
          "overall_confidence": {
            "$ref": "#/components/schemas/MatchConfidenceTier",
            "nullable": true
          },
          "zero_match_reason": {
            "title": "Zero Match Reason",
            "description": "Explanatory copy surfaced in empty-state panel (D-13). Populated only when coverage_count == 0.",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_id",
          "coverage_count",
          "matched_holdings",
          "attribution"
        ],
        "title": "BenchmarkVarianceResponse",
        "description": "GET /deals/{deal_id}/benchmark-variance response payload.\n\nPure read \u2014 route NEVER mutates ValuationOutputs (D-14 / HARD-02 contract).\n\nFields:\n- coverage_count: number of matched BDC holdings\n- matched_holdings: per-holding details with match attribution\n- attribution: per-BDC contribution count (no blended opaque number \u2014 FEATURES.md Theme 1)\n- as_of_date_range: oldest and newest period_of_report across matched holdings\n- overall_confidence: badge tier from max(match_confidence) per OQ-3; None if no matches\n- zero_match_reason: explanatory copy when coverage_count == 0"
      },
      "BlendedSensitivityRequest": {
        "properties": {
          "valuation_date": {
            "type": "string",
            "format": "date",
            "title": "Valuation Date"
          },
          "deal_version_id": {
            "type": "string",
            "title": "Deal Version Id"
          },
          "assumption_set_version_id": {
            "type": "string",
            "title": "Assumption Set Version Id"
          },
          "spread_bumps_bps": {
            "items": {
              "type": "number"
            },
            "type": "array",
            "maxItems": 20,
            "title": "Spread Bumps Bps",
            "description": "List of market-drift shocks (bps). The engine re-runs the blended valuation for each shock and returns the resulting PV, price, and approach tag."
          },
          "override_weights": {
            "title": "Override Weights",
            "description": "Optional {'base': ..., 'downside': ..., 'recovery': ...} override for the scenario weights. Must sum to 1.",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "valuation_date",
          "deal_version_id",
          "assumption_set_version_id"
        ],
        "title": "BlendedSensitivityRequest",
        "description": "Probability-weighted blend with optional spread bumps.\n\nUseful for visualising how the base/downside/recovery blend responds to a\nmarket-wide spread move without recomputing everything through\n``/value``."
      },
      "Body_upload_document_deals__deal_id__documents_post": {
        "properties": {
          "files": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Files"
          }
        },
        "type": "object",
        "required": [
          "files"
        ],
        "title": "Body_upload_document_deals__deal_id__documents_post"
      },
      "Body_upload_files_intake_uploads_post": {
        "properties": {
          "files": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Files"
          }
        },
        "type": "object",
        "required": [
          "files"
        ],
        "title": "Body_upload_files_intake_uploads_post"
      },
      "BorrowerMetrics": {
        "properties": {
          "net_debt_to_ebitda": {
            "title": "Net Debt To Ebitda",
            "type": "number",
            "nullable": true
          },
          "interest_coverage": {
            "title": "Interest Coverage",
            "type": "number",
            "nullable": true
          },
          "data_asof_date": {
            "title": "Data Asof Date",
            "type": "string",
            "format": "date",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "BorrowerMetrics"
      },
      "BrandingPayload": {
        "properties": {
          "logo_base64": {
            "title": "Logo Base64",
            "description": "Base64-encoded logo bytes. PNG/SVG/JPEG only. Max 1 MiB after decode. Send empty string to clear.",
            "type": "string",
            "nullable": true
          },
          "logo_mime": {
            "title": "Logo Mime",
            "description": "MIME type for the logo. Required when logo_base64 is set.",
            "type": "string",
            "nullable": true
          },
          "accent_color": {
            "title": "Accent Color",
            "description": "Hex colour, e.g. '#0C447C'. Sent as null to clear.",
            "type": "string",
            "nullable": true
          },
          "footer_text": {
            "title": "Footer Text",
            "description": "Footer line stamped on the IC-memo PDF/DOCX. Max 200 chars.",
            "type": "string",
            "maxLength": 200,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "BrandingPayload",
        "description": "Body for PUT /funds/{fund_id}/branding.\n\nAll fields optional \u2014 sending a payload with ``accent_color=null``\nexplicitly clears that field back to the default; omitting the\nfield leaves the existing stored value untouched (when a row\nexists; when no row exists, default applies anyway)."
      },
      "BrandingResponse": {
        "properties": {
          "fund_id": {
            "type": "string",
            "title": "Fund Id"
          },
          "logo_base64": {
            "title": "Logo Base64",
            "type": "string",
            "nullable": true
          },
          "logo_mime": {
            "title": "Logo Mime",
            "type": "string",
            "nullable": true
          },
          "accent_color": {
            "type": "string",
            "title": "Accent Color"
          },
          "footer_text": {
            "type": "string",
            "title": "Footer Text"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string",
            "nullable": true
          },
          "is_default": {
            "type": "boolean",
            "title": "Is Default",
            "description": "True when no fund-specific row exists; values are the markst defaults.",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "fund_id",
          "accent_color",
          "footer_text"
        ],
        "title": "BrandingResponse",
        "description": "Read response \u2014 flattened from FundBranding, logo as base64."
      },
      "BreakEvenResponse": {
        "properties": {
          "horizon_start": {
            "type": "string",
            "format": "date",
            "title": "Horizon Start"
          },
          "horizon_end": {
            "type": "string",
            "format": "date",
            "title": "Horizon End"
          },
          "interest_next_12m": {
            "type": "number",
            "title": "Interest Next 12M"
          },
          "principal_next_12m": {
            "type": "number",
            "title": "Principal Next 12M"
          },
          "interest_coverage_break_even": {
            "type": "number",
            "title": "Interest Coverage Break Even",
            "description": "EBITDA at which next-12m interest coverage = 1.0x."
          },
          "fixed_charge_break_even": {
            "type": "number",
            "title": "Fixed Charge Break Even",
            "description": "EBITDA at which next-12m fixed-charge (interest + principal) coverage = 1.0x."
          },
          "index_rate_pct": {
            "title": "Index Rate Pct",
            "description": "Annual index rate (percent) projected flat into the coupon for floating-rate deals. None for fixed-rate deals \u2014 or for floating deals when no curve was available, in which case the figures are spread-only and understate the true break-even.",
            "type": "number",
            "nullable": true
          },
          "coupon_basis": {
            "type": "string",
            "title": "Coupon Basis",
            "description": "How the interest coupon was built: 'fixed' (fixed-rate deal), 'floating_indexed' (index + spread), or 'floating_spread_only' (no curve available \u2014 break-evens understate; UI should warn).",
            "default": "fixed"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "horizon_start",
          "horizon_end",
          "interest_next_12m",
          "principal_next_12m",
          "interest_coverage_break_even",
          "fixed_charge_break_even"
        ],
        "title": "BreakEvenResponse"
      },
      "BrokerQuote": {
        "properties": {
          "price_per_100": {
            "type": "number",
            "maximum": 200.0,
            "exclusiveMinimum": 0.0,
            "title": "Price Per 100",
            "description": "Quoted price per 100 face"
          },
          "quote_date": {
            "type": "string",
            "format": "date",
            "title": "Quote Date",
            "description": "The date the quote was observed in the market"
          },
          "source": {
            "$ref": "#/components/schemas/BrokerQuoteSource"
          },
          "volume_usd": {
            "title": "Volume Usd",
            "description": "Supporting trade volume in USD, if disclosed",
            "type": "number",
            "minimum": 0.0,
            "nullable": true
          },
          "is_related_party": {
            "type": "boolean",
            "title": "Is Related Party",
            "description": "True if the quote came from a related party (disqualifies it)",
            "default": false
          },
          "notes": {
            "type": "string",
            "title": "Notes",
            "description": "Free-form audit notes",
            "default": ""
          },
          "quote_id": {
            "type": "string",
            "title": "Quote Id"
          },
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "recorded_at": {
            "type": "string",
            "format": "date-time",
            "title": "Recorded At"
          },
          "is_reliable": {
            "type": "boolean",
            "title": "Is Reliable",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "price_per_100",
          "quote_date",
          "source",
          "quote_id",
          "deal_id"
        ],
        "title": "BrokerQuote",
        "description": "Stored broker quote \u2014 includes persisted identifiers + reliability flag."
      },
      "BrokerQuoteIn": {
        "properties": {
          "price_per_100": {
            "type": "number",
            "maximum": 200.0,
            "exclusiveMinimum": 0.0,
            "title": "Price Per 100",
            "description": "Quoted price per 100 face"
          },
          "quote_date": {
            "type": "string",
            "format": "date",
            "title": "Quote Date",
            "description": "The date the quote was observed in the market"
          },
          "source": {
            "$ref": "#/components/schemas/BrokerQuoteSource"
          },
          "volume_usd": {
            "title": "Volume Usd",
            "description": "Supporting trade volume in USD, if disclosed",
            "type": "number",
            "minimum": 0.0,
            "nullable": true
          },
          "is_related_party": {
            "type": "boolean",
            "title": "Is Related Party",
            "description": "True if the quote came from a related party (disqualifies it)",
            "default": false
          },
          "notes": {
            "type": "string",
            "title": "Notes",
            "description": "Free-form audit notes",
            "default": ""
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "price_per_100",
          "quote_date",
          "source"
        ],
        "title": "BrokerQuoteIn",
        "description": "Request body for recording a new broker quote against a deal."
      },
      "BrokerQuoteSource": {
        "type": "string",
        "enum": [
          "BLOOMBERG",
          "REUTERS_SMI",
          "IHS_MARKIT",
          "BROKER_DEALER",
          "OTHER"
        ],
        "title": "BrokerQuoteSource",
        "description": "Data source for a broker quote.\n\nThe first three values are \"reputable\" feeds \u2014 a quote from one of these\nis eligible to pass the source-quality gate. BROKER_DEALER and OTHER are\naccepted for audit but cannot be treated as primary Level-2 inputs."
      },
      "BulkApproveRequest": {
        "properties": {
          "run_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "minItems": 1,
            "title": "Run Ids",
            "description": "List of run IDs to approve"
          },
          "note": {
            "title": "Note",
            "type": "string",
            "maxLength": 2000,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "run_ids"
        ],
        "title": "BulkApproveRequest"
      },
      "BulkFeaturesRequest": {
        "properties": {
          "user_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "User Ids"
          },
          "grant": {
            "title": "Grant",
            "items": {
              "type": "string"
            },
            "type": "array",
            "nullable": true
          },
          "revoke": {
            "title": "Revoke",
            "items": {
              "type": "string"
            },
            "type": "array",
            "nullable": true
          },
          "reset": {
            "title": "Reset",
            "items": {
              "type": "string"
            },
            "type": "array",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "user_ids"
        ],
        "title": "BulkFeaturesRequest"
      },
      "BulkResolveRequest": {
        "properties": {
          "error_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "minItems": 1,
            "title": "Error Ids"
          },
          "note": {
            "type": "string",
            "title": "Note",
            "default": ""
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "error_ids"
        ],
        "title": "BulkResolveRequest"
      },
      "BusinessDayConvention": {
        "type": "string",
        "enum": [
          "FOLLOWING",
          "MODFOLLOW",
          "PRECEDING"
        ],
        "title": "BusinessDayConvention"
      },
      "CREOverrides": {
        "properties": {
          "senior_spread_tight_bps": {
            "title": "Senior Spread Tight Bps",
            "type": "integer",
            "nullable": true
          },
          "senior_spread_wide_bps": {
            "title": "Senior Spread Wide Bps",
            "type": "integer",
            "nullable": true
          },
          "mezz_spread_tight_bps": {
            "title": "Mezz Spread Tight Bps",
            "type": "integer",
            "nullable": true
          },
          "mezz_spread_wide_bps": {
            "title": "Mezz Spread Wide Bps",
            "type": "integer",
            "nullable": true
          },
          "preferred_spread_tight_bps": {
            "title": "Preferred Spread Tight Bps",
            "type": "integer",
            "nullable": true
          },
          "preferred_spread_wide_bps": {
            "title": "Preferred Spread Wide Bps",
            "type": "integer",
            "nullable": true
          },
          "illiquidity_prem_tight_bps": {
            "title": "Illiquidity Prem Tight Bps",
            "type": "integer",
            "nullable": true
          },
          "illiquidity_prem_wide_bps": {
            "title": "Illiquidity Prem Wide Bps",
            "type": "integer",
            "nullable": true
          },
          "io_adj_bps": {
            "title": "Io Adj Bps",
            "type": "integer",
            "nullable": true
          },
          "recourse_adj_bps": {
            "title": "Recourse Adj Bps",
            "type": "integer",
            "nullable": true
          },
          "stabilization_adj_bps": {
            "title": "Stabilization Adj Bps",
            "type": "integer",
            "nullable": true
          },
          "duration_factor": {
            "title": "Duration Factor",
            "type": "number",
            "nullable": true
          },
          "cycle": {
            "$ref": "#/components/schemas/CycleOverrides",
            "nullable": true
          },
          "scoring": {
            "$ref": "#/components/schemas/ScoringOverrides",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "CREOverrides"
      },
      "CRERequest": {
        "properties": {
          "strategy": {
            "type": "string",
            "title": "Strategy"
          },
          "ltv": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Ltv"
          },
          "dscr": {
            "type": "number",
            "maximum": 5.0,
            "minimum": 0.0,
            "title": "Dscr"
          },
          "occupancy_rate": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Occupancy Rate"
          },
          "noi_growth_3y": {
            "type": "number",
            "maximum": 2.0,
            "minimum": -1.0,
            "title": "Noi Growth 3Y"
          },
          "cap_rate": {
            "type": "number",
            "maximum": 0.3,
            "minimum": 0.0,
            "title": "Cap Rate"
          },
          "property_type": {
            "type": "string",
            "enum": [
              "Multifamily",
              "Industrial",
              "Office",
              "Retail",
              "Hospitality",
              "Mixed Use"
            ],
            "title": "Property Type",
            "default": "Multifamily"
          },
          "market_tier": {
            "type": "string",
            "enum": [
              "tier_1",
              "tier_2",
              "tier_3"
            ],
            "title": "Market Tier",
            "default": "tier_2"
          },
          "loan_type": {
            "type": "string",
            "enum": [
              "senior",
              "mezz",
              "preferred_equity"
            ],
            "title": "Loan Type",
            "default": "senior"
          },
          "is_stabilized": {
            "type": "boolean",
            "title": "Is Stabilized",
            "default": true
          },
          "io_period_years": {
            "type": "number",
            "maximum": 10.0,
            "minimum": 0.0,
            "title": "Io Period Years",
            "default": 0.0
          },
          "is_recourse": {
            "type": "boolean",
            "title": "Is Recourse",
            "default": false
          },
          "origination_spread_bps": {
            "type": "integer",
            "maximum": 5000.0,
            "minimum": 0.0,
            "title": "Origination Spread Bps"
          },
          "remaining_maturity_years": {
            "type": "number",
            "maximum": 30.0,
            "minimum": 0.0,
            "title": "Remaining Maturity Years"
          },
          "cycle_stage": {
            "type": "string",
            "enum": [
              "early",
              "mid",
              "late",
              "distressed"
            ],
            "title": "Cycle Stage",
            "default": "mid"
          },
          "sponsor_track_record": {
            "type": "string",
            "enum": [
              "institutional",
              "mid",
              "local"
            ],
            "title": "Sponsor Track Record",
            "default": "mid"
          },
          "wault_years": {
            "type": "number",
            "maximum": 30.0,
            "minimum": 0.0,
            "title": "Wault Years",
            "default": 5.0
          },
          "tenant_credit_quality": {
            "type": "string",
            "enum": [
              "investment_grade",
              "mixed",
              "speculative"
            ],
            "title": "Tenant Credit Quality",
            "default": "mixed"
          },
          "interest_reserve_months": {
            "type": "number",
            "maximum": 24.0,
            "minimum": 0.0,
            "title": "Interest Reserve Months",
            "default": 0.0
          },
          "overrides": {
            "$ref": "#/components/schemas/CREOverrides",
            "nullable": true
          },
          "use_dcf": {
            "type": "boolean",
            "title": "Use Dcf",
            "default": false
          },
          "market": {
            "type": "string",
            "enum": [
              "USD",
              "GBP",
              "EUR",
              "CUSTOM"
            ],
            "title": "Market",
            "default": "USD"
          },
          "calibration_params": {
            "$ref": "#/components/schemas/CustomCalibrationParams",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "strategy",
          "ltv",
          "dscr",
          "occupancy_rate",
          "noi_growth_3y",
          "cap_rate",
          "origination_spread_bps",
          "remaining_maturity_years"
        ],
        "title": "CRERequest"
      },
      "CREResponse": {
        "properties": {
          "strategy": {
            "type": "string",
            "title": "Strategy"
          },
          "composite": {
            "$ref": "#/components/schemas/CompositeScoreOut"
          },
          "waterfall": {
            "$ref": "#/components/schemas/SpreadWaterfallOut"
          },
          "fair_value_spread_bps": {
            "type": "integer",
            "title": "Fair Value Spread Bps"
          },
          "fair_value_price": {
            "type": "number",
            "title": "Fair Value Price"
          },
          "spread_delta_vs_origination_bps": {
            "type": "number",
            "title": "Spread Delta Vs Origination Bps"
          },
          "duration_years": {
            "type": "number",
            "title": "Duration Years"
          },
          "debt_yield": {
            "type": "number",
            "title": "Debt Yield"
          },
          "break_even_cap_rate": {
            "type": "number",
            "title": "Break Even Cap Rate"
          },
          "implied_loan_constant": {
            "type": "number",
            "title": "Implied Loan Constant"
          },
          "implied_rating": {
            "type": "string",
            "title": "Implied Rating"
          },
          "dcf_price": {
            "title": "Dcf Price",
            "type": "number",
            "nullable": true
          },
          "calibration_market": {
            "type": "string",
            "title": "Calibration Market",
            "default": "USD"
          },
          "calibration_effective_date": {
            "type": "string",
            "format": "date",
            "title": "Calibration Effective Date",
            "default": "2025-01-01"
          },
          "calibration_warning": {
            "title": "Calibration Warning",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "strategy",
          "composite",
          "waterfall",
          "fair_value_spread_bps",
          "fair_value_price",
          "spread_delta_vs_origination_bps",
          "duration_years",
          "debt_yield",
          "break_even_cap_rate",
          "implied_loan_constant",
          "implied_rating"
        ],
        "title": "CREResponse"
      },
      "CREWeights": {
        "properties": {
          "ltv": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Ltv",
            "description": "Loan-to-value weight",
            "default": 0.2
          },
          "dscr": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Dscr",
            "description": "Debt service coverage weight",
            "default": 0.2
          },
          "property_type": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Property Type",
            "description": "Property type weight",
            "default": 0.12
          },
          "market_tier": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Market Tier",
            "description": "Market tier weight",
            "default": 0.09
          },
          "occupancy": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Occupancy",
            "description": "Occupancy weight",
            "default": 0.1
          },
          "noi_growth": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Noi Growth",
            "description": "NOI growth (3yr CAGR) weight",
            "default": 0.08
          },
          "sponsor": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Sponsor",
            "description": "Sponsor track record weight",
            "default": 0.08
          },
          "wault": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Wault",
            "description": "WAULT weight",
            "default": 0.07
          },
          "tenant_credit": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Tenant Credit",
            "description": "Tenant credit quality weight",
            "default": 0.08
          },
          "debt_yield": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Debt Yield",
            "description": "Debt yield weight",
            "default": 0.05
          },
          "interest_reserve": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Interest Reserve",
            "description": "Interest reserve weight",
            "default": 0.04
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "CREWeights",
        "description": "Factor weights for the Commercial Real Estate debt composite score."
      },
      "CadenceBreach": {
        "properties": {
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "deal_name": {
            "title": "Deal Name",
            "type": "string",
            "nullable": true
          },
          "frequency": {
            "type": "string",
            "title": "Frequency"
          },
          "last_revalued_at": {
            "title": "Last Revalued At",
            "type": "string",
            "nullable": true
          },
          "cadence_days": {
            "type": "integer",
            "title": "Cadence Days"
          },
          "days_overdue": {
            "type": "integer",
            "title": "Days Overdue"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_id",
          "frequency",
          "cadence_days",
          "days_overdue"
        ],
        "title": "CadenceBreach"
      },
      "CadenceBreachesResponse": {
        "properties": {
          "breaches": {
            "items": {
              "$ref": "#/components/schemas/CadenceBreach"
            },
            "type": "array",
            "title": "Breaches"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "breaches",
          "count"
        ],
        "title": "CadenceBreachesResponse"
      },
      "CalibrateRequest": {
        "properties": {
          "strategy": {
            "type": "string",
            "title": "Strategy",
            "default": "direct_lending"
          },
          "observations": {
            "items": {
              "$ref": "#/components/schemas/LabelledObservationIn"
            },
            "type": "array",
            "minItems": 10,
            "title": "Observations",
            "description": "Labelled default dataset (min 10 observations)."
          },
          "n_bootstrap": {
            "type": "integer",
            "maximum": 5000.0,
            "minimum": 100.0,
            "title": "N Bootstrap",
            "description": "Bootstrap samples for 95 % weight confidence intervals.",
            "default": 1000
          },
          "fit_breakpoints_for": {
            "title": "Fit Breakpoints For",
            "description": "Numeric factor names to fit breakpoints for. Defaults to all numeric direct_lending factors.",
            "items": {
              "type": "string"
            },
            "type": "array",
            "nullable": true
          },
          "n_breakpoints": {
            "type": "integer",
            "maximum": 20.0,
            "minimum": 2.0,
            "title": "N Breakpoints",
            "default": 5
          },
          "confirm": {
            "type": "boolean",
            "title": "Confirm",
            "description": "If True, the fitted calibration is committed and registered as active for the strategy, replacing expert weights until cleared. If False (default), results are returned for inspection only.",
            "default": false
          },
          "use_synthetic": {
            "type": "boolean",
            "title": "Use Synthetic",
            "description": "Ignore the observations field and generate a synthetic dataset using the current expert breakpoints as the data-generating process. Useful for end-to-end pipeline testing before real data is available.",
            "default": false
          },
          "n_synthetic": {
            "type": "integer",
            "maximum": 10000.0,
            "minimum": 50.0,
            "title": "N Synthetic",
            "default": 500
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "observations"
        ],
        "title": "CalibrateRequest",
        "description": "Request body for POST /value/multi-factor/calibrate.\n\nAccepts a list of labelled default observations and returns fitted weights\nwith full validation metrics.  Live parameters are NOT modified unless\nconfirm=True is set."
      },
      "CalibrateResponse": {
        "properties": {
          "strategy": {
            "type": "string",
            "title": "Strategy"
          },
          "n_observations": {
            "type": "integer",
            "title": "N Observations"
          },
          "n_defaults": {
            "type": "integer",
            "title": "N Defaults"
          },
          "fitted_weights": {
            "$ref": "#/components/schemas/FittedWeightsOut"
          },
          "validation": {
            "$ref": "#/components/schemas/CalibrationValidationOut"
          },
          "expert_comparison": {
            "items": {
              "$ref": "#/components/schemas/ExpertComparisonOut"
            },
            "type": "array",
            "title": "Expert Comparison"
          },
          "fitted_breakpoints": {
            "additionalProperties": {
              "$ref": "#/components/schemas/FittedBreakpointsOut"
            },
            "type": "object",
            "title": "Fitted Breakpoints"
          },
          "committed": {
            "type": "boolean",
            "title": "Committed"
          },
          "warning": {
            "title": "Warning",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "strategy",
          "n_observations",
          "n_defaults",
          "fitted_weights",
          "validation",
          "expert_comparison",
          "fitted_breakpoints",
          "committed"
        ],
        "title": "CalibrateResponse",
        "description": "Response from POST /value/multi-factor/calibrate."
      },
      "CalibrateSpreadRequest": {
        "properties": {
          "issuance_price_pct": {
            "type": "number",
            "maximum": 200.0,
            "minimum": 0.0,
            "title": "Issuance Price Pct"
          },
          "calibration_date": {
            "title": "Calibration Date",
            "description": "ISO date used for the calibration run. Defaults to today.",
            "type": "string",
            "nullable": true
          },
          "assumption_set_id": {
            "type": "string",
            "title": "Assumption Set Id",
            "description": "Assumption set used for the DCF pricing leg of the bisection."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "issuance_price_pct",
          "assumption_set_id"
        ],
        "title": "CalibrateSpreadRequest",
        "description": "Body for ``POST /deals/{deal_id}/calibrate``."
      },
      "CalibrateSpreadResponse": {
        "properties": {
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "assumption_set_id": {
            "type": "string",
            "title": "Assumption Set Id"
          },
          "issuance_price_pct": {
            "type": "number",
            "title": "Issuance Price Pct"
          },
          "calibration_date": {
            "type": "string",
            "title": "Calibration Date"
          },
          "implied_spread_bps": {
            "type": "number",
            "title": "Implied Spread Bps"
          },
          "notes": {
            "type": "string",
            "title": "Notes",
            "default": ""
          },
          "requires_user_acceptance": {
            "type": "boolean",
            "title": "Requires User Acceptance",
            "description": "Always True for calibration. The endpoint computed an implied spread and recorded it in deal_calibrations history, but the active assumption set is unchanged. To apply the value, PUT the new discount_margin_bps to /assumptionsets/{id} explicitly (or use the frontend's Apply button when wired up).",
            "default": true
          },
          "apply_path": {
            "type": "string",
            "title": "Apply Path",
            "description": "The route to call to make the calibration authoritative. Hard-coded so any caller / SDK can render it as an action without inspecting the methodology doc.",
            "default": "PUT /assumptionsets/{assumption_set_id}"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_id",
          "assumption_set_id",
          "issuance_price_pct",
          "calibration_date",
          "implied_spread_bps"
        ],
        "title": "CalibrateSpreadResponse"
      },
      "CalibrationResponse": {
        "properties": {
          "fetched_at": {
            "type": "string",
            "title": "Fetched At"
          },
          "cache_expires_at": {
            "type": "string",
            "title": "Cache Expires At"
          },
          "market": {
            "$ref": "#/components/schemas/MarketContextOut"
          },
          "composite": {
            "$ref": "#/components/schemas/CompositeContextOut",
            "nullable": true
          },
          "direct_lending": {
            "$ref": "#/components/schemas/StrategyCalibrationOut"
          },
          "mezzanine": {
            "$ref": "#/components/schemas/StrategyCalibrationOut"
          },
          "cre_senior": {
            "$ref": "#/components/schemas/StrategyCalibrationOut"
          },
          "cre_mezz": {
            "$ref": "#/components/schemas/StrategyCalibrationOut"
          },
          "cre_preferred": {
            "$ref": "#/components/schemas/StrategyCalibrationOut"
          },
          "methodology_note": {
            "type": "string",
            "title": "Methodology Note",
            "default": "Calibrated bounds anchor on Verus spread-composite cohort percentile bands (BDC medians + daily CDS overlay) \u2014 the illiquidity premium is embedded in observed private-credit pricing, not added on top. Direct lending: BB p25 / B p75. Mezzanine: B p75 / CCC p75. CRE strategies are model constants pending a CRE reference dataset."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "fetched_at",
          "cache_expires_at",
          "market",
          "direct_lending",
          "mezzanine",
          "cre_senior",
          "cre_mezz",
          "cre_preferred"
        ],
        "title": "CalibrationResponse"
      },
      "CalibrationValidationOut": {
        "properties": {
          "auc_roc": {
            "type": "number",
            "title": "Auc Roc"
          },
          "auc_pr": {
            "type": "number",
            "title": "Auc Pr"
          },
          "brier_score": {
            "type": "number",
            "title": "Brier Score"
          },
          "fold_results": {
            "items": {
              "$ref": "#/components/schemas/FoldResultOut"
            },
            "type": "array",
            "title": "Fold Results"
          },
          "n_observations": {
            "type": "integer",
            "title": "N Observations"
          },
          "n_defaults": {
            "type": "integer",
            "title": "N Defaults"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "auc_roc",
          "auc_pr",
          "brier_score",
          "fold_results",
          "n_observations",
          "n_defaults"
        ],
        "title": "CalibrationValidationOut"
      },
      "CallProtectionEnum": {
        "type": "string",
        "enum": [
          "make_whole",
          "soft_call_101",
          "at_par"
        ],
        "title": "CallProtectionEnum"
      },
      "CancelResponse": {
        "properties": {
          "cancelled": {
            "type": "boolean",
            "title": "Cancelled"
          },
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "cancelled",
          "message"
        ],
        "title": "CancelResponse"
      },
      "CapitalAdequacyOut": {
        "properties": {
          "eligible_capital": {
            "type": "number",
            "title": "Eligible Capital"
          },
          "total_rwa": {
            "type": "number",
            "title": "Total Rwa"
          },
          "cet1_ratio": {
            "type": "number",
            "title": "Cet1 Ratio"
          },
          "tier1_ratio": {
            "type": "number",
            "title": "Tier1 Ratio"
          },
          "total_capital_ratio": {
            "type": "number",
            "title": "Total Capital Ratio"
          },
          "cet1_surplus_deficit": {
            "type": "number",
            "title": "Cet1 Surplus Deficit"
          },
          "total_surplus_deficit": {
            "type": "number",
            "title": "Total Surplus Deficit"
          },
          "is_adequately_capitalised": {
            "type": "boolean",
            "title": "Is Adequately Capitalised"
          },
          "distance_to_breach_eur": {
            "type": "number",
            "title": "Distance To Breach Eur"
          },
          "cet1_minimum_pct": {
            "type": "number",
            "title": "Cet1 Minimum Pct",
            "default": 4.5
          },
          "cet1_target_pct": {
            "type": "number",
            "title": "Cet1 Target Pct",
            "default": 7.000000000000001
          },
          "total_minimum_pct": {
            "type": "number",
            "title": "Total Minimum Pct",
            "default": 8.0
          },
          "total_target_pct": {
            "type": "number",
            "title": "Total Target Pct",
            "default": 10.5
          }
        },
        "type": "object",
        "required": [
          "eligible_capital",
          "total_rwa",
          "cet1_ratio",
          "tier1_ratio",
          "total_capital_ratio",
          "cet1_surplus_deficit",
          "total_surplus_deficit",
          "is_adequately_capitalised",
          "distance_to_breach_eur"
        ],
        "title": "CapitalAdequacyOut"
      },
      "CapitalAdequacyRequest": {
        "properties": {
          "eligible_capital": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Eligible Capital",
            "description": "Total eligible capital"
          },
          "tier1_capital": {
            "title": "Tier1 Capital",
            "type": "number",
            "exclusiveMinimum": 0.0,
            "nullable": true
          },
          "cet1_capital": {
            "title": "Cet1 Capital",
            "type": "number",
            "exclusiveMinimum": 0.0,
            "nullable": true
          },
          "total_rwa": {
            "title": "Total Rwa",
            "description": "If not supplied, computed from portfolio",
            "type": "number",
            "exclusiveMinimum": 0.0,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "eligible_capital"
        ],
        "title": "CapitalAdequacyRequest"
      },
      "CdsFreshnessOut": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "latest_date": {
            "title": "Latest Date",
            "type": "string",
            "nullable": true
          },
          "median_bps": {
            "title": "Median Bps",
            "type": "number",
            "nullable": true
          },
          "trade_count": {
            "title": "Trade Count",
            "type": "integer",
            "nullable": true
          },
          "source": {
            "title": "Source",
            "type": "string",
            "nullable": true
          },
          "business_days_lag": {
            "title": "Business Days Lag",
            "type": "integer",
            "nullable": true
          },
          "status": {
            "type": "string",
            "title": "Status"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "ticker",
          "status"
        ],
        "title": "CdsFreshnessOut",
        "description": "Latest persisted DTCC print per overlay factor + business-day staleness."
      },
      "CdsRefreshResponse": {
        "properties": {
          "refreshed": {
            "items": {
              "$ref": "#/components/schemas/CdsRefreshResult"
            },
            "type": "array",
            "title": "Refreshed"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "refreshed"
        ],
        "title": "CdsRefreshResponse"
      },
      "CdsRefreshResult": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "rows_written": {
            "title": "Rows Written",
            "type": "integer",
            "nullable": true
          },
          "error": {
            "title": "Error",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "ticker"
        ],
        "title": "CdsRefreshResult"
      },
      "ChallengerRequest": {
        "properties": {
          "as_of": {
            "title": "As Of",
            "description": "Valuation date / market-data replay anchor. Defaults to today.",
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "assumption_set_id": {
            "title": "Assumption Set Id",
            "description": "Specific assumption set to evaluate against. Defaults to the deal's most recent assumption set.",
            "type": "string",
            "nullable": true
          },
          "top_n": {
            "type": "integer",
            "maximum": 5.0,
            "minimum": 1.0,
            "title": "Top N",
            "description": "Number of fragilities to combine in the bear case.",
            "default": 3
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ChallengerRequest"
      },
      "ChallengerResponse": {
        "properties": {
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "base_pv": {
            "type": "number",
            "title": "Base Pv"
          },
          "fragilities": {
            "items": {
              "$ref": "#/components/schemas/FragilityResponse"
            },
            "type": "array",
            "title": "Fragilities"
          },
          "bear_case": {
            "$ref": "#/components/schemas/BearCaseResponse"
          },
          "deterministic_key": {
            "type": "string",
            "title": "Deterministic Key"
          },
          "top_n": {
            "type": "integer",
            "title": "Top N"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_id",
          "base_pv",
          "fragilities",
          "bear_case",
          "deterministic_key",
          "top_n"
        ],
        "title": "ChallengerResponse"
      },
      "ChangePasswordRequest": {
        "properties": {
          "current_password": {
            "type": "string",
            "title": "Current Password"
          },
          "new_password": {
            "type": "string",
            "title": "New Password"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "current_password",
          "new_password"
        ],
        "title": "ChangePasswordRequest"
      },
      "ChangePlanRequest": {
        "properties": {
          "plan_id": {
            "type": "string",
            "title": "Plan Id"
          },
          "billing_cycle": {
            "type": "string",
            "title": "Billing Cycle",
            "default": "monthly"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "plan_id"
        ],
        "title": "ChangePlanRequest"
      },
      "ChatRequest": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          },
          "history": {
            "items": {
              "$ref": "#/components/schemas/HistoryItem"
            },
            "type": "array",
            "title": "History",
            "default": []
          },
          "force_category": {
            "title": "Force Category",
            "type": "string",
            "nullable": true
          },
          "stream": {
            "type": "boolean",
            "title": "Stream",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "message"
        ],
        "title": "ChatRequest"
      },
      "CheckoutSessionRequest": {
        "properties": {
          "plan_id": {
            "type": "string",
            "title": "Plan Id"
          },
          "billing_cycle": {
            "type": "string",
            "title": "Billing Cycle",
            "default": "monthly"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "plan_id"
        ],
        "title": "CheckoutSessionRequest"
      },
      "Classification": {
        "properties": {
          "capital_structure": {
            "type": "string",
            "title": "Capital Structure",
            "default": "Senior Secured"
          },
          "sector": {
            "type": "string",
            "title": "Sector",
            "default": "General"
          },
          "country": {
            "type": "string",
            "title": "Country",
            "default": "US"
          },
          "illiquidity_bucket": {
            "type": "string",
            "title": "Illiquidity Bucket",
            "default": "Standard"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "Classification"
      },
      "CloneDealToUserRequest": {
        "properties": {
          "target_user_id": {
            "type": "string",
            "title": "Target User Id",
            "description": "User who will own the cloned deal. Must be an existing platform_users.user_id; the route 422s otherwise."
          },
          "include_documents": {
            "type": "boolean",
            "title": "Include Documents",
            "description": "When true (default), every document attached to the source deal is also cloned \u2014 each gets a new doc_id stamped with the target user as owner, but reuses the source's file_path (no byte duplication on disk). Set false to clone the deal terms only without dataroom contents.",
            "default": true
          },
          "note": {
            "title": "Note",
            "description": "Free-form audit note recorded in change_log.",
            "type": "string",
            "maxLength": 500,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "target_user_id"
        ],
        "title": "CloneDealToUserRequest"
      },
      "CloseRequest": {
        "properties": {
          "note": {
            "title": "Note",
            "type": "string",
            "maxLength": 2000,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "CloseRequest",
        "description": "Empty-body request stamp for cutoff / sign-off / reopen routes.\n\nKept typed so we get 422 on malformed bodies and so future fields\n(reason / note) can be added without breaking clients."
      },
      "CloseStatus": {
        "type": "string",
        "enum": [
          "OPEN",
          "CUTOFF",
          "RECONCILED",
          "SIGNED_OFF",
          "REOPENED"
        ],
        "title": "CloseStatus"
      },
      "ClusterStats": {
        "properties": {
          "spread_median": {
            "type": "number",
            "title": "Spread Median"
          },
          "spread_p25": {
            "type": "number",
            "title": "Spread P25"
          },
          "spread_p75": {
            "type": "number",
            "title": "Spread P75"
          },
          "spread_min": {
            "type": "number",
            "title": "Spread Min"
          },
          "spread_max": {
            "type": "number",
            "title": "Spread Max"
          },
          "n": {
            "type": "integer",
            "title": "N"
          },
          "leverage_median": {
            "title": "Leverage Median",
            "type": "number",
            "nullable": true
          },
          "leverage_p25": {
            "title": "Leverage P25",
            "type": "number",
            "nullable": true
          },
          "leverage_p75": {
            "title": "Leverage P75",
            "type": "number",
            "nullable": true
          },
          "n_with_leverage": {
            "type": "integer",
            "title": "N With Leverage",
            "default": 0
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "spread_median",
          "spread_p25",
          "spread_p75",
          "spread_min",
          "spread_max",
          "n"
        ],
        "title": "ClusterStats"
      },
      "CohortFiltersEcho": {
        "properties": {
          "sector": {
            "title": "Sector",
            "type": "string",
            "nullable": true
          },
          "vintage_year": {
            "title": "Vintage Year",
            "type": "integer",
            "nullable": true
          },
          "seniority": {
            "title": "Seniority",
            "type": "string",
            "enum": [
              "senior_secured",
              "mezzanine",
              "subordinated",
              "equity",
              "unsecured",
              "unknown"
            ],
            "nullable": true
          },
          "min_cohort_size": {
            "type": "integer",
            "maximum": 50.0,
            "minimum": 5.0,
            "title": "Min Cohort Size"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "min_cohort_size"
        ],
        "title": "CohortFiltersEcho",
        "description": "Echo of the applied filter values \u2014 helps the client confirm what was queried."
      },
      "CohortResponse": {
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "cohort_too_small"
            ],
            "title": "Status"
          },
          "filters": {
            "$ref": "#/components/schemas/CohortFiltersEcho"
          },
          "stats": {
            "$ref": "#/components/schemas/CohortStats",
            "nullable": true
          },
          "too_small": {
            "$ref": "#/components/schemas/CohortTooSmall",
            "nullable": true
          },
          "attribution": {
            "items": {
              "$ref": "#/components/schemas/BDCAttribution"
            },
            "type": "array",
            "title": "Attribution"
          },
          "as_of_date_range": {
            "$ref": "#/components/schemas/AsOfDateRange",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status",
          "filters",
          "attribution"
        ],
        "title": "CohortResponse",
        "description": "GET /benchmark/cohort response.\n\nDiscriminated by ``status``:\n    * ``\"ok\"`` \u2192 ``stats`` populated, ``too_small`` is ``None``\n    * ``\"cohort_too_small\"`` \u2192 ``too_small`` populated, ``stats`` is ``None``\n\n``attribution`` is ALWAYS present (may be empty list when the cohort is\nempty). ``extra=\"forbid\"`` enforces the no-blended-number contract at the\nresponse-validation layer."
      },
      "CohortStats": {
        "properties": {
          "n": {
            "type": "integer",
            "minimum": 5.0,
            "title": "N",
            "description": "Number of spread-bearing holdings in cohort"
          },
          "median_bps": {
            "type": "number",
            "title": "Median Bps"
          },
          "p25_bps": {
            "type": "number",
            "title": "P25 Bps"
          },
          "p75_bps": {
            "type": "number",
            "title": "P75 Bps"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "n",
          "median_bps",
          "p25_bps",
          "p75_bps"
        ],
        "title": "CohortStats",
        "description": "Cohort statistics populated only when ``status == 'ok'``.\n\nAll spread values are in basis points (bps) per Juno codebase convention."
      },
      "CohortTooSmall": {
        "properties": {
          "n": {
            "type": "integer",
            "minimum": 0.0,
            "title": "N",
            "description": "Matching rows after filters (may be 0)"
          },
          "min": {
            "type": "integer",
            "minimum": 1.0,
            "title": "Min",
            "description": "Minimum cohort size required"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "n",
          "min"
        ],
        "title": "CohortTooSmall",
        "description": "Returned when fewer than ``min_cohort_size`` holdings match the filters.\n\nNEVER fabricate statistics on small cohorts (T-2-08 / T-2-15 mitigation).\nThe caller must surface this sentinel to the UI rather than a median."
      },
      "CommitteePacket": {
        "properties": {
          "entity_type": {
            "$ref": "#/components/schemas/EntityType"
          },
          "entity_id": {
            "type": "string",
            "title": "Entity Id"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Generated At"
          },
          "deal_snapshot": {
            "title": "Deal Snapshot",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          },
          "valuation_run": {
            "title": "Valuation Run",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          },
          "assumption_set": {
            "title": "Assumption Set",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          },
          "approval_history": {
            "items": {
              "$ref": "#/components/schemas/PacketApproval"
            },
            "type": "array",
            "title": "Approval History"
          },
          "reviewer_metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Reviewer Metadata"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "entity_type",
          "entity_id",
          "generated_at"
        ],
        "title": "CommitteePacket",
        "description": "Printable committee packet bundle \u2014 pure JSON, no PDF."
      },
      "CompanyFactorDelta": {
        "properties": {
          "delta_bps": {
            "type": "number",
            "maximum": 250.0,
            "minimum": -75.0,
            "title": "Delta Bps",
            "description": "Company-factor spread delta in bps (negative = tighter)."
          },
          "source": {
            "type": "string",
            "title": "Source",
            "description": "Provenance for CalibrationTrace.company_delta_source, e.g. 'multi_factor:Adequate:run:1a2b3c4d'."
          },
          "composite_score": {
            "type": "number",
            "maximum": 100.0,
            "minimum": 0.0,
            "title": "Composite Score",
            "description": "Composite score the delta was derived from."
          },
          "applied_at": {
            "type": "string",
            "title": "Applied At",
            "description": "ISO date the analyst applied the delta."
          },
          "lpi_suppressed": {
            "type": "boolean",
            "title": "Lpi Suppressed",
            "description": "True when the composite behind this delta was computed with the Covenant factor suppressed because the deal's LPI was complete at apply time (Phase 29 XOR \u2014 LPI owns structural pricing). False on legacy applies from unsuppressed runs: stacking those with an LPI delta double-counts covenant until the analyst re-applies.",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "delta_bps",
          "source",
          "composite_score",
          "applied_at"
        ],
        "title": "CompanyFactorDelta",
        "description": "Deal-specific company-factor spread delta, applied explicitly by an analyst\nfrom a committed multi-factor run (\"Apply to mark\"). Carried on the deal's\nCreditBasisState so the yield-path resolver can stamp it onto the resolved\nassumption set \u2014 the shared Market Env set is never mutated.\n\nBounds mirror app/engine/company_spread_delta.py: composite 100 tightens by\nat most 75 bps; composite 0 widens by at most 250 bps."
      },
      "ComparableDeal": {
        "properties": {
          "comp_id": {
            "type": "string",
            "title": "Comp Id",
            "description": "CMP-XXXXXXXX identifier"
          },
          "borrower_name": {
            "type": "string",
            "title": "Borrower Name"
          },
          "sector": {
            "type": "string",
            "title": "Sector"
          },
          "geography": {
            "type": "string",
            "enum": [
              "US",
              "EU",
              "UK",
              "APAC",
              "LatAm",
              "Other"
            ],
            "title": "Geography"
          },
          "asset_type": {
            "type": "string",
            "title": "Asset Type",
            "description": "One of app.models.comparables.ASSET_TYPES"
          },
          "seniority": {
            "type": "string",
            "enum": [
              "first_lien",
              "second_lien",
              "unitranche",
              "mezzanine",
              "subordinated",
              "senior_unsecured",
              "DIP"
            ],
            "title": "Seniority"
          },
          "notional_usd": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Notional Usd",
            "description": "USD-equivalent at pricing"
          },
          "origination_date": {
            "type": "string",
            "format": "date",
            "title": "Origination Date"
          },
          "maturity_date": {
            "type": "string",
            "format": "date",
            "title": "Maturity Date"
          },
          "tenor_years": {
            "type": "number",
            "minimum": 0.0,
            "title": "Tenor Years"
          },
          "rating": {
            "type": "string",
            "enum": [
              "AAA",
              "AA+",
              "AA",
              "AA-",
              "A+",
              "A",
              "A-",
              "BBB+",
              "BBB",
              "BBB-",
              "BB+",
              "BB",
              "BB-",
              "B+",
              "B",
              "B-",
              "CCC+",
              "CCC",
              "CCC-",
              "CC",
              "C",
              "D"
            ],
            "title": "Rating"
          },
          "spread_bps": {
            "type": "integer",
            "maximum": 5000.0,
            "minimum": 0.0,
            "title": "Spread Bps"
          },
          "reference_rate": {
            "type": "string",
            "enum": [
              "SOFR",
              "EURIBOR",
              "SONIA",
              "FIXED"
            ],
            "title": "Reference Rate"
          },
          "ltv_pct": {
            "title": "Ltv Pct",
            "type": "number",
            "maximum": 200.0,
            "minimum": 0.0,
            "nullable": true
          },
          "leverage_x": {
            "title": "Leverage X",
            "type": "number",
            "maximum": 20.0,
            "minimum": 0.0,
            "nullable": true
          },
          "coverage_x": {
            "title": "Coverage X",
            "type": "number",
            "maximum": 20.0,
            "minimum": 0.0,
            "nullable": true
          },
          "oid_pct": {
            "title": "Oid Pct",
            "description": "Original issue discount (pts off par)",
            "type": "number",
            "maximum": 100.0,
            "minimum": 0.0,
            "nullable": true
          },
          "floor_bps": {
            "title": "Floor Bps",
            "description": "Floor on the reference rate, bps",
            "type": "integer",
            "maximum": 1000.0,
            "minimum": 0.0,
            "nullable": true
          },
          "call_protection": {
            "title": "Call Protection",
            "description": "e.g. 'NC1 101/100' or 'MWC'",
            "type": "string",
            "maxLength": 64,
            "nullable": true
          },
          "upfront_fee_pct": {
            "title": "Upfront Fee Pct",
            "description": "Upfront / arrangement fee, pts",
            "type": "number",
            "maximum": 10.0,
            "minimum": 0.0,
            "nullable": true
          },
          "covenants": {
            "title": "Covenants",
            "description": "e.g. 'cov-lite', 'maint-lev 6.5x', 'DSCR 1.25x'",
            "type": "string",
            "maxLength": 128,
            "nullable": true
          },
          "ebitda_usd": {
            "title": "Ebitda Usd",
            "description": "Borrower LTM EBITDA at pricing, USD",
            "type": "number",
            "minimum": 0.0,
            "nullable": true
          },
          "origin": {
            "type": "string",
            "title": "Origin",
            "description": "Every row is a real observation \u2014 synthetic rows are not accepted.",
            "default": "real"
          },
          "source": {
            "type": "string",
            "enum": [
              "syndicated_market",
              "club_deal",
              "rating_agency",
              "news",
              "news_inferred",
              "sec_filing",
              "sec_edgar",
              "lcd",
              "court_doc"
            ],
            "title": "Source"
          },
          "source_ref": {
            "type": "string",
            "title": "Source Ref",
            "description": "URL, press-release id, internal doc id"
          },
          "as_of_date": {
            "type": "string",
            "format": "date",
            "title": "As Of Date"
          },
          "notes": {
            "type": "string",
            "title": "Notes",
            "default": ""
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "comp_id",
          "borrower_name",
          "sector",
          "geography",
          "asset_type",
          "seniority",
          "notional_usd",
          "origination_date",
          "maturity_date",
          "tenor_years",
          "rating",
          "spread_bps",
          "reference_rate",
          "source",
          "source_ref",
          "as_of_date"
        ],
        "title": "ComparableDeal",
        "description": "A stored comparable deal observation."
      },
      "ComparableDealIn": {
        "properties": {
          "borrower_name": {
            "type": "string",
            "title": "Borrower Name"
          },
          "sector": {
            "type": "string",
            "title": "Sector"
          },
          "geography": {
            "type": "string",
            "enum": [
              "US",
              "EU",
              "UK",
              "APAC",
              "LatAm",
              "Other"
            ],
            "title": "Geography"
          },
          "asset_type": {
            "type": "string",
            "title": "Asset Type"
          },
          "seniority": {
            "type": "string",
            "enum": [
              "first_lien",
              "second_lien",
              "unitranche",
              "mezzanine",
              "subordinated",
              "senior_unsecured",
              "DIP"
            ],
            "title": "Seniority"
          },
          "notional_usd": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Notional Usd"
          },
          "origination_date": {
            "type": "string",
            "format": "date",
            "title": "Origination Date"
          },
          "maturity_date": {
            "type": "string",
            "format": "date",
            "title": "Maturity Date"
          },
          "tenor_years": {
            "type": "number",
            "minimum": 0.0,
            "title": "Tenor Years"
          },
          "rating": {
            "type": "string",
            "enum": [
              "AAA",
              "AA+",
              "AA",
              "AA-",
              "A+",
              "A",
              "A-",
              "BBB+",
              "BBB",
              "BBB-",
              "BB+",
              "BB",
              "BB-",
              "B+",
              "B",
              "B-",
              "CCC+",
              "CCC",
              "CCC-",
              "CC",
              "C",
              "D"
            ],
            "title": "Rating"
          },
          "spread_bps": {
            "type": "integer",
            "maximum": 5000.0,
            "minimum": 0.0,
            "title": "Spread Bps"
          },
          "reference_rate": {
            "type": "string",
            "enum": [
              "SOFR",
              "EURIBOR",
              "SONIA",
              "FIXED"
            ],
            "title": "Reference Rate"
          },
          "ltv_pct": {
            "title": "Ltv Pct",
            "type": "number",
            "maximum": 200.0,
            "minimum": 0.0,
            "nullable": true
          },
          "leverage_x": {
            "title": "Leverage X",
            "type": "number",
            "maximum": 20.0,
            "minimum": 0.0,
            "nullable": true
          },
          "coverage_x": {
            "title": "Coverage X",
            "type": "number",
            "maximum": 20.0,
            "minimum": 0.0,
            "nullable": true
          },
          "oid_pct": {
            "title": "Oid Pct",
            "type": "number",
            "maximum": 100.0,
            "minimum": 0.0,
            "nullable": true
          },
          "floor_bps": {
            "title": "Floor Bps",
            "type": "integer",
            "maximum": 1000.0,
            "minimum": 0.0,
            "nullable": true
          },
          "call_protection": {
            "title": "Call Protection",
            "type": "string",
            "maxLength": 64,
            "nullable": true
          },
          "upfront_fee_pct": {
            "title": "Upfront Fee Pct",
            "type": "number",
            "maximum": 10.0,
            "minimum": 0.0,
            "nullable": true
          },
          "covenants": {
            "title": "Covenants",
            "type": "string",
            "maxLength": 128,
            "nullable": true
          },
          "ebitda_usd": {
            "title": "Ebitda Usd",
            "type": "number",
            "minimum": 0.0,
            "nullable": true
          },
          "origin": {
            "type": "string",
            "title": "Origin",
            "default": "real"
          },
          "source": {
            "type": "string",
            "enum": [
              "syndicated_market",
              "club_deal",
              "rating_agency",
              "news",
              "news_inferred",
              "sec_filing",
              "sec_edgar",
              "lcd",
              "court_doc"
            ],
            "title": "Source"
          },
          "source_ref": {
            "type": "string",
            "title": "Source Ref"
          },
          "as_of_date": {
            "type": "string",
            "format": "date",
            "title": "As Of Date"
          },
          "notes": {
            "type": "string",
            "title": "Notes",
            "default": ""
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "borrower_name",
          "sector",
          "geography",
          "asset_type",
          "seniority",
          "notional_usd",
          "origination_date",
          "maturity_date",
          "tenor_years",
          "rating",
          "spread_bps",
          "reference_rate",
          "source",
          "source_ref",
          "as_of_date"
        ],
        "title": "ComparableDealIn",
        "description": "Request body for inserting a new comparable \u2014 ``comp_id`` is generated."
      },
      "ComparableMatch": {
        "properties": {
          "comp": {
            "$ref": "#/components/schemas/ComparableDeal"
          },
          "distance": {
            "type": "number",
            "minimum": 0.0,
            "title": "Distance",
            "description": "Weighted Euclidean distance (lower is closer)"
          },
          "match_reasons": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Match Reasons"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "comp",
          "distance"
        ],
        "title": "ComparableMatch"
      },
      "ComparableQuery": {
        "properties": {
          "asset_type": {
            "title": "Asset Type",
            "type": "string",
            "nullable": true
          },
          "sector": {
            "title": "Sector",
            "type": "string",
            "nullable": true
          },
          "geography": {
            "title": "Geography",
            "type": "string",
            "nullable": true
          },
          "seniority": {
            "title": "Seniority",
            "type": "string",
            "nullable": true
          },
          "notional_usd": {
            "title": "Notional Usd",
            "type": "number",
            "exclusiveMinimum": 0.0,
            "nullable": true
          },
          "tenor_years": {
            "title": "Tenor Years",
            "type": "number",
            "minimum": 0.0,
            "nullable": true
          },
          "rating": {
            "title": "Rating",
            "type": "string",
            "nullable": true
          },
          "leverage_x": {
            "title": "Leverage X",
            "type": "number",
            "maximum": 20.0,
            "minimum": 0.0,
            "nullable": true
          },
          "origination_date": {
            "title": "Origination Date",
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "k": {
            "type": "integer",
            "maximum": 100.0,
            "minimum": 1.0,
            "title": "K",
            "default": 10
          },
          "weights": {
            "title": "Weights",
            "description": "Per-feature weight override. Keys are any of {asset_type, seniority, rating, sector, notional, tenor, leverage, geography, vintage}. Missing keys fall back to defaults.",
            "additionalProperties": {
              "type": "number"
            },
            "type": "object",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ComparableQuery",
        "description": "Feature vector describing the subject deal for nearest-neighbour search."
      },
      "ComparableQueryResponse": {
        "properties": {
          "matches": {
            "items": {
              "$ref": "#/components/schemas/ComparableMatch"
            },
            "type": "array",
            "title": "Matches"
          },
          "cluster_stats": {
            "$ref": "#/components/schemas/ClusterStats"
          },
          "subject_leverage_x": {
            "title": "Subject Leverage X",
            "type": "number",
            "nullable": true
          },
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Generated At"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "matches",
          "cluster_stats"
        ],
        "title": "ComparableQueryResponse"
      },
      "CompleteNdaRequest": {
        "properties": {
          "registration_token": {
            "type": "string",
            "title": "Registration Token"
          },
          "envelope_id": {
            "type": "string",
            "maxLength": 64,
            "minLength": 1,
            "title": "Envelope Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "registration_token",
          "envelope_id"
        ],
        "title": "CompleteNdaRequest"
      },
      "CompleteNdaResponse": {
        "properties": {
          "ok": {
            "type": "boolean",
            "title": "Ok"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending_approval",
              "active"
            ],
            "title": "Status"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "ok",
          "status",
          "user_id",
          "message"
        ],
        "title": "CompleteNdaResponse"
      },
      "CompositeBucketOut": {
        "properties": {
          "level_bps": {
            "type": "integer",
            "title": "Level Bps"
          },
          "anchor_bps": {
            "type": "integer",
            "title": "Anchor Bps"
          },
          "n_obs": {
            "type": "integer",
            "title": "N Obs"
          },
          "factor": {
            "type": "string",
            "title": "Factor"
          },
          "basis": {
            "type": "string",
            "title": "Basis"
          },
          "as_of": {
            "type": "string",
            "title": "As Of"
          },
          "gap_vs_market_bps": {
            "title": "Gap Vs Market Bps",
            "type": "integer",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "level_bps",
          "anchor_bps",
          "n_obs",
          "factor",
          "basis",
          "as_of"
        ],
        "title": "CompositeBucketOut",
        "description": "One Verus spread-composite bucket (parallel-run vs the FRED-sourced\nmarket context ahead of the composite cutover)."
      },
      "CompositeConsoleResponse": {
        "properties": {
          "generated_at": {
            "type": "string",
            "title": "Generated At"
          },
          "composite": {
            "$ref": "#/components/schemas/ConsoleCompositeOut",
            "nullable": true
          },
          "cds_overlay": {
            "items": {
              "$ref": "#/components/schemas/CdsFreshnessOut"
            },
            "type": "array",
            "title": "Cds Overlay"
          },
          "overlay_status": {
            "type": "string",
            "title": "Overlay Status"
          },
          "vintages": {
            "items": {
              "$ref": "#/components/schemas/VintagePointerOut"
            },
            "type": "array",
            "title": "Vintages"
          },
          "scheduler_enabled": {
            "type": "boolean",
            "title": "Scheduler Enabled"
          },
          "scheduler_jobs": {
            "items": {
              "$ref": "#/components/schemas/SchedulerJobOut"
            },
            "type": "array",
            "title": "Scheduler Jobs"
          },
          "source_note": {
            "type": "string",
            "title": "Source Note",
            "default": "Verus spread composite \u2014 BDC-EDGAR median anchors moved daily by public DTCC SDR CDS prints. Composite levels only; not agency ratings."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "generated_at",
          "cds_overlay",
          "overlay_status",
          "vintages",
          "scheduler_enabled",
          "scheduler_jobs"
        ],
        "title": "CompositeConsoleResponse"
      },
      "CompositeContextOut": {
        "properties": {
          "vintage_id": {
            "type": "string",
            "title": "Vintage Id"
          },
          "anchor_as_of": {
            "type": "string",
            "title": "Anchor As Of"
          },
          "buckets": {
            "additionalProperties": {
              "$ref": "#/components/schemas/CompositeBucketOut"
            },
            "type": "object",
            "title": "Buckets"
          },
          "source_note": {
            "type": "string",
            "title": "Source Note",
            "default": "Verus spread composite \u2014 BDC-EDGAR median anchors moved daily by public DTCC SDR CDS prints. markst-derived; spread-band buckets, not agency ratings."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "vintage_id",
          "anchor_as_of",
          "buckets"
        ],
        "title": "CompositeContextOut"
      },
      "CompositeScoreOut": {
        "properties": {
          "composite": {
            "type": "number",
            "title": "Composite"
          },
          "quality_label": {
            "type": "string",
            "title": "Quality Label"
          },
          "total_weight": {
            "type": "number",
            "title": "Total Weight"
          },
          "factors": {
            "items": {
              "$ref": "#/components/schemas/FactorScoreOut"
            },
            "type": "array",
            "title": "Factors"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "composite",
          "quality_label",
          "total_weight",
          "factors"
        ],
        "title": "CompositeScoreOut"
      },
      "ConsentCompleteRequest": {
        "properties": {
          "token": {
            "type": "string",
            "title": "Token"
          },
          "allow": {
            "type": "boolean",
            "title": "Allow"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "token",
          "allow"
        ],
        "title": "ConsentCompleteRequest"
      },
      "ConsentCompleteResponse": {
        "properties": {
          "redirect_url": {
            "type": "string",
            "title": "Redirect Url"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "redirect_url"
        ],
        "title": "ConsentCompleteResponse"
      },
      "ConsentInfoResponse": {
        "properties": {
          "client_id": {
            "type": "string",
            "title": "Client Id"
          },
          "client_name": {
            "title": "Client Name",
            "type": "string",
            "nullable": true
          },
          "client_uri": {
            "title": "Client Uri",
            "type": "string",
            "nullable": true
          },
          "redirect_uri": {
            "type": "string",
            "title": "Redirect Uri"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Scopes"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "client_id",
          "client_name",
          "client_uri",
          "redirect_uri",
          "scopes"
        ],
        "title": "ConsentInfoResponse",
        "description": "Surface returned to the /oauth/consent SPA page so it can render\na sensible \"X wants to access Y\" prompt before the user clicks\nAllow / Deny.\n\nDeliberately omits sensitive bits \u2014 no code_challenge, no state.\nThe frontend never needs those; the server keeps them in the\npending row and pulls them at /oauth/consent/complete time."
      },
      "ConsiderationKey": {
        "type": "string",
        "enum": [
          "default_delinquency",
          "credit_losses_expected",
          "contractual_risk",
          "insolvency",
          "concession_granted"
        ],
        "title": "ConsiderationKey",
        "description": "The five industry guidance impairment considerations, in order."
      },
      "ConsiderationResponse": {
        "properties": {
          "key": {
            "$ref": "#/components/schemas/ConsiderationKey"
          },
          "verdict": {
            "$ref": "#/components/schemas/ConsiderationVerdict"
          },
          "observation": {
            "type": "string",
            "maxLength": 2000,
            "title": "Observation",
            "default": ""
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "key",
          "verdict"
        ],
        "title": "ConsiderationResponse"
      },
      "ConsiderationVerdict": {
        "type": "string",
        "enum": [
          "no_concern",
          "concern",
          "breach"
        ],
        "title": "ConsiderationVerdict"
      },
      "ConsoleBucketOut": {
        "properties": {
          "level_bps": {
            "type": "number",
            "title": "Level Bps"
          },
          "anchor_bps": {
            "type": "number",
            "title": "Anchor Bps"
          },
          "p25_bps": {
            "title": "P25 Bps",
            "type": "number",
            "nullable": true
          },
          "p75_bps": {
            "title": "P75 Bps",
            "type": "number",
            "nullable": true
          },
          "scaled_p25_bps": {
            "title": "Scaled P25 Bps",
            "type": "number",
            "nullable": true
          },
          "scaled_p75_bps": {
            "title": "Scaled P75 Bps",
            "type": "number",
            "nullable": true
          },
          "n_obs": {
            "type": "integer",
            "title": "N Obs"
          },
          "factor": {
            "type": "string",
            "title": "Factor"
          },
          "basis": {
            "type": "string",
            "title": "Basis"
          },
          "as_of": {
            "type": "string",
            "title": "As Of"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "level_bps",
          "anchor_bps",
          "n_obs",
          "factor",
          "basis",
          "as_of"
        ],
        "title": "ConsoleBucketOut",
        "description": "One live composite bucket, sourced from composite_source.current_composite()."
      },
      "ConsoleCompositeOut": {
        "properties": {
          "vintage_id": {
            "type": "string",
            "title": "Vintage Id"
          },
          "anchor_as_of": {
            "type": "string",
            "title": "Anchor As Of"
          },
          "as_of": {
            "type": "string",
            "title": "As Of"
          },
          "buckets": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ConsoleBucketOut"
            },
            "type": "object",
            "title": "Buckets"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "vintage_id",
          "anchor_as_of",
          "as_of",
          "buckets"
        ],
        "title": "ConsoleCompositeOut"
      },
      "CovenantAlert": {
        "properties": {
          "alert_id": {
            "type": "string",
            "title": "Alert Id"
          },
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "covenant_id": {
            "type": "string",
            "title": "Covenant Id"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "acknowledged_at": {
            "title": "Acknowledged At",
            "type": "string",
            "nullable": true
          },
          "acknowledged_by": {
            "title": "Acknowledged By",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "alert_id",
          "deal_id",
          "covenant_id",
          "status",
          "message",
          "created_at"
        ],
        "title": "CovenantAlert",
        "description": "Alert generated from covenant monitoring."
      },
      "CovenantResultOutModel": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "covenant_type": {
            "type": "string",
            "title": "Covenant Type"
          },
          "threshold": {
            "type": "number",
            "title": "Threshold"
          },
          "actual": {
            "title": "Actual",
            "type": "number",
            "nullable": true
          },
          "headroom": {
            "title": "Headroom",
            "type": "number",
            "nullable": true
          },
          "breached": {
            "type": "boolean",
            "title": "Breached"
          },
          "headroom_pct": {
            "title": "Headroom Pct",
            "type": "number",
            "nullable": true
          },
          "note": {
            "type": "string",
            "title": "Note"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name",
          "covenant_type",
          "threshold",
          "actual",
          "headroom",
          "breached",
          "headroom_pct",
          "note"
        ],
        "title": "CovenantResultOutModel"
      },
      "CovenantStatus": {
        "properties": {
          "covenant_id": {
            "type": "string",
            "title": "Covenant Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "type": {
            "type": "string",
            "title": "Type"
          },
          "threshold": {
            "title": "Threshold",
            "type": "number",
            "nullable": true
          },
          "threshold_direction": {
            "type": "string",
            "title": "Threshold Direction",
            "default": "max"
          },
          "actual_value": {
            "title": "Actual Value",
            "type": "number",
            "nullable": true
          },
          "headroom": {
            "title": "Headroom",
            "type": "number",
            "nullable": true
          },
          "headroom_pct": {
            "title": "Headroom Pct",
            "type": "number",
            "nullable": true
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "trend": {
            "title": "Trend",
            "type": "string",
            "nullable": true
          },
          "projected_breach_months": {
            "title": "Projected Breach Months",
            "type": "number",
            "nullable": true
          },
          "test_count": {
            "type": "integer",
            "title": "Test Count",
            "default": 0
          },
          "last_test_date": {
            "title": "Last Test Date",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "covenant_id",
          "name",
          "type",
          "status"
        ],
        "title": "CovenantStatus",
        "description": "Status of a single covenant with headroom analysis."
      },
      "CovenantStatusResponse": {
        "properties": {
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/CovenantResultOutModel"
            },
            "type": "array",
            "title": "Results"
          },
          "any_breach": {
            "type": "boolean",
            "title": "Any Breach"
          },
          "breach_count": {
            "type": "integer",
            "title": "Breach Count"
          },
          "compliant_count": {
            "type": "integer",
            "title": "Compliant Count"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_id",
          "results",
          "any_breach",
          "breach_count",
          "compliant_count"
        ],
        "title": "CovenantStatusResponse"
      },
      "CovenantTestRequest": {
        "properties": {
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "net_leverage": {
            "title": "Net Leverage",
            "type": "number",
            "nullable": true
          },
          "interest_coverage": {
            "title": "Interest Coverage",
            "type": "number",
            "nullable": true
          },
          "liquidity_months": {
            "title": "Liquidity Months",
            "type": "number",
            "nullable": true
          },
          "max_leverage_threshold": {
            "type": "number",
            "maximum": 20.0,
            "minimum": 1.0,
            "title": "Max Leverage Threshold",
            "default": 7.5
          },
          "min_coverage_threshold": {
            "type": "number",
            "maximum": 10.0,
            "minimum": 0.5,
            "title": "Min Coverage Threshold",
            "default": 1.5
          },
          "min_liquidity_threshold": {
            "type": "number",
            "maximum": 36.0,
            "minimum": 1.0,
            "title": "Min Liquidity Threshold",
            "default": 6.0
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_id"
        ],
        "title": "CovenantTestRequest"
      },
      "CovenantTypeEnum": {
        "type": "string",
        "enum": [
          "maintenance",
          "incurrence",
          "cov_lite"
        ],
        "title": "CovenantTypeEnum"
      },
      "CoveredTranche": {
        "type": "string",
        "enum": [
          "SENIOR_SECURED",
          "SENIOR_UNSECURED",
          "FIRST_LIEN",
          "UNITRANCHE"
        ],
        "title": "CoveredTranche",
        "description": "Capital-structure tranche a credit guarantee attaches to. Mirrors the\ncapital_structure free-text field but as a closed set, because a credit\ninsurer's exposure must be unambiguous about *which* slice it guarantees."
      },
      "CreateApiKeyRequest": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name"
        ],
        "title": "CreateApiKeyRequest"
      },
      "CreateApiKeyResponse": {
        "properties": {
          "key_id": {
            "type": "string",
            "title": "Key Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "key": {
            "type": "string",
            "title": "Key"
          },
          "key_prefix": {
            "type": "string",
            "title": "Key Prefix"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "key_id",
          "name",
          "key",
          "key_prefix",
          "role",
          "created_at"
        ],
        "title": "CreateApiKeyResponse",
        "description": "One-time response. The raw `key` is only ever returned here \u2014 the\nbackend stores only the SHA-256 hash, so a lost key cannot be recovered."
      },
      "CreateCovenantRequest": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "default": "financial"
          },
          "threshold": {
            "title": "Threshold",
            "type": "number",
            "nullable": true
          },
          "threshold_direction": {
            "type": "string",
            "title": "Threshold Direction",
            "default": "max"
          },
          "frequency": {
            "type": "string",
            "title": "Frequency",
            "default": "quarterly"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name"
        ],
        "title": "CreateCovenantRequest"
      },
      "CreateExternalMarkRequest": {
        "properties": {
          "provider": {
            "type": "string",
            "maxLength": 120,
            "minLength": 1,
            "title": "Provider",
            "description": "Who produced the mark, e.g. 'Houlihan Lokey' or 'Fund CFO'."
          },
          "kind": {
            "type": "string",
            "enum": [
              "valuation_agent",
              "manager",
              "administrator",
              "auditor",
              "other"
            ],
            "title": "Kind"
          },
          "price": {
            "type": "number",
            "maximum": 400.0,
            "exclusiveMinimum": 0.0,
            "title": "Price",
            "description": "Price per 100."
          },
          "price_low": {
            "title": "Price Low",
            "description": "Low end of the provider's range, per 100.",
            "type": "number",
            "maximum": 400.0,
            "exclusiveMinimum": 0.0,
            "nullable": true
          },
          "price_high": {
            "title": "Price High",
            "description": "High end of the provider's range, per 100.",
            "type": "number",
            "maximum": 400.0,
            "exclusiveMinimum": 0.0,
            "nullable": true
          },
          "as_of": {
            "type": "string",
            "title": "As Of",
            "description": "Date the mark is struck for (ISO YYYY-MM-DD)."
          },
          "price_basis": {
            "type": "string",
            "enum": [
              "outstanding",
              "original"
            ],
            "title": "Price Basis",
            "default": "outstanding"
          },
          "reference": {
            "title": "Reference",
            "description": "Report or document reference.",
            "type": "string",
            "maxLength": 300,
            "nullable": true
          },
          "note": {
            "title": "Note",
            "type": "string",
            "maxLength": 2000,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "provider",
          "kind",
          "price",
          "as_of"
        ],
        "title": "CreateExternalMarkRequest"
      },
      "CreateFundRequest": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "currency": {
            "type": "string",
            "title": "Currency",
            "default": "USD"
          },
          "strategy": {
            "title": "Strategy",
            "type": "string",
            "nullable": true
          },
          "vintage_year": {
            "title": "Vintage Year",
            "type": "integer",
            "nullable": true
          },
          "target_size": {
            "title": "Target Size",
            "type": "number",
            "nullable": true
          },
          "legal_entity": {
            "title": "Legal Entity",
            "type": "string",
            "nullable": true
          },
          "notes": {
            "title": "Notes",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name"
        ],
        "title": "CreateFundRequest"
      },
      "CreateKeyRequest": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "pattern": "^[\\w\\s\\-_.]+$",
            "title": "Name"
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "analyst",
              "viewer"
            ],
            "title": "Role",
            "default": "viewer"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name"
        ],
        "title": "CreateKeyRequest"
      },
      "CreateKeyResponse": {
        "properties": {
          "key_id": {
            "type": "string",
            "title": "Key Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "key": {
            "type": "string",
            "title": "Key"
          },
          "key_prefix": {
            "type": "string",
            "title": "Key Prefix"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "role": {
            "type": "string",
            "title": "Role"
          }
        },
        "type": "object",
        "required": [
          "key_id",
          "name",
          "key",
          "key_prefix",
          "created_at",
          "role"
        ],
        "title": "CreateKeyResponse"
      },
      "CreateLPAccountRequest": {
        "properties": {
          "lp_name": {
            "type": "string",
            "title": "Lp Name"
          },
          "commitment": {
            "type": "number",
            "minimum": 0.0,
            "title": "Commitment",
            "default": 0.0
          },
          "called": {
            "type": "number",
            "minimum": 0.0,
            "title": "Called",
            "default": 0.0
          },
          "distributed": {
            "type": "number",
            "minimum": 0.0,
            "title": "Distributed",
            "default": 0.0
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "lp_name"
        ],
        "title": "CreateLPAccountRequest"
      },
      "CreateMandateLimitRequest": {
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/MandateKind"
          },
          "target": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "title": "Target"
          },
          "max_pct_of_aum": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Max Pct Of Aum"
          },
          "max_notional_usd": {
            "title": "Max Notional Usd",
            "type": "number",
            "minimum": 0.0,
            "nullable": true
          },
          "floor_pct_of_aum": {
            "title": "Floor Pct Of Aum",
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "nullable": true
          },
          "notes": {
            "type": "string",
            "title": "Notes",
            "default": ""
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "kind",
          "target",
          "max_pct_of_aum"
        ],
        "title": "CreateMandateLimitRequest"
      },
      "CreateNoteRequest": {
        "properties": {
          "title": {
            "title": "Title",
            "type": "string",
            "maxLength": 500,
            "nullable": true
          },
          "markdown": {
            "type": "string",
            "maxLength": 1000000,
            "title": "Markdown"
          },
          "source_deal_id": {
            "title": "Source Deal Id",
            "type": "string",
            "nullable": true
          },
          "source_run_id": {
            "title": "Source Run Id",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "markdown"
        ],
        "title": "CreateNoteRequest"
      },
      "CreatePeriodRequest": {
        "properties": {
          "fund_id": {
            "type": "string",
            "title": "Fund Id"
          },
          "kind": {
            "$ref": "#/components/schemas/PeriodKind"
          },
          "period_start": {
            "type": "string",
            "format": "date",
            "title": "Period Start"
          },
          "period_end": {
            "type": "string",
            "format": "date",
            "title": "Period End"
          },
          "notes": {
            "type": "string",
            "maxLength": 4000,
            "title": "Notes",
            "default": ""
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "fund_id",
          "kind",
          "period_start",
          "period_end"
        ],
        "title": "CreatePeriodRequest"
      },
      "CreateScenarioRequest": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "rate_shock_bps": {
            "type": "integer",
            "title": "Rate Shock Bps",
            "default": 0
          },
          "spread_shock_bps": {
            "type": "integer",
            "title": "Spread Shock Bps",
            "default": 0
          },
          "hazard_multiplier": {
            "type": "number",
            "title": "Hazard Multiplier",
            "default": 1.0
          },
          "recovery_shift": {
            "type": "number",
            "title": "Recovery Shift",
            "default": 0.0
          },
          "prepayment_cpr_override": {
            "title": "Prepayment Cpr Override",
            "type": "number",
            "nullable": true
          },
          "sector_adjustments": {
            "additionalProperties": {
              "$ref": "#/components/schemas/SectorAdjustment"
            },
            "type": "object",
            "title": "Sector Adjustments",
            "default": {}
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name",
          "description"
        ],
        "title": "CreateScenarioRequest"
      },
      "CreateUserKeyRequest": {
        "properties": {
          "name": {
            "title": "Name",
            "type": "string",
            "nullable": true
          },
          "role": {
            "title": "Role",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "CreateUserKeyRequest"
      },
      "CreateUserRequest": {
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "role": {
            "type": "string",
            "title": "Role",
            "default": "analyst"
          },
          "plan_id": {
            "title": "Plan Id",
            "default": "plan_starter",
            "type": "string",
            "nullable": true
          },
          "password": {
            "title": "Password",
            "type": "string",
            "nullable": true
          },
          "generate_password": {
            "type": "boolean",
            "title": "Generate Password",
            "default": false
          },
          "require_password_change": {
            "type": "boolean",
            "title": "Require Password Change",
            "default": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "email",
          "name"
        ],
        "title": "CreateUserRequest"
      },
      "CreateUserResponse": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "plan_id": {
            "title": "Plan Id",
            "type": "string",
            "nullable": true
          },
          "plan_name": {
            "title": "Plan Name",
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "last_login_at": {
            "title": "Last Login At",
            "type": "string",
            "nullable": true
          },
          "api_calls_this_month": {
            "type": "integer",
            "title": "Api Calls This Month",
            "default": 0
          },
          "valuations_this_month": {
            "title": "Valuations This Month",
            "type": "integer",
            "nullable": true
          },
          "valuation_limit": {
            "title": "Valuation Limit",
            "type": "integer",
            "nullable": true
          },
          "valuation_reset_date": {
            "title": "Valuation Reset Date",
            "type": "string",
            "nullable": true
          },
          "temp_password": {
            "title": "Temp Password",
            "type": "string",
            "nullable": true
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "email",
          "name",
          "role",
          "status",
          "created_at"
        ],
        "title": "CreateUserResponse",
        "description": "UserOut plus the one-time temp password when one was generated."
      },
      "CreateValuationRunRequest": {
        "properties": {
          "valuation_date": {
            "type": "string",
            "format": "date",
            "title": "Valuation Date"
          },
          "deal_version_id": {
            "type": "string",
            "title": "Deal Version Id"
          },
          "assumption_set_version_id": {
            "type": "string",
            "title": "Assumption Set Version Id"
          },
          "allow_past_period_override": {
            "type": "boolean",
            "title": "Allow Past Period Override",
            "default": false
          },
          "market_data_as_of_date": {
            "title": "Market Data As Of Date",
            "type": "string",
            "format": "date",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "valuation_date",
          "deal_version_id",
          "assumption_set_version_id"
        ],
        "title": "CreateValuationRunRequest"
      },
      "CreditAssumptions": {
        "properties": {
          "model": {
            "$ref": "#/components/schemas/CreditModel",
            "default": "HAZARD"
          },
          "hazard_term": {
            "items": {
              "$ref": "#/components/schemas/HazardSegment"
            },
            "type": "array",
            "title": "Hazard Term"
          },
          "recovery_rate": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Recovery Rate"
          },
          "recovery_lag_months": {
            "type": "integer",
            "maximum": 60.0,
            "minimum": 0.0,
            "title": "Recovery Lag Months"
          },
          "default_timing": {
            "$ref": "#/components/schemas/DefaultTiming",
            "default": "MID_PERIOD"
          },
          "prepayment_cpr": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Prepayment Cpr",
            "default": 0.0
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "hazard_term",
          "recovery_rate",
          "recovery_lag_months"
        ],
        "title": "CreditAssumptions"
      },
      "CreditBasisState": {
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "mark_to_model",
              "manual_override",
              "unmarked"
            ],
            "title": "Mode",
            "description": "How the credit spread/mark was determined."
          },
          "manual_overrides": {
            "description": "Required when mode='manual_override'; ignored otherwise.",
            "$ref": "#/components/schemas/ManualOverrides",
            "nullable": true
          },
          "company_factor": {
            "description": "Composite-derived company-factor delta explicitly applied from a multi-factor run. Only priced under mode='mark_to_model' (a manual_override spread is already the full hand-set mark).",
            "$ref": "#/components/schemas/CompanyFactorDelta",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "mode"
        ],
        "title": "CreditBasisState",
        "description": "Per-deal credit basis state carried on the Deal blob (Phase 31).\n\nmode:\n  mark_to_model  \u2014 spread derived from credit analysis \u00d7 rating curve\n  manual_override \u2014 explicit hand-set (spread + recovery + hazard)\n  unmarked        \u2014 no credit analysis; no model mark possible"
      },
      "CreditCurveResult": {
        "properties": {
          "implied_rating": {
            "type": "string",
            "title": "Implied Rating"
          },
          "rating_description": {
            "type": "string",
            "title": "Rating Description"
          },
          "capital_structure": {
            "type": "string",
            "title": "Capital Structure"
          },
          "net_debt_to_ebitda": {
            "title": "Net Debt To Ebitda",
            "type": "number",
            "nullable": true
          },
          "base_spread_mid_bps": {
            "type": "integer",
            "title": "Base Spread Mid Bps"
          },
          "sector_adj_bps": {
            "type": "integer",
            "title": "Sector Adj Bps"
          },
          "country_adj_bps": {
            "type": "integer",
            "title": "Country Adj Bps"
          },
          "currency": {
            "type": "string",
            "title": "Currency",
            "default": "USD"
          },
          "currency_adj_bps": {
            "type": "integer",
            "title": "Currency Adj Bps",
            "default": 0
          },
          "market_spread_low_bps": {
            "type": "integer",
            "title": "Market Spread Low Bps"
          },
          "market_spread_mid_bps": {
            "type": "integer",
            "title": "Market Spread Mid Bps"
          },
          "market_spread_high_bps": {
            "type": "integer",
            "title": "Market Spread High Bps"
          },
          "table_version": {
            "type": "string",
            "title": "Table Version",
            "default": "leveraged_loan_q1_2026"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "implied_rating",
          "rating_description",
          "capital_structure",
          "base_spread_mid_bps",
          "sector_adj_bps",
          "country_adj_bps",
          "market_spread_low_bps",
          "market_spread_mid_bps",
          "market_spread_high_bps"
        ],
        "title": "CreditCurveResult",
        "description": "Result of the leveraged loan credit curve lookup."
      },
      "CreditCurveRow": {
        "properties": {
          "rating": {
            "type": "string",
            "title": "Rating"
          },
          "leverage_range": {
            "type": "string",
            "title": "Leverage Range"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "spread_low_bps": {
            "type": "integer",
            "title": "Spread Low Bps"
          },
          "spread_mid_bps": {
            "type": "integer",
            "title": "Spread Mid Bps"
          },
          "spread_high_bps": {
            "type": "integer",
            "title": "Spread High Bps"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "rating",
          "leverage_range",
          "description",
          "spread_low_bps",
          "spread_mid_bps",
          "spread_high_bps"
        ],
        "title": "CreditCurveRow",
        "description": "One row in the full credit curve table."
      },
      "CreditGuarantee": {
        "properties": {
          "insurer_name": {
            "type": "string",
            "title": "Insurer Name"
          },
          "covered_tranche": {
            "$ref": "#/components/schemas/CoveredTranche",
            "default": "SENIOR_SECURED"
          },
          "guaranteed_pct": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Guaranteed Pct",
            "description": "Fraction of the covered tranche notional that is guaranteed (1.0 = full).",
            "default": 1.0
          },
          "attachment_pct": {
            "title": "Attachment Pct",
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "nullable": true
          },
          "detachment_pct": {
            "title": "Detachment Pct",
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "nullable": true
          },
          "premium_bps": {
            "title": "Premium Bps",
            "type": "integer",
            "maximum": 5000.0,
            "minimum": 0.0,
            "nullable": true
          },
          "insurer_rating": {
            "title": "Insurer Rating",
            "type": "string",
            "nullable": true
          },
          "note": {
            "title": "Note",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "insurer_name"
        ],
        "title": "CreditGuarantee",
        "description": "A credit insurer's guarantee over a tranche of this facility. When set,\nthe deal carries an external party (the insurer) who absorbs loss on the\ncovered slice. Insurers underwrite *default risk* \u2014 they care about PD and\nexpected loss on the guaranteed piece, not the illiquidity premium a\nholding fund demands. Optional everywhere; absent on un-insured deals."
      },
      "CreditModel": {
        "type": "string",
        "enum": [
          "HAZARD"
        ],
        "title": "CreditModel"
      },
      "CrossMarkRow": {
        "properties": {
          "company_name": {
            "type": "string",
            "title": "Company Name"
          },
          "period_of_report": {
            "type": "string",
            "title": "Period Of Report"
          },
          "n_marks": {
            "type": "integer",
            "title": "N Marks"
          },
          "marks": {
            "items": {
              "$ref": "#/components/schemas/MarkEntry"
            },
            "type": "array",
            "title": "Marks"
          },
          "min_mark_pct": {
            "title": "Min Mark Pct",
            "type": "number",
            "nullable": true
          },
          "max_mark_pct": {
            "title": "Max Mark Pct",
            "type": "number",
            "nullable": true
          },
          "mark_range_pct": {
            "title": "Mark Range Pct",
            "type": "number",
            "nullable": true
          },
          "min_spread_bps": {
            "title": "Min Spread Bps",
            "type": "number",
            "nullable": true
          },
          "max_spread_bps": {
            "title": "Max Spread Bps",
            "type": "number",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "company_name",
          "period_of_report",
          "n_marks",
          "marks",
          "min_mark_pct",
          "max_mark_pct",
          "mark_range_pct",
          "min_spread_bps",
          "max_spread_bps"
        ],
        "title": "CrossMarkRow"
      },
      "CurveInterp": {
        "type": "string",
        "enum": [
          "LINEAR_ZERO"
        ],
        "title": "CurveInterp"
      },
      "CurveOverlayOut": {
        "properties": {
          "bucket": {
            "type": "string",
            "title": "Bucket"
          },
          "delta_bps": {
            "type": "number",
            "title": "Delta Bps"
          },
          "reason_code": {
            "type": "string",
            "title": "Reason Code"
          },
          "reason": {
            "type": "string",
            "title": "Reason"
          },
          "expires_on": {
            "type": "string",
            "title": "Expires On"
          },
          "proposed_by": {
            "type": "string",
            "title": "Proposed By"
          },
          "proposed_at": {
            "title": "Proposed At",
            "type": "string",
            "nullable": true
          },
          "approved_by": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Approved By",
            "default": []
          },
          "approved_at": {
            "title": "Approved At",
            "type": "string",
            "nullable": true
          },
          "state": {
            "type": "string",
            "title": "State"
          },
          "parent_vintage_id": {
            "title": "Parent Vintage Id",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "bucket",
          "delta_bps",
          "reason_code",
          "reason",
          "expires_on",
          "proposed_by",
          "state"
        ],
        "title": "CurveOverlayOut"
      },
      "CurvePillar": {
        "properties": {
          "tenor": {
            "type": "string",
            "title": "Tenor"
          },
          "rate": {
            "type": "number",
            "maximum": 0.5,
            "minimum": -0.05,
            "title": "Rate"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "tenor",
          "rate"
        ],
        "title": "CurvePillar"
      },
      "CurveSpec": {
        "properties": {
          "curve_id": {
            "type": "string",
            "title": "Curve Id"
          },
          "as_of_date": {
            "type": "string",
            "format": "date",
            "title": "As Of Date"
          },
          "pillars": {
            "items": {
              "$ref": "#/components/schemas/CurvePillar"
            },
            "type": "array",
            "title": "Pillars"
          },
          "interp": {
            "$ref": "#/components/schemas/CurveInterp",
            "default": "LINEAR_ZERO"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "curve_id",
          "as_of_date",
          "pillars"
        ],
        "title": "CurveSpec"
      },
      "CustomCalibrationParams": {
        "properties": {
          "direct_lending": {
            "$ref": "#/components/schemas/StrategyCalibrationEntry"
          },
          "mezzanine": {
            "$ref": "#/components/schemas/StrategyCalibrationEntry"
          },
          "cre_senior": {
            "$ref": "#/components/schemas/StrategyCalibrationEntry"
          },
          "cre_mezzanine": {
            "$ref": "#/components/schemas/StrategyCalibrationEntry"
          },
          "cre_preferred_equity": {
            "$ref": "#/components/schemas/StrategyCalibrationEntry"
          },
          "illiquid_public": {
            "description": "Optional \u03c3/\u03c0 bands for illiquid public bonds; engine defaults when omitted",
            "$ref": "#/components/schemas/StrategyCalibrationEntry",
            "nullable": true
          },
          "secured_borrowing": {
            "description": "Optional \u03c3/\u03c0 bands for secured borrowing; engine defaults when omitted",
            "$ref": "#/components/schemas/StrategyCalibrationEntry",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "direct_lending",
          "mezzanine",
          "cre_senior",
          "cre_mezzanine",
          "cre_preferred_equity"
        ],
        "title": "CustomCalibrationParams",
        "description": "Full calibration parameter block required when market='CUSTOM'.\n\nThe five core strategy/tranche entries are required. ``illiquid_public``\nand ``secured_borrowing`` are optional: when omitted those strategies\nprice off their engine defaults, exactly as before they had a key."
      },
      "CustomPortfolioRWARequest": {
        "properties": {
          "positions": {
            "items": {
              "$ref": "#/components/schemas/SingleRWARequest"
            },
            "type": "array",
            "minItems": 1,
            "title": "Positions"
          },
          "default_approach": {
            "$ref": "#/components/schemas/BankingApproach",
            "default": "standardized"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "positions"
        ],
        "title": "CustomPortfolioRWARequest"
      },
      "CycleConfig": {
        "properties": {
          "early_dl_bps": {
            "type": "integer",
            "maximum": 0.0,
            "minimum": -300.0,
            "title": "Early Dl Bps",
            "description": "Early cycle DL adjustment (bps)",
            "default": -25
          },
          "early_mezz_bps": {
            "type": "integer",
            "maximum": 0.0,
            "minimum": -300.0,
            "title": "Early Mezz Bps",
            "description": "Early cycle Mezz adjustment (bps)",
            "default": -40
          },
          "early_cre_bps": {
            "type": "integer",
            "maximum": 0.0,
            "minimum": -300.0,
            "title": "Early Cre Bps",
            "description": "Early cycle CRE adjustment (bps)",
            "default": -25
          },
          "mid_dl_bps": {
            "type": "integer",
            "maximum": 50.0,
            "minimum": -50.0,
            "title": "Mid Dl Bps",
            "description": "Mid cycle DL adjustment (bps)",
            "default": 0
          },
          "mid_mezz_bps": {
            "type": "integer",
            "maximum": 50.0,
            "minimum": -50.0,
            "title": "Mid Mezz Bps",
            "description": "Mid cycle Mezz adjustment (bps)",
            "default": 0
          },
          "mid_cre_bps": {
            "type": "integer",
            "maximum": 50.0,
            "minimum": -50.0,
            "title": "Mid Cre Bps",
            "description": "Mid cycle CRE adjustment (bps)",
            "default": 0
          },
          "late_dl_bps": {
            "type": "integer",
            "maximum": 400.0,
            "minimum": 0.0,
            "title": "Late Dl Bps",
            "description": "Late cycle DL adjustment (bps)",
            "default": 50
          },
          "late_mezz_bps": {
            "type": "integer",
            "maximum": 500.0,
            "minimum": 0.0,
            "title": "Late Mezz Bps",
            "description": "Late cycle Mezz adjustment (bps)",
            "default": 80
          },
          "late_cre_bps": {
            "type": "integer",
            "maximum": 400.0,
            "minimum": 0.0,
            "title": "Late Cre Bps",
            "description": "Late cycle CRE adjustment (bps)",
            "default": 50
          },
          "distressed_dl_bps": {
            "type": "integer",
            "maximum": 800.0,
            "minimum": 0.0,
            "title": "Distressed Dl Bps",
            "description": "Distressed cycle DL adjustment (bps)",
            "default": 150
          },
          "distressed_mezz_bps": {
            "type": "integer",
            "maximum": 1000.0,
            "minimum": 0.0,
            "title": "Distressed Mezz Bps",
            "description": "Distressed cycle Mezz adjustment (bps)",
            "default": 240
          },
          "distressed_cre_bps": {
            "type": "integer",
            "maximum": 800.0,
            "minimum": 0.0,
            "title": "Distressed Cre Bps",
            "description": "Distressed cycle CRE adjustment (bps)",
            "default": 150
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "CycleConfig",
        "description": "Credit cycle stage spread adjustments (bps) applied on top of the base spread waterfall."
      },
      "CycleOverrides": {
        "properties": {
          "early_dl_bps": {
            "title": "Early Dl Bps",
            "type": "integer",
            "nullable": true
          },
          "early_mezz_bps": {
            "title": "Early Mezz Bps",
            "type": "integer",
            "nullable": true
          },
          "early_cre_bps": {
            "title": "Early Cre Bps",
            "type": "integer",
            "nullable": true
          },
          "mid_dl_bps": {
            "title": "Mid Dl Bps",
            "type": "integer",
            "nullable": true
          },
          "mid_mezz_bps": {
            "title": "Mid Mezz Bps",
            "type": "integer",
            "nullable": true
          },
          "mid_cre_bps": {
            "title": "Mid Cre Bps",
            "type": "integer",
            "nullable": true
          },
          "late_dl_bps": {
            "title": "Late Dl Bps",
            "type": "integer",
            "nullable": true
          },
          "late_mezz_bps": {
            "title": "Late Mezz Bps",
            "type": "integer",
            "nullable": true
          },
          "late_cre_bps": {
            "title": "Late Cre Bps",
            "type": "integer",
            "nullable": true
          },
          "distressed_dl_bps": {
            "title": "Distressed Dl Bps",
            "type": "integer",
            "nullable": true
          },
          "distressed_mezz_bps": {
            "title": "Distressed Mezz Bps",
            "type": "integer",
            "nullable": true
          },
          "distressed_cre_bps": {
            "title": "Distressed Cre Bps",
            "type": "integer",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "CycleOverrides"
      },
      "CycleStageRequest": {
        "properties": {
          "observations": {
            "items": {
              "$ref": "#/components/schemas/SpreadObservationIn"
            },
            "type": "array",
            "minItems": 1,
            "title": "Observations",
            "description": "Time series of spread index observations, any order."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "observations"
        ],
        "title": "CycleStageRequest",
        "description": "Request body for POST /value/multi-factor/cycle-stage."
      },
      "CycleStageResponse": {
        "properties": {
          "stage": {
            "type": "string",
            "title": "Stage"
          },
          "confidence": {
            "type": "number",
            "title": "Confidence"
          },
          "signal_breakdown": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Signal Breakdown"
          },
          "last_updated": {
            "type": "string",
            "format": "date-time",
            "title": "Last Updated"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "stage",
          "confidence",
          "signal_breakdown",
          "last_updated"
        ],
        "title": "CycleStageResponse",
        "description": "Response from POST /value/multi-factor/cycle-stage."
      },
      "DayCount": {
        "type": "string",
        "enum": [
          "ACT/360",
          "ACT/365",
          "ACT/ACT",
          "30/360"
        ],
        "title": "DayCount"
      },
      "Deal": {
        "properties": {
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "borrower_name": {
            "type": "string",
            "title": "Borrower Name"
          },
          "project_name": {
            "title": "Project Name",
            "type": "string",
            "nullable": true
          },
          "currency": {
            "type": "string",
            "title": "Currency"
          },
          "jurisdiction": {
            "type": "string",
            "title": "Jurisdiction"
          },
          "sector": {
            "title": "Sector",
            "type": "string",
            "nullable": true
          },
          "capital_structure": {
            "title": "Capital Structure",
            "type": "string",
            "nullable": true
          },
          "deal_type": {
            "$ref": "#/components/schemas/DealType",
            "default": "PRIVATE"
          },
          "ifrs13_level": {
            "title": "Ifrs13 Level",
            "type": "string",
            "nullable": true
          },
          "ticker": {
            "title": "Ticker",
            "type": "string",
            "nullable": true
          },
          "isin": {
            "title": "Isin",
            "type": "string",
            "nullable": true
          },
          "origination_date": {
            "type": "string",
            "format": "date",
            "title": "Origination Date"
          },
          "maturity_date": {
            "type": "string",
            "format": "date",
            "title": "Maturity Date"
          },
          "day_count": {
            "$ref": "#/components/schemas/DayCount"
          },
          "business_day_convention": {
            "$ref": "#/components/schemas/BusinessDayConvention"
          },
          "payment_calendar": {
            "type": "string",
            "title": "Payment Calendar"
          },
          "status": {
            "$ref": "#/components/schemas/DealStatus",
            "default": "ACTIVE"
          },
          "facility": {
            "$ref": "#/components/schemas/Facility"
          },
          "observations": {
            "$ref": "#/components/schemas/Observations"
          },
          "metadata": {
            "$ref": "#/components/schemas/DealMetadata"
          },
          "credit_guarantee": {
            "$ref": "#/components/schemas/CreditGuarantee",
            "nullable": true
          },
          "issuance_price_pct": {
            "title": "Issuance Price Pct",
            "description": "Transaction price at origination (per 100). Used by the calibration engine to solve the implied spread.",
            "type": "number",
            "maximum": 200.0,
            "minimum": 0.0,
            "nullable": true
          },
          "provenance": {
            "title": "Provenance",
            "description": "JSON Pointer \u2192 ProvenanceRecord map (RFC 6901, e.g. '/facility/notional'). Optional. NOT stored in _DEAL_STORAGE_FIELDS \u2014 rides the JSON blob via deal_from_blob.",
            "additionalProperties": {
              "$ref": "#/components/schemas/ProvenanceRecord"
            },
            "type": "object",
            "nullable": true
          },
          "credit_basis": {
            "description": "Per-deal credit basis state (Phase 31). mark_to_model | manual_override | unmarked. Rides the JSON blob; not a SQL column.",
            "$ref": "#/components/schemas/CreditBasisState",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_id",
          "borrower_name",
          "currency",
          "jurisdiction",
          "origination_date",
          "maturity_date",
          "day_count",
          "business_day_convention",
          "payment_calendar",
          "facility"
        ],
        "title": "Deal"
      },
      "DealCovenantSummary": {
        "properties": {
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "overall_status": {
            "type": "string",
            "title": "Overall Status"
          },
          "total_covenants": {
            "type": "integer",
            "title": "Total Covenants"
          },
          "green_count": {
            "type": "integer",
            "title": "Green Count",
            "default": 0
          },
          "amber_count": {
            "type": "integer",
            "title": "Amber Count",
            "default": 0
          },
          "red_count": {
            "type": "integer",
            "title": "Red Count",
            "default": 0
          },
          "pending_count": {
            "type": "integer",
            "title": "Pending Count",
            "default": 0
          },
          "covenants": {
            "items": {
              "$ref": "#/components/schemas/CovenantStatus"
            },
            "type": "array",
            "title": "Covenants"
          },
          "alerts": {
            "items": {
              "$ref": "#/components/schemas/CovenantAlert"
            },
            "type": "array",
            "title": "Alerts",
            "default": []
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_id",
          "overall_status",
          "total_covenants",
          "covenants"
        ],
        "title": "DealCovenantSummary",
        "description": "Aggregate covenant status for a single deal."
      },
      "DealMetadata": {
        "properties": {
          "created_by": {
            "type": "string",
            "title": "Created By",
            "default": "user"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "source_system": {
            "type": "string",
            "title": "Source System",
            "default": "manual"
          },
          "source_upload_ids": {
            "title": "Source Upload Ids",
            "items": {
              "type": "string"
            },
            "type": "array",
            "nullable": true
          },
          "asset_type": {
            "title": "Asset Type",
            "type": "string",
            "nullable": true
          },
          "asset_type_confidence": {
            "title": "Asset Type Confidence",
            "type": "number",
            "nullable": true
          },
          "asset_type_reason": {
            "title": "Asset Type Reason",
            "type": "string",
            "nullable": true
          },
          "asset_type_source": {
            "title": "Asset Type Source",
            "type": "string",
            "nullable": true
          },
          "strategy_overrides": {
            "title": "Strategy Overrides",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          },
          "data_origin": {
            "title": "Data Origin",
            "type": "string",
            "enum": [
              "demo",
              "live"
            ],
            "nullable": true
          },
          "promoted_from_deal_id": {
            "title": "Promoted From Deal Id",
            "type": "string",
            "nullable": true
          },
          "promoted_from_tranche": {
            "title": "Promoted From Tranche",
            "type": "string",
            "nullable": true
          },
          "cloned_from_deal_id": {
            "title": "Cloned From Deal Id",
            "type": "string",
            "nullable": true
          },
          "cloned_from_at": {
            "title": "Cloned From At",
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "DealMetadata"
      },
      "DealOverrideOut": {
        "properties": {
          "assumption_set_id": {
            "type": "string",
            "title": "Assumption Set Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "company_spread_delta_bps": {
            "type": "number",
            "title": "Company Spread Delta Bps"
          },
          "company_spread_source": {
            "title": "Company Spread Source",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "assumption_set_id",
          "name",
          "company_spread_delta_bps"
        ],
        "title": "DealOverrideOut",
        "description": "One assumption set carrying a non-zero company_spread_delta_bps \u2014\nthe per-deal override path (already content-versioned + CalibrationTrace\naudited; this endpoint only SURFACES it)."
      },
      "DealOverridesResponse": {
        "properties": {
          "overrides": {
            "items": {
              "$ref": "#/components/schemas/DealOverrideOut"
            },
            "type": "array",
            "title": "Overrides"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "overrides"
        ],
        "title": "DealOverridesResponse"
      },
      "DealRWAOut": {
        "properties": {
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "borrower_name": {
            "type": "string",
            "title": "Borrower Name"
          },
          "exposure_class": {
            "type": "string",
            "title": "Exposure Class"
          },
          "approach": {
            "type": "string",
            "title": "Approach"
          },
          "ead": {
            "type": "number",
            "title": "Ead"
          },
          "risk_weight_pct": {
            "type": "number",
            "title": "Risk Weight Pct"
          },
          "rwa": {
            "type": "number",
            "title": "Rwa"
          },
          "capital_requirement": {
            "type": "number",
            "title": "Capital Requirement"
          },
          "cet1_requirement": {
            "type": "number",
            "title": "Cet1 Requirement"
          },
          "pd_applied": {
            "title": "Pd Applied",
            "type": "number",
            "nullable": true
          },
          "lgd_applied": {
            "title": "Lgd Applied",
            "type": "number",
            "nullable": true
          },
          "maturity_applied": {
            "title": "Maturity Applied",
            "type": "number",
            "nullable": true
          },
          "irb_correlation": {
            "title": "Irb Correlation",
            "type": "number",
            "nullable": true
          },
          "rating_used": {
            "title": "Rating Used",
            "type": "string",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "title": "Notes",
            "default": ""
          },
          "currency": {
            "type": "string",
            "title": "Currency",
            "description": "Reporting currency of the EAD/RWA/capital figures.",
            "default": "EUR"
          }
        },
        "type": "object",
        "required": [
          "deal_id",
          "borrower_name",
          "exposure_class",
          "approach",
          "ead",
          "risk_weight_pct",
          "rwa",
          "capital_requirement",
          "cet1_requirement"
        ],
        "title": "DealRWAOut"
      },
      "DealReviewRequest": {
        "properties": {
          "note": {
            "title": "Note",
            "type": "string",
            "maxLength": 2000,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "DealReviewRequest"
      },
      "DealStatus": {
        "type": "string",
        "enum": [
          "ACTIVE",
          "REPAID",
          "DEFAULTED"
        ],
        "title": "DealStatus"
      },
      "DealType": {
        "type": "string",
        "enum": [
          "PRIVATE",
          "SYNDICATED"
        ],
        "title": "DealType",
        "description": "Market origination type. Distinguishes bilateral/club private credit from\nbroadly syndicated / publicly marketed deals. Used by the asset-type\nclassifier (to bypass size heuristics) and the liquidity scorer (as a\ndirect signal for expected bid-ask and exit horizon).\n\nPRIVATE \u2014 bilateral or club direct lending, mezz, unitranche, CRE debt.\n             No active secondary market.\nSYNDICATED \u2014 broadly syndicated loans (BSL/TLB with book-running arranger)\n             and publicly marketed bonds. Observable secondary market."
      },
      "DefaultTiming": {
        "type": "string",
        "enum": [
          "MID_PERIOD",
          "END_PERIOD"
        ],
        "title": "DefaultTiming"
      },
      "DemoLoginRequest": {
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          },
          "password": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "title": "Password"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "email",
          "password"
        ],
        "title": "DemoLoginRequest"
      },
      "DemoLoginResponse": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "role": {
            "type": "string",
            "title": "Role"
          }
        },
        "type": "object",
        "required": [
          "key",
          "user_id",
          "email",
          "name",
          "role"
        ],
        "title": "DemoLoginResponse"
      },
      "DirectLendingOverrides": {
        "properties": {
          "credit_spread_tight_bps": {
            "title": "Credit Spread Tight Bps",
            "type": "integer",
            "nullable": true
          },
          "credit_spread_wide_bps": {
            "title": "Credit Spread Wide Bps",
            "type": "integer",
            "nullable": true
          },
          "illiquidity_prem_tight_bps": {
            "title": "Illiquidity Prem Tight Bps",
            "type": "integer",
            "nullable": true
          },
          "illiquidity_prem_wide_bps": {
            "title": "Illiquidity Prem Wide Bps",
            "type": "integer",
            "nullable": true
          },
          "seniority_first_lien_bps": {
            "title": "Seniority First Lien Bps",
            "type": "integer",
            "nullable": true
          },
          "seniority_unitranche_bps": {
            "title": "Seniority Unitranche Bps",
            "type": "integer",
            "nullable": true
          },
          "seniority_second_lien_bps": {
            "title": "Seniority Second Lien Bps",
            "type": "integer",
            "nullable": true
          },
          "pik_adj_bps": {
            "title": "Pik Adj Bps",
            "type": "integer",
            "nullable": true
          },
          "duration_factor": {
            "title": "Duration Factor",
            "type": "number",
            "nullable": true
          },
          "cycle": {
            "$ref": "#/components/schemas/CycleOverrides",
            "nullable": true
          },
          "scoring": {
            "$ref": "#/components/schemas/ScoringOverrides",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "DirectLendingOverrides"
      },
      "DirectLendingRequest": {
        "properties": {
          "strategy": {
            "type": "string",
            "title": "Strategy"
          },
          "net_debt_to_ebitda": {
            "type": "number",
            "maximum": 20.0,
            "minimum": 0.0,
            "title": "Net Debt To Ebitda"
          },
          "ebitda_interest_coverage": {
            "type": "number",
            "maximum": 20.0,
            "minimum": 0.0,
            "title": "Ebitda Interest Coverage"
          },
          "fcf_conversion": {
            "type": "number",
            "maximum": 2.0,
            "minimum": 0.0,
            "title": "Fcf Conversion"
          },
          "revenue_growth_3y": {
            "type": "number",
            "maximum": 5.0,
            "minimum": -1.0,
            "title": "Revenue Growth 3Y"
          },
          "seniority": {
            "type": "string",
            "enum": [
              "first_lien",
              "unitranche",
              "second_lien"
            ],
            "title": "Seniority",
            "default": "first_lien"
          },
          "covenant_strength": {
            "type": "string",
            "enum": [
              "Tight",
              "Moderate",
              "Loose / Cov-Lite"
            ],
            "title": "Covenant Strength",
            "default": "Moderate"
          },
          "sponsor_quality": {
            "type": "string",
            "enum": [
              "Top Tier",
              "Mid Tier",
              "No Sponsor"
            ],
            "title": "Sponsor Quality",
            "default": "Mid Tier"
          },
          "industry_risk": {
            "type": "string",
            "enum": [
              "Low",
              "Moderate",
              "High",
              "Cyclical"
            ],
            "title": "Industry Risk",
            "default": "Moderate"
          },
          "origination_spread_bps": {
            "type": "integer",
            "maximum": 5000.0,
            "minimum": 0.0,
            "title": "Origination Spread Bps"
          },
          "remaining_maturity_years": {
            "type": "number",
            "maximum": 30.0,
            "minimum": 0.0,
            "title": "Remaining Maturity Years"
          },
          "pik_toggle_active": {
            "type": "boolean",
            "title": "Pik Toggle Active",
            "default": false
          },
          "cycle_stage": {
            "type": "string",
            "enum": [
              "early",
              "mid",
              "late",
              "distressed"
            ],
            "title": "Cycle Stage",
            "default": "mid"
          },
          "ebitda_quality_addback_pct": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Ebitda Quality Addback Pct",
            "default": 0.1
          },
          "revenue_concentration_pct": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Revenue Concentration Pct",
            "default": 0.2
          },
          "liquidity_runway_months": {
            "title": "Liquidity Runway Months",
            "description": "Months of liquidity runway. Explicit null excludes the Liquidity factor and renormalises the remaining weights rather than scoring a default.",
            "default": 18.0,
            "type": "number",
            "maximum": 120.0,
            "minimum": 0.0,
            "nullable": true
          },
          "management_quality": {
            "type": "string",
            "enum": [
              "strong",
              "adequate",
              "weak"
            ],
            "title": "Management Quality",
            "default": "adequate"
          },
          "asset_coverage_ratio": {
            "type": "number",
            "maximum": 10.0,
            "minimum": 0.0,
            "title": "Asset Coverage Ratio",
            "default": 1.5
          },
          "overrides": {
            "$ref": "#/components/schemas/DirectLendingOverrides",
            "nullable": true
          },
          "use_dcf": {
            "type": "boolean",
            "title": "Use Dcf",
            "default": false
          },
          "market": {
            "type": "string",
            "enum": [
              "USD",
              "GBP",
              "EUR",
              "CUSTOM"
            ],
            "title": "Market",
            "default": "USD"
          },
          "calibration_params": {
            "$ref": "#/components/schemas/CustomCalibrationParams",
            "nullable": true
          },
          "anchor_spread_bps": {
            "title": "Anchor Spread Bps",
            "description": "Rating-model anchor spread (bps) \u2014 same lookup the mark's resolver stamps as calibrated_spread_bps",
            "type": "number",
            "maximum": 5000.0,
            "minimum": 0.0,
            "nullable": true
          },
          "anchor_rating": {
            "title": "Anchor Rating",
            "description": "Rating the anchor was priced off (e.g. 'B-'); display/provenance only",
            "type": "string",
            "maxLength": 8,
            "nullable": true
          },
          "facility_type": {
            "type": "string",
            "enum": [
              "term_loan",
              "revolver",
              "delayed_draw"
            ],
            "title": "Facility Type",
            "default": "term_loan"
          },
          "commitment_amount": {
            "title": "Commitment Amount",
            "description": "Total committed facility size (revolver / DDTL)",
            "type": "number",
            "minimum": 0.0,
            "nullable": true
          },
          "drawn_balance": {
            "title": "Drawn Balance",
            "description": "Current drawn balance (revolver / DDTL)",
            "type": "number",
            "minimum": 0.0,
            "nullable": true
          },
          "unused_fee_bps": {
            "title": "Unused Fee Bps",
            "description": "Unused commitment fee in bps per annum",
            "type": "number",
            "maximum": 500.0,
            "minimum": 0.0,
            "nullable": true
          },
          "expected_utilisation_pct": {
            "title": "Expected Utilisation Pct",
            "description": "Expected average drawn share over remaining life (0\u20131)",
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "nullable": true
          },
          "utilisation_at_default_pct": {
            "title": "Utilisation At Default Pct",
            "description": "Credit conversion factor \u2014 utilisation assumed at default (0\u20131)",
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "strategy",
          "net_debt_to_ebitda",
          "ebitda_interest_coverage",
          "fcf_conversion",
          "revenue_growth_3y",
          "origination_spread_bps",
          "remaining_maturity_years"
        ],
        "title": "DirectLendingRequest"
      },
      "DirectLendingResponse": {
        "properties": {
          "strategy": {
            "type": "string",
            "title": "Strategy"
          },
          "composite": {
            "$ref": "#/components/schemas/CompositeScoreOut"
          },
          "waterfall": {
            "$ref": "#/components/schemas/SpreadWaterfallOut"
          },
          "fair_value_spread_bps": {
            "type": "integer",
            "title": "Fair Value Spread Bps"
          },
          "fair_value_price": {
            "type": "number",
            "title": "Fair Value Price"
          },
          "spread_delta_vs_origination_bps": {
            "type": "number",
            "title": "Spread Delta Vs Origination Bps"
          },
          "duration_years": {
            "type": "number",
            "title": "Duration Years"
          },
          "implied_rating": {
            "type": "string",
            "title": "Implied Rating"
          },
          "dcf_price": {
            "title": "Dcf Price",
            "type": "number",
            "nullable": true
          },
          "calibration_market": {
            "type": "string",
            "title": "Calibration Market",
            "default": "USD"
          },
          "calibration_effective_date": {
            "type": "string",
            "format": "date",
            "title": "Calibration Effective Date",
            "default": "2025-01-01"
          },
          "calibration_warning": {
            "title": "Calibration Warning",
            "type": "string",
            "nullable": true
          },
          "anchor_rating": {
            "title": "Anchor Rating",
            "type": "string",
            "nullable": true
          },
          "anchor_spread_bps": {
            "title": "Anchor Spread Bps",
            "type": "number",
            "nullable": true
          },
          "anchor_source": {
            "title": "Anchor Source",
            "type": "string",
            "nullable": true
          },
          "company_delta_bps": {
            "title": "Company Delta Bps",
            "type": "number",
            "nullable": true
          },
          "score_implied_rating": {
            "title": "Score Implied Rating",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "strategy",
          "composite",
          "waterfall",
          "fair_value_spread_bps",
          "fair_value_price",
          "spread_delta_vs_origination_bps",
          "duration_years",
          "implied_rating"
        ],
        "title": "DirectLendingResponse"
      },
      "DirectLendingWeights": {
        "properties": {
          "leverage": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Leverage",
            "description": "Net Debt/EBITDA weight",
            "default": 0.22
          },
          "coverage": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Coverage",
            "description": "EBITDA/Interest coverage weight",
            "default": 0.18
          },
          "fcf_conv": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Fcf Conv",
            "description": "FCF conversion weight",
            "default": 0.13
          },
          "growth": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Growth",
            "description": "Revenue growth (3yr CAGR) weight",
            "default": 0.08
          },
          "covenant": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Covenant",
            "description": "Covenant strength weight",
            "default": 0.1
          },
          "sponsor": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Sponsor",
            "description": "Sponsor quality weight",
            "default": 0.08
          },
          "industry": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Industry",
            "description": "Industry risk weight",
            "default": 0.07
          },
          "ebitda_quality": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Ebitda Quality",
            "description": "EBITDA quality (addback) weight",
            "default": 0.07
          },
          "concentration": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Concentration",
            "description": "Revenue concentration weight",
            "default": 0.06
          },
          "liquidity": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Liquidity",
            "description": "Liquidity runway weight",
            "default": 0.06
          },
          "management": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Management",
            "description": "Management quality weight",
            "default": 0.08
          },
          "asset_coverage": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Asset Coverage",
            "description": "Asset coverage ratio weight",
            "default": 0.07
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "DirectLendingWeights",
        "description": "Factor weights for the Direct Lending / Senior Secured composite score.\nWeights are normalised automatically by the engine if they don't sum to 1."
      },
      "DisableRequest": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "user_id"
        ],
        "title": "DisableRequest"
      },
      "DisableResponse": {
        "properties": {
          "ok": {
            "type": "boolean",
            "title": "Ok"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "disabled_at": {
            "type": "string",
            "title": "Disabled At"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "ok",
          "user_id",
          "disabled_at"
        ],
        "title": "DisableResponse"
      },
      "DislocationRow": {
        "properties": {
          "company_name": {
            "type": "string",
            "title": "Company Name"
          },
          "bdc_cik": {
            "type": "string",
            "title": "Bdc Cik"
          },
          "bdc_name": {
            "type": "string",
            "title": "Bdc Name"
          },
          "period_of_report": {
            "type": "string",
            "title": "Period Of Report"
          },
          "sector": {
            "title": "Sector",
            "type": "string",
            "nullable": true
          },
          "investment_type": {
            "title": "Investment Type",
            "type": "string",
            "nullable": true
          },
          "spread_bps": {
            "type": "number",
            "title": "Spread Bps"
          },
          "fair_value": {
            "title": "Fair Value",
            "type": "number",
            "nullable": true
          },
          "cost": {
            "title": "Cost",
            "type": "number",
            "nullable": true
          },
          "principal_amount": {
            "title": "Principal Amount",
            "type": "number",
            "nullable": true
          },
          "price_pct": {
            "title": "Price Pct",
            "type": "number",
            "nullable": true
          },
          "cohort_median_bps": {
            "type": "number",
            "title": "Cohort Median Bps"
          },
          "dislocation_bps": {
            "type": "number",
            "title": "Dislocation Bps"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "company_name",
          "bdc_cik",
          "bdc_name",
          "period_of_report",
          "sector",
          "investment_type",
          "spread_bps",
          "fair_value",
          "cost",
          "principal_amount",
          "price_pct",
          "cohort_median_bps",
          "dislocation_bps"
        ],
        "title": "DislocationRow"
      },
      "DistanceToBreachResponse": {
        "properties": {
          "months_to_breach": {
            "title": "Months To Breach",
            "description": "Months until earliest projected covenant breach. 0.0 means a covenant is in breach now.",
            "type": "number",
            "nullable": true
          },
          "covenant_id": {
            "title": "Covenant Id",
            "type": "string",
            "nullable": true
          },
          "covenant_name": {
            "title": "Covenant Name",
            "type": "string",
            "nullable": true
          },
          "tracked_count": {
            "type": "integer",
            "title": "Tracked Count",
            "description": "Total covenants being monitored for this deal. Zero means 'no covenants tracked'.",
            "default": 0
          },
          "projecting_count": {
            "type": "integer",
            "title": "Projecting Count",
            "description": "How many tracked covenants have a finite projected breach within the 12-month horizon.",
            "default": 0
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "DistanceToBreachResponse"
      },
      "DistressedBondOverrides": {
        "properties": {
          "default_prob_negotiated": {
            "title": "Default Prob Negotiated",
            "type": "number",
            "nullable": true
          },
          "default_prob_liquidation": {
            "title": "Default Prob Liquidation",
            "type": "number",
            "nullable": true
          },
          "default_prob_par_recovery": {
            "title": "Default Prob Par Recovery",
            "type": "number",
            "nullable": true
          },
          "negotiated_haircut_low": {
            "title": "Negotiated Haircut Low",
            "type": "number",
            "nullable": true
          },
          "negotiated_haircut_high": {
            "title": "Negotiated Haircut High",
            "type": "number",
            "nullable": true
          },
          "liquidation_recovery_low": {
            "title": "Liquidation Recovery Low",
            "type": "number",
            "nullable": true
          },
          "liquidation_recovery_high": {
            "title": "Liquidation Recovery High",
            "type": "number",
            "nullable": true
          },
          "jurisdiction_ny_months": {
            "title": "Jurisdiction Ny Months",
            "type": "number",
            "nullable": true
          },
          "jurisdiction_english_months": {
            "title": "Jurisdiction English Months",
            "type": "number",
            "nullable": true
          },
          "jurisdiction_local_months": {
            "title": "Jurisdiction Local Months",
            "type": "number",
            "nullable": true
          },
          "advisor_top_tier_adj": {
            "title": "Advisor Top Tier Adj",
            "type": "number",
            "nullable": true
          },
          "advisor_mid_tier_adj": {
            "title": "Advisor Mid Tier Adj",
            "type": "number",
            "nullable": true
          },
          "advisor_none_adj": {
            "title": "Advisor None Adj",
            "type": "number",
            "nullable": true
          },
          "holdout_low_adj": {
            "title": "Holdout Low Adj",
            "type": "number",
            "nullable": true
          },
          "holdout_moderate_adj": {
            "title": "Holdout Moderate Adj",
            "type": "number",
            "nullable": true
          },
          "holdout_high_adj": {
            "title": "Holdout High Adj",
            "type": "number",
            "nullable": true
          },
          "cross_default_triggered_adj": {
            "title": "Cross Default Triggered Adj",
            "type": "number",
            "nullable": true
          },
          "cross_default_not_triggered_adj": {
            "title": "Cross Default Not Triggered Adj",
            "type": "number",
            "nullable": true
          },
          "max_price_cap": {
            "title": "Max Price Cap",
            "type": "number",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "DistressedBondOverrides"
      },
      "DistressedBondRequest": {
        "properties": {
          "strategy": {
            "type": "string",
            "title": "Strategy"
          },
          "face_value": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Face Value"
          },
          "current_price_cents": {
            "type": "number",
            "maximum": 120.0,
            "minimum": 0.0,
            "title": "Current Price Cents"
          },
          "coupon_rate": {
            "type": "number",
            "maximum": 0.5,
            "minimum": 0.0,
            "title": "Coupon Rate"
          },
          "accrued_unpaid_coupons": {
            "type": "integer",
            "maximum": 20.0,
            "minimum": 0.0,
            "title": "Accrued Unpaid Coupons",
            "default": 0
          },
          "remaining_maturity_years": {
            "type": "number",
            "maximum": 30.0,
            "minimum": 0.0,
            "title": "Remaining Maturity Years"
          },
          "seniority": {
            "type": "string",
            "enum": [
              "senior_secured",
              "senior_unsecured",
              "subordinated"
            ],
            "title": "Seniority",
            "default": "senior_unsecured"
          },
          "asset_coverage_ratio": {
            "type": "number",
            "maximum": 10.0,
            "minimum": 0.0,
            "title": "Asset Coverage Ratio",
            "default": 1.0
          },
          "total_debt": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Total Debt"
          },
          "debt_senior_to_us": {
            "type": "number",
            "minimum": 0.0,
            "title": "Debt Senior To Us"
          },
          "restructuring_stage": {
            "type": "string",
            "enum": [
              "pre_filing",
              "filed",
              "plan_proposed",
              "confirmed"
            ],
            "title": "Restructuring Stage",
            "default": "pre_filing"
          },
          "proposed_haircut_pct": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Proposed Haircut Pct",
            "default": 0.0
          },
          "proposed_extension_years": {
            "type": "number",
            "maximum": 15.0,
            "minimum": 0.0,
            "title": "Proposed Extension Years",
            "default": 0.0
          },
          "expected_timeline_months": {
            "type": "number",
            "maximum": 120.0,
            "minimum": 0.0,
            "title": "Expected Timeline Months"
          },
          "debt_for_equity_pct": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Debt For Equity Pct",
            "default": 0.0
          },
          "legal_jurisdiction": {
            "type": "string",
            "enum": [
              "ny_law",
              "english_law",
              "local_law"
            ],
            "title": "Legal Jurisdiction",
            "default": "ny_law"
          },
          "cac_threshold_pct": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Cac Threshold Pct",
            "default": 0.75
          },
          "holdout_risk": {
            "type": "string",
            "enum": [
              "low",
              "moderate",
              "high"
            ],
            "title": "Holdout Risk",
            "default": "moderate"
          },
          "restructuring_advisor": {
            "type": "string",
            "enum": [
              "top_tier",
              "mid_tier",
              "none"
            ],
            "title": "Restructuring Advisor",
            "default": "mid_tier"
          },
          "cross_default_triggered": {
            "type": "boolean",
            "title": "Cross Default Triggered",
            "default": false
          },
          "management_quality": {
            "type": "string",
            "enum": [
              "strong",
              "adequate",
              "weak"
            ],
            "title": "Management Quality",
            "default": "adequate"
          },
          "discount_rate": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Discount Rate"
          },
          "dip_financing_available": {
            "type": "string",
            "enum": [
              "available",
              "unlikely",
              "not_applicable"
            ],
            "title": "Dip Financing Available",
            "default": "not_applicable"
          },
          "liquidity_bid_ask_bps": {
            "type": "number",
            "maximum": 5000.0,
            "minimum": 0.0,
            "title": "Liquidity Bid Ask Bps",
            "default": 500.0
          },
          "overrides": {
            "$ref": "#/components/schemas/DistressedBondOverrides",
            "nullable": true
          },
          "market": {
            "type": "string",
            "enum": [
              "USD",
              "GBP",
              "EUR",
              "CUSTOM"
            ],
            "title": "Market",
            "default": "USD"
          },
          "calibration_params": {
            "$ref": "#/components/schemas/CustomCalibrationParams",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "strategy",
          "face_value",
          "current_price_cents",
          "coupon_rate",
          "remaining_maturity_years",
          "total_debt",
          "debt_senior_to_us",
          "expected_timeline_months",
          "discount_rate"
        ],
        "title": "DistressedBondRequest"
      },
      "DistressedBondResponse": {
        "properties": {
          "strategy": {
            "type": "string",
            "title": "Strategy"
          },
          "negotiated_recovery_cents": {
            "type": "number",
            "title": "Negotiated Recovery Cents"
          },
          "liquidation_recovery_cents": {
            "type": "number",
            "title": "Liquidation Recovery Cents"
          },
          "par_recovery_cents": {
            "type": "number",
            "title": "Par Recovery Cents"
          },
          "effective_timeline_months": {
            "type": "number",
            "title": "Effective Timeline Months"
          },
          "jurisdiction_adj_months": {
            "type": "number",
            "title": "Jurisdiction Adj Months"
          },
          "total_qualitative_adj_pct": {
            "type": "number",
            "title": "Total Qualitative Adj Pct"
          },
          "negotiated_pv_cents": {
            "type": "number",
            "title": "Negotiated Pv Cents"
          },
          "liquidation_pv_cents": {
            "type": "number",
            "title": "Liquidation Pv Cents"
          },
          "par_recovery_pv_cents": {
            "type": "number",
            "title": "Par Recovery Pv Cents"
          },
          "prob_negotiated": {
            "type": "number",
            "title": "Prob Negotiated"
          },
          "prob_liquidation": {
            "type": "number",
            "title": "Prob Liquidation"
          },
          "prob_par_recovery": {
            "type": "number",
            "title": "Prob Par Recovery"
          },
          "probability_weighted_pv_cents": {
            "type": "number",
            "title": "Probability Weighted Pv Cents"
          },
          "fair_value_price": {
            "type": "number",
            "title": "Fair Value Price"
          },
          "accrued_interest_cents": {
            "type": "number",
            "title": "Accrued Interest Cents"
          },
          "clean_price_cents": {
            "type": "number",
            "title": "Clean Price Cents"
          },
          "mark_vs_market_cents": {
            "type": "number",
            "title": "Mark Vs Market Cents"
          },
          "implied_irr": {
            "type": "number",
            "title": "Implied Irr"
          },
          "upside_downside_ratio": {
            "type": "number",
            "title": "Upside Downside Ratio"
          },
          "implied_rating": {
            "type": "string",
            "title": "Implied Rating"
          },
          "calibration_market": {
            "type": "string",
            "title": "Calibration Market",
            "default": "USD"
          },
          "calibration_effective_date": {
            "type": "string",
            "format": "date",
            "title": "Calibration Effective Date",
            "default": "2025-01-01"
          },
          "calibration_warning": {
            "title": "Calibration Warning",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "strategy",
          "negotiated_recovery_cents",
          "liquidation_recovery_cents",
          "par_recovery_cents",
          "effective_timeline_months",
          "jurisdiction_adj_months",
          "total_qualitative_adj_pct",
          "negotiated_pv_cents",
          "liquidation_pv_cents",
          "par_recovery_pv_cents",
          "prob_negotiated",
          "prob_liquidation",
          "prob_par_recovery",
          "probability_weighted_pv_cents",
          "fair_value_price",
          "accrued_interest_cents",
          "clean_price_cents",
          "mark_vs_market_cents",
          "implied_irr",
          "upside_downside_ratio",
          "implied_rating"
        ],
        "title": "DistressedBondResponse"
      },
      "DistressedOverrides": {
        "properties": {
          "upside_factor": {
            "title": "Upside Factor",
            "type": "number",
            "nullable": true
          },
          "stress_factor": {
            "title": "Stress Factor",
            "type": "number",
            "nullable": true
          },
          "restructuring_simple_adj": {
            "title": "Restructuring Simple Adj",
            "type": "number",
            "nullable": true
          },
          "restructuring_moderate_adj": {
            "title": "Restructuring Moderate Adj",
            "type": "number",
            "nullable": true
          },
          "restructuring_complex_adj": {
            "title": "Restructuring Complex Adj",
            "type": "number",
            "nullable": true
          },
          "catalyst_yes_adj": {
            "title": "Catalyst Yes Adj",
            "type": "number",
            "nullable": true
          },
          "catalyst_no_adj": {
            "title": "Catalyst No Adj",
            "type": "number",
            "nullable": true
          },
          "management_strong_adj": {
            "title": "Management Strong Adj",
            "type": "number",
            "nullable": true
          },
          "management_adequate_adj": {
            "title": "Management Adequate Adj",
            "type": "number",
            "nullable": true
          },
          "management_weak_adj": {
            "title": "Management Weak Adj",
            "type": "number",
            "nullable": true
          },
          "max_price_cap": {
            "title": "Max Price Cap",
            "type": "number",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "DistressedOverrides"
      },
      "DistressedRequest": {
        "properties": {
          "strategy": {
            "type": "string",
            "title": "Strategy"
          },
          "ev_ebitda_multiple": {
            "type": "number",
            "maximum": 30.0,
            "minimum": 0.0,
            "title": "Ev Ebitda Multiple"
          },
          "ebitda": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Ebitda"
          },
          "total_debt": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Total Debt"
          },
          "our_position_face": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Our Position Face"
          },
          "debt_senior_to_us": {
            "type": "number",
            "minimum": 0.0,
            "title": "Debt Senior To Us"
          },
          "default_probability_1y": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Default Probability 1Y"
          },
          "restructuring_complexity": {
            "type": "string",
            "enum": [
              "simple",
              "moderate",
              "complex"
            ],
            "title": "Restructuring Complexity",
            "default": "moderate"
          },
          "catalyst_identified": {
            "type": "boolean",
            "title": "Catalyst Identified",
            "default": false
          },
          "management_quality": {
            "type": "string",
            "enum": [
              "strong",
              "adequate",
              "weak"
            ],
            "title": "Management Quality",
            "default": "adequate"
          },
          "liquidity_runway_months": {
            "type": "number",
            "maximum": 120.0,
            "minimum": 0.0,
            "title": "Liquidity Runway Months"
          },
          "purchase_price_pct": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Purchase Price Pct"
          },
          "cash_coupon_rate": {
            "type": "number",
            "maximum": 0.5,
            "minimum": 0.0,
            "title": "Cash Coupon Rate"
          },
          "remaining_maturity_years": {
            "type": "number",
            "maximum": 30.0,
            "minimum": 0.0,
            "title": "Remaining Maturity Years"
          },
          "discount_rate": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Discount Rate"
          },
          "is_fulcrum_security": {
            "type": "boolean",
            "title": "Is Fulcrum Security",
            "default": false
          },
          "dip_financing_available": {
            "type": "string",
            "enum": [
              "available",
              "unlikely",
              "not_applicable"
            ],
            "title": "Dip Financing Available",
            "default": "not_applicable"
          },
          "asset_coverage_ratio": {
            "type": "number",
            "maximum": 10.0,
            "minimum": 0.0,
            "title": "Asset Coverage Ratio",
            "default": 1.0
          },
          "overrides": {
            "$ref": "#/components/schemas/DistressedOverrides",
            "nullable": true
          },
          "use_monte_carlo": {
            "type": "boolean",
            "title": "Use Monte Carlo",
            "default": false
          },
          "n_simulations": {
            "type": "integer",
            "maximum": 100000.0,
            "minimum": 100.0,
            "title": "N Simulations",
            "default": 10000
          },
          "m_std": {
            "title": "M Std",
            "type": "number",
            "minimum": 0.0,
            "nullable": true
          },
          "pd_std": {
            "title": "Pd Std",
            "type": "number",
            "minimum": 0.0,
            "nullable": true
          },
          "rd_std": {
            "title": "Rd Std",
            "type": "number",
            "minimum": 0.0,
            "nullable": true
          },
          "market": {
            "type": "string",
            "enum": [
              "USD",
              "GBP",
              "EUR",
              "CUSTOM"
            ],
            "title": "Market",
            "default": "USD"
          },
          "calibration_params": {
            "$ref": "#/components/schemas/CustomCalibrationParams",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "strategy",
          "ev_ebitda_multiple",
          "ebitda",
          "total_debt",
          "our_position_face",
          "debt_senior_to_us",
          "default_probability_1y",
          "liquidity_runway_months",
          "purchase_price_pct",
          "cash_coupon_rate",
          "remaining_maturity_years",
          "discount_rate"
        ],
        "title": "DistressedRequest"
      },
      "DistressedResponse": {
        "properties": {
          "strategy": {
            "type": "string",
            "title": "Strategy"
          },
          "estimated_ev": {
            "type": "number",
            "title": "Estimated Ev"
          },
          "recoverable_to_position": {
            "type": "number",
            "title": "Recoverable To Position"
          },
          "base_recovery_rate": {
            "type": "number",
            "title": "Base Recovery Rate"
          },
          "base_recovery_cents": {
            "type": "number",
            "title": "Base Recovery Cents"
          },
          "upside_recovery_cents": {
            "type": "number",
            "title": "Upside Recovery Cents"
          },
          "stress_recovery_cents": {
            "type": "number",
            "title": "Stress Recovery Cents"
          },
          "total_qualitative_adj_pct": {
            "type": "number",
            "title": "Total Qualitative Adj Pct"
          },
          "adj_default_recovery_cents": {
            "type": "number",
            "title": "Adj Default Recovery Cents"
          },
          "liquidity_pd_multiplier": {
            "type": "number",
            "title": "Liquidity Pd Multiplier",
            "default": 1.0
          },
          "adj_default_probability_1y": {
            "title": "Adj Default Probability 1Y",
            "type": "number",
            "nullable": true
          },
          "prob_weighted_ev_cents": {
            "type": "number",
            "title": "Prob Weighted Ev Cents"
          },
          "fair_value_price": {
            "type": "number",
            "title": "Fair Value Price"
          },
          "implied_irr": {
            "type": "number",
            "title": "Implied Irr"
          },
          "upside_downside_ratio": {
            "type": "number",
            "title": "Upside Downside Ratio"
          },
          "mark_vs_purchase_cents": {
            "type": "number",
            "title": "Mark Vs Purchase Cents"
          },
          "implied_rating": {
            "type": "string",
            "title": "Implied Rating"
          },
          "monte_carlo": {
            "$ref": "#/components/schemas/DistributedValuationOut",
            "nullable": true
          },
          "calibration_market": {
            "type": "string",
            "title": "Calibration Market",
            "default": "USD"
          },
          "calibration_effective_date": {
            "type": "string",
            "format": "date",
            "title": "Calibration Effective Date",
            "default": "2025-01-01"
          },
          "calibration_warning": {
            "title": "Calibration Warning",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "strategy",
          "estimated_ev",
          "recoverable_to_position",
          "base_recovery_rate",
          "base_recovery_cents",
          "upside_recovery_cents",
          "stress_recovery_cents",
          "total_qualitative_adj_pct",
          "adj_default_recovery_cents",
          "prob_weighted_ev_cents",
          "fair_value_price",
          "implied_irr",
          "upside_downside_ratio",
          "mark_vs_purchase_cents",
          "implied_rating"
        ],
        "title": "DistressedResponse"
      },
      "DistributedValuationOut": {
        "properties": {
          "median": {
            "type": "number",
            "title": "Median"
          },
          "mean": {
            "type": "number",
            "title": "Mean"
          },
          "p5": {
            "type": "number",
            "title": "P5"
          },
          "p25": {
            "type": "number",
            "title": "P25"
          },
          "p75": {
            "type": "number",
            "title": "P75"
          },
          "p95": {
            "type": "number",
            "title": "P95"
          },
          "std": {
            "type": "number",
            "title": "Std"
          },
          "n_simulations": {
            "type": "integer",
            "title": "N Simulations"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "median",
          "mean",
          "p5",
          "p25",
          "p75",
          "p95",
          "std",
          "n_simulations"
        ],
        "title": "DistributedValuationOut"
      },
      "DistributionRequest": {
        "properties": {
          "dist_date": {
            "type": "string",
            "title": "Dist Date"
          },
          "amount": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Amount"
          },
          "dist_type": {
            "type": "string",
            "title": "Dist Type",
            "default": "cash"
          },
          "note": {
            "title": "Note",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "dist_date",
          "amount"
        ],
        "title": "DistributionRequest"
      },
      "ECLAttributionRequest": {
        "properties": {
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "valuation_date": {
            "type": "string",
            "format": "date",
            "title": "Valuation Date"
          },
          "current_spread_bps": {
            "type": "integer",
            "maximum": 5000.0,
            "minimum": 0.0,
            "title": "Current Spread Bps"
          },
          "lgd": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Lgd",
            "default": 0.4
          },
          "origination_spread_bps": {
            "title": "Origination Spread Bps",
            "type": "integer",
            "nullable": true
          },
          "is_defaulted": {
            "type": "boolean",
            "title": "Is Defaulted",
            "default": false
          },
          "covenant_breached": {
            "type": "boolean",
            "title": "Covenant Breached",
            "default": false
          },
          "net_debt_to_ebitda": {
            "title": "Net Debt To Ebitda",
            "type": "number",
            "nullable": true
          },
          "rating_override": {
            "title": "Rating Override",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_id",
          "valuation_date",
          "current_spread_bps"
        ],
        "title": "ECLAttributionRequest",
        "description": "Same contract as ``/ecl/compute`` \u2014 the prior period is derived, not posted."
      },
      "ECLAttributionResponse": {
        "properties": {
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "available": {
            "type": "boolean",
            "title": "Available"
          },
          "reason": {
            "title": "Reason",
            "type": "string",
            "nullable": true
          },
          "prior_period_label": {
            "title": "Prior Period Label",
            "type": "string",
            "nullable": true
          },
          "prior_period_end_date": {
            "title": "Prior Period End Date",
            "type": "string",
            "nullable": true
          },
          "ecl_prior": {
            "title": "Ecl Prior",
            "type": "number",
            "nullable": true
          },
          "ecl_current": {
            "title": "Ecl Current",
            "type": "number",
            "nullable": true
          },
          "ecl_change": {
            "title": "Ecl Change",
            "type": "number",
            "nullable": true
          },
          "volume_effect": {
            "title": "Volume Effect",
            "type": "number",
            "nullable": true
          },
          "migration_effect": {
            "title": "Migration Effect",
            "type": "number",
            "nullable": true
          },
          "lgd_effect": {
            "title": "Lgd Effect",
            "type": "number",
            "nullable": true
          },
          "spread_effect": {
            "title": "Spread Effect",
            "type": "number",
            "nullable": true
          },
          "residual": {
            "title": "Residual",
            "type": "number",
            "nullable": true
          },
          "prior_rating": {
            "title": "Prior Rating",
            "type": "string",
            "nullable": true
          },
          "current_rating": {
            "title": "Current Rating",
            "type": "string",
            "nullable": true
          },
          "prior_stage": {
            "title": "Prior Stage",
            "type": "integer",
            "nullable": true
          },
          "current_stage": {
            "title": "Current Stage",
            "type": "integer",
            "nullable": true
          },
          "rating_migrated": {
            "title": "Rating Migrated",
            "type": "boolean",
            "nullable": true
          },
          "stage_migrated": {
            "title": "Stage Migrated",
            "type": "boolean",
            "nullable": true
          },
          "rating_model_changed": {
            "type": "boolean",
            "title": "Rating Model Changed",
            "default": false
          },
          "lgd_effect_measurable": {
            "type": "boolean",
            "title": "Lgd Effect Measurable",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_id",
          "available"
        ],
        "title": "ECLAttributionResponse",
        "description": "Attribution result, or a stated absence when there is no prior period.\n\n``available=False`` is a normal outcome, not an error: a deal has to have\nbeen snapshotted at least once before the valuation date for there to be a\nchange to attribute."
      },
      "ECLRequest": {
        "properties": {
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "valuation_date": {
            "type": "string",
            "format": "date",
            "title": "Valuation Date"
          },
          "current_spread_bps": {
            "type": "integer",
            "maximum": 5000.0,
            "minimum": 0.0,
            "title": "Current Spread Bps"
          },
          "lgd": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Lgd",
            "default": 0.4
          },
          "origination_spread_bps": {
            "title": "Origination Spread Bps",
            "type": "integer",
            "nullable": true
          },
          "is_defaulted": {
            "type": "boolean",
            "title": "Is Defaulted",
            "default": false
          },
          "covenant_breached": {
            "type": "boolean",
            "title": "Covenant Breached",
            "default": false
          },
          "net_debt_to_ebitda": {
            "title": "Net Debt To Ebitda",
            "type": "number",
            "nullable": true
          },
          "rating_override": {
            "title": "Rating Override",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_id",
          "valuation_date",
          "current_spread_bps"
        ],
        "title": "ECLRequest"
      },
      "ECLResponse": {
        "properties": {
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "rating": {
            "type": "string",
            "title": "Rating"
          },
          "rating_derived": {
            "type": "boolean",
            "title": "Rating Derived",
            "default": true
          },
          "stage": {
            "type": "integer",
            "title": "Stage"
          },
          "ecl_12m": {
            "type": "number",
            "title": "Ecl 12M"
          },
          "ecl_12m_pct": {
            "type": "number",
            "title": "Ecl 12M Pct"
          },
          "ecl_lifetime": {
            "type": "number",
            "title": "Ecl Lifetime"
          },
          "ecl_lifetime_pct": {
            "type": "number",
            "title": "Ecl Lifetime Pct"
          },
          "ecl_applied": {
            "type": "number",
            "title": "Ecl Applied"
          },
          "ecl_applied_pct": {
            "type": "number",
            "title": "Ecl Applied Pct"
          },
          "pd_1y": {
            "type": "number",
            "title": "Pd 1Y"
          },
          "pd_3y": {
            "type": "number",
            "title": "Pd 3Y"
          },
          "pd_5y": {
            "type": "number",
            "title": "Pd 5Y"
          },
          "lgd": {
            "type": "number",
            "title": "Lgd"
          },
          "ead": {
            "type": "number",
            "title": "Ead"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_id",
          "rating",
          "stage",
          "ecl_12m",
          "ecl_12m_pct",
          "ecl_lifetime",
          "ecl_lifetime_pct",
          "ecl_applied",
          "ecl_applied_pct",
          "pd_1y",
          "pd_3y",
          "pd_5y",
          "lgd",
          "ead"
        ],
        "title": "ECLResponse"
      },
      "EVCompMultiple": {
        "properties": {
          "comp_name": {
            "type": "string",
            "minLength": 1,
            "title": "Comp Name",
            "description": "Peer ticker / display name"
          },
          "ev_ebitda_multiple": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Ev Ebitda Multiple",
            "description": "EV / LTM EBITDA"
          },
          "ev_revenue_multiple": {
            "title": "Ev Revenue Multiple",
            "description": "Optional EV / LTM Revenue, used as a sanity cross-check",
            "type": "number",
            "exclusiveMinimum": 0.0,
            "nullable": true
          },
          "peer_ltm_ebitda": {
            "title": "Peer Ltm Ebitda",
            "description": "Peer's own LTM EBITDA, captured for audit",
            "type": "number",
            "exclusiveMinimum": 0.0,
            "nullable": true
          },
          "source_note": {
            "title": "Source Note",
            "description": "Where the multiple came from (Bloomberg as of \u2026, Cap IQ run, \u2026)",
            "type": "string",
            "maxLength": 500,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "comp_name",
          "ev_ebitda_multiple"
        ],
        "title": "EVCompMultiple",
        "description": "One peer company's observed EV/EBITDA multiple."
      },
      "EVDCFForecast": {
        "properties": {
          "horizon_years": {
            "type": "integer",
            "maximum": 10.0,
            "minimum": 1.0,
            "title": "Horizon Years",
            "default": 5
          },
          "base_revenue": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Base Revenue"
          },
          "revenue_growth_pa": {
            "items": {
              "type": "number"
            },
            "type": "array",
            "title": "Revenue Growth Pa",
            "description": "Per-year growth rates, len = horizon"
          },
          "ebitda_margin_pa": {
            "items": {
              "type": "number"
            },
            "type": "array",
            "title": "Ebitda Margin Pa",
            "description": "Per-year EBITDA margins (0\u20131), len = horizon"
          },
          "da_pct_revenue": {
            "items": {
              "type": "number"
            },
            "type": "array",
            "title": "Da Pct Revenue"
          },
          "capex_pct_revenue": {
            "items": {
              "type": "number"
            },
            "type": "array",
            "title": "Capex Pct Revenue"
          },
          "nwc_pct_revenue": {
            "items": {
              "type": "number"
            },
            "type": "array",
            "title": "Nwc Pct Revenue"
          },
          "tax_rate": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Tax Rate"
          },
          "terminal_method": {
            "type": "string",
            "pattern": "^(EXIT_MULTIPLE|GORDON_GROWTH)$",
            "title": "Terminal Method",
            "default": "EXIT_MULTIPLE"
          },
          "terminal_multiple": {
            "title": "Terminal Multiple",
            "type": "number",
            "exclusiveMinimum": 0.0,
            "nullable": true
          },
          "terminal_growth": {
            "title": "Terminal Growth",
            "type": "number",
            "nullable": true
          },
          "wacc": {
            "type": "number",
            "exclusiveMaximum": 1.0,
            "exclusiveMinimum": 0.0,
            "title": "Wacc"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "base_revenue",
          "revenue_growth_pa",
          "ebitda_margin_pa",
          "da_pct_revenue",
          "capex_pct_revenue",
          "nwc_pct_revenue",
          "tax_rate",
          "wacc"
        ],
        "title": "EVDCFForecast",
        "description": "Five-year ULFCF forecast for the intrinsic EV approach."
      },
      "EVDriverRow": {
        "properties": {
          "label": {
            "type": "string",
            "title": "Label",
            "description": "'low' | 'mid' | 'high'"
          },
          "multiple": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Multiple"
          },
          "ev_amount": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Ev Amount"
          },
          "driver": {
            "type": "string",
            "title": "Driver",
            "description": "E.g. peer name, transaction id, scenario"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "label",
          "multiple",
          "ev_amount",
          "driver"
        ],
        "title": "EVDriverRow",
        "description": "One row of the audit trace \u2014 what drove low / mid / high."
      },
      "EVEstimate": {
        "properties": {
          "method": {
            "$ref": "#/components/schemas/EVMethod"
          },
          "ev_low": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Ev Low"
          },
          "ev_mid": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Ev Mid"
          },
          "ev_high": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Ev High"
          },
          "drivers": {
            "items": {
              "$ref": "#/components/schemas/EVDriverRow"
            },
            "type": "array",
            "title": "Drivers"
          },
          "inputs_hash": {
            "type": "string",
            "title": "Inputs Hash",
            "description": "SHA-256 of canonical request \u2014 reproducibility key"
          },
          "valuation_date": {
            "type": "string",
            "format": "date",
            "title": "Valuation Date"
          },
          "computed_at": {
            "type": "string",
            "format": "date-time",
            "title": "Computed At"
          },
          "source_notes": {
            "title": "Source Notes",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "method",
          "ev_low",
          "ev_mid",
          "ev_high",
          "inputs_hash",
          "valuation_date",
          "computed_at"
        ],
        "title": "EVEstimate",
        "description": "Output of POST /ev/estimate. Persistable on Financials."
      },
      "EVEstimateList": {
        "properties": {
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          },
          "items": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_id",
          "count",
          "items"
        ],
        "title": "EVEstimateList"
      },
      "EVEstimateRequest": {
        "properties": {
          "method": {
            "$ref": "#/components/schemas/EVMethod"
          },
          "valuation_date": {
            "type": "string",
            "format": "date",
            "title": "Valuation Date"
          },
          "ltm_ebitda": {
            "title": "Ltm Ebitda",
            "description": "Subject company's LTM EBITDA \u2014 required for GPCA / GTA",
            "type": "number",
            "exclusiveMinimum": 0.0,
            "nullable": true
          },
          "ltm_revenue": {
            "title": "Ltm Revenue",
            "type": "number",
            "exclusiveMinimum": 0.0,
            "nullable": true
          },
          "comps": {
            "title": "Comps",
            "items": {
              "$ref": "#/components/schemas/EVCompMultiple"
            },
            "type": "array",
            "nullable": true
          },
          "transactions": {
            "title": "Transactions",
            "items": {
              "$ref": "#/components/schemas/EVTransactionMultiple"
            },
            "type": "array",
            "nullable": true
          },
          "dcf": {
            "$ref": "#/components/schemas/EVDCFForecast",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "method",
          "valuation_date"
        ],
        "title": "EVEstimateRequest",
        "description": "Request body for POST /ev/estimate."
      },
      "EVMethod": {
        "type": "string",
        "enum": [
          "GPCA",
          "GTA",
          "DCF",
          "USER"
        ],
        "title": "EVMethod",
        "description": "Which approach produced the estimate."
      },
      "EVTransactionMultiple": {
        "properties": {
          "target": {
            "type": "string",
            "minLength": 1,
            "title": "Target"
          },
          "acquirer": {
            "type": "string",
            "minLength": 1,
            "title": "Acquirer"
          },
          "announcement_date": {
            "type": "string",
            "format": "date",
            "title": "Announcement Date"
          },
          "ev_ebitda_multiple": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Ev Ebitda Multiple"
          },
          "ev_revenue_multiple": {
            "title": "Ev Revenue Multiple",
            "type": "number",
            "exclusiveMinimum": 0.0,
            "nullable": true
          },
          "source_note": {
            "title": "Source Note",
            "type": "string",
            "maxLength": 500,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "target",
          "acquirer",
          "announcement_date",
          "ev_ebitda_multiple"
        ],
        "title": "EVTransactionMultiple",
        "description": "One precedent M&A transaction's EV/EBITDA multiple."
      },
      "EconomicsRequest": {
        "properties": {
          "cost_basis": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Cost Basis"
          },
          "investment_date": {
            "title": "Investment Date",
            "type": "string",
            "nullable": true
          },
          "currency": {
            "type": "string",
            "title": "Currency",
            "default": "USD"
          },
          "notes": {
            "title": "Notes",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "cost_basis"
        ],
        "title": "EconomicsRequest"
      },
      "EnableToggle": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "enabled"
        ],
        "title": "EnableToggle",
        "description": "Request body for PATCH enable/disable."
      },
      "EngineConfig": {
        "properties": {
          "dl_weights": {
            "$ref": "#/components/schemas/DirectLendingWeights"
          },
          "mezz_weights": {
            "$ref": "#/components/schemas/MezzanineWeights"
          },
          "cre_weights": {
            "$ref": "#/components/schemas/CREWeights"
          },
          "illiquid_weights": {
            "$ref": "#/components/schemas/IlliquidBondWeights"
          },
          "secured_weights": {
            "$ref": "#/components/schemas/SecuredBorrowingWeights"
          },
          "scoring": {
            "$ref": "#/components/schemas/ScoringThresholds"
          },
          "cycle": {
            "$ref": "#/components/schemas/CycleConfig"
          },
          "strategy_bounds": {
            "$ref": "#/components/schemas/StrategyBoundsConfig"
          },
          "valuation": {
            "$ref": "#/components/schemas/ValuationEngineConfig"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "EngineConfig",
        "description": "Complete engine calibration configuration. All fields have defaults matching\nthe original hardcoded values so behaviour is unchanged until edited."
      },
      "EngineConfigPatch": {
        "properties": {
          "dl_weights": {
            "$ref": "#/components/schemas/DirectLendingWeights",
            "nullable": true
          },
          "mezz_weights": {
            "$ref": "#/components/schemas/MezzanineWeights",
            "nullable": true
          },
          "cre_weights": {
            "$ref": "#/components/schemas/CREWeights",
            "nullable": true
          },
          "illiquid_weights": {
            "$ref": "#/components/schemas/IlliquidBondWeights",
            "nullable": true
          },
          "secured_weights": {
            "$ref": "#/components/schemas/SecuredBorrowingWeights",
            "nullable": true
          },
          "scoring": {
            "$ref": "#/components/schemas/ScoringThresholds",
            "nullable": true
          },
          "cycle": {
            "$ref": "#/components/schemas/CycleConfig",
            "nullable": true
          },
          "strategy_bounds": {
            "$ref": "#/components/schemas/StrategyBoundsConfig",
            "nullable": true
          },
          "valuation": {
            "$ref": "#/components/schemas/ValuationEngineConfig",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "EngineConfigPatch",
        "description": "Partial update \u2014 any omitted top-level section is left unchanged."
      },
      "EngineConfigResponse": {
        "properties": {
          "config": {
            "$ref": "#/components/schemas/EngineConfig"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string",
            "nullable": true
          },
          "updated_by": {
            "title": "Updated By",
            "type": "string",
            "nullable": true
          },
          "is_default": {
            "type": "boolean",
            "title": "Is Default",
            "default": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "config"
        ],
        "title": "EngineConfigResponse",
        "description": "API response wrapping EngineConfig with metadata."
      },
      "EnrollStartResponse": {
        "properties": {
          "otpauth_uri": {
            "type": "string",
            "title": "Otpauth Uri"
          },
          "enroll_token": {
            "type": "string",
            "title": "Enroll Token"
          },
          "ttl_seconds": {
            "type": "integer",
            "title": "Ttl Seconds"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "otpauth_uri",
          "enroll_token",
          "ttl_seconds"
        ],
        "title": "EnrollStartResponse"
      },
      "EnrollVerifyRequest": {
        "properties": {
          "enroll_token": {
            "type": "string",
            "title": "Enroll Token"
          },
          "code": {
            "type": "string",
            "maxLength": 6,
            "minLength": 6,
            "pattern": "^\\d{6}$",
            "title": "Code"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "enroll_token",
          "code"
        ],
        "title": "EnrollVerifyRequest"
      },
      "EnrollVerifyResponse": {
        "properties": {
          "ok": {
            "type": "boolean",
            "title": "Ok"
          },
          "enrolled_at": {
            "type": "string",
            "title": "Enrolled At"
          },
          "backup_codes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Backup Codes"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "ok",
          "enrolled_at",
          "backup_codes"
        ],
        "title": "EnrollVerifyResponse"
      },
      "EntityType": {
        "type": "string",
        "enum": [
          "deal",
          "valuation_run"
        ],
        "title": "EntityType",
        "description": "Discriminator for what kind of entity an approval targets."
      },
      "ErasureResponse": {
        "properties": {
          "ok": {
            "type": "boolean",
            "title": "Ok"
          },
          "erased_at": {
            "type": "string",
            "title": "Erased At"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "retained_records": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Retained Records"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "ok",
          "erased_at",
          "user_id",
          "retained_records"
        ],
        "title": "ErasureResponse"
      },
      "ErrorLogOut": {
        "properties": {
          "error_id": {
            "type": "string",
            "title": "Error Id"
          },
          "endpoint": {
            "type": "string",
            "title": "Endpoint"
          },
          "method": {
            "type": "string",
            "title": "Method"
          },
          "status_code": {
            "type": "integer",
            "title": "Status Code"
          },
          "error_type": {
            "type": "string",
            "title": "Error Type"
          },
          "message": {
            "title": "Message",
            "type": "string",
            "nullable": true
          },
          "traceback_text": {
            "title": "Traceback Text",
            "type": "string",
            "nullable": true
          },
          "response_ms": {
            "title": "Response Ms",
            "type": "integer",
            "nullable": true
          },
          "client_ip": {
            "title": "Client Ip",
            "type": "string",
            "nullable": true
          },
          "resolved": {
            "type": "boolean",
            "title": "Resolved",
            "default": false
          },
          "resolved_at": {
            "title": "Resolved At",
            "type": "string",
            "nullable": true
          },
          "resolved_note": {
            "title": "Resolved Note",
            "type": "string",
            "nullable": true
          },
          "occurred_at": {
            "type": "string",
            "title": "Occurred At"
          }
        },
        "type": "object",
        "required": [
          "error_id",
          "endpoint",
          "method",
          "status_code",
          "error_type",
          "occurred_at"
        ],
        "title": "ErrorLogOut"
      },
      "ErrorSummaryOut": {
        "properties": {
          "total_errors": {
            "type": "integer",
            "title": "Total Errors"
          },
          "unresolved": {
            "type": "integer",
            "title": "Unresolved"
          },
          "resolved": {
            "type": "integer",
            "title": "Resolved"
          },
          "by_type": {
            "additionalProperties": true,
            "type": "object",
            "title": "By Type"
          },
          "by_endpoint": {
            "items": {},
            "type": "array",
            "title": "By Endpoint"
          },
          "by_status_code": {
            "additionalProperties": true,
            "type": "object",
            "title": "By Status Code"
          },
          "by_hour": {
            "items": {},
            "type": "array",
            "title": "By Hour"
          },
          "recurring_patterns": {
            "items": {},
            "type": "array",
            "title": "Recurring Patterns"
          }
        },
        "type": "object",
        "required": [
          "total_errors",
          "unresolved",
          "resolved",
          "by_type",
          "by_endpoint",
          "by_status_code",
          "by_hour",
          "recurring_patterns"
        ],
        "title": "ErrorSummaryOut"
      },
      "ExceptionItem": {
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/ExceptionKind"
          },
          "severity": {
            "$ref": "#/components/schemas/ExceptionSeverity"
          },
          "deal_id": {
            "title": "Deal Id",
            "type": "string",
            "nullable": true
          },
          "deal_name": {
            "title": "Deal Name",
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "detail": {
            "type": "string",
            "title": "Detail",
            "default": ""
          },
          "action_url": {
            "type": "string",
            "title": "Action Url",
            "description": "Frontend URL to click through to \u2014 usually a deal page.",
            "default": "/app"
          },
          "surfaced_at": {
            "type": "string",
            "format": "date-time",
            "title": "Surfaced At"
          },
          "age_days": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Age Days",
            "description": "Integer days since the underlying event first occurred.",
            "default": 0
          },
          "assigned_to": {
            "title": "Assigned To",
            "type": "string",
            "nullable": true
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Metadata"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "kind",
          "severity",
          "title",
          "surfaced_at"
        ],
        "title": "ExceptionItem",
        "description": "One row in the exception inbox."
      },
      "ExceptionKind": {
        "type": "string",
        "enum": [
          "STALE_MARK",
          "COVENANT_BREACH",
          "IMPAIRMENT",
          "SPREAD_OUTLIER",
          "PENDING_APPROVAL",
          "MISSING_SNAPSHOT",
          "MARKET_INGEST_FAILURE",
          "CALIBRATION_DUE"
        ],
        "title": "ExceptionKind"
      },
      "ExceptionSeverity": {
        "type": "string",
        "enum": [
          "INFO",
          "WARNING",
          "CRITICAL"
        ],
        "title": "ExceptionSeverity"
      },
      "ExpertComparisonOut": {
        "properties": {
          "factor_name": {
            "type": "string",
            "title": "Factor Name"
          },
          "expert_weight": {
            "type": "number",
            "title": "Expert Weight"
          },
          "fitted_weight": {
            "type": "number",
            "title": "Fitted Weight"
          },
          "deviation_pct": {
            "type": "number",
            "title": "Deviation Pct"
          },
          "ci_lower": {
            "type": "number",
            "title": "Ci Lower"
          },
          "ci_upper": {
            "type": "number",
            "title": "Ci Upper"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "factor_name",
          "expert_weight",
          "fitted_weight",
          "deviation_pct",
          "ci_lower",
          "ci_upper"
        ],
        "title": "ExpertComparisonOut"
      },
      "ExposureClass": {
        "type": "string",
        "enum": [
          "corporate",
          "sme_corporate",
          "sme_retail",
          "specialized_lending",
          "cre_income_producing",
          "cre_land_adc",
          "sovereign",
          "bank_fi",
          "retail_residential",
          "retail_other"
        ],
        "title": "ExposureClass"
      },
      "ExternalMark": {
        "properties": {
          "mark_id": {
            "type": "string",
            "title": "Mark Id"
          },
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "kind": {
            "type": "string",
            "enum": [
              "valuation_agent",
              "manager",
              "administrator",
              "auditor",
              "other"
            ],
            "title": "Kind"
          },
          "price": {
            "type": "number",
            "title": "Price"
          },
          "price_low": {
            "title": "Price Low",
            "type": "number",
            "nullable": true
          },
          "price_high": {
            "title": "Price High",
            "type": "number",
            "nullable": true
          },
          "as_of": {
            "type": "string",
            "title": "As Of"
          },
          "price_basis": {
            "type": "string",
            "enum": [
              "outstanding",
              "original"
            ],
            "title": "Price Basis",
            "default": "outstanding"
          },
          "reference": {
            "title": "Reference",
            "type": "string",
            "nullable": true
          },
          "note": {
            "title": "Note",
            "type": "string",
            "nullable": true
          },
          "created_by": {
            "title": "Created By",
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "mark_id",
          "deal_id",
          "provider",
          "kind",
          "price",
          "as_of",
          "created_at"
        ],
        "title": "ExternalMark"
      },
      "ExternalMarkComparison": {
        "properties": {
          "mark": {
            "$ref": "#/components/schemas/ExternalMark"
          },
          "delta_pts": {
            "title": "Delta Pts",
            "description": "External price minus Verus price, in price points.",
            "type": "number",
            "nullable": true
          },
          "position": {
            "type": "string",
            "enum": [
              "below_range",
              "within_range",
              "above_range",
              "no_range",
              "basis_mismatch",
              "no_verus_mark"
            ],
            "title": "Position"
          },
          "verus_within_external_range": {
            "title": "Verus Within External Range",
            "description": "Whether the Verus price sits inside the provider's own low/high range, when one was given.",
            "type": "boolean",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "mark",
          "position"
        ],
        "title": "ExternalMarkComparison"
      },
      "ExtractCreditDataRequest": {
        "properties": {
          "doc_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Doc Ids",
            "description": "Specific doc IDs to extract from. Defaults to all deal documents."
          },
          "commit": {
            "type": "boolean",
            "title": "Commit",
            "description": "When False (default) the proposed inputs are returned for review and NOT persisted to the deal \u2014 the caller must accept them via the /credit-analysis endpoint. When True the extracted inputs are written to observations.financials before the response returns.",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ExtractCreditDataRequest",
        "description": "Body for POST /deals/{deal_id}/extract-credit-data.\n\nKept backwards-compatible with callers that still post a bare\n``list[str]`` of doc_ids (FastAPI's Body() handles that via the\nlegacy shape at the route level)."
      },
      "ExtractCreditDataResponse": {
        "properties": {
          "inputs": {
            "$ref": "#/components/schemas/FundamentalCreditInputs"
          },
          "partial_inputs": {
            "$ref": "#/components/schemas/PartialExtractedInputs",
            "default": {
              "financials": [],
              "projections": [],
              "capital_structure": []
            }
          },
          "result": {
            "$ref": "#/components/schemas/FundamentalCreditResult"
          },
          "usage": {
            "additionalProperties": true,
            "type": "object",
            "title": "Usage",
            "default": {}
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings",
            "default": []
          },
          "provenance": {
            "additionalProperties": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "object",
            "title": "Provenance"
          },
          "url_doc_statuses": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Url Doc Statuses"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "inputs",
          "result"
        ],
        "title": "ExtractCreditDataResponse"
      },
      "Facility": {
        "properties": {
          "notional": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Notional",
            "description": "Full facility / issuance size"
          },
          "held_notional": {
            "title": "Held Notional",
            "description": "Fund's actual holding. Defaults to notional (100% participation).",
            "type": "number",
            "exclusiveMinimum": 0.0,
            "nullable": true
          },
          "rate_type": {
            "$ref": "#/components/schemas/RateType"
          },
          "floating_rate": {
            "$ref": "#/components/schemas/FloatingRateSpec",
            "nullable": true
          },
          "fixed_rate": {
            "$ref": "#/components/schemas/FixedRateSpec",
            "nullable": true
          },
          "interest_payment_frequency": {
            "$ref": "#/components/schemas/PaymentFrequency"
          },
          "fees": {
            "$ref": "#/components/schemas/FeesSpec"
          },
          "principal_schedule": {
            "$ref": "#/components/schemas/PrincipalSchedule"
          },
          "lpi_terms": {
            "$ref": "#/components/schemas/LpiTerms",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "notional",
          "rate_type",
          "interest_payment_frequency"
        ],
        "title": "Facility"
      },
      "FacilityCandidate": {
        "properties": {
          "label": {
            "title": "Label",
            "type": "string",
            "nullable": true
          },
          "seniority": {
            "title": "Seniority",
            "type": "string",
            "nullable": true
          },
          "is_preferred": {
            "title": "Is Preferred",
            "default": false,
            "type": "boolean",
            "nullable": true
          },
          "facility": {
            "additionalProperties": true,
            "type": "object",
            "title": "Facility"
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "facility"
        ],
        "title": "FacilityCandidate"
      },
      "FactorScoreOut": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "score": {
            "type": "number",
            "title": "Score"
          },
          "weight": {
            "type": "number",
            "title": "Weight"
          },
          "contribution": {
            "type": "number",
            "title": "Contribution"
          },
          "description": {
            "type": "string",
            "title": "Description",
            "default": ""
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name",
          "score",
          "weight",
          "contribution"
        ],
        "title": "FactorScoreOut"
      },
      "FairValueCompliance": {
        "properties": {
          "framework": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Framework"
          },
          "hierarchy_level": {
            "type": "integer",
            "enum": [
              1,
              2,
              3
            ],
            "title": "Hierarchy Level"
          },
          "level_rationale": {
            "type": "string",
            "title": "Level Rationale"
          },
          "technique": {
            "type": "string",
            "enum": [
              "income_dcf",
              "income_multi_factor_dcf",
              "market_comparable",
              "market_quoted",
              "cost"
            ],
            "title": "Technique"
          },
          "technique_rationale": {
            "type": "string",
            "title": "Technique Rationale"
          },
          "principal_market": {
            "type": "string",
            "title": "Principal Market"
          },
          "market_participant_assumptions": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Market Participant Assumptions"
          },
          "observable_inputs": {
            "items": {
              "$ref": "#/components/schemas/InputRef"
            },
            "type": "array",
            "title": "Observable Inputs"
          },
          "unobservable_inputs": {
            "items": {
              "$ref": "#/components/schemas/UnobservableInputDisclosure"
            },
            "type": "array",
            "title": "Unobservable Inputs"
          },
          "calibration_source": {
            "type": "string",
            "title": "Calibration Source"
          },
          "calibration_as_of_date": {
            "title": "Calibration As Of Date",
            "type": "string",
            "nullable": true
          },
          "transfer_note": {
            "title": "Transfer Note",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "hierarchy_level",
          "level_rationale",
          "technique",
          "technique_rationale",
          "principal_market",
          "market_participant_assumptions",
          "observable_inputs",
          "unobservable_inputs",
          "calibration_source"
        ],
        "title": "FairValueCompliance",
        "description": "Full fair-value compliance record for a single valuation.\n\nBundles hierarchy classification, valuation technique, principal-market\ndetermination, market-participant assumptions, calibration lineage, and\nthe observable / unobservable input inventories required by ASC 820 and\nIFRS 13."
      },
      "FcaLookupResponse": {
        "properties": {
          "firm_reference_number": {
            "type": "string",
            "title": "Firm Reference Number"
          },
          "status": {
            "$ref": "#/components/schemas/FcaLookupStatus"
          },
          "firm_name": {
            "title": "Firm Name",
            "type": "string",
            "nullable": true
          },
          "permissions": {
            "title": "Permissions",
            "items": {
              "type": "string"
            },
            "type": "array",
            "nullable": true
          },
          "unavailable_reason": {
            "title": "Unavailable Reason",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "firm_reference_number",
          "status"
        ],
        "title": "FcaLookupResponse"
      },
      "FcaLookupStatus": {
        "type": "string",
        "enum": [
          "authorised",
          "eea_passporting",
          "cancelled",
          "not_found",
          "lookup_unavailable"
        ],
        "title": "FcaLookupStatus"
      },
      "FeatureOverrideRequest": {
        "properties": {
          "feature": {
            "type": "string",
            "title": "Feature"
          },
          "action": {
            "type": "string",
            "title": "Action"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "feature",
          "action"
        ],
        "title": "FeatureOverrideRequest"
      },
      "FeesSpec": {
        "properties": {
          "oid_pct": {
            "type": "number",
            "maximum": 20.0,
            "minimum": 0.0,
            "title": "Oid Pct",
            "default": 0.0
          },
          "upfront_fee_pct": {
            "type": "number",
            "maximum": 20.0,
            "minimum": 0.0,
            "title": "Upfront Fee Pct",
            "default": 0.0
          },
          "exit_fee_pct": {
            "type": "number",
            "maximum": 20.0,
            "minimum": 0.0,
            "title": "Exit Fee Pct",
            "default": 0.0
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "FeesSpec"
      },
      "FetchFilingsRequest": {
        "properties": {
          "company_number": {
            "title": "Company Number",
            "description": "Start here instead of searching by name.",
            "type": "string",
            "nullable": true
          },
          "query": {
            "title": "Query",
            "description": "Search term; defaults to the deal's borrower_name.",
            "type": "string",
            "nullable": true
          },
          "limit": {
            "type": "integer",
            "maximum": 5.0,
            "minimum": 1.0,
            "title": "Limit",
            "description": "How many of the latest group accounts filings to store.",
            "default": 1
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "FetchFilingsRequest"
      },
      "FetchFilingsResponse": {
        "properties": {
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "filer": {
            "$ref": "#/components/schemas/ResolvedFiler"
          },
          "filings": {
            "items": {
              "$ref": "#/components/schemas/FilingRef"
            },
            "type": "array",
            "title": "Filings"
          },
          "stored": {
            "items": {
              "$ref": "#/components/schemas/StoredFiling"
            },
            "type": "array",
            "title": "Stored"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_id",
          "filer",
          "filings",
          "stored"
        ],
        "title": "FetchFilingsResponse"
      },
      "FilingDraftResponse": {
        "properties": {
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "draft": {
            "title": "Draft",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          },
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "description": "Whether this deployment has the ingest switched on; the UI hides the controls otherwise.",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_id"
        ],
        "title": "FilingDraftResponse"
      },
      "FilingPeriodOut": {
        "properties": {
          "period": {
            "type": "string",
            "title": "Period"
          },
          "filings": {
            "type": "integer",
            "title": "Filings"
          },
          "holdings": {
            "type": "integer",
            "title": "Holdings"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "period",
          "filings",
          "holdings"
        ],
        "title": "FilingPeriodOut",
        "description": "One reporting period contributing to a composite vintage. A vintage\npools each filer's most recent filing, so periods normally differ from\nthe anchor date, which selects the CDS leg only."
      },
      "FilingRef": {
        "properties": {
          "document_id": {
            "type": "string",
            "title": "Document Id"
          },
          "filed_on": {
            "title": "Filed On",
            "type": "string",
            "nullable": true
          },
          "made_up_to": {
            "title": "Made Up To",
            "type": "string",
            "nullable": true
          },
          "accounts_type": {
            "title": "Accounts Type",
            "description": "Parsed from the filing description, e.g. 'group'.",
            "type": "string",
            "nullable": true
          },
          "description": {
            "title": "Description",
            "type": "string",
            "nullable": true
          },
          "transaction_id": {
            "title": "Transaction Id",
            "type": "string",
            "nullable": true
          },
          "filing_history_url": {
            "title": "Filing History Url",
            "description": "Public find-and-update document URL \u2014 the citable one.",
            "type": "string",
            "nullable": true
          },
          "content_types": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Content Types",
            "description": "document-api resources; 'application/pdf' only means scanned."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "document_id"
        ],
        "title": "FilingRef",
        "description": "One accounts filing as the register lists it."
      },
      "FinancialPeriod": {
        "properties": {
          "year": {
            "type": "integer",
            "title": "Year",
            "description": "Fiscal year (e.g. 2024) or 0 for LTM"
          },
          "revenue": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Revenue",
            "description": "Total revenue USD"
          },
          "ebitda": {
            "type": "number",
            "title": "Ebitda",
            "description": "EBITDA USD (can be negative)"
          },
          "total_debt": {
            "type": "number",
            "minimum": 0.0,
            "title": "Total Debt",
            "description": "Total debt outstanding USD"
          },
          "cash": {
            "type": "number",
            "minimum": 0.0,
            "title": "Cash",
            "description": "Cash & equivalents USD",
            "default": 0.0
          },
          "capex": {
            "title": "Capex",
            "description": "Capital expenditures USD",
            "type": "number",
            "nullable": true
          },
          "interest_expense": {
            "title": "Interest Expense",
            "description": "Cash interest expense USD",
            "type": "number",
            "minimum": 0.0,
            "nullable": true
          },
          "accounts_receivable": {
            "title": "Accounts Receivable",
            "description": "Accounts receivable USD",
            "type": "number",
            "minimum": 0.0,
            "nullable": true
          },
          "inventory": {
            "title": "Inventory",
            "description": "Inventory USD",
            "type": "number",
            "minimum": 0.0,
            "nullable": true
          },
          "ppe": {
            "title": "Ppe",
            "description": "Property, plant & equipment (net) USD",
            "type": "number",
            "minimum": 0.0,
            "nullable": true
          },
          "goodwill": {
            "title": "Goodwill",
            "description": "Goodwill & acquired intangibles USD",
            "type": "number",
            "minimum": 0.0,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "year",
          "revenue",
          "ebitda",
          "total_debt"
        ],
        "title": "FinancialPeriod",
        "description": "One year of financial data (LTM or a fiscal year)."
      },
      "FittedBreakpointsOut": {
        "properties": {
          "factor_name": {
            "type": "string",
            "title": "Factor Name"
          },
          "breakpoints": {
            "items": {
              "type": "number"
            },
            "type": "array",
            "title": "Breakpoints"
          },
          "scores": {
            "items": {
              "type": "number"
            },
            "type": "array",
            "title": "Scores"
          },
          "r_squared": {
            "type": "number",
            "title": "R Squared"
          },
          "n_observations": {
            "type": "integer",
            "title": "N Observations"
          },
          "monotone_direction": {
            "type": "string",
            "title": "Monotone Direction"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "factor_name",
          "breakpoints",
          "scores",
          "r_squared",
          "n_observations",
          "monotone_direction"
        ],
        "title": "FittedBreakpointsOut"
      },
      "FittedWeightsOut": {
        "properties": {
          "weights": {
            "additionalProperties": {
              "type": "number"
            },
            "type": "object",
            "title": "Weights"
          },
          "log_likelihood": {
            "type": "number",
            "title": "Log Likelihood"
          },
          "aic": {
            "type": "number",
            "title": "Aic"
          },
          "n_observations": {
            "type": "integer",
            "title": "N Observations"
          },
          "confidence_intervals": {
            "additionalProperties": {
              "items": {
                "type": "number"
              },
              "type": "array"
            },
            "type": "object",
            "title": "Confidence Intervals"
          },
          "intercept": {
            "type": "number",
            "title": "Intercept"
          },
          "scale": {
            "type": "number",
            "title": "Scale"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "weights",
          "log_likelihood",
          "aic",
          "n_observations",
          "confidence_intervals",
          "intercept",
          "scale"
        ],
        "title": "FittedWeightsOut"
      },
      "FixedRateSpec": {
        "properties": {
          "coupon_bps": {
            "type": "integer",
            "maximum": 5000.0,
            "minimum": 0.0,
            "title": "Coupon Bps"
          },
          "pik": {
            "$ref": "#/components/schemas/PIKSpec",
            "nullable": true
          },
          "step_ups": {
            "items": {
              "$ref": "#/components/schemas/StepUp"
            },
            "type": "array",
            "title": "Step Ups"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "coupon_bps"
        ],
        "title": "FixedRateSpec"
      },
      "FloatingRateSpec": {
        "properties": {
          "index": {
            "type": "string",
            "title": "Index"
          },
          "spread_bps": {
            "type": "integer",
            "maximum": 5000.0,
            "minimum": 0.0,
            "title": "Spread Bps"
          },
          "floor_bps": {
            "type": "integer",
            "maximum": 2000.0,
            "minimum": 0.0,
            "title": "Floor Bps",
            "default": 0
          },
          "floor_basis": {
            "$ref": "#/components/schemas/FloorBasis",
            "description": "Whether floor_bps/cap_bps apply to the benchmark (INDEX, the usual credit-agreement convention) or to the total coupon (ALL_IN).",
            "default": "ALL_IN"
          },
          "cap_bps": {
            "title": "Cap Bps",
            "type": "integer",
            "maximum": 5000.0,
            "minimum": 0.0,
            "nullable": true
          },
          "reset_frequency": {
            "$ref": "#/components/schemas/ResetFrequency"
          },
          "pik": {
            "$ref": "#/components/schemas/PIKSpec",
            "nullable": true
          },
          "step_ups": {
            "items": {
              "$ref": "#/components/schemas/StepUp"
            },
            "type": "array",
            "title": "Step Ups"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "index",
          "spread_bps",
          "reset_frequency"
        ],
        "title": "FloatingRateSpec"
      },
      "FloorBasis": {
        "type": "string",
        "enum": [
          "ALL_IN",
          "INDEX"
        ],
        "title": "FloorBasis",
        "description": "What the floor (and cap) on a floating facility applies to.\n\nINDEX  \u2014 floor/cap the benchmark before adding the spread, i.e.\n         all-in = max(index, floor) + spread. This is the standard\n         credit-agreement convention (\"SOFR, subject to a 1.00% floor\").\nALL_IN \u2014 floor/cap the total coupon, i.e. all-in = max(index + spread, floor).\n\nDefaults to ALL_IN because that is the behaviour the engine has always had;\nexisting deals must keep pricing bit-identically. New deals entered from a\nterm sheet should almost always use INDEX."
      },
      "FoldResultOut": {
        "properties": {
          "fold": {
            "type": "integer",
            "title": "Fold"
          },
          "auc_roc": {
            "type": "number",
            "title": "Auc Roc"
          },
          "auc_pr": {
            "type": "number",
            "title": "Auc Pr"
          },
          "brier_score": {
            "type": "number",
            "title": "Brier Score"
          },
          "n_train": {
            "type": "integer",
            "title": "N Train"
          },
          "n_test": {
            "type": "integer",
            "title": "N Test"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "fold",
          "auc_roc",
          "auc_pr",
          "brier_score",
          "n_train",
          "n_test"
        ],
        "title": "FoldResultOut"
      },
      "ForgotRequest": {
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "email"
        ],
        "title": "ForgotRequest"
      },
      "ForgotResponse": {
        "properties": {
          "ok": {
            "type": "boolean",
            "title": "Ok"
          },
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "ok",
          "message"
        ],
        "title": "ForgotResponse"
      },
      "FragilityResponse": {
        "properties": {
          "assumption": {
            "type": "string",
            "title": "Assumption"
          },
          "shock": {
            "type": "string",
            "title": "Shock"
          },
          "stressed_pv": {
            "type": "number",
            "title": "Stressed Pv"
          },
          "swing": {
            "type": "number",
            "title": "Swing"
          },
          "source": {
            "type": "string",
            "title": "Source"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "assumption",
          "shock",
          "stressed_pv",
          "swing",
          "source"
        ],
        "title": "FragilityResponse"
      },
      "FromDealRequest": {
        "properties": {
          "deal_version_id": {
            "type": "string",
            "title": "Deal Version Id"
          },
          "market_env_ref": {
            "type": "string",
            "title": "Market Env Ref",
            "default": "AS-LIVE-DEFAULT"
          },
          "credit_basis": {
            "$ref": "#/components/schemas/CreditBasisState",
            "nullable": true
          },
          "valuation_date": {
            "type": "string",
            "format": "date",
            "title": "Valuation Date"
          },
          "persist": {
            "type": "boolean",
            "title": "Persist",
            "default": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_version_id",
          "valuation_date"
        ],
        "title": "FromDealRequest"
      },
      "FullValuationRequest": {
        "properties": {
          "deal_id": {
            "type": "string",
            "title": "Deal Id",
            "description": "Deal ID in the database"
          },
          "market_env_ref": {
            "type": "string",
            "title": "Market Env Ref",
            "description": "Market environment assumption set id (was: assumption_set_id).",
            "default": "AS-LIVE-DEFAULT"
          },
          "credit_basis": {
            "description": "Credit basis override. None -> resolver derives default (mark_to_model if anchor-capable).",
            "$ref": "#/components/schemas/CreditBasisState",
            "nullable": true
          },
          "valuation_date": {
            "type": "string",
            "format": "date",
            "title": "Valuation Date",
            "description": "Valuation date"
          },
          "persist": {
            "type": "boolean",
            "title": "Persist",
            "description": "False = compute-on-open headline recompute (D-08), no write, sandbox-safe.",
            "default": true
          },
          "extract_from_documents": {
            "type": "boolean",
            "title": "Extract From Documents",
            "description": "Run LLM extraction on deal documents. If False, uses persisted credit inputs.",
            "default": true
          },
          "credit_inputs": {
            "title": "Credit Inputs",
            "description": "Optional pre-supplied FundamentalCreditInputs \u2014 skips both extraction and persisted inputs.",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          },
          "doc_ids": {
            "title": "Doc Ids",
            "description": "Specific doc IDs to extract from (defaults to all deal documents).",
            "items": {
              "type": "string"
            },
            "type": "array",
            "nullable": true
          },
          "commit": {
            "type": "boolean",
            "title": "Commit",
            "description": "Persist LLM-extracted credit inputs back to the deal (observations.financials). Default false: extracted values are previewed in the response and the caller must explicitly opt in to write \u2014 preserves the published methodology that generative output never feeds the pricing path without a user decision. Has no effect when inputs_source is 'provided' or 'persisted'.",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_id",
          "valuation_date"
        ],
        "title": "FullValuationRequest",
        "description": "Request for full pipeline valuation: LLM extraction + credit model + DCF."
      },
      "FullValuationResponse": {
        "properties": {
          "credit_inputs": {
            "additionalProperties": true,
            "type": "object",
            "title": "Credit Inputs",
            "description": "FundamentalCreditInputs used for analysis"
          },
          "credit_result": {
            "additionalProperties": true,
            "type": "object",
            "title": "Credit Result",
            "description": "FundamentalCreditResult from credit model"
          },
          "valuation": {
            "$ref": "#/components/schemas/ValuationRecord",
            "description": "Full valuation record using borrower-specific credit"
          },
          "inputs_source": {
            "type": "string",
            "title": "Inputs Source",
            "description": "'extracted' | 'persisted' | 'provided'"
          },
          "extraction_usage": {
            "title": "Extraction Usage",
            "description": "LLM token usage if extraction ran",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings"
          },
          "committed": {
            "type": "boolean",
            "title": "Committed",
            "description": "True iff the extracted credit inputs were persisted to the deal (observations.financials) on this call. False when the caller passed commit=false (preview), when inputs_source != 'extracted', or when the persist failed (see warnings).",
            "default": false
          },
          "requires_user_acceptance": {
            "type": "boolean",
            "title": "Requires User Acceptance",
            "description": "True when the response carries AI-extracted values that have NOT been persisted. The caller MUST surface a review / accept step before treating the price as authoritative.",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "credit_inputs",
          "credit_result",
          "valuation",
          "inputs_source"
        ],
        "title": "FullValuationResponse",
        "description": "Response bundling credit analysis + valuation record."
      },
      "FundHomeSummary": {
        "properties": {
          "fund_id": {
            "type": "string",
            "title": "Fund Id"
          },
          "fund_name": {
            "type": "string",
            "title": "Fund Name"
          },
          "total_aum_usd": {
            "type": "number",
            "title": "Total Aum Usd"
          },
          "active_aum_usd": {
            "type": "number",
            "title": "Active Aum Usd"
          },
          "deal_count": {
            "type": "integer",
            "title": "Deal Count"
          },
          "avg_wam_years": {
            "type": "number",
            "title": "Avg Wam Years"
          },
          "wtd_spread_bps": {
            "type": "number",
            "title": "Wtd Spread Bps"
          },
          "by_asset_type": {
            "items": {
              "$ref": "#/components/schemas/AssetTypeSlice"
            },
            "type": "array",
            "title": "By Asset Type"
          },
          "by_geography": {
            "items": {
              "$ref": "#/components/schemas/GeographySlice"
            },
            "type": "array",
            "title": "By Geography"
          },
          "by_sector": {
            "items": {
              "$ref": "#/components/schemas/SectorSlice"
            },
            "type": "array",
            "title": "By Sector"
          },
          "by_seniority": {
            "items": {
              "$ref": "#/components/schemas/SenioritySlice"
            },
            "type": "array",
            "title": "By Seniority"
          },
          "by_rating": {
            "items": {
              "$ref": "#/components/schemas/RatingSlice"
            },
            "type": "array",
            "title": "By Rating"
          },
          "top_10_single_names": {
            "items": {
              "$ref": "#/components/schemas/SingleNameRow"
            },
            "type": "array",
            "title": "Top 10 Single Names"
          },
          "mandate_breaches": {
            "items": {
              "$ref": "#/components/schemas/MandateBreach"
            },
            "type": "array",
            "title": "Mandate Breaches"
          },
          "fx_unconverted": {
            "items": {
              "$ref": "#/components/schemas/FxUnconvertedSlice"
            },
            "type": "array",
            "title": "Fx Unconverted"
          },
          "pending_exceptions_count": {
            "type": "integer",
            "title": "Pending Exceptions Count",
            "default": 0
          },
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Generated At"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "fund_id",
          "fund_name",
          "total_aum_usd",
          "active_aum_usd",
          "deal_count",
          "avg_wam_years",
          "wtd_spread_bps"
        ],
        "title": "FundHomeSummary",
        "description": "Computed summary rendered on the fund-scoped home page."
      },
      "FundMembershipRequest": {
        "properties": {
          "fund_id": {
            "type": "string",
            "title": "Fund Id"
          },
          "role": {
            "type": "string",
            "title": "Role",
            "default": "viewer"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "fund_id"
        ],
        "title": "FundMembershipRequest"
      },
      "FundamentalCreditInputs": {
        "properties": {
          "financials": {
            "items": {
              "$ref": "#/components/schemas/FinancialPeriod"
            },
            "type": "array",
            "title": "Financials",
            "description": "Historical financial periods, chronological order"
          },
          "enterprise_value": {
            "title": "Enterprise Value",
            "description": "Current enterprise value USD (analyst estimate or market)",
            "type": "number",
            "exclusiveMinimum": 0.0,
            "nullable": true
          },
          "ev_multiple": {
            "title": "Ev Multiple",
            "description": "EV/EBITDA multiple to derive EV from LTM EBITDA if EV not provided",
            "type": "number",
            "exclusiveMinimum": 0.0,
            "nullable": true
          },
          "ev_estimate": {
            "description": "Computed EV band from one of the three EV approaches (GPCA/GTA/DCF). When present, ev_estimate.ev_mid is used as EV ahead of ev_multiple x EBITDA but behind an explicit enterprise_value.",
            "$ref": "#/components/schemas/EVEstimate",
            "nullable": true
          },
          "capital_structure": {
            "items": {
              "$ref": "#/components/schemas/Tranche"
            },
            "type": "array",
            "title": "Capital Structure",
            "description": "All tranches in the capital structure ordered by seniority_rank"
          },
          "projections": {
            "items": {
              "$ref": "#/components/schemas/RevenueProjection"
            },
            "type": "array",
            "title": "Projections",
            "description": "Forward revenue/margin projections for time-varying PD"
          },
          "liquidity": {
            "description": "Undrawn committed facilities, liquid investments, restricted cash and next-twelve-month uses. Drives liquidity runway, the rating-model liquidity notch and the multi-factor liquidity factor.",
            "$ref": "#/components/schemas/LiquidityInputs",
            "nullable": true
          },
          "rating_override": {
            "title": "Rating Override",
            "description": "Optional S&P-style rating override (e.g. 'BB', 'B+') bypassing model",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "FundamentalCreditInputs",
        "description": "All inputs needed for the four fundamental credit analyses.\nEvery field is optional so callers can provide only what they have."
      },
      "FundamentalCreditResult": {
        "properties": {
          "implied_rating": {
            "title": "Implied Rating",
            "type": "string",
            "nullable": true
          },
          "leverage_ratio": {
            "title": "Leverage Ratio",
            "type": "number",
            "nullable": true
          },
          "interest_coverage": {
            "title": "Interest Coverage",
            "type": "number",
            "nullable": true
          },
          "pd_term_structure": {
            "items": {
              "$ref": "#/components/schemas/PDTermPoint"
            },
            "type": "array",
            "title": "Pd Term Structure"
          },
          "available_liquidity": {
            "title": "Available Liquidity",
            "type": "number",
            "nullable": true
          },
          "liquidity_runway_months": {
            "title": "Liquidity Runway Months",
            "type": "number",
            "nullable": true
          },
          "liquidity_to_debt_service_x": {
            "title": "Liquidity To Debt Service X",
            "type": "number",
            "nullable": true
          },
          "liquidity_notches": {
            "type": "integer",
            "title": "Liquidity Notches",
            "default": 0
          },
          "liquidity_hazard_multipliers": {
            "items": {
              "type": "number"
            },
            "type": "array",
            "title": "Liquidity Hazard Multipliers"
          },
          "enterprise_value_used": {
            "title": "Enterprise Value Used",
            "type": "number",
            "nullable": true
          },
          "waterfall": {
            "items": {
              "$ref": "#/components/schemas/WaterfallTranche"
            },
            "type": "array",
            "title": "Waterfall"
          },
          "subject_recovery_rate": {
            "title": "Subject Recovery Rate",
            "type": "number",
            "nullable": true
          },
          "suggested_hazard_term": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Suggested Hazard Term",
            "description": "[{tenor_years, hazard_rate}] from PD term structure"
          },
          "suggested_recovery_rate": {
            "title": "Suggested Recovery Rate",
            "type": "number",
            "nullable": true
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "FundamentalCreditResult",
        "description": "Aggregated output from all four credit analyses."
      },
      "FxQuoteOut": {
        "properties": {
          "currency": {
            "type": "string",
            "title": "Currency",
            "description": "ISO 4217 code of the quoted currency"
          },
          "rate": {
            "type": "number",
            "title": "Rate",
            "description": "Units of the base currency per one unit of this currency. Multiply an amount in this currency by `rate` to express it in the base."
          },
          "usd_per_unit": {
            "type": "number",
            "title": "Usd Per Unit",
            "description": "Normalised pivot quote: USD per one unit of this currency"
          },
          "obs_date": {
            "type": "string",
            "title": "Obs Date",
            "description": "Observation date the quote is pinned to (ISO date)"
          },
          "series_id": {
            "title": "Series Id",
            "description": "FRED series the quote came from; null for the USD pivot",
            "type": "string",
            "nullable": true
          },
          "business_days_old": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Business Days Old",
            "description": "Business days between obs_date and as_of"
          },
          "is_stale": {
            "type": "boolean",
            "title": "Is Stale",
            "description": "True when older than the H.10 weekly cadence allows"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "currency",
          "rate",
          "usd_per_unit",
          "obs_date",
          "business_days_old",
          "is_stale"
        ],
        "title": "FxQuoteOut",
        "description": "One currency's rate against the requested base, with provenance."
      },
      "FxRatesResponse": {
        "properties": {
          "base": {
            "type": "string",
            "title": "Base",
            "description": "Base (reporting) currency every rate is expressed in"
          },
          "as_of": {
            "type": "string",
            "title": "As Of",
            "description": "As-of date the table is pinned to (ISO date)"
          },
          "source": {
            "type": "string",
            "title": "Source",
            "description": "Data source and licence"
          },
          "rates": {
            "additionalProperties": {
              "$ref": "#/components/schemas/FxQuoteOut"
            },
            "type": "object",
            "title": "Rates",
            "description": "Quotes keyed by currency; always includes the base itself at rate 1.0"
          },
          "unavailable": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Unavailable",
            "description": "Requested currencies with no observation on or before as_of"
          },
          "supported": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Supported",
            "description": "Every currency the service can quote"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "base",
          "as_of",
          "source",
          "rates",
          "supported"
        ],
        "title": "FxRatesResponse"
      },
      "FxUnconvertedSlice": {
        "properties": {
          "currency": {
            "type": "string",
            "title": "Currency",
            "description": "ISO 4217 code, or UNKNOWN when the deal has none"
          },
          "deal_count": {
            "type": "integer",
            "title": "Deal Count"
          },
          "notional": {
            "type": "number",
            "title": "Notional",
            "description": "Raw sum in that currency \u2014 not converted"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "currency",
          "deal_count",
          "notional"
        ],
        "title": "FxUnconvertedSlice",
        "description": "Deals left out of the USD totals because their currency has no FX rate."
      },
      "GeographySlice": {
        "properties": {
          "geography": {
            "type": "string",
            "title": "Geography"
          },
          "notional": {
            "type": "number",
            "title": "Notional"
          },
          "pct": {
            "type": "number",
            "title": "Pct"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "geography",
          "notional",
          "pct"
        ],
        "title": "GeographySlice"
      },
      "GuaranteeOut": {
        "properties": {
          "insurer_name": {
            "type": "string",
            "title": "Insurer Name"
          },
          "covered_tranche": {
            "type": "string",
            "title": "Covered Tranche"
          },
          "guaranteed_pct": {
            "type": "number",
            "title": "Guaranteed Pct"
          },
          "guaranteed_notional": {
            "type": "number",
            "title": "Guaranteed Notional"
          },
          "premium_bps": {
            "title": "Premium Bps",
            "type": "integer",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "insurer_name",
          "covered_tranche",
          "guaranteed_pct",
          "guaranteed_notional"
        ],
        "title": "GuaranteeOut"
      },
      "HTTPValidationError": {
        "title": "ErrorEnvelope",
        "description": "Juno standard error envelope \u2014 see app/models/envelope.py (ApiResponse.err).",
        "type": "object",
        "required": [
          "status",
          "error"
        ],
        "properties": {
          "status": {
            "type": "string"
          },
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "detail": {}
            }
          }
        }
      },
      "HardcodedBoundsOut": {
        "properties": {
          "tight_bps": {
            "type": "integer",
            "title": "Tight Bps"
          },
          "wide_bps": {
            "type": "integer",
            "title": "Wide Bps"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "tight_bps",
          "wide_bps"
        ],
        "title": "HardcodedBoundsOut"
      },
      "HazardSegment": {
        "properties": {
          "start_year": {
            "type": "number",
            "minimum": 0.0,
            "title": "Start Year"
          },
          "end_year": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "End Year"
          },
          "hazard_pa": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Hazard Pa"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "start_year",
          "end_year",
          "hazard_pa"
        ],
        "title": "HazardSegment"
      },
      "HealthCheckResult": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "checks": {
            "items": {},
            "type": "array",
            "title": "Checks"
          },
          "errors_last_hour": {
            "type": "integer",
            "title": "Errors Last Hour"
          },
          "errors_last_24h": {
            "type": "integer",
            "title": "Errors Last 24H"
          },
          "recurring_issues": {
            "type": "integer",
            "title": "Recurring Issues"
          },
          "top_failing_endpoints": {
            "items": {},
            "type": "array",
            "title": "Top Failing Endpoints"
          }
        },
        "type": "object",
        "required": [
          "status",
          "checks",
          "errors_last_hour",
          "errors_last_24h",
          "recurring_issues",
          "top_failing_endpoints"
        ],
        "title": "HealthCheckResult"
      },
      "HistogramBucket": {
        "properties": {
          "bucket_min": {
            "type": "number",
            "title": "Bucket Min"
          },
          "bucket_max": {
            "type": "number",
            "title": "Bucket Max"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          },
          "frequency": {
            "type": "number",
            "title": "Frequency",
            "description": "count / n_paths"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "bucket_min",
          "bucket_max",
          "count",
          "frequency"
        ],
        "title": "HistogramBucket",
        "description": "Single histogram bin for the PV distribution."
      },
      "HistoryItem": {
        "properties": {
          "role": {
            "type": "string",
            "title": "Role"
          },
          "content": {
            "type": "string",
            "title": "Content"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "role",
          "content"
        ],
        "title": "HistoryItem"
      },
      "ICMemoRequest": {
        "properties": {
          "format": {
            "type": "string",
            "enum": [
              "pdf",
              "docx"
            ],
            "title": "Format",
            "description": "Output format. Default 'pdf'.",
            "default": "pdf"
          },
          "fund_id": {
            "title": "Fund Id",
            "description": "Fund whose branding (logo + accent + footer) to apply.",
            "type": "string",
            "nullable": true
          },
          "as_of": {
            "title": "As Of",
            "description": "Replay anchor \u2014 if set, the IC memo regenerates against the valuation run pinned to this market-data as-of-date. Bit-identical on the playwright path (MARKET-03 reproducibility).",
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "run_id": {
            "title": "Run Id",
            "description": "Explicit valuation run ID. Overrides ``as_of`` when both set.",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ICMemoRequest"
      },
      "IlliquidBondOverrides": {
        "properties": {
          "credit_spread_tight_bps": {
            "title": "Credit Spread Tight Bps",
            "type": "integer",
            "nullable": true
          },
          "credit_spread_wide_bps": {
            "title": "Credit Spread Wide Bps",
            "type": "integer",
            "nullable": true
          },
          "illiquidity_prem_tight_bps": {
            "title": "Illiquidity Prem Tight Bps",
            "type": "integer",
            "nullable": true
          },
          "illiquidity_prem_wide_bps": {
            "title": "Illiquidity Prem Wide Bps",
            "type": "integer",
            "nullable": true
          },
          "seniority_secured_bps": {
            "title": "Seniority Secured Bps",
            "type": "integer",
            "nullable": true
          },
          "seniority_unsecured_bps": {
            "title": "Seniority Unsecured Bps",
            "type": "integer",
            "nullable": true
          },
          "seniority_subordinated_bps": {
            "title": "Seniority Subordinated Bps",
            "type": "integer",
            "nullable": true
          },
          "duration_factor": {
            "title": "Duration Factor",
            "type": "number",
            "nullable": true
          },
          "cycle": {
            "$ref": "#/components/schemas/CycleOverrides",
            "nullable": true
          },
          "scoring": {
            "$ref": "#/components/schemas/ScoringOverrides",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "IlliquidBondOverrides"
      },
      "IlliquidBondRequest": {
        "properties": {
          "strategy": {
            "type": "string",
            "title": "Strategy"
          },
          "net_leverage": {
            "type": "number",
            "maximum": 20.0,
            "minimum": 0.0,
            "title": "Net Leverage"
          },
          "interest_coverage": {
            "type": "number",
            "maximum": 20.0,
            "minimum": 0.0,
            "title": "Interest Coverage"
          },
          "fcf_conversion": {
            "type": "number",
            "maximum": 2.0,
            "minimum": 0.0,
            "title": "Fcf Conversion"
          },
          "seniority": {
            "type": "string",
            "enum": [
              "senior_secured",
              "senior_unsecured",
              "subordinated"
            ],
            "title": "Seniority",
            "default": "senior_unsecured"
          },
          "sector": {
            "type": "string",
            "enum": [
              "defensive",
              "cyclical",
              "financial",
              "real_assets",
              "other"
            ],
            "title": "Sector",
            "default": "other"
          },
          "bid_ask_spread_bps": {
            "type": "number",
            "maximum": 1000.0,
            "minimum": 0.0,
            "title": "Bid Ask Spread Bps"
          },
          "outstanding_notional_bn": {
            "type": "number",
            "maximum": 100.0,
            "minimum": 0.0,
            "title": "Outstanding Notional Bn"
          },
          "covenant_package": {
            "type": "string",
            "enum": [
              "maintenance",
              "incurrence",
              "covenant_lite"
            ],
            "title": "Covenant Package",
            "default": "incurrence"
          },
          "origination_spread_bps": {
            "type": "integer",
            "maximum": 5000.0,
            "minimum": 0.0,
            "title": "Origination Spread Bps"
          },
          "remaining_maturity_years": {
            "type": "number",
            "maximum": 30.0,
            "minimum": 0.0,
            "title": "Remaining Maturity Years"
          },
          "coupon_rate": {
            "type": "number",
            "maximum": 0.5,
            "minimum": 0.0,
            "title": "Coupon Rate"
          },
          "cycle_stage": {
            "type": "string",
            "enum": [
              "early",
              "mid",
              "late",
              "distressed"
            ],
            "title": "Cycle Stage",
            "default": "mid"
          },
          "issuer_size_bn": {
            "type": "number",
            "maximum": 500.0,
            "minimum": 0.0,
            "title": "Issuer Size Bn",
            "default": 1.0
          },
          "rating_category": {
            "type": "string",
            "enum": [
              "aaa",
              "aa",
              "a",
              "bbb",
              "bb",
              "b",
              "ccc"
            ],
            "title": "Rating Category",
            "default": "bb"
          },
          "has_change_of_control": {
            "type": "boolean",
            "title": "Has Change Of Control",
            "default": true
          },
          "liquidity_runway_months": {
            "title": "Liquidity Runway Months",
            "description": "Months of issuer liquidity runway. None (default) excludes the Liquidity factor and renormalises the remaining weights.",
            "type": "number",
            "maximum": 120.0,
            "minimum": 0.0,
            "nullable": true
          },
          "overrides": {
            "$ref": "#/components/schemas/IlliquidBondOverrides",
            "nullable": true
          },
          "use_dcf": {
            "type": "boolean",
            "title": "Use Dcf",
            "default": false
          },
          "market": {
            "type": "string",
            "enum": [
              "USD",
              "GBP",
              "EUR",
              "CUSTOM"
            ],
            "title": "Market",
            "default": "USD"
          },
          "calibration_params": {
            "$ref": "#/components/schemas/CustomCalibrationParams",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "strategy",
          "net_leverage",
          "interest_coverage",
          "fcf_conversion",
          "bid_ask_spread_bps",
          "outstanding_notional_bn",
          "origination_spread_bps",
          "remaining_maturity_years",
          "coupon_rate"
        ],
        "title": "IlliquidBondRequest"
      },
      "IlliquidBondResponse": {
        "properties": {
          "strategy": {
            "type": "string",
            "title": "Strategy"
          },
          "composite": {
            "$ref": "#/components/schemas/CompositeScoreOut"
          },
          "waterfall": {
            "$ref": "#/components/schemas/SpreadWaterfallOut"
          },
          "fair_value_spread_bps": {
            "type": "integer",
            "title": "Fair Value Spread Bps"
          },
          "fair_value_price": {
            "type": "number",
            "title": "Fair Value Price"
          },
          "spread_delta_vs_origination_bps": {
            "type": "number",
            "title": "Spread Delta Vs Origination Bps"
          },
          "duration_years": {
            "type": "number",
            "title": "Duration Years"
          },
          "z_spread_equivalent_bps": {
            "type": "number",
            "title": "Z Spread Equivalent Bps"
          },
          "liquidity_adj_yield_pct": {
            "type": "number",
            "title": "Liquidity Adj Yield Pct"
          },
          "implied_rating": {
            "type": "string",
            "title": "Implied Rating"
          },
          "dcf_price": {
            "title": "Dcf Price",
            "type": "number",
            "nullable": true
          },
          "calibration_market": {
            "type": "string",
            "title": "Calibration Market",
            "default": "USD"
          },
          "calibration_effective_date": {
            "type": "string",
            "format": "date",
            "title": "Calibration Effective Date",
            "default": "2025-01-01"
          },
          "calibration_warning": {
            "title": "Calibration Warning",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "strategy",
          "composite",
          "waterfall",
          "fair_value_spread_bps",
          "fair_value_price",
          "spread_delta_vs_origination_bps",
          "duration_years",
          "z_spread_equivalent_bps",
          "liquidity_adj_yield_pct",
          "implied_rating"
        ],
        "title": "IlliquidBondResponse"
      },
      "IlliquidBondWeights": {
        "properties": {
          "leverage": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Leverage",
            "description": "Net leverage weight",
            "default": 0.18
          },
          "coverage": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Coverage",
            "description": "Interest coverage weight",
            "default": 0.13
          },
          "fcf_conv": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Fcf Conv",
            "description": "FCF conversion weight",
            "default": 0.09
          },
          "sector": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Sector",
            "description": "Sector weight",
            "default": 0.09
          },
          "bid_ask": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Bid Ask",
            "description": "Bid-ask spread (liquidity) weight",
            "default": 0.14
          },
          "issue_size": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Issue Size",
            "description": "Outstanding issue size weight",
            "default": 0.1
          },
          "covenant": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Covenant",
            "description": "Covenant package weight",
            "default": 0.1
          },
          "duration_risk": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Duration Risk",
            "description": "Duration risk weight",
            "default": 0.08
          },
          "issuer_size": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Issuer Size",
            "description": "Issuer size weight",
            "default": 0.05
          },
          "rating_category": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Rating Category",
            "description": "Rating category weight (0 = informational only)",
            "default": 0.0
          },
          "coc_protection": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Coc Protection",
            "description": "Change-of-control put weight",
            "default": 0.04
          },
          "liquidity": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Liquidity",
            "description": "Liquidity runway weight (scored only when runway is known)",
            "default": 0.06
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "IlliquidBondWeights",
        "description": "Factor weights for the Illiquid Public Bond composite score.\nrating_category is informational by default (weight 0) and only enters the composite when given weight."
      },
      "ImpairmentReview": {
        "properties": {
          "review_date": {
            "type": "string",
            "format": "date",
            "title": "Review Date"
          },
          "reviewer_name": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "title": "Reviewer Name"
          },
          "responses": {
            "items": {
              "$ref": "#/components/schemas/ConsiderationResponse"
            },
            "type": "array",
            "title": "Responses"
          },
          "notes": {
            "type": "string",
            "maxLength": 4000,
            "title": "Notes",
            "default": ""
          },
          "review_id": {
            "type": "string",
            "title": "Review Id"
          },
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "recorded_at": {
            "type": "string",
            "format": "date-time",
            "title": "Recorded At"
          },
          "is_impaired": {
            "type": "boolean",
            "title": "Is Impaired",
            "description": "True iff any consideration response is a BREACH.",
            "readOnly": true
          },
          "suggested_approach": {
            "type": "string",
            "enum": [
              "yield",
              "recovery",
              "liquidation"
            ],
            "title": "Suggested Approach",
            "description": "Route .\n\n* No breach anywhere -> yield\n* Insolvency breached -> liquidation\n* Any other breach (insolvency clean) -> recovery",
            "readOnly": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "review_date",
          "reviewer_name",
          "responses",
          "review_id",
          "deal_id",
          "is_impaired",
          "suggested_approach"
        ],
        "title": "ImpairmentReview",
        "description": "Read model: stored review with computed impairment routing."
      },
      "ImpairmentReviewIn": {
        "properties": {
          "review_date": {
            "type": "string",
            "format": "date",
            "title": "Review Date"
          },
          "reviewer_name": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "title": "Reviewer Name"
          },
          "responses": {
            "items": {
              "$ref": "#/components/schemas/ConsiderationResponse"
            },
            "type": "array",
            "title": "Responses"
          },
          "notes": {
            "type": "string",
            "maxLength": 4000,
            "title": "Notes",
            "default": ""
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "review_date",
          "reviewer_name",
          "responses"
        ],
        "title": "ImpairmentReviewIn",
        "description": "Request body for ``POST /deals/{deal_id}/impairment-review``.\n\nThe reviewer must submit a verdict for all five considerations \u2014 no\ngaps, no duplicates. This is enforced by a model-level validator so the\nAPI surface fails loud on malformed payloads."
      },
      "ImportPublicFinancialsRequest": {
        "properties": {
          "financials": {
            "additionalProperties": true,
            "type": "object",
            "title": "Financials"
          },
          "provenance": {
            "additionalProperties": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "object",
            "title": "Provenance"
          },
          "year": {
            "title": "Year",
            "type": "integer",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "financials"
        ],
        "title": "ImportPublicFinancialsRequest"
      },
      "ImportPublicFinancialsResponse": {
        "properties": {
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "period_year": {
            "type": "integer",
            "title": "Period Year"
          },
          "fields_imported": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Fields Imported"
          },
          "provenance_keys": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Provenance Keys"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_id",
          "period_year",
          "fields_imported",
          "provenance_keys"
        ],
        "title": "ImportPublicFinancialsResponse"
      },
      "InboxCountResponse": {
        "properties": {
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "counts_by_kind": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Counts By Kind"
          },
          "counts_by_severity": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Counts By Severity"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Generated At"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "total",
          "generated_at"
        ],
        "title": "InboxCountResponse",
        "description": "Sidebar-badge payload returned by ``GET /inbox/count``."
      },
      "InboxResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ExceptionItem"
            },
            "type": "array",
            "title": "Items"
          },
          "counts_by_kind": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Counts By Kind"
          },
          "counts_by_severity": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Counts By Severity"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Generated At"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "items",
          "generated_at"
        ],
        "title": "InboxResponse",
        "description": "Envelope returned by ``GET /inbox``."
      },
      "InputRef": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "value": {
            "title": "Value",
            "type": "string",
            "nullable": true
          },
          "source": {
            "type": "string",
            "title": "Source"
          },
          "as_of_date": {
            "title": "As Of Date",
            "type": "string",
            "nullable": true
          },
          "is_observable": {
            "type": "boolean",
            "title": "Is Observable"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name",
          "source",
          "is_observable"
        ],
        "title": "InputRef",
        "description": "Reference to a single valuation input.\n\nAn input is 'observable' when derived from a market-observable source\n(quoted prices, published indices, broker quotes, benchmark curves)."
      },
      "InsurerOverrideOut": {
        "properties": {
          "pd_to_maturity": {
            "title": "Pd To Maturity",
            "type": "number",
            "nullable": true
          },
          "rating": {
            "title": "Rating",
            "type": "string",
            "nullable": true
          },
          "premium_bps": {
            "title": "Premium Bps",
            "type": "integer",
            "nullable": true
          },
          "note": {
            "title": "Note",
            "type": "string",
            "nullable": true
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "InsurerOverrideOut"
      },
      "InsurerViewOut": {
        "properties": {
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "borrower_name": {
            "type": "string",
            "title": "Borrower Name"
          },
          "valuation_date": {
            "type": "string",
            "title": "Valuation Date"
          },
          "capital_structure": {
            "title": "Capital Structure",
            "type": "string",
            "nullable": true
          },
          "fair_value_per_100": {
            "type": "number",
            "title": "Fair Value Per 100"
          },
          "fair_value_insurer_per_100": {
            "title": "Fair Value Insurer Per 100",
            "type": "number",
            "nullable": true
          },
          "pd_to_maturity_model": {
            "type": "number",
            "title": "Pd To Maturity Model"
          },
          "pd_to_maturity_insurer": {
            "title": "Pd To Maturity Insurer",
            "type": "number",
            "nullable": true
          },
          "pd_term_structure": {
            "items": {
              "$ref": "#/components/schemas/PdTermPoint"
            },
            "type": "array",
            "title": "Pd Term Structure"
          },
          "recovery_rate": {
            "type": "number",
            "title": "Recovery Rate"
          },
          "lgd": {
            "type": "number",
            "title": "Lgd"
          },
          "expected_loss_pct": {
            "type": "number",
            "title": "Expected Loss Pct"
          },
          "expected_loss_amount": {
            "type": "number",
            "title": "Expected Loss Amount"
          },
          "expected_loss_basis": {
            "type": "string",
            "title": "Expected Loss Basis"
          },
          "premium_bps": {
            "title": "Premium Bps",
            "type": "integer",
            "nullable": true
          },
          "premium_basis": {
            "title": "Premium Basis",
            "type": "string",
            "nullable": true
          },
          "premium_income_amount": {
            "title": "Premium Income Amount",
            "type": "number",
            "nullable": true
          },
          "net_underwriting_amount": {
            "title": "Net Underwriting Amount",
            "type": "number",
            "nullable": true
          },
          "guarantee": {
            "$ref": "#/components/schemas/GuaranteeOut",
            "nullable": true
          },
          "override": {
            "$ref": "#/components/schemas/InsurerOverrideOut",
            "nullable": true
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_id",
          "borrower_name",
          "valuation_date",
          "fair_value_per_100",
          "pd_to_maturity_model",
          "pd_term_structure",
          "recovery_rate",
          "lgd",
          "expected_loss_pct",
          "expected_loss_amount",
          "expected_loss_basis"
        ],
        "title": "InsurerViewOut"
      },
      "InvoiceOut": {
        "properties": {
          "invoice_id": {
            "type": "string",
            "title": "Invoice Id"
          },
          "plan_name": {
            "type": "string",
            "title": "Plan Name"
          },
          "amount_usd": {
            "type": "number",
            "title": "Amount Usd"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "period_start": {
            "type": "string",
            "title": "Period Start"
          },
          "period_end": {
            "type": "string",
            "title": "Period End"
          },
          "issued_at": {
            "type": "string",
            "title": "Issued At"
          },
          "paid_at": {
            "title": "Paid At",
            "type": "string",
            "nullable": true
          }
        },
        "type": "object",
        "required": [
          "invoice_id",
          "plan_name",
          "amount_usd",
          "status",
          "period_start",
          "period_end",
          "issued_at"
        ],
        "title": "InvoiceOut"
      },
      "LabelledObservationIn": {
        "properties": {
          "factor_inputs": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string"
                }
              ]
            },
            "type": "object",
            "title": "Factor Inputs"
          },
          "defaulted": {
            "type": "boolean",
            "title": "Defaulted"
          },
          "recovery_rate": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Recovery Rate",
            "default": 0.0
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "factor_inputs",
          "defaulted"
        ],
        "title": "LabelledObservationIn",
        "description": "A single labelled default observation for empirical calibration.\n\nfactor_inputs keys must match DirectLendingInputs field names.\nNumeric factors take float values; categorical factors (covenant_strength,\nsponsor_quality, industry_risk, management_quality) take their string labels."
      },
      "LadderRequest": {
        "properties": {
          "valuation_date": {
            "type": "string",
            "format": "date",
            "title": "Valuation Date"
          },
          "deal_version_id": {
            "type": "string",
            "title": "Deal Version Id"
          },
          "assumption_set_version_id": {
            "type": "string",
            "title": "Assumption Set Version Id"
          },
          "parameter": {
            "type": "string",
            "title": "Parameter",
            "description": "One of: spread_bps, hazard_multiplier, recovery_rate, rate_bps"
          },
          "shocks": {
            "items": {
              "type": "number"
            },
            "type": "array",
            "maxItems": 50,
            "minItems": 1,
            "title": "Shocks",
            "description": "List of shock values (e.g. [-100, -50, 0, 50, 100])"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "valuation_date",
          "deal_version_id",
          "assumption_set_version_id",
          "parameter",
          "shocks"
        ],
        "title": "LadderRequest"
      },
      "LiquidationInputs": {
        "properties": {
          "lines": {
            "items": {
              "$ref": "#/components/schemas/BalanceSheetLine"
            },
            "type": "array",
            "minItems": 1,
            "title": "Lines",
            "description": "Balance-sheet lines with line-item recovery rates"
          },
          "liquidation_discount_pct": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Liquidation Discount Pct",
            "description": "Global forced-sale haircut 0\u20131 applied after line recovery",
            "default": 0.0
          },
          "scenario": {
            "type": "string",
            "enum": [
              "downside",
              "base",
              "upside"
            ],
            "title": "Scenario",
            "description": "Scenario modifier for reporting",
            "default": "base"
          },
          "notes": {
            "title": "Notes",
            "description": "Analyst notes on the liquidation assumption set",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "lines"
        ],
        "title": "LiquidationInputs",
        "description": "Payload for the liquidation approach.\n\n``liquidation_discount_pct`` is applied ONCE on the sum of line-item\n``recoverable_amount``s to reflect forced-sale time & cost on top of the\nline-item haircuts."
      },
      "LiquidityInputs": {
        "properties": {
          "undrawn_committed_facilities": {
            "type": "number",
            "minimum": 0.0,
            "title": "Undrawn Committed Facilities",
            "description": "Undrawn committed RCF / DDTL availability at the balance-sheet date",
            "default": 0.0
          },
          "undrawn_availability_haircut": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Undrawn Availability Haircut",
            "description": "Share of the undrawn line that is genuinely drawable (1.0 = fully available; lower for springing covenants, borrowing-base limits or conditions precedent)",
            "default": 1.0
          },
          "undrawn_maturity_years": {
            "title": "Undrawn Maturity Years",
            "description": "Years to maturity of the undrawn line; lines due within one year do not count toward runway",
            "type": "number",
            "minimum": 0.0,
            "nullable": true
          },
          "liquid_investments": {
            "type": "number",
            "minimum": 0.0,
            "title": "Liquid Investments",
            "description": "Marketable securities / short-term investments readily convertible to cash",
            "default": 0.0
          },
          "restricted_cash": {
            "type": "number",
            "minimum": 0.0,
            "title": "Restricted Cash",
            "description": "Portion of reported cash that is restricted (escrow, collateral, trapped)",
            "default": 0.0
          },
          "mandatory_amortisation_12m": {
            "type": "number",
            "minimum": 0.0,
            "title": "Mandatory Amortisation 12M",
            "description": "Scheduled principal repayments due in the next twelve months",
            "default": 0.0
          },
          "working_capital_outflow_12m": {
            "type": "number",
            "minimum": 0.0,
            "title": "Working Capital Outflow 12M",
            "description": "Expected net working-capital investment over the next twelve months",
            "default": 0.0
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "LiquidityInputs",
        "description": "Borrower liquidity beyond balance-sheet cash.\n\nCash itself lives on FinancialPeriod (and already nets into leverage).\nThis block carries what the going-concern pipeline could not see before:\nundrawn committed lines, liquid investments, restricted cash, and the\nnext-twelve-month uses that turn a liquidity stock into a runway. See\napp/engine/liquidity_runway.py for the derivation. All money fields share\nFinancialPeriod's units."
      },
      "LoanTerms": {
        "properties": {
          "notional": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Notional"
          },
          "currency": {
            "type": "string",
            "title": "Currency",
            "default": "USD"
          },
          "start_date": {
            "type": "string",
            "format": "date",
            "title": "Start Date"
          },
          "maturity_date": {
            "type": "string",
            "format": "date",
            "title": "Maturity Date"
          },
          "payment_frequency": {
            "type": "string",
            "enum": [
              "MONTHLY",
              "QUARTERLY",
              "SEMI_ANNUAL",
              "ANNUAL"
            ],
            "title": "Payment Frequency"
          },
          "day_count": {
            "type": "string",
            "enum": [
              "ACT/360",
              "ACT/365",
              "30/360"
            ],
            "title": "Day Count"
          },
          "rate_type": {
            "type": "string",
            "enum": [
              "FIXED",
              "FLOATING"
            ],
            "title": "Rate Type"
          },
          "fixed_rate_bps": {
            "title": "Fixed Rate Bps",
            "type": "integer",
            "maximum": 50000.0,
            "minimum": -5000.0,
            "nullable": true
          },
          "margin_bps": {
            "title": "Margin Bps",
            "type": "integer",
            "maximum": 50000.0,
            "minimum": -5000.0,
            "nullable": true
          },
          "floor_bps": {
            "title": "Floor Bps",
            "default": 0,
            "type": "integer",
            "maximum": 50000.0,
            "minimum": -5000.0,
            "nullable": true
          },
          "floor_basis": {
            "type": "string",
            "enum": [
              "ALL_IN",
              "INDEX"
            ],
            "title": "Floor Basis",
            "default": "ALL_IN"
          },
          "principal_type": {
            "type": "string",
            "title": "Principal Type",
            "default": "BULLET"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "notional",
          "start_date",
          "maturity_date",
          "payment_frequency",
          "day_count",
          "rate_type"
        ],
        "title": "LoanTerms"
      },
      "LoginRequest": {
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          },
          "password": {
            "type": "string",
            "title": "Password"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "email",
          "password"
        ],
        "title": "LoginRequest"
      },
      "LoginResponse": {
        "properties": {
          "ok": {
            "type": "boolean",
            "title": "Ok"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "must_change_password": {
            "type": "boolean",
            "title": "Must Change Password"
          },
          "ttl_seconds": {
            "type": "integer",
            "title": "Ttl Seconds"
          },
          "nda_required": {
            "type": "boolean",
            "title": "Nda Required",
            "default": false
          },
          "nda_redirect": {
            "title": "Nda Redirect",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "ok",
          "user_id",
          "email",
          "name",
          "role",
          "must_change_password",
          "ttl_seconds"
        ],
        "title": "LoginResponse"
      },
      "LpiTerms": {
        "properties": {
          "security_lien": {
            "$ref": "#/components/schemas/SecurityLienEnum",
            "nullable": true
          },
          "covenant_type": {
            "$ref": "#/components/schemas/CovenantTypeEnum",
            "nullable": true
          },
          "call_protection": {
            "$ref": "#/components/schemas/CallProtectionEnum",
            "nullable": true
          },
          "portability": {
            "$ref": "#/components/schemas/PortabilityEnum",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "LpiTerms",
        "description": "Structured capture of the four settable LPI term dimensions on a facility.\n\nAll four fields are Optional so that existing deals load cleanly through\ndeal_from_blob under ConfigDict(extra=\"forbid\"). A field set to None means\nthat dimension has not yet been captured; the scoring engine will mark it\nUnset and withhold the composite until all four are populated."
      },
      "MandateBreach": {
        "properties": {
          "limit": {
            "$ref": "#/components/schemas/MandateLimit"
          },
          "observed_pct": {
            "type": "number",
            "title": "Observed Pct",
            "description": "Observed share of AUM (0\u20131)"
          },
          "observed_notional": {
            "type": "number",
            "title": "Observed Notional"
          },
          "severity": {
            "type": "string",
            "enum": [
              "info",
              "warn",
              "breach"
            ],
            "title": "Severity"
          },
          "surfaced_at": {
            "type": "string",
            "format": "date-time",
            "title": "Surfaced At"
          },
          "contributing_deals": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Contributing Deals"
          },
          "fund_id": {
            "title": "Fund Id",
            "description": "Originating fund_id \u2014 only populated when the breach is part of a cross-fund consolidated rollup. Per-fund views leave this as None because the container is already fund-scoped.",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "limit",
          "observed_pct",
          "observed_notional",
          "severity"
        ],
        "title": "MandateBreach",
        "description": "A live comparison of observed exposure to a mandate limit."
      },
      "MandateKind": {
        "type": "string",
        "enum": [
          "SINGLE_NAME",
          "SECTOR",
          "GEOGRAPHY",
          "ASSET_TYPE",
          "SENIORITY",
          "RATING_BUCKET"
        ],
        "title": "MandateKind",
        "description": "The axis along which a mandate limit applies."
      },
      "MandateLimit": {
        "properties": {
          "limit_id": {
            "type": "string",
            "title": "Limit Id",
            "description": "LM-XXXXXXXX identifier"
          },
          "fund_id": {
            "type": "string",
            "title": "Fund Id"
          },
          "kind": {
            "$ref": "#/components/schemas/MandateKind"
          },
          "target": {
            "type": "string",
            "title": "Target",
            "description": "The specific category being limited (borrower, sector name, geography, etc.). Use '*' to apply to the aggregate bucket."
          },
          "max_pct_of_aum": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Max Pct Of Aum",
            "description": "Concentration ceiling, expressed as fraction of AUM"
          },
          "max_notional_usd": {
            "title": "Max Notional Usd",
            "description": "Optional absolute notional cap",
            "type": "number",
            "minimum": 0.0,
            "nullable": true
          },
          "floor_pct_of_aum": {
            "title": "Floor Pct Of Aum",
            "description": "Optional minimum allocation (e.g. minimum senior secured %)",
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "nullable": true
          },
          "notes": {
            "type": "string",
            "title": "Notes",
            "default": ""
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "created_by": {
            "type": "string",
            "title": "Created By",
            "default": ""
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "limit_id",
          "fund_id",
          "kind",
          "target",
          "max_pct_of_aum"
        ],
        "title": "MandateLimit",
        "description": "A single concentration / floor rule attached to a fund."
      },
      "ManualInvoiceRequest": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "plan_id": {
            "type": "string",
            "title": "Plan Id"
          },
          "amount_usd": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Amount Usd"
          },
          "period_start": {
            "type": "string",
            "title": "Period Start"
          },
          "period_end": {
            "type": "string",
            "title": "Period End"
          },
          "note": {
            "title": "Note",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "user_id",
          "plan_id",
          "amount_usd",
          "period_start",
          "period_end"
        ],
        "title": "ManualInvoiceRequest"
      },
      "ManualOverrides": {
        "properties": {
          "spread_bps": {
            "type": "number",
            "maximum": 5000.0,
            "minimum": -500.0,
            "title": "Spread Bps",
            "description": "Hand-set effective spread in bps (overrides calibrated anchor)."
          },
          "recovery_rate": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Recovery Rate"
          },
          "recovery_lag_months": {
            "type": "integer",
            "maximum": 60.0,
            "minimum": 0.0,
            "title": "Recovery Lag Months",
            "default": 0
          },
          "default_timing": {
            "$ref": "#/components/schemas/DefaultTiming",
            "default": "MID_PERIOD"
          },
          "prepayment_cpr": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Prepayment Cpr",
            "default": 0.0
          },
          "hazard_term": {
            "items": {
              "$ref": "#/components/schemas/HazardSegment"
            },
            "type": "array",
            "title": "Hazard Term",
            "description": "Optional hand-set hazard term structure. Empty list means the engine will use recovery_rate only."
          },
          "reason": {
            "title": "Reason",
            "description": "Analyst note explaining the manual override.",
            "type": "string",
            "maxLength": 500,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "spread_bps",
          "recovery_rate"
        ],
        "title": "ManualOverrides",
        "description": "Full hand-mark for manual_override Credit Basis.\n\nMirrors the hazard/recovery shape from CreditAssumptions so the engine\ncan price without an AssumptionSet. spread_bps is in basis points."
      },
      "MarkComparison": {
        "properties": {
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "verus": {
            "$ref": "#/components/schemas/VerusMarkPoint",
            "nullable": true
          },
          "marks": {
            "items": {
              "$ref": "#/components/schemas/ExternalMarkComparison"
            },
            "type": "array",
            "title": "Marks"
          },
          "n_external": {
            "type": "integer",
            "title": "N External",
            "default": 0
          },
          "dispersion_pts": {
            "title": "Dispersion Pts",
            "description": "Max minus min across every comparable price, Verus included.",
            "type": "number",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_id"
        ],
        "title": "MarkComparison"
      },
      "MarkEntry": {
        "properties": {
          "bdc_cik": {
            "type": "string",
            "title": "Bdc Cik"
          },
          "bdc_name": {
            "type": "string",
            "title": "Bdc Name"
          },
          "period_of_report": {
            "type": "string",
            "title": "Period Of Report"
          },
          "fair_value": {
            "title": "Fair Value",
            "type": "number",
            "nullable": true
          },
          "cost": {
            "title": "Cost",
            "type": "number",
            "nullable": true
          },
          "principal_amount": {
            "title": "Principal Amount",
            "type": "number",
            "nullable": true
          },
          "mark_pct": {
            "title": "Mark Pct",
            "type": "number",
            "nullable": true
          },
          "spread_bps": {
            "title": "Spread Bps",
            "type": "number",
            "nullable": true
          },
          "investment_type": {
            "title": "Investment Type",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "bdc_cik",
          "bdc_name",
          "period_of_report",
          "fair_value",
          "cost",
          "principal_amount",
          "mark_pct",
          "spread_bps",
          "investment_type"
        ],
        "title": "MarkEntry"
      },
      "MarketAssumptions": {
        "properties": {
          "risk_free_curve": {
            "$ref": "#/components/schemas/CurveSpec"
          },
          "index_curve": {
            "$ref": "#/components/schemas/CurveSpec",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "risk_free_curve"
        ],
        "title": "MarketAssumptions"
      },
      "MarketContextOut": {
        "properties": {
          "hy_oas_bps": {
            "type": "integer",
            "title": "Hy Oas Bps"
          },
          "market_env": {
            "type": "string",
            "title": "Market Env"
          },
          "bb_oas_bps": {
            "type": "integer",
            "title": "Bb Oas Bps"
          },
          "b_oas_bps": {
            "type": "integer",
            "title": "B Oas Bps"
          },
          "bbb_oas_bps": {
            "type": "integer",
            "title": "Bbb Oas Bps"
          },
          "ccc_oas_bps": {
            "type": "integer",
            "title": "Ccc Oas Bps"
          },
          "as_of_date": {
            "type": "string",
            "title": "As Of Date"
          },
          "is_fallback": {
            "type": "boolean",
            "title": "Is Fallback"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "hy_oas_bps",
          "market_env",
          "bb_oas_bps",
          "b_oas_bps",
          "bbb_oas_bps",
          "ccc_oas_bps",
          "as_of_date",
          "is_fallback",
          "warnings"
        ],
        "title": "MarketContextOut"
      },
      "MarketData": {
        "properties": {
          "valuation_date": {
            "type": "string",
            "format": "date",
            "title": "Valuation Date"
          },
          "forward_rate": {
            "type": "number",
            "maximum": 0.5,
            "minimum": -0.05,
            "title": "Forward Rate",
            "default": 0.0
          },
          "anchor_spread_bps": {
            "type": "integer",
            "maximum": 50000.0,
            "minimum": -5000.0,
            "title": "Anchor Spread Bps"
          },
          "ois_curve": {
            "title": "Ois Curve",
            "items": {
              "$ref": "#/components/schemas/OISCurveRow"
            },
            "type": "array",
            "minItems": 1,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "valuation_date",
          "anchor_spread_bps"
        ],
        "title": "MarketData"
      },
      "MarkstFactorTraceRow": {
        "properties": {
          "factor_name": {
            "type": "string",
            "title": "Factor Name"
          },
          "deal_value": {
            "type": "string",
            "title": "Deal Value"
          },
          "cell_median": {
            "type": "string",
            "title": "Cell Median"
          },
          "delta_bps": {
            "type": "number",
            "title": "Delta Bps"
          },
          "note": {
            "title": "Note",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "factor_name",
          "deal_value",
          "cell_median",
          "delta_bps"
        ],
        "title": "MarkstFactorTraceRow",
        "description": "One named contribution in the Markst factor calibration trace.\n\nSums of `delta_bps` across all rows equal `markst_factor_delta_bps`\non the parent ValuationRecord. Each row is a named factor (e.g.\n\"Leverage\", \"Sector adjustment\") with the deal's value, the cell\nmedian (or base level for categoricals), and the resulting bps.\nAuditable: `delta_bps = coefficient \u00d7 (deal_value \u2212 cell_median)`\nfor numeric features, or the dummy coefficient for categoricals."
      },
      "MatchConfidenceTier": {
        "properties": {
          "tier": {
            "type": "string",
            "enum": [
              "high",
              "medium",
              "low"
            ],
            "title": "Tier"
          },
          "score": {
            "type": "number",
            "maximum": 100.0,
            "minimum": 85.0,
            "title": "Score",
            "description": "The max match_confidence score across matched holdings (OQ-3)."
          },
          "label": {
            "type": "string",
            "title": "Label",
            "description": "Short badge label e.g. \"High match \u00b7 96%\", \"Medium match \u00b7 92%\"."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "tier",
          "score",
          "label"
        ],
        "title": "MatchConfidenceTier",
        "description": "UI badge tier \u2014 D-12 thresholds (\u226595 high, 90-94 medium, 85-89 low)."
      },
      "MatchedHolding": {
        "properties": {
          "bdc_cik": {
            "type": "string",
            "title": "Bdc Cik"
          },
          "bdc_name": {
            "type": "string",
            "title": "Bdc Name"
          },
          "accession_number": {
            "type": "string",
            "title": "Accession Number"
          },
          "filing_url": {
            "type": "string",
            "title": "Filing Url"
          },
          "period_of_report": {
            "type": "string",
            "title": "Period Of Report"
          },
          "investment_type": {
            "title": "Investment Type",
            "type": "string",
            "nullable": true
          },
          "fair_value": {
            "title": "Fair Value",
            "type": "number",
            "nullable": true
          },
          "cost": {
            "title": "Cost",
            "type": "number",
            "nullable": true
          },
          "principal_amount": {
            "title": "Principal Amount",
            "type": "number",
            "nullable": true
          },
          "spread_bps": {
            "title": "Spread Bps",
            "type": "number",
            "nullable": true
          },
          "match_confidence": {
            "type": "number",
            "maximum": 100.0,
            "minimum": 85.0,
            "title": "Match Confidence",
            "description": "Match confidence, range [85, 100]. Normally the rapidfuzz token_set_ratio score; always 100.0 when match_method is 'alias_map', where the match rests on a reviewed identity assertion rather than on a score."
          },
          "match_method": {
            "type": "string",
            "enum": [
              "token_set_ratio",
              "token_set_ratio+second_signal",
              "alias_map"
            ],
            "title": "Match Method",
            "description": "Engine method used to accept this match (OQ-1 vocabulary). Only accepted-match methods are included \u2014 'no_match', 'second_signal_failed' and 'distinctive_token_mismatch' rows are never surfaced in this list. 'alias_map' means an operator-curated obligor alias accepted it (issue #684): the pair scored below the fuzzy gate and a reviewed entry in bdc_match._OBLIGOR_ALIASES asserts the two names denote one obligor. It is called out separately so curation is never mistaken for inference."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "bdc_cik",
          "bdc_name",
          "accession_number",
          "filing_url",
          "period_of_report",
          "match_confidence",
          "match_method"
        ],
        "title": "MatchedHolding",
        "description": "One matched BDC holding surfaced to the UI variance panel (HARD-02)."
      },
      "MeResponse": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "must_change_password": {
            "type": "boolean",
            "title": "Must Change Password"
          },
          "has_password": {
            "type": "boolean",
            "title": "Has Password"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "user_id",
          "email",
          "name",
          "role",
          "status",
          "must_change_password",
          "has_password"
        ],
        "title": "MeResponse"
      },
      "MezzanineOverrides": {
        "properties": {
          "credit_spread_tight_bps": {
            "title": "Credit Spread Tight Bps",
            "type": "integer",
            "nullable": true
          },
          "credit_spread_wide_bps": {
            "title": "Credit Spread Wide Bps",
            "type": "integer",
            "nullable": true
          },
          "illiquidity_prem_tight_bps": {
            "title": "Illiquidity Prem Tight Bps",
            "type": "integer",
            "nullable": true
          },
          "illiquidity_prem_wide_bps": {
            "title": "Illiquidity Prem Wide Bps",
            "type": "integer",
            "nullable": true
          },
          "pik_multiplier": {
            "title": "Pik Multiplier",
            "type": "integer",
            "nullable": true
          },
          "warrant_multiplier": {
            "title": "Warrant Multiplier",
            "type": "integer",
            "nullable": true
          },
          "duration_factor": {
            "title": "Duration Factor",
            "type": "number",
            "nullable": true
          },
          "cycle": {
            "$ref": "#/components/schemas/CycleOverrides",
            "nullable": true
          },
          "scoring": {
            "$ref": "#/components/schemas/ScoringOverrides",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "MezzanineOverrides"
      },
      "MezzanineRequest": {
        "properties": {
          "strategy": {
            "type": "string",
            "title": "Strategy"
          },
          "total_net_debt_to_ebitda": {
            "type": "number",
            "maximum": 25.0,
            "minimum": 0.0,
            "title": "Total Net Debt To Ebitda"
          },
          "senior_debt_to_ebitda": {
            "type": "number",
            "maximum": 25.0,
            "minimum": 0.0,
            "title": "Senior Debt To Ebitda"
          },
          "ebitda_interest_coverage": {
            "type": "number",
            "maximum": 20.0,
            "minimum": 0.0,
            "title": "Ebitda Interest Coverage"
          },
          "fcf_conversion": {
            "type": "number",
            "maximum": 2.0,
            "minimum": 0.0,
            "title": "Fcf Conversion"
          },
          "revenue_growth_3y": {
            "type": "number",
            "maximum": 5.0,
            "minimum": -1.0,
            "title": "Revenue Growth 3Y"
          },
          "pik_percentage": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Pik Percentage"
          },
          "cash_coupon_rate": {
            "type": "number",
            "maximum": 0.5,
            "minimum": 0.0,
            "title": "Cash Coupon Rate"
          },
          "pik_coupon_rate": {
            "type": "number",
            "maximum": 0.5,
            "minimum": 0.0,
            "title": "Pik Coupon Rate"
          },
          "warrant_coverage": {
            "type": "number",
            "maximum": 0.3,
            "minimum": 0.0,
            "title": "Warrant Coverage",
            "default": 0.0
          },
          "subordination_depth_x_ebitda": {
            "type": "number",
            "maximum": 20.0,
            "minimum": 0.0,
            "title": "Subordination Depth X Ebitda"
          },
          "covenant_strength": {
            "type": "string",
            "enum": [
              "Tight",
              "Moderate",
              "Loose / Cov-Lite"
            ],
            "title": "Covenant Strength",
            "default": "Moderate"
          },
          "sponsor_quality": {
            "type": "string",
            "enum": [
              "Top Tier",
              "Mid Tier",
              "No Sponsor"
            ],
            "title": "Sponsor Quality",
            "default": "Mid Tier"
          },
          "industry_risk": {
            "type": "string",
            "enum": [
              "Low",
              "Moderate",
              "High",
              "Cyclical"
            ],
            "title": "Industry Risk",
            "default": "Moderate"
          },
          "origination_spread_bps": {
            "type": "integer",
            "maximum": 10000.0,
            "minimum": 0.0,
            "title": "Origination Spread Bps"
          },
          "remaining_maturity_years": {
            "type": "number",
            "maximum": 30.0,
            "minimum": 0.0,
            "title": "Remaining Maturity Years"
          },
          "cycle_stage": {
            "type": "string",
            "enum": [
              "early",
              "mid",
              "late",
              "distressed"
            ],
            "title": "Cycle Stage",
            "default": "mid"
          },
          "equity_cushion_pct": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Equity Cushion Pct",
            "default": 0.25
          },
          "exit_clarity": {
            "type": "string",
            "enum": [
              "clear",
              "likely",
              "unclear"
            ],
            "title": "Exit Clarity",
            "default": "likely"
          },
          "pik_mix_scored": {
            "type": "boolean",
            "title": "Pik Mix Scored",
            "default": true
          },
          "liquidity_runway_months": {
            "title": "Liquidity Runway Months",
            "description": "Months of liquidity runway. None (default) excludes the Liquidity factor and renormalises the remaining weights.",
            "type": "number",
            "maximum": 120.0,
            "minimum": 0.0,
            "nullable": true
          },
          "overrides": {
            "$ref": "#/components/schemas/MezzanineOverrides",
            "nullable": true
          },
          "use_dcf": {
            "type": "boolean",
            "title": "Use Dcf",
            "default": false
          },
          "market": {
            "type": "string",
            "enum": [
              "USD",
              "GBP",
              "EUR",
              "CUSTOM"
            ],
            "title": "Market",
            "default": "USD"
          },
          "calibration_params": {
            "$ref": "#/components/schemas/CustomCalibrationParams",
            "nullable": true
          },
          "anchor_spread_bps": {
            "title": "Anchor Spread Bps",
            "description": "Rating-model anchor spread (bps) \u2014 lookup_credit_curve mid on the mezzanine capital-structure row",
            "type": "number",
            "maximum": 5000.0,
            "minimum": 0.0,
            "nullable": true
          },
          "anchor_rating": {
            "title": "Anchor Rating",
            "description": "Rating the anchor was priced off (e.g. 'B-'); display/provenance only",
            "type": "string",
            "maxLength": 8,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "strategy",
          "total_net_debt_to_ebitda",
          "senior_debt_to_ebitda",
          "ebitda_interest_coverage",
          "fcf_conversion",
          "revenue_growth_3y",
          "pik_percentage",
          "cash_coupon_rate",
          "pik_coupon_rate",
          "subordination_depth_x_ebitda",
          "origination_spread_bps",
          "remaining_maturity_years"
        ],
        "title": "MezzanineRequest"
      },
      "MezzanineResponse": {
        "properties": {
          "strategy": {
            "type": "string",
            "title": "Strategy"
          },
          "composite": {
            "$ref": "#/components/schemas/CompositeScoreOut"
          },
          "waterfall": {
            "$ref": "#/components/schemas/SpreadWaterfallOut"
          },
          "fair_value_spread_bps": {
            "type": "integer",
            "title": "Fair Value Spread Bps"
          },
          "fair_value_price": {
            "type": "number",
            "title": "Fair Value Price"
          },
          "spread_delta_vs_origination_bps": {
            "type": "number",
            "title": "Spread Delta Vs Origination Bps"
          },
          "duration_years": {
            "type": "number",
            "title": "Duration Years"
          },
          "total_coupon_rate": {
            "type": "number",
            "title": "Total Coupon Rate"
          },
          "implied_rating": {
            "type": "string",
            "title": "Implied Rating"
          },
          "dcf_price": {
            "title": "Dcf Price",
            "type": "number",
            "nullable": true
          },
          "calibration_market": {
            "type": "string",
            "title": "Calibration Market",
            "default": "USD"
          },
          "calibration_effective_date": {
            "type": "string",
            "format": "date",
            "title": "Calibration Effective Date",
            "default": "2025-01-01"
          },
          "calibration_warning": {
            "title": "Calibration Warning",
            "type": "string",
            "nullable": true
          },
          "anchor_rating": {
            "title": "Anchor Rating",
            "type": "string",
            "nullable": true
          },
          "anchor_spread_bps": {
            "title": "Anchor Spread Bps",
            "type": "number",
            "nullable": true
          },
          "anchor_source": {
            "title": "Anchor Source",
            "type": "string",
            "nullable": true
          },
          "company_delta_bps": {
            "title": "Company Delta Bps",
            "type": "number",
            "nullable": true
          },
          "score_implied_rating": {
            "title": "Score Implied Rating",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "strategy",
          "composite",
          "waterfall",
          "fair_value_spread_bps",
          "fair_value_price",
          "spread_delta_vs_origination_bps",
          "duration_years",
          "total_coupon_rate",
          "implied_rating"
        ],
        "title": "MezzanineResponse"
      },
      "MezzanineWeights": {
        "properties": {
          "total_leverage": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Total Leverage",
            "description": "Total leverage weight",
            "default": 0.18
          },
          "senior_coverage": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Senior Coverage",
            "description": "Senior coverage weight",
            "default": 0.15
          },
          "coverage": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Coverage",
            "description": "Interest coverage weight",
            "default": 0.13
          },
          "fcf_conv": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Fcf Conv",
            "description": "FCF conversion weight",
            "default": 0.1
          },
          "growth": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Growth",
            "description": "Revenue growth weight",
            "default": 0.05
          },
          "subordination": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Subordination",
            "description": "Subordination depth weight",
            "default": 0.13
          },
          "covenant": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Covenant",
            "description": "Covenant strength weight",
            "default": 0.07
          },
          "sponsor": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Sponsor",
            "description": "Sponsor quality weight",
            "default": 0.06
          },
          "equity_cushion": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Equity Cushion",
            "description": "Equity cushion weight",
            "default": 0.12
          },
          "exit_clarity": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Exit Clarity",
            "description": "Exit clarity weight",
            "default": 0.09
          },
          "pik_mix": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Pik Mix",
            "description": "PIK mix weight",
            "default": 0.07
          },
          "liquidity": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Liquidity",
            "description": "Liquidity runway weight (scored only when runway is known)",
            "default": 0.06
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "MezzanineWeights",
        "description": "Factor weights for the Mezzanine / Subordinated Debt composite score."
      },
      "MonteCarloRequest": {
        "properties": {
          "deal_version_id": {
            "type": "string",
            "title": "Deal Version Id",
            "description": "Deal version ID"
          },
          "assumption_set_version_id": {
            "type": "string",
            "title": "Assumption Set Version Id",
            "description": "Assumption set version ID"
          },
          "valuation_date": {
            "type": "string",
            "format": "date",
            "title": "Valuation Date",
            "description": "Valuation date"
          },
          "n_paths": {
            "type": "integer",
            "maximum": 50000.0,
            "minimum": 10.0,
            "title": "N Paths",
            "description": "Number of simulation paths",
            "default": 1000
          },
          "horizon_years": {
            "type": "number",
            "maximum": 10.0,
            "exclusiveMinimum": 0.0,
            "title": "Horizon Years",
            "description": "Simulation horizon in years",
            "default": 1.0
          },
          "seed": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Seed",
            "description": "Random seed for reproducibility",
            "default": 42
          },
          "rate_vol_bps": {
            "type": "number",
            "maximum": 1000.0,
            "minimum": 0.0,
            "title": "Rate Vol Bps",
            "description": "Interest rate volatility (bps)",
            "default": 100.0
          },
          "spread_vol_bps": {
            "type": "number",
            "maximum": 500.0,
            "minimum": 0.0,
            "title": "Spread Vol Bps",
            "description": "Credit spread volatility (bps)",
            "default": 50.0
          },
          "default_intensity": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Default Intensity",
            "description": "Annual default intensity for Bernoulli default draw",
            "default": 0.02
          },
          "rate_spread_corr": {
            "type": "number",
            "maximum": 1.0,
            "minimum": -1.0,
            "title": "Rate Spread Corr",
            "description": "Correlation between rate and spread shocks",
            "default": 0.3
          },
          "recovery_rate_override": {
            "title": "Recovery Rate Override",
            "description": "Recovery rate for default paths (defaults to assumption set value)",
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "nullable": true
          },
          "confidence_levels": {
            "items": {
              "type": "number"
            },
            "type": "array",
            "title": "Confidence Levels",
            "description": "Confidence levels for VaR/CVaR (e.g. 0.95 = 95%)",
            "default": [
              0.95,
              0.99
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_version_id",
          "assumption_set_version_id",
          "valuation_date"
        ],
        "title": "MonteCarloRequest",
        "description": "Request for POST /value/monte-carlo."
      },
      "MonteCarloResponse": {
        "properties": {
          "run_id": {
            "type": "string",
            "title": "Run Id"
          },
          "n_paths": {
            "type": "integer",
            "title": "N Paths"
          },
          "seed": {
            "type": "integer",
            "title": "Seed"
          },
          "horizon_years": {
            "type": "number",
            "title": "Horizon Years"
          },
          "base_pv": {
            "type": "number",
            "title": "Base Pv",
            "description": "Deterministic base-case PV (no shocks)"
          },
          "mean_pv": {
            "type": "number",
            "title": "Mean Pv"
          },
          "std_pv": {
            "type": "number",
            "title": "Std Pv"
          },
          "min_pv": {
            "type": "number",
            "title": "Min Pv"
          },
          "max_pv": {
            "type": "number",
            "title": "Max Pv"
          },
          "median_pv": {
            "type": "number",
            "title": "Median Pv"
          },
          "skewness": {
            "type": "number",
            "title": "Skewness"
          },
          "default_rate_realised": {
            "type": "number",
            "title": "Default Rate Realised",
            "description": "Fraction of paths that experienced default"
          },
          "percentiles": {
            "additionalProperties": {
              "type": "number"
            },
            "type": "object",
            "title": "Percentiles",
            "description": "Key percentiles: p1, p5, p10, p25, p50, p75, p90, p95, p99"
          },
          "var_results": {
            "items": {
              "$ref": "#/components/schemas/VaRResult"
            },
            "type": "array",
            "title": "Var Results"
          },
          "histogram": {
            "items": {
              "$ref": "#/components/schemas/HistogramBucket"
            },
            "type": "array",
            "title": "Histogram"
          },
          "worst_paths": {
            "items": {
              "$ref": "#/components/schemas/PathResult"
            },
            "type": "array",
            "title": "Worst Paths",
            "description": "Worst 10 paths by PV"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "run_id",
          "n_paths",
          "seed",
          "horizon_years",
          "base_pv",
          "mean_pv",
          "std_pv",
          "min_pv",
          "max_pv",
          "median_pv",
          "skewness",
          "default_rate_realised",
          "percentiles",
          "var_results",
          "histogram",
          "worst_paths"
        ],
        "title": "MonteCarloResponse",
        "description": "Response for POST /value/monte-carlo."
      },
      "NextAction": {
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "missing_financials",
              "run_credit_analysis",
              "impairment_breach",
              "covenant_breach",
              "run_first_valuation",
              "stale_valuation",
              "pending_approval",
              "period_locked",
              "nominal"
            ],
            "title": "Kind"
          },
          "severity": {
            "type": "string",
            "enum": [
              "info",
              "warn",
              "critical"
            ],
            "title": "Severity"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "detail": {
            "type": "string",
            "title": "Detail"
          },
          "label": {
            "type": "string",
            "title": "Label"
          },
          "href": {
            "type": "string",
            "title": "Href"
          },
          "reason": {
            "type": "string",
            "title": "Reason",
            "default": ""
          },
          "tab_badges": {
            "additionalProperties": {
              "type": "string",
              "nullable": true
            },
            "type": "object",
            "title": "Tab Badges",
            "default": {}
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "kind",
          "severity",
          "title",
          "detail",
          "label",
          "href"
        ],
        "title": "NextAction",
        "description": "Single recommended next step on a deal's workflow arc."
      },
      "NoteDetail": {
        "properties": {
          "note_id": {
            "type": "string",
            "title": "Note Id"
          },
          "user_id": {
            "title": "User Id",
            "type": "string",
            "nullable": true
          },
          "title": {
            "title": "Title",
            "type": "string",
            "nullable": true
          },
          "markdown": {
            "type": "string",
            "title": "Markdown"
          },
          "source_deal_id": {
            "title": "Source Deal Id",
            "type": "string",
            "nullable": true
          },
          "source_run_id": {
            "title": "Source Run Id",
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "title": "Updated At"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "note_id",
          "markdown",
          "created_at",
          "updated_at"
        ],
        "title": "NoteDetail"
      },
      "NoteSummary": {
        "properties": {
          "note_id": {
            "type": "string",
            "title": "Note Id"
          },
          "title": {
            "title": "Title",
            "type": "string",
            "nullable": true
          },
          "source_deal_id": {
            "title": "Source Deal Id",
            "type": "string",
            "nullable": true
          },
          "source_run_id": {
            "title": "Source Run Id",
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "title": "Updated At"
          },
          "preview": {
            "title": "Preview",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "note_id",
          "created_at",
          "updated_at"
        ],
        "title": "NoteSummary"
      },
      "OISCurveRow": {
        "properties": {
          "tenor_years": {
            "type": "number",
            "maximum": 50.0,
            "minimum": 0.001,
            "title": "Tenor Years"
          },
          "df": {
            "type": "number",
            "maximum": 1.0,
            "exclusiveMinimum": 0.0,
            "title": "Df"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "tenor_years",
          "df"
        ],
        "title": "OISCurveRow"
      },
      "Observations": {
        "properties": {
          "payment_history": {
            "items": {
              "$ref": "#/components/schemas/PaymentRecord"
            },
            "type": "array",
            "title": "Payment History"
          },
          "financials": {
            "description": "Fundamental credit inputs (financials, capital structure, projections). Legacy empty-list values are coerced to None.",
            "$ref": "#/components/schemas/FundamentalCreditInputs",
            "nullable": true
          },
          "financials_draft": {
            "title": "Financials Draft",
            "description": "Raw in-progress Borrower Fundamentals form state (may contain incomplete rows and UI-only flags). Autosaved by the frontend; not priced.",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          },
          "lpi_terms_draft": {
            "title": "Lpi Terms Draft",
            "description": "AI-extracted LPI term values (security_lien, covenant_type, call_protection, portability) pending analyst confirmation. Not scored; confirmed values are written to facility.lpi_terms by the analyst.",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          },
          "filing_extraction_draft": {
            "title": "Filing Extraction Draft",
            "description": "Companies House ingest state: the resolved group filer and the filing documents stored in the data room. The numbers are read by AI fill from the stored PDF; nothing here is priced.",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          },
          "covenants": {
            "items": {},
            "type": "array",
            "title": "Covenants"
          },
          "liquidation_inputs": {
            "title": "Liquidation Inputs",
            "description": "industry guidance liquidation analysis inputs \u2014 balance-sheet line items with recovery rates, liquidation discount, scenario tag. Shape validated by app.models.liquidation.LiquidationInputs.",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "Observations"
      },
      "OverlayStageRequest": {
        "properties": {
          "bucket": {
            "type": "string",
            "title": "Bucket"
          },
          "delta_bps": {
            "type": "number",
            "title": "Delta Bps"
          },
          "reason_code": {
            "type": "string",
            "title": "Reason Code"
          },
          "reason": {
            "type": "string",
            "title": "Reason"
          },
          "expires_on": {
            "type": "string",
            "title": "Expires On"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "bucket",
          "delta_bps",
          "reason_code",
          "reason",
          "expires_on"
        ],
        "title": "OverlayStageRequest"
      },
      "OverlayStateResponse": {
        "properties": {
          "vintage_id": {
            "title": "Vintage Id",
            "type": "string",
            "nullable": true
          },
          "active": {
            "items": {
              "$ref": "#/components/schemas/CurveOverlayOut"
            },
            "type": "array",
            "title": "Active"
          },
          "staged": {
            "items": {
              "$ref": "#/components/schemas/CurveOverlayOut"
            },
            "type": "array",
            "title": "Staged"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "active",
          "staged"
        ],
        "title": "OverlayStateResponse"
      },
      "PDTermPoint": {
        "properties": {
          "tenor_years": {
            "type": "number",
            "title": "Tenor Years"
          },
          "cumulative_pd": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Cumulative Pd"
          },
          "annual_hazard_rate": {
            "type": "number",
            "minimum": 0.0,
            "title": "Annual Hazard Rate"
          },
          "implied_rating": {
            "type": "string",
            "title": "Implied Rating"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "tenor_years",
          "cumulative_pd",
          "annual_hazard_rate",
          "implied_rating"
        ],
        "title": "PDTermPoint",
        "description": "Single point on the PD term structure."
      },
      "PIKSpec": {
        "properties": {
          "pik_pct": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Pik Pct",
            "description": "Fraction of interest paid as PIK (0=all cash, 1=all PIK)",
            "default": 0.0
          },
          "capitalise_to_notional": {
            "type": "boolean",
            "title": "Capitalise To Notional",
            "default": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "PIKSpec",
        "description": "PIK toggle: fraction of interest that accrues to notional vs pays cash."
      },
      "PacketApproval": {
        "properties": {
          "approval_id": {
            "type": "string",
            "title": "Approval Id"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "rejected"
            ],
            "title": "Status"
          },
          "submitted_by": {
            "type": "string",
            "title": "Submitted By"
          },
          "submitted_at": {
            "type": "string",
            "title": "Submitted At"
          },
          "reviewed_by": {
            "title": "Reviewed By",
            "type": "string",
            "nullable": true
          },
          "reviewed_at": {
            "title": "Reviewed At",
            "type": "string",
            "nullable": true
          },
          "reviewer_note": {
            "title": "Reviewer Note",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "approval_id",
          "status",
          "submitted_by",
          "submitted_at"
        ],
        "title": "PacketApproval"
      },
      "PartialExtractedInputs": {
        "properties": {
          "financials": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Financials",
            "default": []
          },
          "projections": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Projections",
            "default": []
          },
          "capital_structure": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Capital Structure",
            "default": []
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "PartialExtractedInputs",
        "description": "Rows the LLM returned with at least one field present but missing\none or more Pydantic-required fields. Surfaced separately from\n``inputs`` so the frontend can render them as placeholder rows in\nthe form for the user to complete \u2014 instead of silently dropping\nreal partial data.\n\nEach list item is the raw dict the LLM returned for that row, with\nnulls preserved (no defaulting). The frontend treats null/missing\nfields as empty form inputs the user fills in before clicking Run\nAnalysis."
      },
      "PatchDealRequest": {
        "properties": {
          "held_notional": {
            "title": "Held Notional",
            "description": "Fund's holding in this facility",
            "type": "number",
            "exclusiveMinimum": 0.0,
            "nullable": true
          },
          "status": {
            "title": "Status",
            "description": "ACTIVE | REPAID | DEFAULTED",
            "type": "string",
            "nullable": true
          },
          "borrower_name": {
            "title": "Borrower Name",
            "type": "string",
            "nullable": true
          },
          "sector": {
            "title": "Sector",
            "type": "string",
            "nullable": true
          },
          "jurisdiction": {
            "title": "Jurisdiction",
            "type": "string",
            "nullable": true
          },
          "currency": {
            "title": "Currency",
            "type": "string",
            "nullable": true
          },
          "origination_date": {
            "title": "Origination Date",
            "type": "string",
            "nullable": true
          },
          "maturity_date": {
            "title": "Maturity Date",
            "type": "string",
            "nullable": true
          },
          "day_count": {
            "title": "Day Count",
            "type": "string",
            "nullable": true
          },
          "business_day_convention": {
            "title": "Business Day Convention",
            "type": "string",
            "nullable": true
          },
          "payment_calendar": {
            "title": "Payment Calendar",
            "type": "string",
            "nullable": true
          },
          "ticker": {
            "title": "Ticker",
            "type": "string",
            "nullable": true
          },
          "isin": {
            "title": "Isin",
            "type": "string",
            "nullable": true
          },
          "facility": {
            "title": "Facility",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          },
          "observations": {
            "title": "Observations",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          },
          "metadata": {
            "title": "Metadata",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          },
          "credit_basis": {
            "$ref": "#/components/schemas/CreditBasisState",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "PatchDealRequest"
      },
      "PathResult": {
        "properties": {
          "path_index": {
            "type": "integer",
            "title": "Path Index"
          },
          "rate_shock_bps": {
            "type": "number",
            "title": "Rate Shock Bps"
          },
          "spread_shock_bps": {
            "type": "number",
            "title": "Spread Shock Bps"
          },
          "defaulted": {
            "type": "boolean",
            "title": "Defaulted"
          },
          "pv": {
            "type": "number",
            "title": "Pv"
          },
          "price_per_100": {
            "type": "number",
            "title": "Price Per 100"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "path_index",
          "rate_shock_bps",
          "spread_shock_bps",
          "defaulted",
          "pv",
          "price_per_100"
        ],
        "title": "PathResult",
        "description": "Summary of a single simulation path."
      },
      "PaymentFrequency": {
        "type": "string",
        "enum": [
          "MONTHLY",
          "QUARTERLY",
          "SEMI_ANNUAL",
          "ANNUAL"
        ],
        "title": "PaymentFrequency"
      },
      "PaymentRecord": {
        "properties": {
          "date": {
            "type": "string",
            "format": "date",
            "title": "Date"
          },
          "interest_paid": {
            "type": "number",
            "minimum": 0.0,
            "title": "Interest Paid",
            "default": 0.0
          },
          "principal_paid": {
            "type": "number",
            "minimum": 0.0,
            "title": "Principal Paid",
            "default": 0.0
          },
          "fees_paid": {
            "type": "number",
            "minimum": 0.0,
            "title": "Fees Paid",
            "default": 0.0
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "date"
        ],
        "title": "PaymentRecord"
      },
      "PdOverrideRequest": {
        "properties": {
          "pd_to_maturity": {
            "title": "Pd To Maturity",
            "description": "Insurer's own cumulative probability of default to maturity (0\u20131).",
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "nullable": true
          },
          "rating": {
            "title": "Rating",
            "description": "Insurer's own rating (e.g. 'BB', 'B', 'CCC'); mapped to a PD curve.",
            "type": "string",
            "nullable": true
          },
          "premium_bps": {
            "title": "Premium Bps",
            "description": "Insurer's own annual guarantee premium (bps of guaranteed notional).",
            "type": "integer",
            "maximum": 5000.0,
            "minimum": 0.0,
            "nullable": true
          },
          "note": {
            "title": "Note",
            "type": "string",
            "maxLength": 2000,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "PdOverrideRequest"
      },
      "PdTermPoint": {
        "properties": {
          "horizon_years": {
            "type": "number",
            "title": "Horizon Years"
          },
          "model_pd": {
            "type": "number",
            "title": "Model Pd"
          },
          "insurer_pd": {
            "title": "Insurer Pd",
            "type": "number",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "horizon_years",
          "model_pd"
        ],
        "title": "PdTermPoint"
      },
      "PeriodClose": {
        "properties": {
          "period_id": {
            "type": "string",
            "pattern": "^PC-[A-Fa-f0-9]{8}$",
            "title": "Period Id"
          },
          "fund_id": {
            "type": "string",
            "title": "Fund Id"
          },
          "kind": {
            "$ref": "#/components/schemas/PeriodKind"
          },
          "period_start": {
            "type": "string",
            "format": "date",
            "title": "Period Start"
          },
          "period_end": {
            "type": "string",
            "format": "date",
            "title": "Period End"
          },
          "cutoff_at": {
            "title": "Cutoff At",
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "signed_off_at": {
            "title": "Signed Off At",
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "signed_off_by": {
            "title": "Signed Off By",
            "type": "string",
            "nullable": true
          },
          "status": {
            "$ref": "#/components/schemas/CloseStatus",
            "default": "OPEN"
          },
          "notes": {
            "type": "string",
            "maxLength": 4000,
            "title": "Notes",
            "default": ""
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "created_by": {
            "title": "Created By",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "period_id",
          "fund_id",
          "kind",
          "period_start",
          "period_end"
        ],
        "title": "PeriodClose",
        "description": "A fund-scoped accounting period."
      },
      "PeriodCloseSnapshot": {
        "properties": {
          "period_id": {
            "type": "string",
            "title": "Period Id"
          },
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "deal_version_id": {
            "title": "Deal Version Id",
            "type": "string",
            "nullable": true
          },
          "valuation_run_id": {
            "title": "Valuation Run Id",
            "type": "string",
            "nullable": true
          },
          "assumption_set_version_id": {
            "title": "Assumption Set Version Id",
            "type": "string",
            "nullable": true
          },
          "pv_mid": {
            "title": "Pv Mid",
            "type": "number",
            "nullable": true
          },
          "price_mid": {
            "title": "Price Mid",
            "type": "number",
            "nullable": true
          },
          "snapshotted_at": {
            "type": "string",
            "format": "date-time",
            "title": "Snapshotted At"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "period_id",
          "deal_id"
        ],
        "title": "PeriodCloseSnapshot",
        "description": "One row per deal in a closed period: the exact versions that back\nthe period's final mark."
      },
      "PeriodKind": {
        "type": "string",
        "enum": [
          "MONTHLY",
          "QUARTERLY",
          "SEMI_ANNUAL",
          "ANNUAL",
          "AD_HOC"
        ],
        "title": "PeriodKind"
      },
      "PipelineRequest": {
        "properties": {
          "document_text": {
            "type": "string",
            "title": "Document Text"
          },
          "cycle_stage": {
            "type": "string",
            "title": "Cycle Stage",
            "default": "mid"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "document_text"
        ],
        "title": "PipelineRequest"
      },
      "PlanOut": {
        "properties": {
          "plan_id": {
            "type": "string",
            "title": "Plan Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name"
          },
          "price_usd_month": {
            "type": "number",
            "title": "Price Usd Month"
          },
          "deals_per_month": {
            "type": "integer",
            "title": "Deals Per Month"
          },
          "api_calls_per_month": {
            "type": "integer",
            "title": "Api Calls Per Month"
          },
          "valuations_per_month": {
            "type": "integer",
            "title": "Valuations Per Month"
          },
          "seats": {
            "type": "integer",
            "title": "Seats"
          },
          "features": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Features"
          },
          "sort_order": {
            "type": "integer",
            "title": "Sort Order"
          }
        },
        "type": "object",
        "required": [
          "plan_id",
          "name",
          "display_name",
          "price_usd_month",
          "deals_per_month",
          "api_calls_per_month",
          "valuations_per_month",
          "seats",
          "features",
          "sort_order"
        ],
        "title": "PlanOut"
      },
      "PortabilityEnum": {
        "type": "string",
        "enum": [
          "non_portable",
          "portable_with_conditions",
          "freely_portable"
        ],
        "title": "PortabilityEnum"
      },
      "PortfolioBenchmarkResponse": {
        "properties": {
          "sector": {
            "title": "Sector",
            "type": "string",
            "nullable": true
          },
          "vintage_year": {
            "title": "Vintage Year",
            "type": "integer",
            "nullable": true
          },
          "rating": {
            "title": "Rating",
            "type": "string",
            "nullable": true
          },
          "book_was_bps": {
            "title": "Book Was Bps",
            "description": "Notional-weighted average spread (bps) of the user's accessible deals matching the filter. ``None`` when book_n_deals=0 or the weighted-notional total is zero.",
            "type": "number",
            "nullable": true
          },
          "bdc_median_bps": {
            "title": "Bdc Median Bps",
            "description": "Unweighted median spread (bps) of BDC universe holdings matching the filter \u2014 one BDC mark = one observation. ``None`` when bdc_n_marks=0.",
            "type": "number",
            "nullable": true
          },
          "delta_bps": {
            "title": "Delta Bps",
            "description": "book_was_bps \u2212 bdc_median_bps. Positive \u21d2 book is wider than the BDC median (richer compensation per unit of risk). Negative \u21d2 book is tighter. ``None`` when either side is ``None``.",
            "type": "number",
            "nullable": true
          },
          "book_n_deals": {
            "type": "integer",
            "title": "Book N Deals",
            "description": "Number of user-accessible spread-bearing deals in cohort",
            "default": 0
          },
          "bdc_n_marks": {
            "type": "integer",
            "title": "Bdc N Marks",
            "description": "Number of spread-bearing BDC marks in cohort",
            "default": 0
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "PortfolioBenchmarkResponse",
        "description": "GET /benchmark/portfolio response (HARD-05).\n\nAggregation surface for the portfolio benchmark dashboard. Returns the\nuser's notional-weighted book WAS vs the BDC universe's unweighted\nmedian spread, optionally narrowed by sector \u00d7 vintage \u00d7 rating.\n\nAsymmetry note (RESEARCH \u00a7Pitfall 5 \u2014 locked):\n    * ``book_was_bps`` is **notional-weighted**: each deal contributes in\n      proportion to its facility size.\n    * ``bdc_median_bps`` is **unweighted**: one BDC mark = one observation.\n      BDC marks are line items at the holdings level \u2014 weighting them by\n      fair value would over-represent large issuers and break the\n      dispersion-first contract Phase 2 established.\n\nThe frontend caption surfaces the same asymmetry verbatim so callers\ncannot mistake one side for the other. ``extra=\"forbid\"`` locks the\ncontract at the response-validation layer (see CLAUDE.md \"Key\nConventions\").\n\n``rating`` filtering applies to the book side only \u2014 bdc_holdings carries\nno rating column at this Phase. The frontend caption documents that the\nBDC median is computed over the same sector \u00d7 vintage cohort regardless\nof the rating filter."
      },
      "PortfolioCovenantSummary": {
        "properties": {
          "total_deals": {
            "type": "integer",
            "title": "Total Deals"
          },
          "total_covenants": {
            "type": "integer",
            "title": "Total Covenants"
          },
          "by_status": {
            "additionalProperties": true,
            "type": "object",
            "title": "By Status"
          },
          "deals_with_alerts": {
            "type": "integer",
            "title": "Deals With Alerts"
          },
          "deals": {
            "items": {
              "$ref": "#/components/schemas/DealCovenantSummary"
            },
            "type": "array",
            "title": "Deals"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "total_deals",
          "total_covenants",
          "by_status",
          "deals_with_alerts",
          "deals"
        ],
        "title": "PortfolioCovenantSummary",
        "description": "Cross-portfolio covenant monitoring summary."
      },
      "PortfolioRWAOut": {
        "properties": {
          "total_ead": {
            "type": "number",
            "title": "Total Ead"
          },
          "total_rwa": {
            "type": "number",
            "title": "Total Rwa"
          },
          "average_risk_weight_pct": {
            "type": "number",
            "title": "Average Risk Weight Pct"
          },
          "rwa_density_pct": {
            "type": "number",
            "title": "Rwa Density Pct"
          },
          "capital_requirement_8pct": {
            "type": "number",
            "title": "Capital Requirement 8Pct"
          },
          "capital_requirement_10_5pct": {
            "type": "number",
            "title": "Capital Requirement 10 5Pct"
          },
          "cet1_requirement_4_5pct": {
            "type": "number",
            "title": "Cet1 Requirement 4 5Pct"
          },
          "cet1_requirement_7pct": {
            "type": "number",
            "title": "Cet1 Requirement 7Pct"
          },
          "by_approach": {
            "additionalProperties": true,
            "type": "object",
            "title": "By Approach"
          },
          "by_exposure_class": {
            "additionalProperties": true,
            "type": "object",
            "title": "By Exposure Class"
          },
          "by_rating_bucket": {
            "additionalProperties": true,
            "type": "object",
            "title": "By Rating Bucket"
          },
          "top_5_rwa_deals": {
            "items": {},
            "type": "array",
            "title": "Top 5 Rwa Deals"
          },
          "deal_count": {
            "type": "integer",
            "title": "Deal Count"
          },
          "positions": {
            "items": {
              "$ref": "#/components/schemas/DealRWAOut"
            },
            "type": "array",
            "title": "Positions"
          }
        },
        "type": "object",
        "required": [
          "total_ead",
          "total_rwa",
          "average_risk_weight_pct",
          "rwa_density_pct",
          "capital_requirement_8pct",
          "capital_requirement_10_5pct",
          "cet1_requirement_4_5pct",
          "cet1_requirement_7pct",
          "by_approach",
          "by_exposure_class",
          "by_rating_bucket",
          "top_5_rwa_deals",
          "deal_count",
          "positions"
        ],
        "title": "PortfolioRWAOut"
      },
      "PortfolioStressRequest": {
        "properties": {
          "deal_ids": {
            "title": "Deal Ids",
            "items": {
              "type": "string"
            },
            "type": "array",
            "nullable": true
          },
          "scenario_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Scenario Ids"
          },
          "assumption_set_id": {
            "type": "string",
            "title": "Assumption Set Id"
          },
          "valuation_date": {
            "type": "string",
            "format": "date",
            "title": "Valuation Date"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "scenario_ids",
          "assumption_set_id",
          "valuation_date"
        ],
        "title": "PortfolioStressRequest"
      },
      "PriceCompositionRow": {
        "properties": {
          "factor": {
            "type": "string",
            "title": "Factor"
          },
          "pv": {
            "type": "number",
            "title": "Pv"
          },
          "price_per_100": {
            "type": "number",
            "title": "Price Per 100"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "factor",
          "pv",
          "price_per_100"
        ],
        "title": "PriceCompositionRow",
        "description": "One row in the price waterfall: a factor's contribution to price per 100."
      },
      "PriceRangeResult": {
        "properties": {
          "valuation_date": {
            "type": "string",
            "title": "Valuation Date"
          },
          "min_price_per_100": {
            "type": "number",
            "title": "Min Price Per 100"
          },
          "max_price_per_100": {
            "type": "number",
            "title": "Max Price Per 100"
          },
          "base_price_per_100": {
            "type": "number",
            "title": "Base Price Per 100"
          },
          "scenarios": {
            "items": {
              "$ref": "#/components/schemas/ScenarioResult"
            },
            "type": "array",
            "title": "Scenarios"
          },
          "run_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Run Ids"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "valuation_date",
          "min_price_per_100",
          "max_price_per_100",
          "base_price_per_100",
          "scenarios",
          "run_ids"
        ],
        "title": "PriceRangeResult",
        "description": "Suggested price range with scenario breakdown and components."
      },
      "PrincipalSchedule": {
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "BULLET",
              "AMORT_PLUS_BULLET",
              "ANNUITY"
            ],
            "title": "Type",
            "default": "BULLET"
          },
          "amort_events": {
            "items": {
              "$ref": "#/components/schemas/AmortEvent"
            },
            "type": "array",
            "title": "Amort Events"
          },
          "bullet_date": {
            "title": "Bullet Date",
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "annuity_pct_per_year": {
            "title": "Annuity Pct Per Year",
            "description": "% of original notional amortised per year (e.g. 5.0 = 5%/yr). Only used when type=ANNUITY.",
            "type": "number",
            "maximum": 50.0,
            "minimum": 0.1,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "PrincipalSchedule"
      },
      "PromoteRequest": {
        "properties": {
          "candidate_id": {
            "type": "string",
            "title": "Candidate Id"
          },
          "anchor_date": {
            "type": "string",
            "title": "Anchor Date"
          },
          "vintage_id": {
            "type": "string",
            "pattern": "^\\d{4}Q[1-4][A-Za-z0-9._-]{0,32}$",
            "title": "Vintage Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "candidate_id",
          "anchor_date",
          "vintage_id"
        ],
        "title": "PromoteRequest"
      },
      "PromoteResponse": {
        "properties": {
          "vintage_id": {
            "type": "string",
            "title": "Vintage Id"
          },
          "previous_vintage_id": {
            "title": "Previous Vintage Id",
            "type": "string",
            "nullable": true
          },
          "candidate_id": {
            "type": "string",
            "title": "Candidate Id"
          },
          "file": {
            "type": "string",
            "title": "File"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "vintage_id",
          "candidate_id",
          "file"
        ],
        "title": "PromoteResponse"
      },
      "PromptCreateDealRequest": {
        "properties": {
          "prompt": {
            "type": "string",
            "maxLength": 10000,
            "title": "Prompt"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "prompt"
        ],
        "title": "PromptCreateDealRequest"
      },
      "PromptCreateDealWithSearchRequest": {
        "properties": {
          "prompt": {
            "type": "string",
            "maxLength": 10000,
            "title": "Prompt"
          },
          "web_search": {
            "type": "boolean",
            "title": "Web Search",
            "default": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "prompt"
        ],
        "title": "PromptCreateDealWithSearchRequest"
      },
      "PromptPreviewResponse": {
        "properties": {
          "borrower_name": {
            "title": "Borrower Name",
            "type": "string",
            "nullable": true
          },
          "currency": {
            "title": "Currency",
            "type": "string",
            "nullable": true
          },
          "jurisdiction": {
            "title": "Jurisdiction",
            "type": "string",
            "nullable": true
          },
          "sector": {
            "title": "Sector",
            "type": "string",
            "nullable": true
          },
          "origination_date": {
            "title": "Origination Date",
            "type": "string",
            "nullable": true
          },
          "maturity_date": {
            "title": "Maturity Date",
            "type": "string",
            "nullable": true
          },
          "candidates": {
            "items": {
              "$ref": "#/components/schemas/FacilityCandidate"
            },
            "type": "array",
            "title": "Candidates"
          },
          "suggested_deal": {
            "additionalProperties": true,
            "type": "object",
            "title": "Suggested Deal"
          },
          "note": {
            "type": "string",
            "title": "Note"
          },
          "citations": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Citations",
            "default": []
          },
          "extraction_usage": {
            "title": "Extraction Usage",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "candidates",
          "suggested_deal",
          "note"
        ],
        "title": "PromptPreviewResponse"
      },
      "ProvenanceRecord": {
        "properties": {
          "source_doc": {
            "type": "string",
            "title": "Source Doc",
            "description": "Original filename of the source document.",
            "default": ""
          },
          "source_doc_id": {
            "title": "Source Doc Id",
            "description": "upload_id or URL that resolves the source document.",
            "type": "string",
            "nullable": true
          },
          "page": {
            "title": "Page",
            "description": "1-based page number within source_doc.",
            "type": "integer",
            "nullable": true
          },
          "section": {
            "title": "Section",
            "description": "Section heading nearest to the extracted value.",
            "type": "string",
            "nullable": true
          },
          "snippet": {
            "title": "Snippet",
            "description": "Verbatim text excerpt that grounded the extraction.",
            "type": "string",
            "nullable": true
          },
          "confidence": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Confidence",
            "description": "Model self-rated confidence (0.0-1.0).",
            "default": 0.0
          },
          "extractor": {
            "type": "string",
            "title": "Extractor",
            "description": "Model identifier that produced this extraction (e.g. anthropic:claude-haiku-4-5-20251001:web_search=false).",
            "default": ""
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ProvenanceRecord",
        "description": "Source citation for one extracted deal field, keyed by JSON Pointer (RFC 6901)."
      },
      "PurgeRequest": {
        "properties": {
          "days": {
            "type": "integer",
            "maximum": 365.0,
            "minimum": 1.0,
            "title": "Days",
            "default": 30
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "PurgeRequest"
      },
      "QuarterlyRefreshResponse": {
        "properties": {
          "as_of": {
            "type": "string",
            "title": "As Of"
          },
          "deal_count": {
            "type": "integer",
            "title": "Deal Count"
          },
          "valued_count": {
            "type": "integer",
            "title": "Valued Count"
          },
          "covenant_breach_count": {
            "type": "integer",
            "title": "Covenant Breach Count"
          },
          "total_fair_value": {
            "type": "number",
            "title": "Total Fair Value"
          },
          "total_ecl_12m": {
            "type": "number",
            "title": "Total Ecl 12M"
          },
          "unprovisioned_count": {
            "type": "integer",
            "title": "Unprovisioned Count",
            "default": 0
          },
          "unprovisioned_ead": {
            "type": "number",
            "title": "Unprovisioned Ead",
            "default": 0.0
          },
          "scope": {
            "type": "string",
            "title": "Scope",
            "default": "all"
          },
          "base_currency": {
            "title": "Base Currency",
            "type": "string",
            "nullable": true
          },
          "fx": {
            "title": "Fx",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          },
          "stage_2_count": {
            "type": "integer",
            "title": "Stage 2 Count"
          },
          "stage_3_count": {
            "type": "integer",
            "title": "Stage 3 Count"
          },
          "deals": {
            "items": {
              "$ref": "#/components/schemas/RefreshResult"
            },
            "type": "array",
            "title": "Deals"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "as_of",
          "deal_count",
          "valued_count",
          "covenant_breach_count",
          "total_fair_value",
          "total_ecl_12m",
          "stage_2_count",
          "stage_3_count",
          "deals"
        ],
        "title": "QuarterlyRefreshResponse"
      },
      "RangeWidthDriver": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "bps": {
            "type": "number",
            "title": "Bps"
          },
          "note": {
            "title": "Note",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name",
          "bps"
        ],
        "title": "RangeWidthDriver"
      },
      "RateType": {
        "type": "string",
        "enum": [
          "FIXED",
          "FLOATING"
        ],
        "title": "RateType"
      },
      "RatingSlice": {
        "properties": {
          "rating": {
            "type": "string",
            "title": "Rating"
          },
          "notional": {
            "type": "number",
            "title": "Notional"
          },
          "pct": {
            "type": "number",
            "title": "Pct"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "rating",
          "notional",
          "pct"
        ],
        "title": "RatingSlice"
      },
      "RebuildCandidateResponse": {
        "properties": {
          "candidate_id": {
            "type": "string",
            "title": "Candidate Id"
          },
          "vintage_id": {
            "type": "string",
            "title": "Vintage Id"
          },
          "anchor_date": {
            "type": "string",
            "title": "Anchor Date"
          },
          "n_holdings": {
            "type": "integer",
            "title": "N Holdings"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings"
          },
          "gate_complete": {
            "type": "boolean",
            "title": "Gate Complete"
          },
          "gate_missing": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Gate Missing"
          },
          "vintage_exists": {
            "type": "boolean",
            "title": "Vintage Exists",
            "default": false
          },
          "filing_composition": {
            "items": {
              "$ref": "#/components/schemas/FilingPeriodOut"
            },
            "type": "array",
            "title": "Filing Composition",
            "default": []
          },
          "active_vintage_id": {
            "title": "Active Vintage Id",
            "type": "string",
            "nullable": true
          },
          "diff": {
            "items": {
              "$ref": "#/components/schemas/RebuildDiffRow"
            },
            "type": "array",
            "title": "Diff"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "candidate_id",
          "vintage_id",
          "anchor_date",
          "n_holdings",
          "warnings",
          "gate_complete",
          "gate_missing",
          "diff"
        ],
        "title": "RebuildCandidateResponse"
      },
      "RebuildDiffRow": {
        "properties": {
          "bucket": {
            "type": "string",
            "title": "Bucket"
          },
          "active_anchor_bps": {
            "title": "Active Anchor Bps",
            "type": "number",
            "nullable": true
          },
          "candidate_anchor_bps": {
            "title": "Candidate Anchor Bps",
            "type": "number",
            "nullable": true
          },
          "anchor_delta_bps": {
            "title": "Anchor Delta Bps",
            "type": "number",
            "nullable": true
          },
          "active_n_obs": {
            "title": "Active N Obs",
            "type": "integer",
            "nullable": true
          },
          "candidate_n_obs": {
            "title": "Candidate N Obs",
            "type": "integer",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "bucket"
        ],
        "title": "RebuildDiffRow"
      },
      "RebuildRequest": {
        "properties": {
          "anchor_date": {
            "title": "Anchor Date",
            "type": "string",
            "nullable": true
          },
          "vintage_id": {
            "title": "Vintage Id",
            "type": "string",
            "pattern": "^\\d{4}Q[1-4][A-Za-z0-9._-]{0,32}$",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "RebuildRequest"
      },
      "RecordTestRequest": {
        "properties": {
          "test_date": {
            "type": "string",
            "title": "Test Date"
          },
          "actual_value": {
            "title": "Actual Value",
            "type": "number",
            "nullable": true
          },
          "note": {
            "title": "Note",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "test_date"
        ],
        "title": "RecordTestRequest"
      },
      "RefreshResult": {
        "properties": {
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "borrower_name": {
            "type": "string",
            "title": "Borrower Name"
          },
          "currency": {
            "title": "Currency",
            "type": "string",
            "nullable": true
          },
          "fair_value": {
            "title": "Fair Value",
            "type": "number",
            "nullable": true
          },
          "price_per_100": {
            "title": "Price Per 100",
            "type": "number",
            "nullable": true
          },
          "valuation_status": {
            "type": "string",
            "title": "Valuation Status"
          },
          "covenant_any_breach": {
            "type": "boolean",
            "title": "Covenant Any Breach",
            "default": false
          },
          "covenant_breach_count": {
            "type": "integer",
            "title": "Covenant Breach Count",
            "default": 0
          },
          "covenant_compliant_count": {
            "type": "integer",
            "title": "Covenant Compliant Count",
            "default": 0
          },
          "ecl_stage": {
            "type": "integer",
            "title": "Ecl Stage",
            "default": 1
          },
          "ecl_12m": {
            "title": "Ecl 12M",
            "type": "number",
            "nullable": true
          },
          "ecl_lifetime": {
            "title": "Ecl Lifetime",
            "type": "number",
            "nullable": true
          },
          "implied_rating": {
            "title": "Implied Rating",
            "type": "string",
            "nullable": true
          },
          "rating_derived": {
            "type": "boolean",
            "title": "Rating Derived",
            "default": true
          },
          "spread_bps": {
            "title": "Spread Bps",
            "type": "number",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_id",
          "borrower_name",
          "valuation_status"
        ],
        "title": "RefreshResult"
      },
      "ReopenRequest": {
        "properties": {
          "reason": {
            "type": "string",
            "maxLength": 2000,
            "minLength": 1,
            "title": "Reason"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "reason"
        ],
        "title": "ReopenRequest",
        "description": "Admin-only reopen requires an explicit reason."
      },
      "ReportDetail": {
        "properties": {
          "report_id": {
            "type": "string",
            "title": "Report Id"
          },
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "markdown": {
            "type": "string",
            "title": "Markdown"
          },
          "generated_at": {
            "type": "string",
            "title": "Generated At"
          },
          "as_of_date": {
            "title": "As Of Date",
            "type": "string",
            "nullable": true
          },
          "usage": {
            "additionalProperties": true,
            "type": "object",
            "title": "Usage",
            "default": {}
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "report_id",
          "deal_id",
          "title",
          "markdown",
          "generated_at",
          "as_of_date"
        ],
        "title": "ReportDetail"
      },
      "ReportPeriodRequest": {
        "properties": {
          "period_end": {
            "type": "string",
            "title": "Period End",
            "description": "ISO date, e.g. 2026-03-31"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "period_end"
        ],
        "title": "ReportPeriodRequest"
      },
      "ReportScheduleCreate": {
        "properties": {
          "schedule_type": {
            "type": "string",
            "enum": [
              "deal",
              "portfolio"
            ],
            "title": "Schedule Type",
            "description": "'deal' for single-deal reports, 'portfolio' for full portfolio"
          },
          "deal_id": {
            "title": "Deal Id",
            "description": "Required when schedule_type='deal'",
            "type": "string",
            "nullable": true
          },
          "frequency": {
            "type": "string",
            "enum": [
              "daily",
              "weekly",
              "monthly",
              "quarterly"
            ],
            "title": "Frequency",
            "description": "How often to generate and send the report"
          },
          "day_of_week": {
            "title": "Day Of Week",
            "description": "0=Monday..6=Sunday. Required for weekly frequency.",
            "type": "integer",
            "maximum": 6.0,
            "minimum": 0.0,
            "nullable": true
          },
          "day_of_month": {
            "title": "Day Of Month",
            "description": "Day of month (1-28). Required for monthly/quarterly frequency.",
            "type": "integer",
            "maximum": 28.0,
            "minimum": 1.0,
            "nullable": true
          },
          "hour_utc": {
            "type": "integer",
            "maximum": 23.0,
            "minimum": 0.0,
            "title": "Hour Utc",
            "description": "Hour in UTC (0-23)",
            "default": 6
          },
          "minute_utc": {
            "type": "integer",
            "maximum": 59.0,
            "minimum": 0.0,
            "title": "Minute Utc",
            "description": "Minute (0-59)",
            "default": 0
          },
          "recipients": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 20,
            "minItems": 1,
            "title": "Recipients",
            "description": "Email addresses to receive the report"
          },
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "description": "Whether the schedule is active",
            "default": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "schedule_type",
          "frequency",
          "recipients"
        ],
        "title": "ReportScheduleCreate",
        "description": "Request model for creating a scheduled report delivery."
      },
      "ReportScheduleUpdate": {
        "properties": {
          "frequency": {
            "title": "Frequency",
            "type": "string",
            "enum": [
              "daily",
              "weekly",
              "monthly",
              "quarterly"
            ],
            "nullable": true
          },
          "day_of_week": {
            "title": "Day Of Week",
            "type": "integer",
            "maximum": 6.0,
            "minimum": 0.0,
            "nullable": true
          },
          "day_of_month": {
            "title": "Day Of Month",
            "type": "integer",
            "maximum": 28.0,
            "minimum": 1.0,
            "nullable": true
          },
          "hour_utc": {
            "title": "Hour Utc",
            "type": "integer",
            "maximum": 23.0,
            "minimum": 0.0,
            "nullable": true
          },
          "minute_utc": {
            "title": "Minute Utc",
            "type": "integer",
            "maximum": 59.0,
            "minimum": 0.0,
            "nullable": true
          },
          "recipients": {
            "title": "Recipients",
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 20,
            "minItems": 1,
            "nullable": true
          },
          "enabled": {
            "title": "Enabled",
            "type": "boolean",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ReportScheduleUpdate",
        "description": "Request model for updating a scheduled report delivery."
      },
      "ReportSummary": {
        "properties": {
          "report_id": {
            "type": "string",
            "title": "Report Id"
          },
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "generated_at": {
            "type": "string",
            "title": "Generated At"
          },
          "as_of_date": {
            "title": "As Of Date",
            "type": "string",
            "nullable": true
          },
          "char_count": {
            "type": "integer",
            "title": "Char Count"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "report_id",
          "deal_id",
          "title",
          "generated_at",
          "as_of_date",
          "char_count"
        ],
        "title": "ReportSummary"
      },
      "ResetFrequency": {
        "type": "string",
        "enum": [
          "MONTHLY",
          "QUARTERLY",
          "SEMI_ANNUAL"
        ],
        "title": "ResetFrequency"
      },
      "ResetRequest": {
        "properties": {
          "token": {
            "type": "string",
            "title": "Token"
          },
          "password": {
            "type": "string",
            "title": "Password"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "token",
          "password"
        ],
        "title": "ResetRequest"
      },
      "ResetResponse": {
        "properties": {
          "ok": {
            "type": "boolean",
            "title": "Ok"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "ok",
          "email",
          "message"
        ],
        "title": "ResetResponse"
      },
      "ResolveRequest": {
        "properties": {
          "note": {
            "type": "string",
            "title": "Note",
            "default": ""
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ResolveRequest"
      },
      "ResolvedFiler": {
        "properties": {
          "company_number": {
            "type": "string",
            "title": "Company Number"
          },
          "company_name": {
            "type": "string",
            "title": "Company Name"
          },
          "accounts_type": {
            "type": "string",
            "title": "Accounts Type",
            "description": "last_accounts.type from the register, e.g. 'group' or 'full'."
          },
          "consolidates": {
            "type": "boolean",
            "title": "Consolidates",
            "description": "True when accounts_type == 'group'."
          },
          "period_start_on": {
            "title": "Period Start On",
            "type": "string",
            "nullable": true
          },
          "period_end_on": {
            "title": "Period End On",
            "type": "string",
            "nullable": true
          },
          "named_entity": {
            "title": "Named Entity",
            "description": "The company number the search or caller started from.",
            "type": "string",
            "nullable": true
          },
          "walk": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Walk",
            "description": "Company numbers visited on the way up, in order."
          },
          "note": {
            "title": "Note",
            "description": "Why resolution stopped where it did.",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "company_number",
          "company_name",
          "accounts_type",
          "consolidates"
        ],
        "title": "ResolvedFiler",
        "description": "The entity whose accounts consolidate the borrower."
      },
      "RevaluationPolicyBody": {
        "properties": {
          "frequency": {
            "type": "string",
            "enum": [
              "weekly",
              "monthly",
              "quarterly",
              "semi_annual",
              "annual"
            ],
            "title": "Frequency",
            "default": "quarterly"
          },
          "next_due": {
            "title": "Next Due",
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "notes": {
            "title": "Notes",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "RevaluationPolicyBody"
      },
      "RevenueProjection": {
        "properties": {
          "year": {
            "type": "integer",
            "title": "Year",
            "description": "Projection year (e.g. 2025)"
          },
          "revenue": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Revenue",
            "description": "Projected revenue USD"
          },
          "ebitda_margin": {
            "type": "number",
            "maximum": 1.0,
            "exclusiveMinimum": 0.0,
            "title": "Ebitda Margin",
            "description": "EBITDA margin 0\u20131"
          },
          "debt_outstanding": {
            "title": "Debt Outstanding",
            "description": "Expected debt balance; if None uses current",
            "type": "number",
            "minimum": 0.0,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "year",
          "revenue",
          "ebitda_margin"
        ],
        "title": "RevenueProjection",
        "description": "Single-year forward revenue / margin projection."
      },
      "ReviewBody": {
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "approved",
              "rejected"
            ],
            "title": "Status"
          },
          "note": {
            "title": "Note",
            "type": "string",
            "maxLength": 2000,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "ReviewBody"
      },
      "ReviewQueueCountResponse": {
        "properties": {
          "pending": {
            "type": "integer",
            "title": "Pending"
          },
          "overdue": {
            "type": "integer",
            "title": "Overdue"
          },
          "mine": {
            "type": "integer",
            "title": "Mine"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "pending",
          "overdue",
          "mine"
        ],
        "title": "ReviewQueueCountResponse"
      },
      "ReviewQueueItem": {
        "properties": {
          "approval_id": {
            "type": "string",
            "title": "Approval Id"
          },
          "entity_type": {
            "$ref": "#/components/schemas/EntityType"
          },
          "entity_id": {
            "type": "string",
            "title": "Entity Id"
          },
          "submitted_by": {
            "type": "string",
            "title": "Submitted By"
          },
          "submitted_at": {
            "type": "string",
            "format": "date-time",
            "title": "Submitted At"
          },
          "due_at": {
            "title": "Due At",
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "is_overdue": {
            "type": "boolean",
            "title": "Is Overdue",
            "default": false
          },
          "age_hours": {
            "type": "number",
            "title": "Age Hours",
            "default": 0.0
          },
          "deal_id": {
            "title": "Deal Id",
            "type": "string",
            "nullable": true
          },
          "deal_name": {
            "title": "Deal Name",
            "type": "string",
            "nullable": true
          },
          "fund_id": {
            "title": "Fund Id",
            "type": "string",
            "nullable": true
          },
          "run_id": {
            "title": "Run Id",
            "type": "string",
            "nullable": true
          },
          "valuation_date": {
            "title": "Valuation Date",
            "type": "string",
            "nullable": true
          },
          "pv_mid": {
            "title": "Pv Mid",
            "type": "number",
            "nullable": true
          },
          "price_mid": {
            "title": "Price Mid",
            "type": "number",
            "nullable": true
          },
          "assumption_set_id": {
            "title": "Assumption Set Id",
            "type": "string",
            "nullable": true
          },
          "assigned_to": {
            "title": "Assigned To",
            "type": "string",
            "nullable": true
          },
          "assigned_at": {
            "title": "Assigned At",
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "approval_id",
          "entity_type",
          "entity_id",
          "submitted_by",
          "submitted_at"
        ],
        "title": "ReviewQueueItem",
        "description": "One pending approval, enriched with context for the reviewer UI."
      },
      "ReviewQueueResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ReviewQueueItem"
            },
            "type": "array",
            "title": "Items"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          },
          "pending": {
            "type": "integer",
            "title": "Pending"
          },
          "overdue": {
            "type": "integer",
            "title": "Overdue"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "items",
          "count",
          "pending",
          "overdue"
        ],
        "title": "ReviewQueueResponse"
      },
      "ReviewRequest": {
        "properties": {
          "note": {
            "title": "Note",
            "type": "string",
            "maxLength": 2000,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ReviewRequest"
      },
      "RiskDecompositionRequest": {
        "properties": {
          "deal_version_id": {
            "type": "string",
            "title": "Deal Version Id"
          },
          "assumption_set_version_id": {
            "type": "string",
            "title": "Assumption Set Version Id"
          },
          "valuation_date": {
            "type": "string",
            "format": "date",
            "title": "Valuation Date"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_version_id",
          "assumption_set_version_id",
          "valuation_date"
        ],
        "title": "RiskDecompositionRequest"
      },
      "RiskMetricsResponse": {
        "properties": {
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "as_of": {
            "type": "string",
            "format": "date",
            "title": "As Of"
          },
          "currency": {
            "type": "string",
            "title": "Currency",
            "description": "Deal currency (ISO code) for formatting the break-even figures."
          },
          "distance_to_breach": {
            "$ref": "#/components/schemas/DistanceToBreachResponse"
          },
          "break_even": {
            "$ref": "#/components/schemas/BreakEvenResponse"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_id",
          "as_of",
          "currency",
          "distance_to_breach",
          "break_even"
        ],
        "title": "RiskMetricsResponse"
      },
      "RouteRequest": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "message"
        ],
        "title": "RouteRequest"
      },
      "RunReviewRequest": {
        "properties": {
          "note": {
            "title": "Note",
            "type": "string",
            "maxLength": 2000,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "RunReviewRequest"
      },
      "ScenarioComposition": {
        "properties": {
          "label": {
            "type": "string",
            "title": "Label"
          },
          "spread_bps": {
            "type": "integer",
            "title": "Spread Bps"
          },
          "total_pv": {
            "type": "number",
            "title": "Total Pv"
          },
          "total_price_per_100": {
            "type": "number",
            "title": "Total Price Per 100"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/PriceCompositionRow"
            },
            "type": "array",
            "title": "Rows"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "label",
          "spread_bps",
          "total_pv",
          "total_price_per_100",
          "rows"
        ],
        "title": "ScenarioComposition",
        "description": "Price composition for one scenario (low / mid / high)."
      },
      "ScenarioResult": {
        "properties": {
          "scenario_id": {
            "type": "string",
            "title": "Scenario Id"
          },
          "label": {
            "type": "string",
            "title": "Label"
          },
          "pv": {
            "type": "number",
            "title": "Pv"
          },
          "price_per_100": {
            "type": "number",
            "title": "Price Per 100"
          },
          "components": {
            "$ref": "#/components/schemas/ValuationComponents"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "scenario_id",
          "label",
          "pv",
          "price_per_100",
          "components"
        ],
        "title": "ScenarioResult",
        "description": "Single scenario run: label, outputs, components."
      },
      "ScenarioWeights": {
        "properties": {
          "base": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Base"
          },
          "downside": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Downside"
          },
          "recovery": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Recovery"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "base",
          "downside",
          "recovery"
        ],
        "title": "ScenarioWeights",
        "description": "Probability weights over the three valuation scenarios.\n\nThe three probabilities must sum to 1 (within a small tolerance). The\ntypical use is:\n\n  base \u2014 borrower continues to perform, yield approach drives value.\n  downside \u2014 borrower stressed but performing; yield approach with a\n              widened spread (or a lower recovery-weighted path).\n  recovery \u2014 borrower defaults; value comes from the EV waterfall."
      },
      "SchedulerJobOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "trigger": {
            "type": "string",
            "title": "Trigger"
          },
          "next_run": {
            "title": "Next Run",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "trigger"
        ],
        "title": "SchedulerJobOut"
      },
      "ScoringOverrides": {
        "properties": {
          "quality_strong_threshold": {
            "title": "Quality Strong Threshold",
            "type": "number",
            "nullable": true
          },
          "quality_adequate_threshold": {
            "title": "Quality Adequate Threshold",
            "type": "number",
            "nullable": true
          },
          "rating_bb_plus": {
            "title": "Rating Bb Plus",
            "type": "number",
            "nullable": true
          },
          "rating_bb": {
            "title": "Rating Bb",
            "type": "number",
            "nullable": true
          },
          "rating_bb_minus": {
            "title": "Rating Bb Minus",
            "type": "number",
            "nullable": true
          },
          "rating_b": {
            "title": "Rating B",
            "type": "number",
            "nullable": true
          },
          "rating_b_minus": {
            "title": "Rating B Minus",
            "type": "number",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ScoringOverrides"
      },
      "ScoringThresholds": {
        "properties": {
          "quality_strong": {
            "type": "number",
            "maximum": 100.0,
            "minimum": 0.0,
            "title": "Quality Strong",
            "description": "Min composite for 'Strong' quality label",
            "default": 72.0
          },
          "quality_adequate": {
            "type": "number",
            "maximum": 100.0,
            "minimum": 0.0,
            "title": "Quality Adequate",
            "description": "Min composite for 'Adequate' quality label",
            "default": 48.0
          },
          "rating_bb_plus": {
            "type": "number",
            "maximum": 100.0,
            "minimum": 0.0,
            "title": "Rating Bb Plus",
            "description": "Min composite for BB+ / BBB- implied rating",
            "default": 80.0
          },
          "rating_bb": {
            "type": "number",
            "maximum": 100.0,
            "minimum": 0.0,
            "title": "Rating Bb",
            "description": "Min composite for BB implied rating",
            "default": 68.0
          },
          "rating_bb_minus": {
            "type": "number",
            "maximum": 100.0,
            "minimum": 0.0,
            "title": "Rating Bb Minus",
            "description": "Min composite for BB- / B+ implied rating",
            "default": 55.0
          },
          "rating_b": {
            "type": "number",
            "maximum": 100.0,
            "minimum": 0.0,
            "title": "Rating B",
            "description": "Min composite for B implied rating",
            "default": 42.0
          },
          "rating_b_minus": {
            "type": "number",
            "maximum": 100.0,
            "minimum": 0.0,
            "title": "Rating B Minus",
            "description": "Min composite for B- implied rating",
            "default": 30.0
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ScoringThresholds",
        "description": "Composite score \u2192 quality label and implied rating thresholds (0\u2013100 scale)."
      },
      "SearchPublicFinancialsRequest": {
        "properties": {},
        "additionalProperties": false,
        "type": "object",
        "title": "SearchPublicFinancialsRequest",
        "description": "Body for POST /deals/{deal_id}/search-public-financials.\n\nNo fields \u2014 borrower name is sourced from the deal blob.\nReserved for future explicit overrides (jurisdiction, sector hint).\nextra='forbid' enforces JSON-empty bodies (T-10-V5)."
      },
      "SearchPublicFinancialsResponse": {
        "properties": {
          "financials": {
            "additionalProperties": true,
            "type": "object",
            "title": "Financials"
          },
          "provenance": {
            "additionalProperties": true,
            "type": "object",
            "title": "Provenance"
          },
          "no_match_reason": {
            "title": "No Match Reason",
            "type": "string",
            "nullable": true
          },
          "bdc_match": {
            "title": "Bdc Match",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "financials",
          "provenance"
        ],
        "title": "SearchPublicFinancialsResponse",
        "description": "Response shape for POST /deals/{deal_id}/search-public-financials."
      },
      "SectorAdjustment": {
        "properties": {
          "spread_addon_bps": {
            "type": "integer",
            "title": "Spread Addon Bps",
            "default": 0
          },
          "hazard_multiplier_addon": {
            "type": "number",
            "title": "Hazard Multiplier Addon",
            "default": 0.0
          },
          "recovery_shift_addon": {
            "type": "number",
            "title": "Recovery Shift Addon",
            "default": 0.0
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "SectorAdjustment"
      },
      "SectorMultipleSuggestion": {
        "properties": {
          "sector": {
            "type": "string",
            "title": "Sector"
          },
          "country": {
            "type": "string",
            "title": "Country"
          },
          "size_bucket": {
            "type": "string",
            "title": "Size Bucket"
          },
          "ev_ebitda_low": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Ev Ebitda Low"
          },
          "ev_ebitda_mid": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Ev Ebitda Mid"
          },
          "ev_ebitda_high": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Ev Ebitda High"
          },
          "table_version": {
            "type": "string",
            "title": "Table Version"
          },
          "source_note": {
            "type": "string",
            "title": "Source Note"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "sector",
          "country",
          "size_bucket",
          "ev_ebitda_low",
          "ev_ebitda_mid",
          "ev_ebitda_high",
          "table_version",
          "source_note"
        ],
        "title": "SectorMultipleSuggestion",
        "description": "Response for GET /ev/sector-multiples \u2014 a starting-point band."
      },
      "SectorSlice": {
        "properties": {
          "sector": {
            "type": "string",
            "title": "Sector"
          },
          "notional": {
            "type": "number",
            "title": "Notional"
          },
          "pct": {
            "type": "number",
            "title": "Pct"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "sector",
          "notional",
          "pct"
        ],
        "title": "SectorSlice"
      },
      "SecuredBorrowingOverrides": {
        "properties": {
          "credit_spread_tight_bps": {
            "title": "Credit Spread Tight Bps",
            "type": "integer",
            "nullable": true
          },
          "credit_spread_wide_bps": {
            "title": "Credit Spread Wide Bps",
            "type": "integer",
            "nullable": true
          },
          "illiquidity_prem_tight_bps": {
            "title": "Illiquidity Prem Tight Bps",
            "type": "integer",
            "nullable": true
          },
          "illiquidity_prem_wide_bps": {
            "title": "Illiquidity Prem Wide Bps",
            "type": "integer",
            "nullable": true
          },
          "senior_secured_adj_bps": {
            "title": "Senior Secured Adj Bps",
            "type": "integer",
            "nullable": true
          },
          "unsecured_adj_bps": {
            "title": "Unsecured Adj Bps",
            "type": "integer",
            "nullable": true
          },
          "duration_factor": {
            "title": "Duration Factor",
            "type": "number",
            "nullable": true
          },
          "cycle": {
            "$ref": "#/components/schemas/CycleOverrides",
            "nullable": true
          },
          "scoring": {
            "$ref": "#/components/schemas/ScoringOverrides",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "SecuredBorrowingOverrides"
      },
      "SecuredBorrowingRequest": {
        "properties": {
          "strategy": {
            "type": "string",
            "title": "Strategy"
          },
          "asset_type": {
            "type": "string",
            "enum": [
              "equipment",
              "aviation",
              "infrastructure",
              "receivables",
              "real_assets",
              "other"
            ],
            "title": "Asset Type",
            "default": "equipment"
          },
          "asset_ltv": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Asset Ltv"
          },
          "counterparty_credit": {
            "type": "string",
            "enum": [
              "investment_grade",
              "sub_investment_grade",
              "unrated"
            ],
            "title": "Counterparty Credit",
            "default": "sub_investment_grade"
          },
          "cash_flow_predictability": {
            "type": "string",
            "enum": [
              "contracted",
              "semi_contracted",
              "merchant"
            ],
            "title": "Cash Flow Predictability",
            "default": "semi_contracted"
          },
          "asset_depreciation_rate_pa": {
            "type": "number",
            "maximum": 0.5,
            "minimum": 0.0,
            "title": "Asset Depreciation Rate Pa"
          },
          "weighted_avg_life_years": {
            "type": "number",
            "maximum": 30.0,
            "minimum": 0.0,
            "title": "Weighted Avg Life Years"
          },
          "balloon_risk_pct": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Balloon Risk Pct",
            "default": 0.0
          },
          "is_senior_secured": {
            "type": "boolean",
            "title": "Is Senior Secured",
            "default": true
          },
          "origination_spread_bps": {
            "type": "integer",
            "maximum": 5000.0,
            "minimum": 0.0,
            "title": "Origination Spread Bps"
          },
          "remaining_maturity_years": {
            "type": "number",
            "maximum": 30.0,
            "minimum": 0.0,
            "title": "Remaining Maturity Years"
          },
          "coupon_rate": {
            "type": "number",
            "maximum": 0.5,
            "minimum": 0.0,
            "title": "Coupon Rate"
          },
          "cycle_stage": {
            "type": "string",
            "enum": [
              "early",
              "mid",
              "late",
              "distressed"
            ],
            "title": "Cycle Stage",
            "default": "mid"
          },
          "obligor_count": {
            "type": "integer",
            "maximum": 10000.0,
            "minimum": 1.0,
            "title": "Obligor Count",
            "default": 1
          },
          "geographic_diversification": {
            "type": "string",
            "enum": [
              "single",
              "regional",
              "multi_jurisdictional"
            ],
            "title": "Geographic Diversification",
            "default": "single"
          },
          "residual_value_risk": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "title": "Residual Value Risk",
            "default": "low"
          },
          "overrides": {
            "$ref": "#/components/schemas/SecuredBorrowingOverrides",
            "nullable": true
          },
          "use_dcf": {
            "type": "boolean",
            "title": "Use Dcf",
            "default": false
          },
          "market": {
            "type": "string",
            "enum": [
              "USD",
              "GBP",
              "EUR",
              "CUSTOM"
            ],
            "title": "Market",
            "default": "USD"
          },
          "calibration_params": {
            "$ref": "#/components/schemas/CustomCalibrationParams",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "strategy",
          "asset_ltv",
          "asset_depreciation_rate_pa",
          "weighted_avg_life_years",
          "origination_spread_bps",
          "remaining_maturity_years",
          "coupon_rate"
        ],
        "title": "SecuredBorrowingRequest"
      },
      "SecuredBorrowingResponse": {
        "properties": {
          "strategy": {
            "type": "string",
            "title": "Strategy"
          },
          "composite": {
            "$ref": "#/components/schemas/CompositeScoreOut"
          },
          "waterfall": {
            "$ref": "#/components/schemas/SpreadWaterfallOut"
          },
          "fair_value_spread_bps": {
            "type": "integer",
            "title": "Fair Value Spread Bps"
          },
          "fair_value_price": {
            "type": "number",
            "title": "Fair Value Price"
          },
          "spread_delta_vs_origination_bps": {
            "type": "number",
            "title": "Spread Delta Vs Origination Bps"
          },
          "duration_years": {
            "type": "number",
            "title": "Duration Years"
          },
          "asset_coverage_ratio": {
            "type": "number",
            "title": "Asset Coverage Ratio"
          },
          "implied_debt_service_coverage": {
            "type": "number",
            "title": "Implied Debt Service Coverage"
          },
          "implied_rating": {
            "type": "string",
            "title": "Implied Rating"
          },
          "dcf_price": {
            "title": "Dcf Price",
            "type": "number",
            "nullable": true
          },
          "calibration_market": {
            "type": "string",
            "title": "Calibration Market",
            "default": "USD"
          },
          "calibration_effective_date": {
            "type": "string",
            "format": "date",
            "title": "Calibration Effective Date",
            "default": "2025-01-01"
          },
          "calibration_warning": {
            "title": "Calibration Warning",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "strategy",
          "composite",
          "waterfall",
          "fair_value_spread_bps",
          "fair_value_price",
          "spread_delta_vs_origination_bps",
          "duration_years",
          "asset_coverage_ratio",
          "implied_debt_service_coverage",
          "implied_rating"
        ],
        "title": "SecuredBorrowingResponse"
      },
      "SecuredBorrowingWeights": {
        "properties": {
          "asset_ltv": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Asset Ltv",
            "description": "Asset LTV weight",
            "default": 0.22
          },
          "counterparty": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Counterparty",
            "description": "Counterparty credit weight",
            "default": 0.18
          },
          "cf_predictability": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Cf Predictability",
            "description": "Cash-flow predictability weight",
            "default": 0.17
          },
          "asset_type": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Asset Type",
            "description": "Asset type weight",
            "default": 0.1
          },
          "depreciation": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Depreciation",
            "description": "Depreciation rate weight",
            "default": 0.09
          },
          "balloon": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Balloon",
            "description": "Balloon risk weight",
            "default": 0.08
          },
          "wal": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Wal",
            "description": "Weighted average life weight",
            "default": 0.07
          },
          "obligor_count": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Obligor Count",
            "description": "Obligor count weight",
            "default": 0.05
          },
          "geography": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Geography",
            "description": "Geographic diversification weight",
            "default": 0.04
          },
          "residual_value": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Residual Value",
            "description": "Residual value risk weight",
            "default": 0.05
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "SecuredBorrowingWeights",
        "description": "Factor weights for the Secured Borrowing / asset-financing composite score."
      },
      "SecurityLienEnum": {
        "type": "string",
        "enum": [
          "1st_lien_sr_secured",
          "2nd_lien_sr_unsecured",
          "sub_mezz"
        ],
        "title": "SecurityLienEnum"
      },
      "SenioritySlice": {
        "properties": {
          "seniority": {
            "type": "string",
            "title": "Seniority"
          },
          "notional": {
            "type": "number",
            "title": "Notional"
          },
          "pct": {
            "type": "number",
            "title": "Pct"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "seniority",
          "notional",
          "pct"
        ],
        "title": "SenioritySlice"
      },
      "SensitivityRequest": {
        "properties": {
          "valuation_date": {
            "type": "string",
            "format": "date",
            "title": "Valuation Date"
          },
          "deal_version_id": {
            "type": "string",
            "title": "Deal Version Id"
          },
          "assumption_set_version_id": {
            "type": "string",
            "title": "Assumption Set Version Id"
          },
          "scenarios": {
            "title": "Scenarios",
            "description": "Scenario names to run. If null, runs all regulatory scenarios.",
            "items": {
              "type": "string"
            },
            "type": "array",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "valuation_date",
          "deal_version_id",
          "assumption_set_version_id"
        ],
        "title": "SensitivityRequest"
      },
      "SessionResponse": {
        "properties": {
          "ok": {
            "type": "boolean",
            "title": "Ok"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "ttl_seconds": {
            "type": "integer",
            "title": "Ttl Seconds"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "ok",
          "user_id",
          "role",
          "ttl_seconds"
        ],
        "title": "SessionResponse"
      },
      "SetLimitRequest": {
        "properties": {
          "user_id": {
            "type": "string",
            "minLength": 1,
            "title": "User Id"
          },
          "daily_usd_cap": {
            "type": "number",
            "minimum": 0.0,
            "title": "Daily Usd Cap"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "user_id",
          "daily_usd_cap"
        ],
        "title": "SetLimitRequest"
      },
      "SetPasswordRequest": {
        "properties": {
          "password": {
            "title": "Password",
            "type": "string",
            "nullable": true
          },
          "require_password_change": {
            "type": "boolean",
            "title": "Require Password Change",
            "default": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "SetPasswordRequest"
      },
      "SetRoleFeaturesRequest": {
        "properties": {
          "features": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Features"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "features"
        ],
        "title": "SetRoleFeaturesRequest"
      },
      "SetRoutePermissionsRequest": {
        "properties": {
          "route": {
            "type": "string",
            "title": "Route"
          },
          "roles": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Roles"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "route",
          "roles"
        ],
        "title": "SetRoutePermissionsRequest"
      },
      "SingleNameRow": {
        "properties": {
          "borrower": {
            "type": "string",
            "title": "Borrower"
          },
          "notional": {
            "type": "number",
            "title": "Notional"
          },
          "pct": {
            "type": "number",
            "title": "Pct"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "borrower",
          "notional",
          "pct"
        ],
        "title": "SingleNameRow"
      },
      "SingleRWARequest": {
        "properties": {
          "deal_id": {
            "title": "Deal Id",
            "type": "string",
            "nullable": true
          },
          "borrower_name": {
            "type": "string",
            "title": "Borrower Name",
            "default": "Unknown"
          },
          "exposure_class": {
            "$ref": "#/components/schemas/ExposureClass",
            "default": "corporate"
          },
          "ead": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Ead",
            "description": "Exposure at Default (notional or drawn amount)"
          },
          "approach": {
            "$ref": "#/components/schemas/BankingApproach",
            "default": "standardized"
          },
          "external_rating": {
            "title": "External Rating",
            "description": "External rating e.g. BB+, B, Baa",
            "type": "string",
            "nullable": true
          },
          "pd_1y": {
            "title": "Pd 1Y",
            "description": "1-year PD (0\u20131)",
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "nullable": true
          },
          "lgd": {
            "title": "Lgd",
            "description": "Loss Given Default (0\u20131)",
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "nullable": true
          },
          "maturity_years": {
            "title": "Maturity Years",
            "description": "Effective maturity M",
            "type": "number",
            "maximum": 5.0,
            "minimum": 1.0,
            "nullable": true
          },
          "annual_sales_eur_m": {
            "title": "Annual Sales Eur M",
            "description": "Firm annual sales EUR M (for SME)",
            "type": "number",
            "minimum": 0.0,
            "nullable": true
          },
          "sl_slot": {
            "$ref": "#/components/schemas/SpecializedLendingSlot",
            "nullable": true
          },
          "ltv_ratio": {
            "title": "Ltv Ratio",
            "type": "number",
            "maximum": 2.0,
            "minimum": 0.0,
            "nullable": true
          },
          "facility_type": {
            "type": "string",
            "title": "Facility Type",
            "default": "term_loan"
          },
          "ccf_override": {
            "title": "Ccf Override",
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "nullable": true
          },
          "currency": {
            "type": "string",
            "title": "Currency",
            "default": "EUR"
          },
          "capital_structure": {
            "title": "Capital Structure",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "ead"
        ],
        "title": "SingleRWARequest"
      },
      "SnapshotRequest": {
        "properties": {
          "period_end_date": {
            "type": "string",
            "title": "Period End Date"
          },
          "period_label": {
            "title": "Period Label",
            "type": "string",
            "nullable": true
          },
          "fair_value_pv": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Fair Value Pv"
          },
          "price_per_100": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Price Per 100"
          },
          "price_clean": {
            "title": "Price Clean",
            "type": "number",
            "nullable": true
          },
          "price_dirty": {
            "title": "Price Dirty",
            "type": "number",
            "nullable": true
          },
          "accrued_per_100": {
            "type": "number",
            "title": "Accrued Per 100",
            "default": 0.0
          },
          "spread_bps": {
            "title": "Spread Bps",
            "type": "number",
            "nullable": true
          },
          "implied_rating": {
            "title": "Implied Rating",
            "type": "string",
            "nullable": true
          },
          "ecl_12m": {
            "title": "Ecl 12M",
            "type": "number",
            "nullable": true
          },
          "ecl_lifetime": {
            "title": "Ecl Lifetime",
            "type": "number",
            "nullable": true
          },
          "ecl_stage": {
            "type": "integer",
            "title": "Ecl Stage",
            "default": 1
          },
          "notional": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Notional"
          },
          "run_id": {
            "title": "Run Id",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "period_end_date",
          "fair_value_pv",
          "price_per_100",
          "notional"
        ],
        "title": "SnapshotRequest"
      },
      "SolveDMRequest": {
        "properties": {
          "loan_terms": {
            "$ref": "#/components/schemas/LoanTerms"
          },
          "borrower_metrics": {
            "$ref": "#/components/schemas/BorrowerMetrics"
          },
          "classification": {
            "$ref": "#/components/schemas/Classification"
          },
          "market": {
            "$ref": "#/components/schemas/MarketData"
          },
          "target_price": {
            "type": "number",
            "maximum": 200.0,
            "exclusiveMinimum": 0.0,
            "title": "Target Price",
            "description": "Target clean price per 100 of notional"
          },
          "spread_search_min_bps": {
            "type": "number",
            "maximum": 5000.0,
            "minimum": -500.0,
            "title": "Spread Search Min Bps",
            "description": "Lower bound of spread search (bps)",
            "default": 0
          },
          "spread_search_max_bps": {
            "type": "number",
            "maximum": 10000.0,
            "minimum": 0.0,
            "title": "Spread Search Max Bps",
            "description": "Upper bound of spread search (bps)",
            "default": 5000
          },
          "tolerance_bps": {
            "type": "number",
            "maximum": 1.0,
            "exclusiveMinimum": 0.0,
            "title": "Tolerance Bps",
            "description": "Convergence tolerance (bps)",
            "default": 0.01
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "loan_terms",
          "market",
          "target_price"
        ],
        "title": "SolveDMRequest"
      },
      "SolveDMResponse": {
        "properties": {
          "implied_spread_bps": {
            "type": "number",
            "title": "Implied Spread Bps"
          },
          "target_price": {
            "type": "number",
            "title": "Target Price"
          },
          "achieved_price": {
            "type": "number",
            "title": "Achieved Price"
          },
          "residual": {
            "type": "number",
            "title": "Residual"
          },
          "converged": {
            "type": "boolean",
            "title": "Converged"
          },
          "iterations": {
            "type": "integer",
            "title": "Iterations"
          },
          "valuation": {
            "additionalProperties": true,
            "type": "object",
            "title": "Valuation"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "implied_spread_bps",
          "target_price",
          "achieved_price",
          "residual",
          "converged",
          "iterations",
          "valuation"
        ],
        "title": "SolveDMResponse"
      },
      "SovereignCDSOut": {
        "properties": {
          "as_of": {
            "type": "string",
            "title": "As Of"
          },
          "baseline_country": {
            "type": "string",
            "title": "Baseline Country"
          },
          "baseline_cds_bps": {
            "type": "integer",
            "title": "Baseline Cds Bps"
          },
          "methodology": {
            "type": "string",
            "title": "Methodology"
          },
          "points": {
            "items": {
              "$ref": "#/components/schemas/SovereignPointOut"
            },
            "type": "array",
            "title": "Points"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "as_of",
          "baseline_country",
          "baseline_cds_bps",
          "methodology",
          "points"
        ],
        "title": "SovereignCDSOut"
      },
      "SovereignPointOut": {
        "properties": {
          "country": {
            "type": "string",
            "title": "Country"
          },
          "cds_5y_bps": {
            "type": "integer",
            "title": "Cds 5Y Bps"
          },
          "derived_adj_bps": {
            "type": "integer",
            "title": "Derived Adj Bps"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "country",
          "cds_5y_bps",
          "derived_adj_bps"
        ],
        "title": "SovereignPointOut"
      },
      "SpecializedLendingSlot": {
        "type": "string",
        "enum": [
          "strong",
          "good",
          "satisfactory",
          "weak",
          "default"
        ],
        "title": "SpecializedLendingSlot"
      },
      "SpreadDecompositionRow": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "bps": {
            "type": "number",
            "title": "Bps"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name",
          "bps"
        ],
        "title": "SpreadDecompositionRow"
      },
      "SpreadObservationIn": {
        "properties": {
          "date": {
            "type": "string",
            "format": "date",
            "title": "Date"
          },
          "spread_bps": {
            "type": "number",
            "minimum": 0.0,
            "title": "Spread Bps",
            "description": "Index-level spread (bps)"
          },
          "p25_bps": {
            "type": "number",
            "minimum": 0.0,
            "title": "P25 Bps",
            "description": "25th-percentile loan spread (bps)"
          },
          "p75_bps": {
            "type": "number",
            "minimum": 0.0,
            "title": "P75 Bps",
            "description": "75th-percentile loan spread (bps)"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "date",
          "spread_bps",
          "p25_bps",
          "p75_bps"
        ],
        "title": "SpreadObservationIn",
        "description": "Single spread index observation.  Compatible with LSTA / LCD data."
      },
      "SpreadPillar": {
        "properties": {
          "tenor_years": {
            "type": "number",
            "maximum": 30.0,
            "exclusiveMinimum": 0.0,
            "title": "Tenor Years"
          },
          "spread_bps": {
            "type": "integer",
            "maximum": 5000.0,
            "minimum": 0.0,
            "title": "Spread Bps"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "tenor_years",
          "spread_bps"
        ],
        "title": "SpreadPillar"
      },
      "SpreadWaterfallOut": {
        "properties": {
          "credit_spread_bps": {
            "type": "number",
            "title": "Credit Spread Bps"
          },
          "seniority_adj_bps": {
            "type": "number",
            "title": "Seniority Adj Bps"
          },
          "illiquidity_prem_bps": {
            "type": "number",
            "title": "Illiquidity Prem Bps"
          },
          "pik_adj_bps": {
            "type": "number",
            "title": "Pik Adj Bps"
          },
          "cycle_adj_bps": {
            "type": "number",
            "title": "Cycle Adj Bps"
          },
          "fair_value_spread_bps": {
            "type": "number",
            "title": "Fair Value Spread Bps"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "credit_spread_bps",
          "seniority_adj_bps",
          "illiquidity_prem_bps",
          "pik_adj_bps",
          "cycle_adj_bps",
          "fair_value_spread_bps"
        ],
        "title": "SpreadWaterfallOut"
      },
      "StartRequest": {
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          },
          "name": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "title": "Name"
          },
          "account_type": {
            "type": "string",
            "enum": [
              "individual",
              "company"
            ],
            "title": "Account Type"
          },
          "company_name": {
            "title": "Company Name",
            "type": "string",
            "maxLength": 200,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "email",
          "name",
          "account_type"
        ],
        "title": "StartRequest"
      },
      "StartResponse": {
        "properties": {
          "ok": {
            "type": "boolean",
            "title": "Ok"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "ttl_minutes": {
            "type": "integer",
            "title": "Ttl Minutes"
          },
          "dev_code": {
            "title": "Dev Code",
            "type": "string",
            "nullable": true
          }
        },
        "type": "object",
        "required": [
          "ok",
          "message",
          "ttl_minutes"
        ],
        "title": "StartResponse"
      },
      "StepUp": {
        "properties": {
          "step_date": {
            "type": "string",
            "format": "date",
            "title": "Step Date"
          },
          "step_bps": {
            "type": "integer",
            "title": "Step Bps",
            "description": "Additional bps added to spread/coupon from step_date onwards"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "step_date",
          "step_bps"
        ],
        "title": "StepUp",
        "description": "Coupon step-up: on step_date, spread/coupon increases by step_bps."
      },
      "StoredEVEstimate": {
        "properties": {
          "method": {
            "$ref": "#/components/schemas/EVMethod"
          },
          "ev_low": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Ev Low"
          },
          "ev_mid": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Ev Mid"
          },
          "ev_high": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Ev High"
          },
          "drivers": {
            "items": {
              "$ref": "#/components/schemas/EVDriverRow"
            },
            "type": "array",
            "title": "Drivers"
          },
          "inputs_hash": {
            "type": "string",
            "title": "Inputs Hash",
            "description": "SHA-256 of canonical request \u2014 reproducibility key"
          },
          "valuation_date": {
            "type": "string",
            "format": "date",
            "title": "Valuation Date"
          },
          "computed_at": {
            "type": "string",
            "format": "date-time",
            "title": "Computed At"
          },
          "source_notes": {
            "title": "Source Notes",
            "type": "string",
            "nullable": true
          },
          "estimate_id": {
            "type": "string",
            "title": "Estimate Id"
          },
          "deal_id": {
            "title": "Deal Id",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "method",
          "ev_low",
          "ev_mid",
          "ev_high",
          "inputs_hash",
          "valuation_date",
          "computed_at",
          "estimate_id"
        ],
        "title": "StoredEVEstimate",
        "description": "An EVEstimate as returned from the store \u2014 adds the assigned id."
      },
      "StoredFiling": {
        "properties": {
          "doc_id": {
            "type": "string",
            "title": "Doc Id",
            "description": "deal_documents.doc_id"
          },
          "upload_id": {
            "type": "string",
            "title": "Upload Id"
          },
          "filename": {
            "type": "string",
            "title": "Filename"
          },
          "size_bytes": {
            "type": "integer",
            "title": "Size Bytes"
          },
          "filing": {
            "$ref": "#/components/schemas/FilingRef"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "doc_id",
          "upload_id",
          "filename",
          "size_bytes",
          "filing"
        ],
        "title": "StoredFiling"
      },
      "StrategyBoundsConfig": {
        "properties": {
          "dl_pik_adj_bps": {
            "type": "integer",
            "maximum": 500.0,
            "minimum": 0.0,
            "title": "Dl Pik Adj Bps",
            "description": "PIK toggle spread add-on (bps)",
            "default": 60
          },
          "dl_seniority_unitranche_bps": {
            "type": "integer",
            "maximum": 500.0,
            "minimum": 0.0,
            "title": "Dl Seniority Unitranche Bps",
            "description": "Unitranche seniority premium (bps)",
            "default": 100
          },
          "dl_seniority_second_lien_bps": {
            "type": "integer",
            "maximum": 1000.0,
            "minimum": 0.0,
            "title": "Dl Seniority Second Lien Bps",
            "description": "Second lien seniority premium (bps)",
            "default": 220
          },
          "dl_duration_factor": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.1,
            "title": "Dl Duration Factor",
            "description": "DL modified duration approximation factor",
            "default": 0.85
          },
          "mezz_pik_multiplier": {
            "type": "integer",
            "maximum": 1000.0,
            "minimum": 0.0,
            "title": "Mezz Pik Multiplier",
            "description": "PIK% \u00d7 multiplier \u2192 bps add-on",
            "default": 250
          },
          "mezz_warrant_multiplier": {
            "type": "integer",
            "maximum": 2000.0,
            "minimum": 0.0,
            "title": "Mezz Warrant Multiplier",
            "description": "Warrant coverage \u00d7 multiplier \u2192 bps credit",
            "default": 600
          },
          "mezz_duration_factor": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.1,
            "title": "Mezz Duration Factor",
            "description": "Mezz modified duration approximation factor",
            "default": 0.8
          },
          "distressed_upside_factor": {
            "type": "number",
            "maximum": 2.0,
            "minimum": 1.0,
            "title": "Distressed Upside Factor",
            "description": "Upside recovery multiplier (vs base cents)",
            "default": 1.2
          },
          "distressed_stress_factor": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.1,
            "title": "Distressed Stress Factor",
            "description": "Stress recovery multiplier (vs base cents)",
            "default": 0.65
          },
          "distressed_max_price_cap": {
            "type": "number",
            "maximum": 120.0,
            "minimum": 100.0,
            "title": "Distressed Max Price Cap",
            "description": "Max distressed fair value price cap",
            "default": 105.0
          },
          "distressed_restructuring_simple_adj": {
            "type": "number",
            "maximum": 20.0,
            "minimum": -20.0,
            "title": "Distressed Restructuring Simple Adj",
            "description": "Restructuring simple adj (%)",
            "default": 0.0
          },
          "distressed_restructuring_moderate_adj": {
            "type": "number",
            "maximum": 0.0,
            "minimum": -20.0,
            "title": "Distressed Restructuring Moderate Adj",
            "description": "Restructuring moderate adj (%)",
            "default": -5.0
          },
          "distressed_restructuring_complex_adj": {
            "type": "number",
            "maximum": 0.0,
            "minimum": -30.0,
            "title": "Distressed Restructuring Complex Adj",
            "description": "Restructuring complex adj (%)",
            "default": -14.0
          },
          "distressed_catalyst_yes_adj": {
            "type": "number",
            "maximum": 15.0,
            "minimum": 0.0,
            "title": "Distressed Catalyst Yes Adj",
            "description": "Catalyst identified adj (%)",
            "default": 5.0
          },
          "distressed_catalyst_no_adj": {
            "type": "number",
            "maximum": 0.0,
            "minimum": -15.0,
            "title": "Distressed Catalyst No Adj",
            "description": "No catalyst adj (%)",
            "default": -6.0
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "StrategyBoundsConfig",
        "description": "Per-strategy bound adjustments that aren't covered by the CalibrationSet spread bounds."
      },
      "StrategyBoundsOut": {
        "properties": {
          "tight_bps": {
            "type": "integer",
            "title": "Tight Bps"
          },
          "wide_bps": {
            "type": "integer",
            "title": "Wide Bps"
          },
          "proxy_label": {
            "type": "string",
            "title": "Proxy Label"
          },
          "illiq_prem_bps": {
            "type": "integer",
            "title": "Illiq Prem Bps"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "tight_bps",
          "wide_bps",
          "proxy_label",
          "illiq_prem_bps"
        ],
        "title": "StrategyBoundsOut"
      },
      "StrategyCalibrationEntry": {
        "properties": {
          "sigma_tight": {
            "type": "integer",
            "maximum": 5000.0,
            "minimum": 0.0,
            "title": "Sigma Tight",
            "description": "Credit spread tight bound (\u03c3_tight) in bps"
          },
          "sigma_wide": {
            "type": "integer",
            "maximum": 10000.0,
            "minimum": 0.0,
            "title": "Sigma Wide",
            "description": "Credit spread wide bound (\u03c3_wide) in bps"
          },
          "pi_tight": {
            "type": "integer",
            "maximum": 2000.0,
            "minimum": 0.0,
            "title": "Pi Tight",
            "description": "Illiquidity premium tight bound (\u03c0_tight) in bps"
          },
          "pi_wide": {
            "type": "integer",
            "maximum": 5000.0,
            "minimum": 0.0,
            "title": "Pi Wide",
            "description": "Illiquidity premium wide bound (\u03c0_wide) in bps"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "sigma_tight",
          "sigma_wide",
          "pi_tight",
          "pi_wide"
        ],
        "title": "StrategyCalibrationEntry",
        "description": "\u03c3/\u03c0 spread bounds for a single strategy/tranche in a CUSTOM calibration."
      },
      "StrategyCalibrationOut": {
        "properties": {
          "market_calibrated": {
            "$ref": "#/components/schemas/StrategyBoundsOut"
          },
          "hardcoded_default": {
            "$ref": "#/components/schemas/HardcodedBoundsOut"
          },
          "tight_delta_bps": {
            "type": "integer",
            "title": "Tight Delta Bps"
          },
          "wide_delta_bps": {
            "type": "integer",
            "title": "Wide Delta Bps"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "market_calibrated",
          "hardcoded_default",
          "tight_delta_bps",
          "wide_delta_bps"
        ],
        "title": "StrategyCalibrationOut"
      },
      "SubmitApprovalRequest": {
        "properties": {
          "assumption_set_id": {
            "type": "string",
            "title": "Assumption Set Id"
          },
          "version_id": {
            "type": "string",
            "title": "Version Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "assumption_set_id",
          "version_id"
        ],
        "title": "SubmitApprovalRequest"
      },
      "SubscribeRequest": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "plan_id": {
            "type": "string",
            "title": "Plan Id"
          },
          "billing_cycle": {
            "type": "string",
            "title": "Billing Cycle",
            "default": "monthly"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "user_id",
          "plan_id"
        ],
        "title": "SubscribeRequest"
      },
      "SubscriptionOut": {
        "properties": {
          "subscription_id": {
            "type": "string",
            "title": "Subscription Id"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "plan_id": {
            "type": "string",
            "title": "Plan Id"
          },
          "plan_name": {
            "type": "string",
            "title": "Plan Name"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "billing_cycle": {
            "type": "string",
            "title": "Billing Cycle"
          },
          "current_period_start": {
            "type": "string",
            "title": "Current Period Start"
          },
          "current_period_end": {
            "type": "string",
            "title": "Current Period End"
          },
          "price_usd_month": {
            "type": "number",
            "title": "Price Usd Month"
          },
          "deals_per_month": {
            "type": "integer",
            "title": "Deals Per Month"
          },
          "api_calls_per_month": {
            "type": "integer",
            "title": "Api Calls Per Month"
          },
          "valuations_per_month": {
            "type": "integer",
            "title": "Valuations Per Month"
          },
          "seats": {
            "type": "integer",
            "title": "Seats"
          },
          "features": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Features"
          },
          "cancelled_at": {
            "title": "Cancelled At",
            "type": "string",
            "nullable": true
          }
        },
        "type": "object",
        "required": [
          "subscription_id",
          "user_id",
          "plan_id",
          "plan_name",
          "status",
          "billing_cycle",
          "current_period_start",
          "current_period_end",
          "price_usd_month",
          "deals_per_month",
          "api_calls_per_month",
          "valuations_per_month",
          "seats",
          "features"
        ],
        "title": "SubscriptionOut"
      },
      "SuggestAndCreateDealResponse": {
        "properties": {
          "deal_id": {
            "type": "string",
            "title": "Deal Id"
          },
          "suggested_deal": {
            "additionalProperties": true,
            "type": "object",
            "title": "Suggested Deal"
          },
          "note": {
            "type": "string",
            "title": "Note"
          },
          "extraction_usage": {
            "title": "Extraction Usage",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "deal_id",
          "suggested_deal",
          "note"
        ],
        "title": "SuggestAndCreateDealResponse"
      },
      "SuggestDealRequest": {
        "properties": {
          "upload_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Upload Ids"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "upload_ids"
        ],
        "title": "SuggestDealRequest"
      },
      "SuggestDealResponse": {
        "properties": {
          "suggested_deal": {
            "additionalProperties": true,
            "type": "object",
            "title": "Suggested Deal"
          },
          "source_upload_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Source Upload Ids"
          },
          "note": {
            "type": "string",
            "title": "Note"
          },
          "extraction_usage": {
            "title": "Extraction Usage",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "suggested_deal",
          "source_upload_ids",
          "note"
        ],
        "title": "SuggestDealResponse"
      },
      "SuggestPriceRequest": {
        "properties": {
          "valuation_date": {
            "type": "string",
            "format": "date",
            "title": "Valuation Date"
          },
          "deal_version_id": {
            "type": "string",
            "title": "Deal Version Id"
          },
          "assumption_set_version_id": {
            "type": "string",
            "title": "Assumption Set Version Id"
          },
          "scenario_spread_bps": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "minItems": 1,
            "title": "Scenario Spread Bps",
            "description": "Spread offsets in bps for base / upside / downside (e.g. 0, +50, -50)",
            "default": [
              0,
              50,
              -50
            ]
          },
          "allow_past_period_override": {
            "type": "boolean",
            "title": "Allow Past Period Override",
            "default": false
          },
          "market_data_as_of_date": {
            "title": "Market Data As Of Date",
            "type": "string",
            "format": "date",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "valuation_date",
          "deal_version_id",
          "assumption_set_version_id"
        ],
        "title": "SuggestPriceRequest"
      },
      "SyncResult": {
        "properties": {
          "updated_count": {
            "type": "integer",
            "title": "Updated Count"
          },
          "entries": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Entries"
          },
          "baseline_is_live": {
            "type": "boolean",
            "title": "Baseline Is Live"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "updated_count",
          "entries",
          "baseline_is_live"
        ],
        "title": "SyncResult"
      },
      "ToolTraceEntry": {
        "properties": {
          "tool": {
            "type": "string",
            "title": "Tool"
          },
          "input": {
            "additionalProperties": true,
            "type": "object",
            "title": "Input"
          },
          "ok": {
            "type": "boolean",
            "title": "Ok"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "tool",
          "input",
          "ok"
        ],
        "title": "ToolTraceEntry"
      },
      "Tranche": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name",
            "description": "E.g. 'Senior Secured TLB', 'Second Lien', 'Mezz'"
          },
          "notional": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Notional",
            "description": "Face value USD"
          },
          "seniority_rank": {
            "type": "integer",
            "minimum": 1.0,
            "title": "Seniority Rank",
            "description": "1 = most senior; higher = more junior"
          },
          "is_subject_deal": {
            "type": "boolean",
            "title": "Is Subject Deal",
            "description": "True if this tranche is the deal being analysed",
            "default": false
          },
          "undrawn_commitment": {
            "title": "Undrawn Commitment",
            "description": "Undrawn committed amount (RCF / DDTL) that would be drawn before default",
            "type": "number",
            "minimum": 0.0,
            "nullable": true
          },
          "utilisation_at_default_pct": {
            "title": "Utilisation At Default Pct",
            "description": "Share of the undrawn commitment assumed drawn at default (default 0.75)",
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name",
          "notional",
          "seniority_rank"
        ],
        "title": "Tranche",
        "description": "One layer of the capital structure."
      },
      "TransferDealRequest": {
        "properties": {
          "new_owner_user_id": {
            "title": "New Owner User Id",
            "description": "User to transfer the deal to. Use null to revert the deal to seed/system status (admin-only thereafter). Must be an existing platform_users.user_id; the route 422s otherwise.",
            "type": "string",
            "nullable": true
          },
          "note": {
            "title": "Note",
            "description": "Free-form audit note recorded in change_log.",
            "type": "string",
            "maxLength": 500,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "new_owner_user_id"
        ],
        "title": "TransferDealRequest"
      },
      "UnifiedValuationRequest": {
        "properties": {
          "valuation_date": {
            "type": "string",
            "format": "date",
            "title": "Valuation Date",
            "description": "Valuation date for this run. REQUIRED \u2014 every result is reproducible only if the caller pins the as-of date. Earlier implementations silently fell through to date.today() inside the dispatcher, which broke historical re-runs (Codex review 2026-05-10). The schema now rejects requests that omit it so the same gap can't reopen."
          },
          "deal_id": {
            "title": "Deal Id",
            "description": "Existing deal ID to value.",
            "type": "string",
            "nullable": true
          },
          "upload_ids": {
            "title": "Upload Ids",
            "description": "Upload IDs to run LLM extraction on.",
            "items": {
              "type": "string"
            },
            "type": "array",
            "nullable": true
          },
          "deal_payload": {
            "title": "Deal Payload",
            "description": "Inline deal dict (skips extraction + DB lookup).",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          },
          "assumption_set_id": {
            "title": "Assumption Set Id",
            "description": "Base assumption set for fundamental credit pipeline.",
            "type": "string",
            "nullable": true
          },
          "asset_type_override": {
            "title": "Asset Type Override",
            "description": "Override the classifier's asset type. One of: direct_lending, mezzanine, distressed, distressed_bond, cre, illiquid_public, secured_borrowing.",
            "type": "string",
            "nullable": true
          },
          "scenarios": {
            "title": "Scenarios",
            "description": "Optional list of spread scenarios (bps) to run alongside mid.",
            "items": {
              "type": "integer"
            },
            "type": "array",
            "nullable": true
          },
          "extract_from_documents": {
            "title": "Extract From Documents",
            "description": "If False and upload_ids provided, skips LLM extraction.",
            "default": true,
            "type": "boolean",
            "nullable": true
          },
          "strategy_overrides": {
            "title": "Strategy Overrides",
            "description": "Per-strategy engine input overrides (e.g. EBITDA, leverage, coverage). Takes precedence over deal / facility / defaults.",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          },
          "commit": {
            "type": "boolean",
            "title": "Commit",
            "description": "Persist this run as authoritative when LLM extraction was involved. Default false: when upload_ids drove a fresh extraction, the response is returned for review (no valuation_run row written, no deal metadata updated, requires_user_acceptance=true) and the caller MUST surface a review-and-accept step before treating the price as a mark. Mirrors the /value/full commit-gate (PR #125) \u2014 preserves the published methodology that AI never feeds the pricing path without an explicit user decision. Has no effect when no extraction occurred (deal_id / deal_payload paths bypass this gate because the inputs already came from a user choice).",
            "default": false
          },
          "persist": {
            "type": "boolean",
            "title": "Persist",
            "description": "When False, the run is ephemeral: no deal/assumption snapshot, no valuation_run row, no deal-metadata writes \u2014 the price is computed and returned, then forgotten (committed=false, run_id=null). Used by read-only surfaces (e.g. Ask Verus) that must never write valuation history. Independent of `commit`, which governs the extraction methodology gate.",
            "default": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "valuation_date"
        ],
        "title": "UnifiedValuationRequest"
      },
      "UnifiedValuationResponse": {
        "properties": {
          "classification": {
            "additionalProperties": true,
            "type": "object",
            "title": "Classification"
          },
          "asset_type_used": {
            "type": "string",
            "title": "Asset Type Used"
          },
          "override_applied": {
            "type": "boolean",
            "title": "Override Applied"
          },
          "extraction_usage": {
            "title": "Extraction Usage",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          },
          "valuation": {
            "$ref": "#/components/schemas/UnifiedValuationResult"
          },
          "engine_used": {
            "type": "string",
            "title": "Engine Used"
          },
          "run_id": {
            "title": "Run Id",
            "type": "string",
            "nullable": true
          },
          "deal_id": {
            "title": "Deal Id",
            "type": "string",
            "nullable": true
          },
          "deal_version_id": {
            "title": "Deal Version Id",
            "type": "string",
            "nullable": true
          },
          "assumption_set_version_id": {
            "title": "Assumption Set Version Id",
            "type": "string",
            "nullable": true
          },
          "committed": {
            "type": "boolean",
            "title": "Committed",
            "description": "True iff this call wrote a valuation_run row and updated deal metadata. False on preview-only calls where extraction ran but the caller did not pass commit=true.",
            "default": false
          },
          "requires_user_acceptance": {
            "type": "boolean",
            "title": "Requires User Acceptance",
            "description": "True when the response carries AI-extracted inputs that have NOT been reviewed by the user. The caller MUST surface a review/accept step before treating the price as authoritative.",
            "default": false
          },
          "extracted_credit_inputs": {
            "title": "Extracted Credit Inputs",
            "description": "What the LLM extracted from upload_ids on this call, surfaced so the user can review before accepting. Populated only on preview-only calls (extraction occurred + commit=false). On commit=true calls the inputs are already implicit in the valuation result and need not be echoed back.",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "classification",
          "asset_type_used",
          "override_applied",
          "valuation",
          "engine_used"
        ],
        "title": "UnifiedValuationResponse"
      },
      "UnifiedValuationResult": {
        "properties": {
          "pv_low": {
            "type": "number",
            "title": "Pv Low"
          },
          "pv_mid": {
            "type": "number",
            "title": "Pv Mid"
          },
          "pv_high": {
            "type": "number",
            "title": "Pv High"
          },
          "price_low": {
            "type": "number",
            "title": "Price Low"
          },
          "price_mid": {
            "type": "number",
            "title": "Price Mid"
          },
          "price_high": {
            "type": "number",
            "title": "Price High"
          },
          "range_basis": {
            "title": "Range Basis",
            "description": "Which methodology produced the low/mid/high band \u2014 two paths would otherwise present incomparable ranges under the same field names (same contract as ValuationRecord.range_basis). 'scenario_blend': low = recovery-scenario price, high = base-scenario price, mid = probability-weighted blend \u2014 scenario BOUNDS, not distribution percentiles (the default for direct-lending deals with EV coverage). 'spread_percentile': 5th/50th/95th percentile of the spread distribution (pure-yield deals; the engine's vol_quantile ladder). 'driver_widened': per-driver dispersion width from the full DCF pipeline. 'fixed_min_width' / 'vol_quantile': forwarded verbatim from ValuationRecord.range_basis when the full pipeline stamps them. 'monte_carlo': p5/p95 of a strategy Monte Carlo. 'indicative_band': fixed \u00b13% display band around a multi-factor score-based price \u2014 directional only.",
            "type": "string",
            "enum": [
              "scenario_blend",
              "spread_percentile",
              "driver_widened",
              "fixed_min_width",
              "vol_quantile",
              "monte_carlo",
              "indicative_band"
            ],
            "nullable": true
          },
          "price_basis": {
            "title": "Price Basis",
            "description": "Denominator convention of price_low/mid/high. 'outstanding_notional' (the 2026-08 loan-market convention on every DCF path): PV of remaining cashflows per 100 of CURRENT outstanding. 'original_effective_notional': legacy per-100-of-original-commitment quote (past-maturity edge path only). 'face_par_100': cents per 100 face from a multi-factor / distressed strategy engine.",
            "type": "string",
            "enum": [
              "outstanding_notional",
              "original_effective_notional",
              "face_par_100"
            ],
            "nullable": true
          },
          "outstanding_notional": {
            "title": "Outstanding Notional",
            "description": "Schedule-implied outstanding at the valuation date (scheduled amortisation netted, capitalised PIK included, held-share scaled) \u2014 the denominator of price_low/mid/high on DCF yield-path runs. Populated on those runs only.",
            "type": "number",
            "nullable": true
          },
          "price_per_100_original": {
            "title": "Price Per 100 Original",
            "description": "Mid price re-quoted per 100 of the ORIGINAL effective (held) commitment \u2014 the pre-2026-08 headline convention, kept for reconciliation against historical marks. pv_mid == price_mid/100 \u00d7 outstanding_notional == price_per_100_original/100 \u00d7 original effective notional.",
            "type": "number",
            "nullable": true
          },
          "principal_factor": {
            "title": "Principal Factor",
            "description": "Market-convention amortisation factor (ABS pool-factor analogue): outstanding_notional / original effective commitment. Settlement-style math: pv_mid == price_mid/100 \u00d7 principal_factor \u00d7 original effective notional. 1.0 for bullets; < 1.0 after scheduled amortisation; > 1.0 possible when capitalised PIK outgrows amortisation. Populated on DCF yield-path runs only.",
            "type": "number",
            "nullable": true
          },
          "spread_waterfall": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "nullable": true
              }
            ],
            "title": "Spread Waterfall",
            "description": "Spread decomposition for the mark. Two shapes, by engine: the multi-factor paths (value_deal+multi_factor_modifier, multi_factor) emit the flat SpreadWaterfallOut OBJECT (credit_spread_bps / seniority_adj_bps / illiquidity_prem_bps / pik_adj_bps / cycle_adj_bps / fair_value_spread_bps) \u2014 that is the shape the UI's SpreadWaterfallPayload renders; the full_pipeline path emits the ordered spread_decomposition ROWS ([{name, bps}, ...]). Consumers must branch on the type."
          },
          "factor_scores": {
            "title": "Factor Scores",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          },
          "credit_metrics": {
            "title": "Credit Metrics",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings"
          },
          "compliance": {
            "$ref": "#/components/schemas/FairValueCompliance",
            "nullable": true
          },
          "is_indicative": {
            "type": "boolean",
            "title": "Is Indicative",
            "description": "True when this result was produced by a fallback engine rather than the primary borrower-specific path \u2014 e.g. direct-lending where the yield path couldn't run and the dispatcher fell back to multi-factor scoring. The UI MUST render an 'Indicative' badge and treat the price as directional, not as a mark. False on every primary engine path (DCF, full pipeline, multi-factor for asset types where MF IS the primary engine like mezzanine / cre / distressed).",
            "default": false
          },
          "fair_value_level": {
            "title": "Fair Value Level",
            "description": "Canonical IFRS 13 / ASC 820 fair-value hierarchy level. Single source of truth: derived from the engine's `fair_value_level_resolved` when value_deal() ran (DCF + yield-path direct lending), or from the rule-based asset-type default for paths where no DCF level was computed (multi-factor dispatch on mezzanine / cre / distressed, full pipeline where the engine didn't escalate). Replaces the duplicated level that used to live on credit_metrics \u2014 that was a two-sources-of-truth bug (Codex P2 #8) where the engine and the compliance module independently classified the level and could silently disagree.",
            "type": "integer",
            "enum": [
              1,
              2,
              3
            ],
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "pv_low",
          "pv_mid",
          "pv_high",
          "price_low",
          "price_mid",
          "price_high"
        ],
        "title": "UnifiedValuationResult"
      },
      "UnobservableInputDisclosure": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "value": {
            "type": "number",
            "title": "Value"
          },
          "unit": {
            "type": "string",
            "title": "Unit"
          },
          "range_low": {
            "title": "Range Low",
            "type": "number",
            "nullable": true
          },
          "range_high": {
            "title": "Range High",
            "type": "number",
            "nullable": true
          },
          "weighted_average": {
            "title": "Weighted Average",
            "type": "number",
            "nullable": true
          },
          "sensitivity_note": {
            "title": "Sensitivity Note",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name",
          "value",
          "unit"
        ],
        "title": "UnobservableInputDisclosure",
        "description": "Quantitative disclosure for a Level 3 unobservable input.\n\nASC 820-10-50-2(bbb) / IFRS 13.93(d) require, for each class of Level 3\nmeasurements, a quantitative disclosure of the significant unobservable\ninputs including the range and (where practicable) weighted average."
      },
      "UpdateFundRequest": {
        "properties": {
          "name": {
            "title": "Name",
            "type": "string",
            "nullable": true
          },
          "strategy": {
            "title": "Strategy",
            "type": "string",
            "nullable": true
          },
          "status": {
            "title": "Status",
            "type": "string",
            "nullable": true
          },
          "target_size": {
            "title": "Target Size",
            "type": "number",
            "nullable": true
          },
          "legal_entity": {
            "title": "Legal Entity",
            "type": "string",
            "nullable": true
          },
          "notes": {
            "title": "Notes",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "UpdateFundRequest"
      },
      "UpdateLPAccountRequest": {
        "properties": {
          "lp_name": {
            "title": "Lp Name",
            "type": "string",
            "nullable": true
          },
          "commitment": {
            "title": "Commitment",
            "type": "number",
            "minimum": 0.0,
            "nullable": true
          },
          "called": {
            "title": "Called",
            "type": "number",
            "minimum": 0.0,
            "nullable": true
          },
          "distributed": {
            "title": "Distributed",
            "type": "number",
            "minimum": 0.0,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "UpdateLPAccountRequest"
      },
      "UpdateNoteRequest": {
        "properties": {
          "title": {
            "title": "Title",
            "type": "string",
            "maxLength": 500,
            "nullable": true
          },
          "markdown": {
            "title": "Markdown",
            "type": "string",
            "maxLength": 1000000,
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "UpdateNoteRequest"
      },
      "UpdateUserRequest": {
        "properties": {
          "name": {
            "title": "Name",
            "type": "string",
            "nullable": true
          },
          "role": {
            "title": "Role",
            "type": "string",
            "nullable": true
          },
          "status": {
            "title": "Status",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "UpdateUserRequest"
      },
      "UploadIdResult": {
        "properties": {
          "upload_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Upload Ids"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "upload_ids"
        ],
        "title": "UploadIdResult"
      },
      "UploadResult": {
        "properties": {
          "inserted": {
            "type": "integer",
            "title": "Inserted"
          },
          "received": {
            "type": "integer",
            "title": "Received"
          },
          "skipped": {
            "type": "integer",
            "title": "Skipped"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "inserted",
          "received",
          "skipped"
        ],
        "title": "UploadResult"
      },
      "UploadSummary": {
        "properties": {
          "upload_id": {
            "type": "string",
            "title": "Upload Id"
          },
          "filename": {
            "type": "string",
            "title": "Filename"
          },
          "content_type": {
            "type": "string",
            "title": "Content Type"
          },
          "size_bytes": {
            "type": "integer",
            "title": "Size Bytes"
          },
          "uploaded_at": {
            "type": "string",
            "title": "Uploaded At"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "upload_id",
          "filename",
          "content_type",
          "size_bytes",
          "uploaded_at"
        ],
        "title": "UploadSummary"
      },
      "UsageDayPoint": {
        "properties": {
          "date": {
            "type": "string",
            "title": "Date"
          },
          "calls": {
            "type": "integer",
            "title": "Calls"
          }
        },
        "type": "object",
        "required": [
          "date",
          "calls"
        ],
        "title": "UsageDayPoint"
      },
      "UsageSummaryOut": {
        "properties": {
          "period": {
            "type": "string",
            "title": "Period"
          },
          "total_api_calls": {
            "type": "integer",
            "title": "Total Api Calls"
          },
          "by_resource_type": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "By Resource Type"
          },
          "by_day": {
            "items": {
              "$ref": "#/components/schemas/UsageDayPoint"
            },
            "type": "array",
            "title": "By Day"
          },
          "limit_api_calls": {
            "type": "integer",
            "title": "Limit Api Calls",
            "default": -1
          },
          "limit_deals": {
            "type": "integer",
            "title": "Limit Deals",
            "default": -1
          },
          "limit_valuations": {
            "type": "integer",
            "title": "Limit Valuations",
            "default": -1
          },
          "pct_api_calls": {
            "title": "Pct Api Calls",
            "type": "number",
            "nullable": true
          }
        },
        "type": "object",
        "required": [
          "period",
          "total_api_calls",
          "by_resource_type",
          "by_day"
        ],
        "title": "UsageSummaryOut"
      },
      "UserOut": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "plan_id": {
            "title": "Plan Id",
            "type": "string",
            "nullable": true
          },
          "plan_name": {
            "title": "Plan Name",
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "last_login_at": {
            "title": "Last Login At",
            "type": "string",
            "nullable": true
          },
          "api_calls_this_month": {
            "type": "integer",
            "title": "Api Calls This Month",
            "default": 0
          },
          "valuations_this_month": {
            "title": "Valuations This Month",
            "type": "integer",
            "nullable": true
          },
          "valuation_limit": {
            "title": "Valuation Limit",
            "type": "integer",
            "nullable": true
          },
          "valuation_reset_date": {
            "title": "Valuation Reset Date",
            "type": "string",
            "nullable": true
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "email",
          "name",
          "role",
          "status",
          "created_at"
        ],
        "title": "UserOut"
      },
      "UserStatsOut": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "plan_id": {
            "title": "Plan Id",
            "type": "string",
            "nullable": true
          },
          "plan_name": {
            "title": "Plan Name",
            "type": "string",
            "nullable": true
          },
          "api_calls_this_month": {
            "type": "integer",
            "title": "Api Calls This Month"
          },
          "api_calls_limit": {
            "type": "integer",
            "title": "Api Calls Limit"
          },
          "deals_limit": {
            "type": "integer",
            "title": "Deals Limit"
          },
          "valuations_limit": {
            "type": "integer",
            "title": "Valuations Limit"
          },
          "pct_used": {
            "title": "Pct Used",
            "type": "number",
            "nullable": true
          },
          "status": {
            "type": "string",
            "title": "Status"
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "email",
          "name",
          "role",
          "plan_id",
          "plan_name",
          "api_calls_this_month",
          "api_calls_limit",
          "deals_limit",
          "valuations_limit",
          "pct_used",
          "status"
        ],
        "title": "UserStatsOut"
      },
      "VaRResult": {
        "properties": {
          "confidence_level": {
            "type": "number",
            "title": "Confidence Level"
          },
          "var_loss": {
            "type": "number",
            "title": "Var Loss",
            "description": "Loss from mean at this confidence level"
          },
          "cvar_loss": {
            "type": "number",
            "title": "Cvar Loss",
            "description": "Expected shortfall (average loss beyond VaR)"
          },
          "var_pv": {
            "type": "number",
            "title": "Var Pv",
            "description": "PV at VaR threshold"
          },
          "cvar_pv": {
            "type": "number",
            "title": "Cvar Pv",
            "description": "Average PV in the tail beyond VaR"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "confidence_level",
          "var_loss",
          "cvar_loss",
          "var_pv",
          "cvar_pv"
        ],
        "title": "VaRResult",
        "description": "Value at Risk at a given confidence level."
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "ValidationRequest": {
        "properties": {
          "valuation_date": {
            "type": "string",
            "format": "date",
            "title": "Valuation Date"
          },
          "deal_version_id": {
            "type": "string",
            "title": "Deal Version Id"
          },
          "assumption_set_version_id": {
            "type": "string",
            "title": "Assumption Set Version Id"
          },
          "market_data_as_of_date": {
            "title": "Market Data As Of Date",
            "type": "string",
            "format": "date",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "valuation_date",
          "deal_version_id",
          "assumption_set_version_id"
        ],
        "title": "ValidationRequest"
      },
      "ValuationAssumptions": {
        "properties": {
          "valuation_method": {
            "$ref": "#/components/schemas/ValuationMethod",
            "default": "DM"
          },
          "discount_margin_bps": {
            "type": "integer",
            "maximum": 5000.0,
            "minimum": -500.0,
            "title": "Discount Margin Bps"
          },
          "spread_curve": {
            "title": "Spread Curve",
            "items": {
              "$ref": "#/components/schemas/SpreadPillar"
            },
            "type": "array",
            "nullable": true
          },
          "liquidity_haircut_bps": {
            "type": "integer",
            "maximum": 500.0,
            "minimum": 0.0,
            "title": "Liquidity Haircut Bps",
            "default": 0
          },
          "ifrs13_level": {
            "type": "integer",
            "maximum": 3.0,
            "minimum": 1.0,
            "title": "Ifrs13 Level",
            "default": 3
          },
          "calibrated_spread_bps": {
            "title": "Calibrated Spread Bps",
            "description": "Spread implied by the issuance price at calibration_date, in bps.",
            "type": "number",
            "maximum": 5000.0,
            "minimum": -500.0,
            "nullable": true
          },
          "calibration_date": {
            "title": "Calibration Date",
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "market_spread_delta_bps": {
            "type": "number",
            "maximum": 5000.0,
            "minimum": -2000.0,
            "title": "Market Spread Delta Bps",
            "description": "Additive market drift applied to the calibrated anchor. Resolved from FRED at run time when not supplied.",
            "default": 0.0
          },
          "company_spread_delta_bps": {
            "type": "number",
            "maximum": 2000.0,
            "minimum": -1000.0,
            "title": "Company Spread Delta Bps",
            "description": "Company-specific spread delta. Sum of the structured checklist contributions or a multi-factor-derived delta. Applied additively on top of calibrated_spread + market_spread_delta; audited on the CalibrationTrace.",
            "default": 0.0
          },
          "company_delta_source": {
            "type": "string",
            "maxLength": 200,
            "title": "Company Delta Source",
            "description": "Provenance of company_spread_delta_bps for audit: 'multi_factor:<label>', 'checklist', 'manual', or 'none'.",
            "default": "none"
          },
          "lpi_spread_delta_bps": {
            "type": "number",
            "maximum": 500.0,
            "minimum": -200.0,
            "title": "Lpi Spread Delta Bps",
            "description": "LPI composite -> bps structural-protection delta. 0.0 when LPI is incomplete or deal has no lpi_terms. Applied additively to the calibrated yield spread alongside company_spread_delta_bps. Audited on CalibrationTrace. Bounds [-200, 500] guard this engine input: delta_from_lpi only produces [-75, +250] (neutral 60), so the range covers the mapping with calibration headroom while rejecting absurd direct-DB/bypass values that would otherwise move the mark ~10x intended.",
            "default": 0.0
          },
          "lpi_source": {
            "type": "string",
            "maxLength": 200,
            "title": "Lpi Source",
            "description": "Provenance of lpi_spread_delta_bps: 'lpi:strong', 'lpi:balanced', 'lpi:borrower-friendly', 'lpi:incomplete-fallback', or 'none'.",
            "default": "none"
          },
          "anchor_source": {
            "type": "string",
            "enum": [
              "none",
              "rating_model",
              "price_calibrated",
              "manual"
            ],
            "title": "Anchor Source",
            "description": "How this set's spread ANCHOR was derived \u2014 whichever field carries it (calibrated_spread_bps when present, else discount_margin_bps): 'rating_model' (a rating \u2192 credit-curve lookup, e.g. from fundamental_credit or the live per-rating composite), 'price_calibrated' (back-solved from an observed market price), 'manual' (analyst override), or 'none' (unknown / legacy provenance). Load-bearing beyond display: 'rating_model' means the anchor already embeds expected loss, so the engine skips the hazard survival haircut and the explicit recovery leg on the base mark rather than charging credit twice (MARK-03, engine/valuation.py::_el_embedded_in_spread).",
            "default": "none"
          },
          "market_spread_source": {
            "type": "string",
            "maxLength": 200,
            "title": "Market Spread Source",
            "description": "Provenance of market_spread_delta_bps (the composite drift), e.g. 'composite:mezzanine:Normal' or 'none'. Preserves the drift origin so the calibration trace does not degrade to 'manual' when the delta is pre-stamped at apply time (review codex-MEDIUM).",
            "default": "none"
          },
          "observable_comparable_price": {
            "title": "Observable Comparable Price",
            "description": "Observable secondary-market price per 100 for a comparable instrument. When present and close to the DCF price the output is tagged Level 2.",
            "type": "number",
            "maximum": 200.0,
            "minimum": 0.0,
            "nullable": true
          },
          "observable_comparable_tolerance_pct": {
            "type": "number",
            "maximum": 25.0,
            "minimum": 0.0,
            "title": "Observable Comparable Tolerance Pct",
            "description": "Absolute price tolerance (in price points / 100) for Level-2 escalation. Default 1.0 = within 1 cent on the dollar.",
            "default": 1.0
          },
          "scenario_weights": {
            "$ref": "#/components/schemas/ScenarioWeights",
            "nullable": true
          },
          "downside_uplift_bps": {
            "title": "Downside Uplift Bps",
            "description": "Spread uplift applied in the blend's downside scenario, before coverage scaling. None \u2192 engine default (300 bps). When anchor_source=='rating_model' the anchor sites stamp the grid-implied one-letter-grade-downgrade widening here so the downside stress is proportional to where the credit sits on the curve.",
            "type": "number",
            "maximum": 2000.0,
            "minimum": 0.0,
            "nullable": true
          },
          "downside_uplift_source": {
            "type": "string",
            "maxLength": 100,
            "title": "Downside Uplift Source",
            "description": "Provenance of downside_uplift_bps for audit: 'grid_downgrade:<rating>-><rating>', 'manual', or 'none' (engine default of 300 bps).",
            "default": "none"
          },
          "downside_hazard_multiplier": {
            "type": "number",
            "maximum": 10.0,
            "minimum": 1.0,
            "title": "Downside Hazard Multiplier",
            "description": "Multiplier on the hazard term structure in the downside scenario. Applied ONLY when the base mark does not embed expected loss in its spread (i.e. NOT rating_model-calibrated sets \u2014 MARK-03: stressing both spread and hazard there would double-count credit). 1.0 = no hazard stress (default, bit-identical to prior behaviour).",
            "default": 1.0
          },
          "downside_regime_factor": {
            "type": "number",
            "maximum": 2.0,
            "minimum": 0.25,
            "title": "Downside Regime Factor",
            "description": "Multiplier on the downside spread uplift reflecting the market regime at valuation (e.g. <1 when spreads are already wide and much of the stress widening is in the base mark via market drift). Set per assumption set / stamped by callers using regime_uplift_factor(); 1.0 = neutral (default).",
            "default": 1.0
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "discount_margin_bps"
        ],
        "title": "ValuationAssumptions"
      },
      "ValuationComponents": {
        "properties": {
          "pv_interest": {
            "type": "number",
            "title": "Pv Interest",
            "default": 0.0
          },
          "pv_principal": {
            "type": "number",
            "title": "Pv Principal",
            "default": 0.0
          },
          "pv_fees": {
            "type": "number",
            "title": "Pv Fees",
            "default": 0.0
          },
          "pv_recovery": {
            "type": "number",
            "title": "Pv Recovery",
            "default": 0.0
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ValuationComponents",
        "description": "PV breakdown by cashflow leg (explainable valuation)."
      },
      "ValuationEngineConfig": {
        "properties": {
          "spread_clamp_max_bps": {
            "type": "integer",
            "maximum": 100000.0,
            "minimum": 5000.0,
            "title": "Spread Clamp Max Bps",
            "description": "Maximum spread clamp (bps)",
            "default": 50000
          },
          "spread_clamp_min_bps": {
            "type": "integer",
            "maximum": 0.0,
            "minimum": -10000.0,
            "title": "Spread Clamp Min Bps",
            "description": "Minimum spread clamp (bps)",
            "default": -5000
          },
          "dv01_bump_bps": {
            "type": "integer",
            "maximum": 10.0,
            "minimum": 1.0,
            "title": "Dv01 Bump Bps",
            "description": "DV01 calculation bump size (bps)",
            "default": 1
          },
          "default_spread_vol_bps": {
            "type": "integer",
            "maximum": 500.0,
            "minimum": 10.0,
            "title": "Default Spread Vol Bps",
            "description": "Default spread vol when unavailable (bps)",
            "default": 85
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ValuationEngineConfig",
        "description": "Core DCF valuation engine clamps and defaults."
      },
      "ValuationMethod": {
        "type": "string",
        "enum": [
          "DM"
        ],
        "title": "ValuationMethod"
      },
      "ValuationRangeRequest": {
        "properties": {
          "valuation_date": {
            "type": "string",
            "format": "date",
            "title": "Valuation Date"
          },
          "deal_version_id": {
            "type": "string",
            "title": "Deal Version Id"
          },
          "assumption_set_version_id": {
            "type": "string",
            "title": "Assumption Set Version Id"
          },
          "country": {
            "type": "string",
            "title": "Country",
            "description": "e.g. US, UK"
          },
          "sector": {
            "type": "string",
            "title": "Sector",
            "description": "e.g. Software, Healthcare"
          },
          "capital_structure": {
            "type": "string",
            "title": "Capital Structure",
            "description": "senior | unitranche | subordinated",
            "default": "senior"
          },
          "leverage_bucket": {
            "type": "string",
            "title": "Leverage Bucket",
            "description": "low | mid | high",
            "default": "mid"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "valuation_date",
          "deal_version_id",
          "assumption_set_version_id",
          "country",
          "sector"
        ],
        "title": "ValuationRangeRequest",
        "description": "Deterministic valuation range from spread lookup (country, sector, capital structure, leverage)."
      },
      "ValuationRecord": {
        "properties": {
          "run_id": {
            "type": "string",
            "title": "Run Id"
          },
          "valuation_date": {
            "type": "string",
            "title": "Valuation Date"
          },
          "pv_low": {
            "type": "number",
            "title": "Pv Low"
          },
          "pv_mid": {
            "type": "number",
            "title": "Pv Mid"
          },
          "pv_high": {
            "type": "number",
            "title": "Pv High"
          },
          "price_clean_low": {
            "type": "number",
            "title": "Price Clean Low"
          },
          "price_clean_mid": {
            "type": "number",
            "title": "Price Clean Mid"
          },
          "price_clean_high": {
            "type": "number",
            "title": "Price Clean High"
          },
          "price_dirty_low": {
            "type": "number",
            "title": "Price Dirty Low"
          },
          "price_dirty_mid": {
            "type": "number",
            "title": "Price Dirty Mid"
          },
          "price_dirty_high": {
            "type": "number",
            "title": "Price Dirty High"
          },
          "mid_spread_bps": {
            "type": "number",
            "title": "Mid Spread Bps"
          },
          "range_width_bps": {
            "type": "number",
            "title": "Range Width Bps"
          },
          "range_basis": {
            "type": "string",
            "enum": [
              "driver_widened",
              "fixed_min_width",
              "vol_quantile",
              "scenario_blend"
            ],
            "title": "Range Basis",
            "default": "driver_widened"
          },
          "confidence_level": {
            "title": "Confidence Level",
            "type": "number",
            "nullable": true
          },
          "ytm_mid": {
            "title": "Ytm Mid",
            "type": "number",
            "nullable": true
          },
          "ytm_mid_blended": {
            "title": "Ytm Mid Blended",
            "type": "number",
            "nullable": true
          },
          "oid_accreted": {
            "type": "number",
            "title": "Oid Accreted",
            "default": 0.0
          },
          "oid_unamortized": {
            "type": "number",
            "title": "Oid Unamortized",
            "default": 0.0
          },
          "carrying_value": {
            "type": "number",
            "title": "Carrying Value",
            "default": 0.0
          },
          "upfront_fee_accreted": {
            "type": "number",
            "title": "Upfront Fee Accreted",
            "default": 0.0
          },
          "upfront_fee_unamortized": {
            "type": "number",
            "title": "Upfront Fee Unamortized",
            "default": 0.0
          },
          "exit_fee_accreted": {
            "type": "number",
            "title": "Exit Fee Accreted",
            "default": 0.0
          },
          "exit_fee_unamortized": {
            "type": "number",
            "title": "Exit Fee Unamortized",
            "default": 0.0
          },
          "exit_price_mid": {
            "title": "Exit Price Mid",
            "type": "number",
            "nullable": true
          },
          "liquidity_haircut_bps": {
            "type": "integer",
            "title": "Liquidity Haircut Bps",
            "default": 0
          },
          "ifrs13_level": {
            "type": "integer",
            "title": "Ifrs13 Level",
            "default": 3
          },
          "ifrs13_rationale": {
            "type": "string",
            "title": "Ifrs13 Rationale",
            "default": "Private credit \u2014 unobservable inputs (Level 3)"
          },
          "modified_duration": {
            "title": "Modified Duration",
            "type": "number",
            "nullable": true
          },
          "dv01": {
            "title": "Dv01",
            "type": "number",
            "nullable": true
          },
          "approach_used": {
            "title": "Approach Used",
            "type": "string",
            "nullable": true
          },
          "ev_coverage_ratio": {
            "title": "Ev Coverage Ratio",
            "type": "number",
            "nullable": true
          },
          "fair_value_level_resolved": {
            "title": "Fair Value Level Resolved",
            "type": "integer",
            "nullable": true
          },
          "calibration_trace": {
            "title": "Calibration Trace",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          },
          "scenario_breakdown": {
            "title": "Scenario Breakdown",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          },
          "spread_decomposition": {
            "items": {
              "$ref": "#/components/schemas/SpreadDecompositionRow"
            },
            "type": "array",
            "title": "Spread Decomposition"
          },
          "range_width_drivers": {
            "items": {
              "$ref": "#/components/schemas/RangeWidthDriver"
            },
            "type": "array",
            "title": "Range Width Drivers"
          },
          "price_composition": {
            "items": {
              "$ref": "#/components/schemas/ScenarioComposition"
            },
            "type": "array",
            "title": "Price Composition"
          },
          "credit_curve": {
            "$ref": "#/components/schemas/CreditCurveResult",
            "nullable": true
          },
          "credit_curve_table": {
            "items": {
              "$ref": "#/components/schemas/CreditCurveRow"
            },
            "type": "array",
            "title": "Credit Curve Table"
          },
          "cashflows": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Cashflows"
          },
          "components_mid": {
            "$ref": "#/components/schemas/ValuationComponents",
            "nullable": true
          },
          "inputs_snapshot": {
            "additionalProperties": true,
            "type": "object",
            "title": "Inputs Snapshot"
          },
          "lookup_table_versions": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Lookup Table Versions"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings"
          },
          "markst_factor_delta_bps": {
            "type": "number",
            "title": "Markst Factor Delta Bps",
            "default": 0.0
          },
          "markst_calibrated_mid_bps": {
            "title": "Markst Calibrated Mid Bps",
            "type": "number",
            "nullable": true
          },
          "markst_factor_trace": {
            "items": {
              "$ref": "#/components/schemas/MarkstFactorTraceRow"
            },
            "type": "array",
            "title": "Markst Factor Trace"
          },
          "markst_calibration_version_id": {
            "title": "Markst Calibration Version Id",
            "type": "string",
            "nullable": true
          },
          "credit_basis": {
            "description": "Credit basis state at run time (mark_to_model | manual_override | unmarked).",
            "$ref": "#/components/schemas/CreditBasisState",
            "nullable": true
          },
          "market_env_version": {
            "title": "Market Env Version",
            "description": "Version ID of the Market Env AssumptionSet used for this run.",
            "type": "string",
            "nullable": true
          },
          "credit_analysis_version": {
            "title": "Credit Analysis Version",
            "description": "Version ID of the credit-analysis snapshot used for this run.",
            "type": "string",
            "nullable": true
          },
          "assumption_set_version_id": {
            "title": "Assumption Set Version Id",
            "description": "Version ID of the stamped AssumptionSet (resolved.version_id) that produced this run.",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "run_id",
          "valuation_date",
          "pv_low",
          "pv_mid",
          "pv_high",
          "price_clean_low",
          "price_clean_mid",
          "price_clean_high",
          "price_dirty_low",
          "price_dirty_mid",
          "price_dirty_high",
          "mid_spread_bps",
          "range_width_bps"
        ],
        "title": "ValuationRecord"
      },
      "ValuationRequest": {
        "properties": {
          "loan_terms": {
            "$ref": "#/components/schemas/LoanTerms"
          },
          "borrower_metrics": {
            "$ref": "#/components/schemas/BorrowerMetrics"
          },
          "classification": {
            "$ref": "#/components/schemas/Classification"
          },
          "market": {
            "$ref": "#/components/schemas/MarketData"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "loan_terms",
          "market"
        ],
        "title": "ValuationRequest"
      },
      "VerusMarkPoint": {
        "properties": {
          "run_id": {
            "type": "string",
            "title": "Run Id"
          },
          "as_of": {
            "title": "As Of",
            "type": "string",
            "nullable": true
          },
          "price": {
            "title": "Price",
            "type": "number",
            "nullable": true
          },
          "price_low": {
            "title": "Price Low",
            "type": "number",
            "nullable": true
          },
          "price_high": {
            "title": "Price High",
            "type": "number",
            "nullable": true
          },
          "spread_bps": {
            "title": "Spread Bps",
            "type": "number",
            "nullable": true
          },
          "price_basis": {
            "type": "string",
            "enum": [
              "outstanding",
              "original"
            ],
            "title": "Price Basis",
            "default": "outstanding"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "run_id"
        ],
        "title": "VerusMarkPoint",
        "description": "The persisted Verus mark reduced to the fields a comparison needs."
      },
      "VintagePointerOut": {
        "properties": {
          "source": {
            "type": "string",
            "title": "Source"
          },
          "vintage_id": {
            "type": "string",
            "title": "Vintage Id"
          },
          "ingested_at": {
            "title": "Ingested At",
            "type": "string",
            "nullable": true
          },
          "ingested_by": {
            "title": "Ingested By",
            "type": "string",
            "nullable": true
          },
          "anchor_as_of": {
            "title": "Anchor As Of",
            "type": "string",
            "nullable": true
          },
          "source_filings": {
            "title": "Source Filings",
            "items": {
              "$ref": "#/components/schemas/FilingPeriodOut"
            },
            "type": "array",
            "nullable": true
          },
          "present": {
            "type": "boolean",
            "title": "Present"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "source",
          "vintage_id",
          "present"
        ],
        "title": "VintagePointerOut"
      },
      "WaterfallTranche": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "notional": {
            "type": "number",
            "title": "Notional"
          },
          "seniority_rank": {
            "type": "integer",
            "title": "Seniority Rank"
          },
          "recovered": {
            "type": "number",
            "minimum": 0.0,
            "title": "Recovered"
          },
          "recovery_rate": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Recovery Rate"
          },
          "is_subject_deal": {
            "type": "boolean",
            "title": "Is Subject Deal"
          },
          "claim_at_default": {
            "title": "Claim At Default",
            "type": "number",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name",
          "notional",
          "seniority_rank",
          "recovered",
          "recovery_rate",
          "is_subject_deal"
        ],
        "title": "WaterfallTranche",
        "description": "Per-tranche result from the EV recovery waterfall."
      },
      "app__api__api_keys__ApiKeyOut": {
        "properties": {
          "key_id": {
            "type": "string",
            "title": "Key Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "key_prefix": {
            "type": "string",
            "title": "Key Prefix"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "last_used_at": {
            "title": "Last Used At",
            "type": "string",
            "nullable": true
          },
          "revoked": {
            "type": "boolean",
            "title": "Revoked"
          },
          "role": {
            "type": "string",
            "title": "Role"
          }
        },
        "type": "object",
        "required": [
          "key_id",
          "name",
          "key_prefix",
          "created_at",
          "last_used_at",
          "revoked",
          "role"
        ],
        "title": "ApiKeyOut"
      },
      "app__api__auth_register__VerifyRequest": {
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          },
          "code": {
            "type": "string",
            "maxLength": 6,
            "minLength": 6,
            "pattern": "^\\d{6}$",
            "title": "Code"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "email",
          "code"
        ],
        "title": "VerifyRequest"
      },
      "app__api__auth_register__VerifyResponse": {
        "properties": {
          "ok": {
            "type": "boolean",
            "title": "Ok"
          },
          "registration_token": {
            "type": "string",
            "title": "Registration Token"
          },
          "account_type": {
            "type": "string",
            "enum": [
              "individual",
              "company"
            ],
            "title": "Account Type"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "company_name": {
            "title": "Company Name",
            "type": "string",
            "nullable": true
          },
          "next_step": {
            "type": "string",
            "enum": [
              "nda",
              "enterprise_contact"
            ],
            "title": "Next Step"
          }
        },
        "type": "object",
        "required": [
          "ok",
          "registration_token",
          "account_type",
          "name",
          "email",
          "next_step"
        ],
        "title": "VerifyResponse"
      },
      "app__api__me__ApiKeyOut": {
        "properties": {
          "key_id": {
            "type": "string",
            "title": "Key Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "key_prefix": {
            "type": "string",
            "title": "Key Prefix"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "last_used_at": {
            "title": "Last Used At",
            "type": "string",
            "nullable": true
          },
          "revoked": {
            "type": "boolean",
            "title": "Revoked"
          }
        },
        "type": "object",
        "required": [
          "key_id",
          "name",
          "key_prefix",
          "role",
          "created_at",
          "revoked"
        ],
        "title": "ApiKeyOut",
        "description": "Public-safe view of an API key \u2014 never includes the raw secret."
      },
      "app__api__mfa__VerifyRequest": {
        "properties": {
          "code": {
            "type": "string",
            "maxLength": 12,
            "minLength": 6,
            "title": "Code"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "code"
        ],
        "title": "VerifyRequest"
      },
      "app__api__mfa__VerifyResponse": {
        "properties": {
          "ok": {
            "type": "boolean",
            "title": "Ok"
          },
          "used_backup_code": {
            "type": "boolean",
            "title": "Used Backup Code"
          },
          "remaining_backup_codes": {
            "type": "integer",
            "title": "Remaining Backup Codes"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "ok",
          "used_backup_code",
          "remaining_backup_codes"
        ],
        "title": "VerifyResponse"
      },
      "app__api__reports__GenerateReportRequest": {
        "properties": {
          "valuation": {
            "additionalProperties": true,
            "type": "object",
            "title": "Valuation",
            "default": {}
          },
          "credit_analysis": {
            "title": "Credit Analysis",
            "additionalProperties": true,
            "type": "object",
            "nullable": true
          },
          "as_of_date": {
            "title": "As Of Date",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "GenerateReportRequest"
      },
      "app__api__value__GenerateReportRequest": {
        "properties": {
          "record": {
            "additionalProperties": true,
            "type": "object",
            "maxProperties": 100,
            "title": "Record"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "record"
        ],
        "title": "GenerateReportRequest"
      }
    },
    "securitySchemes": {
      "APIKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    }
  },
  "tags": [],
  "servers": [
    {
      "url": "https://beta.markst.com",
      "description": "Beta (current)"
    }
  ]
}
