{
  "openapi": "3.1.0",
  "info": {
    "title": "Cortex Investment Agent API",
    "description": "Stock technical analysis API with AI-powered insights",
    "version": "0.13.0"
  },
  "paths": {
    "/health": {
      "get": {
        "summary": "Health Check",
        "description": "Health check endpoint; returns 503 when the database is unreachable.",
        "operationId": "health_check_health_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthStatus"
                }
              }
            }
          },
          "503": {
            "description": "Database unreachable; `status` is `degraded`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthStatus"
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/": {
      "get": {
        "summary": "Root",
        "description": "Root endpoint.",
        "operationId": "root__get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/stocks/search": {
      "get": {
        "tags": [
          "stocks"
        ],
        "summary": "Search Stocks",
        "description": "Search stocks by ticker or name, optionally filtered by market.\n\nArgs:\n    q: Search query\n    market: Optional market filter\n    limit: Maximum results to return",
        "operationId": "search_stocks_api_stocks_search_get",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "description": "Search query (ticker or name)",
              "title": "Q"
            },
            "description": "Search query (ticker or name)"
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^(taiwan|us|japan)$"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by market (taiwan, us, japan)",
              "title": "Market"
            },
            "description": "Filter by market (taiwan, us, japan)"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockSearchResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/stocks/resolve": {
      "post": {
        "tags": [
          "stocks"
        ],
        "summary": "Resolve Stocks",
        "description": "Resolve multiple stock names/tickers into their best ticker match.",
        "operationId": "resolve_stocks_api_stocks_resolve_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StockResolveRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockResolveResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/stocks/{ticker}": {
      "get": {
        "tags": [
          "stocks"
        ],
        "summary": "Get Stock Info",
        "description": "Get stock information.\n\nArgs:\n    ticker: Stock ticker symbol",
        "operationId": "get_stock_info_api_stocks__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockInfo"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/stocks/{ticker}/ohlc": {
      "get": {
        "tags": [
          "stocks"
        ],
        "summary": "Get Stock Ohlc",
        "description": "Get historical OHLC data.\n\nArgs:\n    ticker: Stock ticker symbol\n    start_date: Optional start date\n    end_date: Optional end date\n    limit: Maximum records to return\n    basis: 'raw' (default) for as-traded prices, 'adj' for the\n        split/dividend-adjusted series (issue #1253). The default keeps\n        every existing caller on the as-traded prices; a caller that\n        overlays adjusted-basis indicator history asks for 'adj' so the\n        chart and its overlays share one basis. Rows whose adjusted\n        prices are missing are omitted rather than filled from raw —\n        a mixed-basis series is worse than a gapped one.",
        "operationId": "get_stock_ohlc_api_stocks__ticker__ohlc_get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Start date (YYYY-MM-DD)",
              "title": "Start Date"
            },
            "description": "Start date (YYYY-MM-DD)"
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "End date (YYYY-MM-DD)",
              "title": "End Date"
            },
            "description": "End date (YYYY-MM-DD)"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 5000,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "basis",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "raw",
                "adj"
              ],
              "type": "string",
              "description": "Price basis: 'raw' (default) returns the as-traded prices; 'adj' returns the split/dividend-adjusted series. volume is the traded share count on both.",
              "default": "raw",
              "title": "Basis"
            },
            "description": "Price basis: 'raw' (default) returns the as-traded prices; 'adj' returns the split/dividend-adjusted series. volume is the traded share count on both."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OHLCResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/stocks/{ticker}/indicators": {
      "get": {
        "tags": [
          "stocks"
        ],
        "summary": "Get Stock Indicators",
        "description": "Get technical indicators.\n\nWhen ``latest=true`` (default), returns the most recent indicator snapshot\nfor the ticker's canonical raw trading day (\"exact-D\", issue #1356 C5):\nboth the persisted-snapshot path and the recompute fallback answer for\nthat SAME date or return nothing — never a stale complete D-1 row, and\nnever a D row with NULL indicator values. When the ticker's own adjusted\nOHLC has not caught up to its raw D yet, the response is ``200`` with an\nempty ``indicators`` object and ``trading_date`` set to that raw D. It is\nnot a ``503``: this window opens once every trading day, between the raw\nclose and the adjusted batch finishing, so it is a normal phase of the day\nrather than a fault (``docs/api-reference.md`` documents the change).\nWhen ``latest=false``, returns at most the last *days* complete trading\nrows, ordered chronologically. Adjusted-basis rows project price-valued\nindicators with the factor effective on their own trading date so they\nremain on the raw OHLC display scale; raw-basis rows stay unchanged.\nAn unknown basis or a missing factor for an adjusted row nulls only its\nprice-valued leaves. The ``days`` parameter is ignored when ``latest=true``.\n\nArgs:\n    ticker: Stock ticker symbol\n    latest: Return only latest values (default True)\n    days: Number of complete trading rows (only honoured when latest=False)\n    fields: Comma-separated indicator group names to include (e.g. 'rsi,macd')",
        "operationId": "get_stock_indicators_api_stocks__ticker__indicators_get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "latest",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Return only latest values",
              "default": true,
              "title": "Latest"
            },
            "description": "Return only latest values"
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Number of complete trading rows to return when latest=false (default 66, maximum 200)",
              "maximum": 200,
              "title": "Days"
            },
            "description": "Number of complete trading rows to return when latest=false (default 66, maximum 200)"
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated indicator group names, e.g. 'rsi,macd,ma'. Names are case-sensitive and lowercase, matching the keys in the response. Omit, or send an empty/whitespace value, to get every group. An unknown name, or a value that names no group at all (e.g. ',,,'), is a 422 -- neither is silently filtered away, because an empty `indicators` map already means the trading day's indicators are not ready yet. Trailing separators, repeats and padding are accepted.",
              "title": "Fields"
            },
            "description": "Comma-separated indicator group names, e.g. 'rsi,macd,ma'. Names are case-sensitive and lowercase, matching the keys in the response. Omit, or send an empty/whitespace value, to get every group. An unknown name, or a value that names no group at all (e.g. ',,,'), is a 422 -- neither is silently filtered away, because an empty `indicators` map already means the trading day's indicators are not ready yet. Trailing separators, repeats and padding are accepted."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/IndicatorsResponse"
                    },
                    {
                      "$ref": "#/components/schemas/IndicatorsSeriesResponse"
                    }
                  ],
                  "title": "Response 200 Get Stock Indicators Api Stocks  Ticker  Indicators Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation error. FastAPI's own parameter validation answers with `detail` as an array of field errors; anything the route rejects is reshaped by the global handler into an `error` envelope. The route rejects when: `fields` named an unknown group, or `fields` was non-blank but named no group at all (separator-only, e.g. `,,,`), or `days` was above the configured cap. An empty or whitespace `fields` is not rejected -- it means no filtering and answers 200.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/IndicatorsParameterValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/IndicatorsRequestRejected"
                    }
                  ],
                  "title": "Response 422 Get Stock Indicators Api Stocks  Ticker  Indicators Get"
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/stocks/markets/list": {
      "get": {
        "tags": [
          "stocks"
        ],
        "summary": "List Markets",
        "description": "List available markets.",
        "operationId": "list_markets_api_stocks_markets_list_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/stocks/{ticker}/realtime-quote": {
      "get": {
        "tags": [
          "stocks"
        ],
        "summary": "Get Realtime Quote",
        "description": "Latest persisted intraday quote snapshot of a Taiwan stock.\n\n``status`` is ``no_data`` (with ``quote`` null) when no snapshot exists.",
        "operationId": "get_realtime_quote_api_stocks__ticker__realtime_quote_get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RealtimeQuoteResponse"
                }
              }
            }
          },
          "403": {
            "description": "The member's permission set does not enable realtime_quote",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/stocks/{ticker}/intraday-ohlc": {
      "get": {
        "tags": [
          "stocks"
        ],
        "summary": "Get Intraday Ohlc",
        "description": "Latest retained regular-session day of sampled 10s, 1m or 5m OHLC.\n\nReads stored quotes only. Volume is per interval in lots; sampled extrema\ndo not claim to include every trade. Missing intervals are not fabricated.",
        "operationId": "get_intraday_ohlc_api_stocks__ticker__intraday_ohlc_get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "interval",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "10s",
                "1m",
                "5m"
              ],
              "type": "string",
              "default": "5m",
              "title": "Interval"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntradayOHLCResponse"
                }
              }
            }
          },
          "403": {
            "description": "The member's permission set does not enable realtime_quote",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/stocks/{ticker}/realtime-quote/stream": {
      "get": {
        "tags": [
          "stocks"
        ],
        "summary": "Stream Realtime Quote",
        "description": "Stream intraday quote snapshots of a Taiwan stock while its session is open.\n\nAuthentication, ``realtime_quote`` permission and ticker errors are\nordinary HTTP errors returned before the stream starts; the token and the\npermission are re-checked on every poll.",
        "operationId": "stream_realtime_quote_api_stocks__ticker__realtime_quote_stream_get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "SSE stream of JSON events: a first `quote` event with the latest snapshot, further `quote` events whenever the snapshot changes (including a change to `no_data`), then one of `session_closed`, `token_expired` or `unauthorized`",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "The member's permission set does not enable realtime_quote",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/market/realtime-quote": {
      "get": {
        "tags": [
          "market"
        ],
        "summary": "Get Realtime Index Quote",
        "description": "Latest stored TAIEX snapshot; prices are points and amounts are TWD.",
        "operationId": "get_realtime_index_quote_api_market_realtime_quote_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RealtimeQuoteResponse"
                }
              }
            }
          },
          "403": {
            "description": "The member's permission set does not enable realtime_quote",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/market/intraday-ohlc": {
      "get": {
        "tags": [
          "market"
        ],
        "summary": "Get Intraday Index Ohlc",
        "description": "Stored TAIEX sampled OHLC and price series; index volume stays unknown.",
        "operationId": "get_intraday_index_ohlc_api_market_intraday_ohlc_get",
        "parameters": [
          {
            "name": "interval",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "10s",
                "1m",
                "5m"
              ],
              "type": "string",
              "default": "5m",
              "title": "Interval"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntradayOHLCResponse"
                }
              }
            }
          },
          "403": {
            "description": "The member's permission set does not enable realtime_quote",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/market/realtime-quote/stream": {
      "get": {
        "tags": [
          "market"
        ],
        "summary": "Stream Realtime Index Quote",
        "description": "Reuse quote change detection, re-authentication and session termination.",
        "operationId": "stream_realtime_index_quote_api_market_realtime_quote_stream_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Authenticated TAIEX quote SSE; original quote event contract",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "The member's permission set does not enable realtime_quote",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/analyze": {
      "post": {
        "tags": [
          "analyze"
        ],
        "summary": "Analyze Stock",
        "description": "Execute stock analysis.\n\nThis endpoint performs a complete technical analysis including:\n- Trend analysis\n- Key support/resistance levels\n- Technical indicator interpretation\n- Risk assessment\n- Recommendations\n\nThe analysis uses the VRR (Verify-Reflect-Refine) process for quality.",
        "operationId": "analyze_stock_api_analyze_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyzeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyzeResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/update-data": {
      "post": {
        "tags": [
          "analyze"
        ],
        "summary": "Update Data",
        "description": "Trigger data update job.\n\nThis starts a background job to update stock data for specified markets.",
        "operationId": "update_data_api_admin_update_data_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDataRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateDataResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/jobs/{job_id}": {
      "get": {
        "tags": [
          "analyze"
        ],
        "summary": "Get Job Status",
        "description": "Get job status.",
        "operationId": "get_job_status_api_admin_jobs__job_id__get",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Job Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobStatus"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/jobs": {
      "get": {
        "tags": [
          "analyze"
        ],
        "summary": "List Jobs",
        "description": "List all jobs.",
        "operationId": "list_jobs_api_admin_jobs_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/institutional/stock/{ticker}": {
      "get": {
        "tags": [
          "institutional",
          "institutional"
        ],
        "summary": "Get Institutional Data",
        "description": "Get institutional investor trading data for a stock.\n\nArgs:\n    ticker: Stock ticker (e.g., 2330.TW)\n    days: Calendar days back from today in Taipei (default 30, max 3650);\n        ignored when start_date is given\n    start_date: Optional inclusive lower bound; overrides days\n    end_date: Optional inclusive upper bound",
        "operationId": "get_institutional_data_api_institutional_stock__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}(\\.TW|\\.TWO)?$",
              "title": "Ticker"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 3650,
              "minimum": 1,
              "default": 30,
              "title": "Days"
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Start date (YYYY-MM-DD)",
              "title": "Start Date"
            },
            "description": "Start date (YYYY-MM-DD)"
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "End date (YYYY-MM-DD)",
              "title": "End Date"
            },
            "description": "End date (YYYY-MM-DD)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InstitutionalData"
                  },
                  "title": "Response Get Institutional Data Api Institutional Stock  Ticker  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/institutional/stock/{ticker}/summary": {
      "get": {
        "tags": [
          "institutional",
          "institutional"
        ],
        "summary": "Get Institutional Summary",
        "description": "Get summary of institutional investor trading for a stock.\nIncludes latest day, 5-day, 20-day totals and streak information.",
        "operationId": "get_institutional_summary_api_institutional_stock__ticker__summary_get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}(\\.TW|\\.TWO)?$",
              "title": "Ticker"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstitutionalSummary"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/institutional/amount-ranking": {
      "get": {
        "tags": [
          "institutional",
          "institutional"
        ],
        "summary": "三大法人個股估算淨額排行榜",
        "description": "Rank stocks only once the target session has current institutional data.",
        "operationId": "get_institutional_amount_ranking_api_institutional_amount_ranking_get",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 30,
              "minimum": 1,
              "description": "Number of recent distinct institutional trading days",
              "default": 1,
              "title": "Days"
            },
            "description": "Number of recent distinct institutional trading days"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Maximum rows returned per buy/sell ranking side",
              "default": 20,
              "title": "Limit"
            },
            "description": "Maximum rows returned per buy/sell ranking side"
          },
          {
            "name": "investor_type",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "foreign",
                "trust",
                "dealer"
              ],
              "type": "string",
              "description": "Institutional actor; all returns foreign, trust, dealer, and their total",
              "default": "all",
              "title": "Investor Type"
            },
            "description": "Institutional actor; all returns foreign, trust, dealer, and their total"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstitutionalAmountRankingResponse"
                }
              }
            }
          },
          "500": {
            "description": "Institutional ranking query failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/institutional/stock/{ticker}/amount-flows": {
      "get": {
        "tags": [
          "institutional",
          "institutional"
        ],
        "summary": "指定個股三大法人逐日估算買賣金額",
        "description": "Return per-day institutional flows estimated using same-day close.",
        "operationId": "get_institutional_amount_flows_api_institutional_stock__ticker__amount_flows_get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4,6}[A-Z]?(\\.TW|\\.TWO)?$",
              "title": "Ticker"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 30,
              "minimum": 1,
              "description": "Number of the stock's most recent institutional trading days",
              "default": 1,
              "title": "Days"
            },
            "description": "Number of the stock's most recent institutional trading days"
          },
          {
            "name": "investor_type",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "foreign",
                "trust",
                "dealer"
              ],
              "type": "string",
              "description": "Institutional actor; all returns foreign, trust, dealer, and their total",
              "default": "all",
              "title": "Investor Type"
            },
            "description": "Institutional actor; all returns foreign, trust, dealer, and their total"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstitutionalAmountFlowsResponse"
                }
              }
            }
          },
          "404": {
            "description": "Ticker or institutional flow data not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Bare ticker resolves to multiple market candidates",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Institutional amount-flow query failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/institutional/ranking/foreign": {
      "get": {
        "tags": [
          "institutional",
          "institutional"
        ],
        "summary": "Get Foreign Ranking",
        "description": "Get stocks ranked by foreign investor net buying/selling.\n\nArgs:\n    days: Number of days to aggregate (default 1)\n    limit: Maximum results (default 20)\n    order: 'desc' for top buyers, 'asc' for top sellers",
        "operationId": "get_foreign_ranking_api_institutional_ranking_foreign_get",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 30,
              "minimum": 1,
              "default": 1,
              "title": "Days"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "desc",
              "title": "Order"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TopInstitutionalStock"
                  },
                  "title": "Response Get Foreign Ranking Api Institutional Ranking Foreign Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/institutional/ranking/trust": {
      "get": {
        "tags": [
          "institutional",
          "institutional"
        ],
        "summary": "Get Trust Ranking",
        "description": "Get stocks ranked by investment trust net buying/selling.",
        "operationId": "get_trust_ranking_api_institutional_ranking_trust_get",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 30,
              "minimum": 1,
              "default": 1,
              "title": "Days"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "desc",
              "title": "Order"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TopInstitutionalStock"
                  },
                  "title": "Response Get Trust Ranking Api Institutional Ranking Trust Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/institutional/ranking/dealer": {
      "get": {
        "tags": [
          "institutional",
          "institutional"
        ],
        "summary": "Get Dealer Ranking",
        "description": "Get stocks ranked by dealer net buying/selling.",
        "operationId": "get_dealer_ranking_api_institutional_ranking_dealer_get",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 30,
              "minimum": 1,
              "default": 1,
              "title": "Days"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "desc",
              "title": "Order"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TopInstitutionalStock"
                  },
                  "title": "Response Get Dealer Ranking Api Institutional Ranking Dealer Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/institutional/ranking/total": {
      "get": {
        "tags": [
          "institutional",
          "institutional"
        ],
        "summary": "Get Total Ranking",
        "description": "Get stocks ranked by total institutional investor net buying/selling.",
        "operationId": "get_total_ranking_api_institutional_ranking_total_get",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 30,
              "minimum": 1,
              "default": 1,
              "title": "Days"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "desc",
              "title": "Order"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TopInstitutionalStock"
                  },
                  "title": "Response Get Total Ranking Api Institutional Ranking Total Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/institutional/consensus/all-buy-streak": {
      "get": {
        "tags": [
          "institutional",
          "institutional"
        ],
        "summary": "Get All Three Buying Streak",
        "description": "Get stocks where all 3 institutional investors have consecutive buying streaks.\nSorted by consensus days (minimum of the three streaks) in descending order.",
        "operationId": "get_all_three_buying_streak_api_institutional_consensus_all_buy_streak_get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsensusStreakStock"
                  },
                  "title": "Response Get All Three Buying Streak Api Institutional Consensus All Buy Streak Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/institutional/consensus/all-sell-streak": {
      "get": {
        "tags": [
          "institutional",
          "institutional"
        ],
        "summary": "Get All Three Selling Streak",
        "description": "Get stocks where all 3 institutional investors have consecutive selling streaks.\nSorted by consensus days (minimum absolute value of the three streaks) in descending order.",
        "operationId": "get_all_three_selling_streak_api_institutional_consensus_all_sell_streak_get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsensusStreakStock"
                  },
                  "title": "Response Get All Three Selling Streak Api Institutional Consensus All Sell Streak Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/institutional/consensus/two-buy-streak": {
      "get": {
        "tags": [
          "institutional",
          "institutional"
        ],
        "summary": "Get Two Buying Streak",
        "description": "Get stocks where exactly 2 institutional investors have consecutive buying streaks.\nSorted by consensus days (minimum of the two positive streaks) in descending order.",
        "operationId": "get_two_buying_streak_api_institutional_consensus_two_buy_streak_get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsensusStreakStock"
                  },
                  "title": "Response Get Two Buying Streak Api Institutional Consensus Two Buy Streak Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/institutional/consensus/two-sell-streak": {
      "get": {
        "tags": [
          "institutional",
          "institutional"
        ],
        "summary": "Get Two Selling Streak",
        "description": "Get stocks where exactly 2 institutional investors have consecutive selling streaks.\nSorted by consensus days (minimum absolute value of the two negative streaks) in descending order.",
        "operationId": "get_two_selling_streak_api_institutional_consensus_two_sell_streak_get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsensusStreakStock"
                  },
                  "title": "Response Get Two Selling Streak Api Institutional Consensus Two Sell Streak Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/institutional/consensus/all-buy": {
      "get": {
        "tags": [
          "institutional",
          "institutional"
        ],
        "summary": "Get All Three Buying",
        "description": "Get stocks where all 3 institutional investors are buying (三大法人同買).",
        "operationId": "get_all_three_buying_api_institutional_consensus_all_buy_get",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 30,
              "minimum": 1,
              "default": 1,
              "title": "Days"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsensusStock"
                  },
                  "title": "Response Get All Three Buying Api Institutional Consensus All Buy Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/institutional/consensus/all-sell": {
      "get": {
        "tags": [
          "institutional",
          "institutional"
        ],
        "summary": "Get All Three Selling",
        "description": "Get stocks where all 3 institutional investors are selling (三大法人同賣).",
        "operationId": "get_all_three_selling_api_institutional_consensus_all_sell_get",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 30,
              "minimum": 1,
              "default": 1,
              "title": "Days"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsensusStock"
                  },
                  "title": "Response Get All Three Selling Api Institutional Consensus All Sell Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/institutional/consensus/two-buy": {
      "get": {
        "tags": [
          "institutional",
          "institutional"
        ],
        "summary": "Get Two Buying",
        "description": "Get stocks where exactly 2 institutional investors are buying (兩大法人同買).",
        "operationId": "get_two_buying_api_institutional_consensus_two_buy_get",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 30,
              "minimum": 1,
              "default": 1,
              "title": "Days"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsensusStock"
                  },
                  "title": "Response Get Two Buying Api Institutional Consensus Two Buy Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/institutional/consensus/two-sell": {
      "get": {
        "tags": [
          "institutional",
          "institutional"
        ],
        "summary": "Get Two Selling",
        "description": "Get stocks where exactly 2 institutional investors are selling (兩大法人同賣).",
        "operationId": "get_two_selling_api_institutional_consensus_two_sell_get",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 30,
              "minimum": 1,
              "default": 1,
              "title": "Days"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsensusStock"
                  },
                  "title": "Response Get Two Selling Api Institutional Consensus Two Sell Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/institutional/turnaround/buy-to-sell": {
      "get": {
        "tags": [
          "institutional",
          "institutional"
        ],
        "summary": "Get Buy To Sell Turnaround",
        "description": "Get stocks where investors turned from consecutive buying (min_streak days) to selling (連買轉賣).\n\nExample: If min_streak=5, returns stocks where an investor bought for 5+ consecutive days\nand today started selling.",
        "operationId": "get_buy_to_sell_turnaround_api_institutional_turnaround_buy_to_sell_get",
        "parameters": [
          {
            "name": "min_streak",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 20,
              "minimum": 2,
              "default": 3,
              "title": "Min Streak"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TurnAroundStock"
                  },
                  "title": "Response Get Buy To Sell Turnaround Api Institutional Turnaround Buy To Sell Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/institutional/turnaround/sell-to-buy": {
      "get": {
        "tags": [
          "institutional",
          "institutional"
        ],
        "summary": "Get Sell To Buy Turnaround",
        "description": "Get stocks where investors turned from consecutive selling (min_streak days) to buying (連賣轉買).\n\nExample: If min_streak=5, returns stocks where an investor sold for 5+ consecutive days\nand today started buying.",
        "operationId": "get_sell_to_buy_turnaround_api_institutional_turnaround_sell_to_buy_get",
        "parameters": [
          {
            "name": "min_streak",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 20,
              "minimum": 2,
              "default": 3,
              "title": "Min Streak"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TurnAroundStock"
                  },
                  "title": "Response Get Sell To Buy Turnaround Api Institutional Turnaround Sell To Buy Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/institutional/stats/options": {
      "get": {
        "tags": [
          "institutional",
          "institutional"
        ],
        "summary": "Get Statistics Options",
        "description": "Get available statistics options based on actual data.\nReturns the range of days available and max streak values.",
        "operationId": "get_statistics_options_api_institutional_stats_options_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatisticsOptions"
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/institutional/stats/consensus-options": {
      "get": {
        "tags": [
          "institutional",
          "institutional"
        ],
        "summary": "Get Consensus Options",
        "description": "Get available consensus options based on actual data.\nChecks which day ranges have stocks matching the consensus criteria.",
        "operationId": "get_consensus_options_api_institutional_stats_consensus_options_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsensusOptions"
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/institutional/stats/turnaround-options": {
      "get": {
        "tags": [
          "institutional",
          "institutional"
        ],
        "summary": "Get Turnaround Options",
        "description": "Get available turnaround streak options based on actual data.\nOptimized to use a single batch query.",
        "operationId": "get_turnaround_options_api_institutional_stats_turnaround_options_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TurnaroundOptions"
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/institutional/streak/consecutive-buy": {
      "get": {
        "tags": [
          "institutional",
          "institutional"
        ],
        "summary": "Get Consecutive Buy",
        "description": "Get stocks with consecutive buying streaks.\n\nArgs:\n    investor: Investor type (foreign, trust, dealer)\n    min_days: Minimum consecutive buying days\n    limit: Maximum number of results",
        "operationId": "get_consecutive_buy_api_institutional_streak_consecutive_buy_get",
        "parameters": [
          {
            "name": "investor",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "foreign",
                "trust",
                "dealer"
              ],
              "type": "string",
              "default": "foreign",
              "title": "Investor"
            }
          },
          {
            "name": "min_days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 1,
              "title": "Min Days"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StreakStock"
                  },
                  "title": "Response Get Consecutive Buy Api Institutional Streak Consecutive Buy Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/institutional/streak/consecutive-sell": {
      "get": {
        "tags": [
          "institutional",
          "institutional"
        ],
        "summary": "Get Consecutive Sell",
        "description": "Get stocks with consecutive selling streaks.\n\nArgs:\n    investor: Investor type (foreign, trust, dealer)\n    min_days: Minimum consecutive selling days (absolute value)\n    limit: Maximum number of results",
        "operationId": "get_consecutive_sell_api_institutional_streak_consecutive_sell_get",
        "parameters": [
          {
            "name": "investor",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "foreign",
                "trust",
                "dealer"
              ],
              "type": "string",
              "default": "foreign",
              "title": "Investor"
            }
          },
          {
            "name": "min_days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 1,
              "title": "Min Days"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StreakStock"
                  },
                  "title": "Response Get Consecutive Sell Api Institutional Streak Consecutive Sell Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/institutional/streak/options": {
      "get": {
        "tags": [
          "institutional",
          "institutional"
        ],
        "summary": "Get Streak Options",
        "description": "Get available streak options for each investor type.\nReturns the range of streak days available in the data.",
        "operationId": "get_streak_options_api_institutional_streak_options_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StreakOptions"
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/day-trading/stocks/{ticker}": {
      "get": {
        "tags": [
          "day-trading"
        ],
        "summary": "Get Stock Day Trading History",
        "description": "Return the latest N stored day-trading rows, ordered for charting.",
        "operationId": "get_stock_day_trading_history_api_day_trading_stocks__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 30,
              "title": "Days"
            }
          },
          {
            "name": "final_only",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Final Only"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DayTradingHistoryResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/day-trading/rankings/latest": {
      "get": {
        "tags": [
          "day-trading"
        ],
        "summary": "Get Latest Day Trading Ranking",
        "description": "Rank the latest complete snapshot by shares or exact-date ratio.",
        "operationId": "get_latest_day_trading_ranking_api_day_trading_rankings_latest_get",
        "parameters": [
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "TWSE",
                "TPEX"
              ],
              "type": "string",
              "default": "all",
              "title": "Market"
            }
          },
          {
            "name": "metric",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "day_trade_volume",
                "day_trade_ratio"
              ],
              "type": "string",
              "default": "day_trade_volume",
              "title": "Metric"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 10,
              "title": "Limit"
            }
          },
          {
            "name": "security_type",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "common",
                "all"
              ],
              "type": "string",
              "default": "common",
              "title": "Security Type"
            }
          },
          {
            "name": "final_only",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Final Only"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LatestDayTradingRankingResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/margin/stock/{ticker}": {
      "get": {
        "tags": [
          "margin",
          "margin"
        ],
        "summary": "Get Margin Data",
        "operationId": "get_margin_data_api_margin_stock__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Stock ticker (e.g., 2330.TW)",
              "title": "Ticker"
            },
            "description": "Stock ticker (e.g., 2330.TW)"
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 365,
              "minimum": 1,
              "default": 30,
              "title": "Days"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MarginData"
                  },
                  "title": "Response Get Margin Data Api Margin Stock  Ticker  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/margin/ranking": {
      "get": {
        "tags": [
          "margin",
          "margin"
        ],
        "summary": "Get Margin Ranking",
        "description": "Rank stocks by a margin/short metric at the latest available trade date.\n\nMetrics:\n    margin_change: 融資增減 (margin_balance - margin_previous), day-over-day\n    short_change:  融券增減 (short_balance - short_previous), day-over-day\n    margin_balance: 融資餘額 absolute level (lots)\n    short_balance:  融券餘額 absolute level (lots)\n\nRows whose metric is NULL (e.g. missing previous-day data) sort last.\nReturns an empty list when no margin data exists.",
        "operationId": "get_margin_ranking_api_margin_ranking_get",
        "parameters": [
          {
            "name": "metric",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "margin_change",
                "short_change",
                "margin_balance",
                "short_balance"
              ],
              "type": "string",
              "description": "Ranking dimension",
              "default": "margin_change",
              "title": "Metric"
            },
            "description": "Ranking dimension"
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "description": "desc = largest increase/balance first",
              "default": "desc",
              "title": "Order"
            },
            "description": "desc = largest increase/balance first"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MarginRankingStock"
                  },
                  "title": "Response Get Margin Ranking Api Margin Ranking Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/ownership/stock/{ticker}": {
      "get": {
        "tags": [
          "ownership",
          "ownership"
        ],
        "summary": "Get Ownership Distribution",
        "operationId": "get_ownership_distribution_api_ownership_stock__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Stock ticker (e.g., 2330.TW)",
              "title": "Ticker"
            },
            "description": "Stock ticker (e.g., 2330.TW)"
          },
          {
            "name": "trade_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Specific trade date",
              "title": "Trade Date"
            },
            "description": "Specific trade date"
          },
          {
            "name": "weeks",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 104,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Recent weeks to return",
              "title": "Weeks"
            },
            "description": "Recent weeks to return"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OwnershipDistribution"
                  },
                  "title": "Response Get Ownership Distribution Api Ownership Stock  Ticker  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/fundamentals/monthly-revenue/{ticker}": {
      "get": {
        "tags": [
          "fundamentals",
          "fundamentals"
        ],
        "summary": "Get Monthly Revenue",
        "operationId": "get_monthly_revenue_api_fundamentals_monthly_revenue__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Stock ticker (e.g., 2330.TW)",
              "title": "Ticker"
            },
            "description": "Stock ticker (e.g., 2330.TW)"
          },
          {
            "name": "months",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 120,
              "minimum": 1,
              "default": 12,
              "title": "Months"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MonthlyRevenue"
                  },
                  "title": "Response Get Monthly Revenue Api Fundamentals Monthly Revenue  Ticker  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/fundamentals/valuation/{ticker}": {
      "get": {
        "tags": [
          "fundamentals",
          "fundamentals"
        ],
        "summary": "Get Valuation Metrics",
        "operationId": "get_valuation_metrics_api_fundamentals_valuation__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Stock ticker (e.g., 2330.TW)",
              "title": "Ticker"
            },
            "description": "Stock ticker (e.g., 2330.TW)"
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 365,
              "minimum": 1,
              "default": 60,
              "title": "Days"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ValuationMetric"
                  },
                  "title": "Response Get Valuation Metrics Api Fundamentals Valuation  Ticker  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/fundamentals/quarterly/{ticker}": {
      "get": {
        "tags": [
          "fundamentals",
          "fundamentals"
        ],
        "summary": "Get Quarterly Reports",
        "operationId": "get_quarterly_reports_api_fundamentals_quarterly__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Stock ticker (e.g., 2330.TW)",
              "title": "Ticker"
            },
            "description": "Stock ticker (e.g., 2330.TW)"
          },
          {
            "name": "years",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 10,
              "minimum": 1,
              "default": 5,
              "title": "Years"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/QuarterlyReport"
                  },
                  "title": "Response Get Quarterly Reports Api Fundamentals Quarterly  Ticker  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/fundamentals/dividend-events/{ticker}": {
      "get": {
        "tags": [
          "fundamentals",
          "fundamentals"
        ],
        "summary": "Get Dividend Events",
        "description": "Per-ticker ex-dividend timeline (v2 nested 除息/除權, derived fields).",
        "operationId": "get_dividend_events_api_fundamentals_dividend_events__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Stock ticker (e.g., 2330.TW)",
              "title": "Ticker"
            },
            "description": "Stock ticker (e.g., 2330.TW)"
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 3650,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "title": "Days"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DividendEvent"
                  },
                  "title": "Response Get Dividend Events Api Fundamentals Dividend Events  Ticker  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/fundamentals/dividend-calendar": {
      "get": {
        "tags": [
          "fundamentals",
          "fundamentals"
        ],
        "summary": "Get Dividend Calendar",
        "description": "Market-wide ex-dividend calendar for the window [on, on + window].",
        "operationId": "get_dividend_calendar_api_fundamentals_dividend_calendar_get",
        "parameters": [
          {
            "name": "on",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Calendar start date; defaults to today.",
              "title": "On"
            },
            "description": "Calendar start date; defaults to today."
          },
          {
            "name": "window",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 90,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Days forward from 'on'.",
              "title": "Window"
            },
            "description": "Days forward from 'on'."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DividendCalendarEntry"
                  },
                  "title": "Response Get Dividend Calendar Api Fundamentals Dividend Calendar Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/updates/recent": {
      "get": {
        "tags": [
          "updates",
          "updates"
        ],
        "summary": "Get Recent Updates",
        "description": "Get recent update runs for notifications.",
        "operationId": "get_recent_updates_api_updates_recent_get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UpdateRun"
                  },
                  "title": "Response Get Recent Updates Api Updates Recent Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/updates/schedule-summary": {
      "get": {
        "tags": [
          "updates",
          "updates"
        ],
        "summary": "Get Schedule Summary",
        "description": "Daily scheduler recap for ``date`` (default today): every scheduled job\nand the per-step APIs it ran, with start/end times and success/failure.\n\nBacks the admin daily summary mail and any frontend dashboard. Reads the\nsame ``build_schedule_summary`` aggregation the email uses.",
        "operationId": "get_schedule_summary_api_updates_schedule_summary_get",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Taiwan calendar day (YYYY-MM-DD) to recap. Defaults to today (Asia/Taipei).",
              "title": "Date"
            },
            "description": "Taiwan calendar day (YYYY-MM-DD) to recap. Defaults to today (Asia/Taipei)."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleSummaryOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/watchlists/groups": {
      "get": {
        "tags": [
          "watchlists",
          "watchlists"
        ],
        "summary": "Get Watchlist Groups",
        "description": "List watchlist groups for the authenticated member.",
        "operationId": "get_watchlist_groups_api_watchlists_groups_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WatchlistGroup"
                  },
                  "title": "Response Get Watchlist Groups Api Watchlists Groups Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "watchlists",
          "watchlists"
        ],
        "summary": "Create Watchlist Group",
        "description": "Create a new watchlist group.",
        "operationId": "create_watchlist_group_api_watchlists_groups_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWatchlistGroupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatchlistGroup"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/watchlists/groups/{group_id}/items": {
      "get": {
        "tags": [
          "watchlists",
          "watchlists"
        ],
        "summary": "Get Watchlist Items",
        "description": "List watchlist items for a group.",
        "operationId": "get_watchlist_items_api_watchlists_groups__group_id__items_get",
        "parameters": [
          {
            "name": "group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Group Id"
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Market used for OHLC price lookup",
              "default": "taiwan",
              "title": "Market"
            },
            "description": "Market used for OHLC price lookup"
          },
          {
            "name": "trade_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Price lookup upper-bound date",
              "title": "Trade Date"
            },
            "description": "Price lookup upper-bound date"
          },
          {
            "name": "include_price",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include latest OHLC price/change payload",
              "default": true,
              "title": "Include Price"
            },
            "description": "Include latest OHLC price/change payload"
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WatchlistItem"
                  },
                  "title": "Response Get Watchlist Items Api Watchlists Groups  Group Id  Items Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "watchlists",
          "watchlists"
        ],
        "summary": "Add Watchlist Item",
        "description": "Add a ticker to a watchlist group.",
        "operationId": "add_watchlist_item_api_watchlists_groups__group_id__items_post",
        "parameters": [
          {
            "name": "group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Group Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddWatchlistItemRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatchlistItem"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/watchlists/groups/{group_id}/capital-flow-diff": {
      "get": {
        "tags": [
          "watchlists",
          "watchlists"
        ],
        "summary": "Get Watchlist Capital Flow Diff",
        "description": "Return collection-level estimated turnover deltas for a watchlist group.",
        "operationId": "get_watchlist_capital_flow_diff_api_watchlists_groups__group_id__capital_flow_diff_get",
        "parameters": [
          {
            "name": "group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Group Id"
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Market used for OHLC turnover lookup",
              "default": "taiwan",
              "title": "Market"
            },
            "description": "Market used for OHLC turnover lookup"
          },
          {
            "name": "trade_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Turnover lookup upper-bound date",
              "title": "Trade Date"
            },
            "description": "Turnover lookup upper-bound date"
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Watchlist Capital Flow Diff Api Watchlists Groups  Group Id  Capital Flow Diff Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/watchlists/groups/{group_id}": {
      "delete": {
        "tags": [
          "watchlists",
          "watchlists"
        ],
        "summary": "Delete Watchlist Group",
        "description": "Delete a watchlist group and all its items.",
        "operationId": "delete_watchlist_group_api_watchlists_groups__group_id__delete",
        "parameters": [
          {
            "name": "group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Group Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/watchlists/groups/{group_id}/items/{ticker}": {
      "delete": {
        "tags": [
          "watchlists",
          "watchlists"
        ],
        "summary": "Remove Watchlist Item",
        "description": "Remove a ticker from a watchlist group.",
        "operationId": "remove_watchlist_item_api_watchlists_groups__group_id__items__ticker__delete",
        "parameters": [
          {
            "name": "group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Group Id"
            }
          },
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/watchlists/membership/{ticker}": {
      "get": {
        "tags": [
          "watchlists",
          "watchlists"
        ],
        "summary": "Get Watchlist Membership",
        "description": "Return groups that contain the ticker.",
        "operationId": "get_watchlist_membership_api_watchlists_membership__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/portfolio/config": {
      "get": {
        "tags": [
          "portfolio",
          "portfolio"
        ],
        "summary": "Get Portfolio Config",
        "description": "Return portfolio-wide config the frontend needs to render forms.\n\nPublic endpoint (no auth) — the values are non-sensitive tax rates sourced\nfrom config/core.yaml portfolio.tax_rates. The frontend reads this once at\nstartup so it can show accurate rate hints in the day-trade and sell forms\nwithout hardcoding any rate values in the UI layer (see\n``portfolio.tax_rates`` in ``config/core.yaml`` for the canonical source).",
        "operationId": "get_portfolio_config_api_portfolio_config_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortfolioConfigResponse"
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/portfolio/open-lots": {
      "get": {
        "tags": [
          "portfolio",
          "portfolio"
        ],
        "summary": "Get Open Lots",
        "description": "List open buy lots for a given ticker in FIFO order.\n\nUsed by the sell-form UI to render a batch selector: each row shows\nthe original buy price, the fee/tax-adjusted effective cost per\nshare, and the remaining quantity a sell can close.\n\nLots that have been fully closed (``original_qty == closed_qty``) are\nfiltered out. Day-trade pair rows appear like any other buy row — the\nschema does not distinguish them at this layer, but pair legs are\nedited via the day-trade endpoints and typically already have a\nmatching closure from their sibling leg.",
        "operationId": "get_open_lots_api_portfolio_open_lots_get",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OpenLotResponse"
                  },
                  "title": "Response Get Open Lots Api Portfolio Open Lots Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/portfolio/day-trades": {
      "post": {
        "tags": [
          "portfolio",
          "portfolio"
        ],
        "summary": "Create Day Trade",
        "description": "Create a day-trade pair — 2 transactions + 1 closure, atomically.\n\nThe request body describes both legs of a same-day round-trip. Direction\ncontrols which leg is inserted first — best-effort ordering only, since\n`created_at` uses `CURRENT_TIMESTAMP` and two inserts in the same\ntransaction may land on the same clock tick. The authoritative leg\nidentity comes from `day_trade_direction` on both rows; `created_at`\nshould not be relied on for pair-leg ordering.\n\nBoth legs share the same `day_trade_pair_id` and `day_trade_direction`\nmetadata, and a single `transaction_closures` row links them.\n\nIf ``tax_sell`` is omitted from the payload, it is auto-computed from\n``config.portfolio.tax_rates.day_trade_sell`` (0.15% by default). An\nexplicit ``tax_sell = 0`` is preserved as-is.",
        "operationId": "create_day_trade_api_portfolio_day_trades_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDayTradeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDayTradeResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/portfolio/day-trades/{pair_id}": {
      "put": {
        "tags": [
          "portfolio",
          "portfolio"
        ],
        "summary": "Update Day Trade",
        "description": "Partially update a day-trade pair — both legs + closure atomically.\n\nSupplied fields overwrite the corresponding leg. Price / qty changes\ntrigger tax_sell auto-recomputation at the current day-trade rate unless\nthe caller explicitly supplies tax_sell. Changes to direction are not\nallowed; delete + re-create instead.",
        "operationId": "update_day_trade_api_portfolio_day_trades__pair_id__put",
        "parameters": [
          {
            "name": "pair_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Pair Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDayTradeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateDayTradeResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "portfolio",
          "portfolio"
        ],
        "summary": "Delete Day Trade",
        "description": "Delete a day-trade pair — both legs and the closure, atomically.\n\nClosures are deleted explicitly first; the deferred buy FK then lets the\nsecond DELETE remove both transaction rows in the same transaction.",
        "operationId": "delete_day_trade_api_portfolio_day_trades__pair_id__delete",
        "parameters": [
          {
            "name": "pair_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Pair Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "boolean"
                  },
                  "title": "Response Delete Day Trade Api Portfolio Day Trades  Pair Id  Delete"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/portfolio/transactions": {
      "post": {
        "tags": [
          "portfolio",
          "portfolio"
        ],
        "summary": "Create Transaction",
        "description": "Create a portfolio transaction.\n\nFor sell transactions, ``closes_lots`` identifies which open buy lots\nthe sell closes. When omitted, the endpoint auto-pairs via FIFO against\nthe caller's open lots for the ticker (sorted by\ntransaction_date → created_at → id). If FIFO has insufficient open qty,\nthe sell is still stored without closures and the response includes a\nwarning for the UI. When ``closes_lots`` is explicitly supplied, the sum\nof closure quantities must equal the sell quantity and every referenced\nlot must have enough remaining qty, or HTTP 400 is raised before any row\nis inserted.",
        "operationId": "create_transaction_api_portfolio_transactions_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTransactionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "portfolio",
          "portfolio"
        ],
        "summary": "List Transactions",
        "description": "List recent transactions for editing.\n\nThe response includes ``day_trade_pair_id`` and ``day_trade_direction``\nso the frontend can render pair badges and disable single-leg editing\nfor rows that belong to a day-trade pair.",
        "operationId": "list_transactions_api_portfolio_transactions_get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 200,
              "title": "Limit"
            }
          },
          {
            "name": "ticker",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 20
                },
                {
                  "type": "null"
                }
              ],
              "title": "Ticker"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/portfolio/positions/{ticker}": {
      "get": {
        "tags": [
          "portfolio",
          "portfolio"
        ],
        "summary": "Get Position",
        "description": "Get current position for a ticker.",
        "operationId": "get_position_api_portfolio_positions__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/portfolio/brokers": {
      "get": {
        "tags": [
          "portfolio",
          "portfolio"
        ],
        "summary": "List Brokers",
        "description": "List brokers for transaction form.",
        "operationId": "list_brokers_api_portfolio_brokers_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "portfolio",
          "portfolio"
        ],
        "summary": "Create Broker",
        "description": "Create broker and fee settings.",
        "operationId": "create_broker_api_portfolio_brokers_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertBrokerRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/portfolio/brokers/{broker_id}": {
      "put": {
        "tags": [
          "portfolio",
          "portfolio"
        ],
        "summary": "Update Broker",
        "description": "Update broker fee settings.",
        "operationId": "update_broker_api_portfolio_brokers__broker_id__put",
        "parameters": [
          {
            "name": "broker_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Broker Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertBrokerRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/portfolio/transactions/batch": {
      "post": {
        "tags": [
          "portfolio",
          "portfolio"
        ],
        "summary": "Create Transactions Batch",
        "description": "Create multiple regular transactions in one atomic import request.\n\nMissing FIFO lots on imported sells are stored without closures and\nreported as anomalies so incomplete broker statement files do not block\nthe rest of the import.",
        "operationId": "create_transactions_batch_api_portfolio_transactions_batch_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchCreateTransactionsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "portfolio",
          "portfolio"
        ],
        "summary": "Update Transactions Batch",
        "description": "Update multiple regular transactions in one atomic request.",
        "operationId": "update_transactions_batch_api_portfolio_transactions_batch_put",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchUpdateTransactionsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "portfolio",
          "portfolio"
        ],
        "summary": "Delete Transactions Batch",
        "description": "Delete multiple regular transactions in one atomic request.",
        "operationId": "delete_transactions_batch_api_portfolio_transactions_batch_delete",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchDeleteTransactionsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/portfolio/transactions/{transaction_id}": {
      "put": {
        "tags": [
          "portfolio",
          "portfolio"
        ],
        "summary": "Update Transaction",
        "description": "Update an existing transaction.\n\nRejects requests targeting a day-trade pair leg — callers must use the\ndedicated ``PUT /api/portfolio/day-trades/{pair_id}`` endpoint so both\nlegs and the closure row are updated atomically.",
        "operationId": "update_transaction_api_portfolio_transactions__transaction_id__put",
        "parameters": [
          {
            "name": "transaction_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Transaction Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTransactionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "portfolio",
          "portfolio"
        ],
        "summary": "Delete Transaction",
        "description": "Delete a regular (non-day-trade) transaction.\n\nRejects requests targeting a day-trade pair leg — deleting one leg\nin isolation would leave the other leg orphaned and break closure\naccounting. Callers must use ``DELETE /api/portfolio/day-trades/{pair_id}``\ninstead, which atomically removes both legs plus the closure row.",
        "operationId": "delete_transaction_api_portfolio_transactions__transaction_id__delete",
        "parameters": [
          {
            "name": "transaction_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Transaction Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/portfolio/positions": {
      "get": {
        "tags": [
          "portfolio",
          "portfolio"
        ],
        "summary": "List Positions",
        "description": "List positions aggregated by ticker.",
        "operationId": "list_positions_api_portfolio_positions_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/portfolio/holdings": {
      "get": {
        "tags": [
          "portfolio",
          "portfolio"
        ],
        "summary": "List Holdings",
        "description": "List holdings with aggregated cost information.",
        "operationId": "list_holdings_api_portfolio_holdings_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/portfolio/allocation": {
      "get": {
        "tags": [
          "portfolio",
          "portfolio"
        ],
        "summary": "Get Portfolio Allocation",
        "description": "Aggregate active holdings by stock category or ETF/stock split.",
        "operationId": "get_portfolio_allocation_api_portfolio_allocation_get",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "Group",
                "ETF"
              ],
              "type": "string",
              "default": "Group",
              "title": "Type"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortfolioAllocationResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/portfolio/performance": {
      "get": {
        "tags": [
          "portfolio",
          "portfolio"
        ],
        "summary": "Get Portfolio Performance",
        "description": "Get unrealized holding performance totals and period changes.\n\nWith ``tickers`` the response is the batch shape: one single-ticker\nresponse per requested ticker, computed in a single metrics/price pass.",
        "operationId": "get_portfolio_performance_api_portfolio_performance_get",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 20
                },
                {
                  "type": "null"
                }
              ],
              "title": "Ticker"
            }
          },
          {
            "name": "tickers",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 2100
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated tickers for batch per-ticker performance; mutually exclusive with ticker and type.",
              "title": "Tickers"
            },
            "description": "Comma-separated tickers for batch per-ticker performance; mutually exclusive with ticker and type."
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "Group",
                    "ETF"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Type"
            }
          },
          {
            "name": "reference_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Reference Date"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/PortfolioPerformanceResponse"
                    },
                    {
                      "$ref": "#/components/schemas/PortfolioGroupedPerformanceResponse"
                    },
                    {
                      "$ref": "#/components/schemas/PortfolioBatchPerformanceResponse"
                    }
                  ],
                  "title": "Response Get Portfolio Performance Api Portfolio Performance Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/portfolio/summary": {
      "get": {
        "tags": [
          "portfolio",
          "portfolio"
        ],
        "summary": "Get Portfolio Summary",
        "description": "Get portfolio summary metrics.",
        "operationId": "get_portfolio_summary_api_portfolio_summary_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/portfolio/realtime-quotes/stream": {
      "get": {
        "tags": [
          "portfolio",
          "portfolio"
        ],
        "summary": "Stream Portfolio Realtime Quotes",
        "description": "Stream the latest persisted quotes for up to 100 Taiwan tickers.",
        "operationId": "stream_portfolio_realtime_quotes_api_portfolio_realtime_quotes_stream_get",
        "parameters": [
          {
            "name": "tickers",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Comma-separated Taiwan tickers (max 100)",
              "title": "Tickers"
            },
            "description": "Comma-separated Taiwan tickers (max 100)"
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "SSE stream with a full initial `quotes` event, partial changed-item events, then `session_closed`, `token_expired`, or `unauthorized`",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "The member's permission set does not enable realtime_quote",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/portfolio/investment-performance": {
      "get": {
        "tags": [
          "portfolio",
          "portfolio"
        ],
        "summary": "Get Investment Performance",
        "operationId": "get_investment_performance_api_portfolio_investment_performance_get",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "day",
                "week",
                "month",
                "quarter",
                "year"
              ],
              "type": "string",
              "default": "all",
              "title": "Period"
            }
          },
          {
            "name": "value",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Value"
            }
          },
          {
            "name": "ticker",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 20
                },
                {
                  "type": "null"
                }
              ],
              "title": "Ticker"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "Group",
                    "ETF"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Type"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/InvestmentPerformanceResponse"
                    },
                    {
                      "$ref": "#/components/schemas/GroupedInvestmentPerformanceResponse"
                    }
                  ],
                  "title": "Response Get Investment Performance Api Portfolio Investment Performance Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/portfolio/investment-performance/details": {
      "get": {
        "tags": [
          "portfolio",
          "portfolio"
        ],
        "summary": "Get Investment Performance Details",
        "description": "Return the reconciliable item breakdown for one investment-performance metric. Items are ordered from newest to oldest by their primary date.",
        "operationId": "get_investment_performance_details_api_portfolio_investment_performance_details_get",
        "parameters": [
          {
            "name": "metric",
            "in": "query",
            "required": true,
            "schema": {
              "enum": [
                "regular_pnl",
                "day_trade_pnl",
                "cash_dividend",
                "expected_cash_dividend",
                "realized_total",
                "unrealized_pnl",
                "capital_employed",
                "opened_lots_count",
                "closed_lots_count",
                "total_pnl"
              ],
              "type": "string",
              "title": "Metric"
            }
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "day",
                "week",
                "month",
                "quarter",
                "year"
              ],
              "type": "string",
              "default": "all",
              "title": "Period"
            }
          },
          {
            "name": "value",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Value"
            }
          },
          {
            "name": "ticker",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 20
                },
                {
                  "type": "null"
                }
              ],
              "title": "Ticker"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "Group",
                    "ETF"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Type"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "title": "Category"
            }
          },
          {
            "name": "category_source",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 30
                },
                {
                  "type": "null"
                }
              ],
              "title": "Category Source"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvestmentPerformanceDetailsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/portfolio/investment-performance/timeseries": {
      "get": {
        "tags": [
          "portfolio",
          "portfolio"
        ],
        "summary": "Get Investment Performance Timeseries",
        "operationId": "get_investment_performance_timeseries_api_portfolio_investment_performance_timeseries_get",
        "parameters": [
          {
            "name": "start_date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "title": "Start Date"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "title": "End Date"
            }
          },
          {
            "name": "interval",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "day",
                "week",
                "month",
                "quarter",
                "year"
              ],
              "type": "string",
              "default": "month",
              "title": "Interval"
            }
          },
          {
            "name": "ticker",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 20
                },
                {
                  "type": "null"
                }
              ],
              "title": "Ticker"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "Group",
                    "ETF"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Type"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvestmentPerformanceTimeseriesResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/portfolio/advice": {
      "get": {
        "tags": [
          "portfolio"
        ],
        "summary": "Get Portfolio Advice",
        "description": "Daily action advice for the authenticated member's open holdings.\n\nThe response ``close`` and unrealized P&L retain the latest raw traded\nclose used by the portfolio valuation APIs. Stop, resistance, and drawdown\ndecisions use ``adj_close`` from that same latest OHLC row so they share\nthe adjusted basis of structural levels and the post-entry peak. A missing,\nnon-finite, or non-positive latest adjusted close fails closed to ``hold``;\nit never falls back to the raw valuation close or an older adjusted bar.",
        "operationId": "get_portfolio_advice_api_portfolio_advice_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortfolioAdviceResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/watchlists/groups/{group_id}/advice": {
      "get": {
        "tags": [
          "watchlists"
        ],
        "summary": "Get Watchlist Advice",
        "description": "Daily action advice for one watchlist group (cost-free).",
        "operationId": "get_watchlist_advice_api_watchlists_groups__group_id__advice_get",
        "parameters": [
          {
            "name": "group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Group Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatchlistAdviceResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/signals/latest": {
      "get": {
        "tags": [
          "signals",
          "signals"
        ],
        "summary": "Get Latest Signals",
        "description": "Get latest signals from daily snapshot rule engine.",
        "operationId": "get_latest_signals_api_signals_latest_get",
        "parameters": [
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by realized primary signal state: bullish or bearish",
              "title": "Direction"
            },
            "description": "Filter by realized primary signal state: bullish or bearish"
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Signal date (YYYY-MM-DD). Default: latest in DB",
              "title": "Date"
            },
            "description": "Signal date (YYYY-MM-DD). Default: latest in DB"
          },
          {
            "name": "ticker",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by ticker symbol (e.g. 2330.TW)",
              "title": "Ticker"
            },
            "description": "Filter by ticker symbol (e.g. 2330.TW)"
          },
          {
            "name": "view",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "summary",
                "full"
              ],
              "type": "string",
              "description": "summary (default): flat fields only, nested payloads empty; full: complete signals/events/stories/relations payload",
              "default": "summary",
              "title": "View"
            },
            "description": "summary (default): flat fields only, nested payloads empty; full: complete signals/events/stories/relations payload"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 3000,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Return at most N items after the confidence-desc sort",
              "title": "Limit"
            },
            "description": "Return at most N items after the confidence-desc sort"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SignalResponse"
                  },
                  "title": "Response Get Latest Signals Api Signals Latest Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/signals/market-regime-today": {
      "get": {
        "tags": [
          "signals",
          "signals"
        ],
        "summary": "Get Market Regime Today",
        "description": "Return the latest available market regime data for ^TWII.\n\nReturns status='no_data' if no regime data exists, 'warmup' if the latest\nday has no confirmed regime, or 'ok' with full regime details.",
        "operationId": "get_market_regime_today_api_signals_market_regime_today_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketRegimeTodayResponse"
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/signals/market-regime-range": {
      "get": {
        "tags": [
          "signals",
          "signals"
        ],
        "summary": "Get Market Regime Range",
        "description": "Return market regime daily data and overlapping segments for a date range.",
        "operationId": "get_market_regime_range_api_signals_market_regime_range_get",
        "parameters": [
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Start date in YYYY-MM-DD. Default: lookback from config.",
              "title": "Start Date"
            },
            "description": "Start date in YYYY-MM-DD. Default: lookback from config."
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "End date in YYYY-MM-DD. Default: today.",
              "title": "End Date"
            },
            "description": "End date in YYYY-MM-DD. Default: today."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketRegimeRangeResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/signals/market-pulse": {
      "get": {
        "tags": [
          "signals",
          "signals"
        ],
        "summary": "Get Market Pulse",
        "description": "Aggregate technical statistics across all tickers for the latest snapshot date.",
        "operationId": "get_market_pulse_api_signals_market_pulse_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketPulseResponse"
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/signals/market-pulse/tickers": {
      "get": {
        "tags": [
          "signals",
          "signals"
        ],
        "summary": "Get Market Pulse Tickers",
        "description": "Ticker-level drill-down for a single market-pulse belt count metric.",
        "operationId": "get_market_pulse_tickers_api_signals_market_pulse_tickers_get",
        "parameters": [
          {
            "name": "metric",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "One of the 26 market-pulse belt count keys, e.g. ma_month_reclaim_count.",
              "title": "Metric"
            },
            "description": "One of the 26 market-pulse belt count keys, e.g. ma_month_reclaim_count."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketPulseTickersResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/signals/ticker/{ticker}": {
      "get": {
        "tags": [
          "signals",
          "signals"
        ],
        "summary": "Get Signals For Ticker",
        "description": "Get legacy signal history for a specific ticker.",
        "operationId": "get_signals_for_ticker_api_signals_ticker__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 365,
              "minimum": 1,
              "description": "Number of days to look back",
              "default": 30,
              "title": "Days"
            },
            "description": "Number of days to look back"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SignalResponse"
                  },
                  "title": "Response Get Signals For Ticker Api Signals Ticker  Ticker  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/signals/chip-highlights": {
      "get": {
        "tags": [
          "signals",
          "signals"
        ],
        "summary": "Get Chip Highlights",
        "description": "Return top chip-scored tickers from the latest daily_chip_snapshot.\n\nSorted by confidence DESC within the requested direction.\nExcludes neutral bias and very-stale / low-liquidity quality flags.",
        "operationId": "get_chip_highlights_api_signals_chip_highlights_get",
        "parameters": [
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by realized primary signal state: bullish or bearish; omit for both",
              "title": "Direction"
            },
            "description": "Filter by realized primary signal state: bullish or bearish; omit for both"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "title": "Response Get Chip Highlights Api Signals Chip Highlights Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/signals/financial-highlights": {
      "get": {
        "tags": [
          "signals",
          "signals"
        ],
        "summary": "Get Financial Highlights",
        "description": "Return top financial-scored tickers from the latest daily_financial_snapshot.\n\nSorted by legacy confidence as a coarse fetch order, then exposed labels\nare projected from replacement signals/events/stories.",
        "operationId": "get_financial_highlights_api_signals_financial_highlights_get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "title": "Response Get Financial Highlights Api Signals Financial Highlights Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/signals/fundamental-highlights": {
      "get": {
        "tags": [
          "signals",
          "signals"
        ],
        "summary": "Get Fundamental Highlights",
        "description": "Placeholder -- returns status envelope until fundamental engine is built.\n\nAnti-fallback: This endpoint MUST NOT fall back to financial engine data.\n\nItem shape contract (for when items are populated):\n{\n    \"ticker\": str,\n    \"name\": str,\n    \"snapshot_date\": str,\n    \"coverage_status\": str,        # from dimensions.ALL_COVERAGE_STATUS\n    \"summary\": {\n        \"coverage_status\": str,    # mirrors item-level; same enum\n        \"signal_type\": str|None,\n        \"score\": float|None,\n        \"primary_reasons\": list,\n        \"risk_flags\": list,\n    },\n    \"closing_price\": float|None,\n}",
        "operationId": "get_fundamental_highlights_api_signals_fundamental_highlights_get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Fundamental Highlights Api Signals Fundamental Highlights Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/signals/stock/{ticker}": {
      "get": {
        "tags": [
          "stock-signals"
        ],
        "summary": "Get Stock Signals",
        "description": "Return consolidated signal summaries for a single stock.\n\nFixed to interval='1d' daily snapshots.\nWhen qryDate is specified, strict same-day query (no fallback).\nEach dimension may have different actual trading dates.",
        "operationId": "get_stock_signals_api_signals_stock__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "qryDate",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Query date (YYYY-MM-DD). Default: chip uses the newest day this stock has any daily chip source, up to the latest official trading session; other dimensions use latest available.",
              "title": "Qrydate"
            },
            "description": "Query date (YYYY-MM-DD). Default: chip uses the newest day this stock has any daily chip source, up to the latest official trading session; other dimensions use latest available."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockSignalsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/signals/stories/latest": {
      "get": {
        "tags": [
          "story-signals"
        ],
        "summary": "Get Stories Latest",
        "description": "Group the latest ``ses_story_daily`` rows by story for the homepage.",
        "operationId": "get_stories_latest_api_signals_stories_latest_get",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "technical",
                    "chip",
                    "financial",
                    "cross_domain"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Restrict to one domain; default returns all four.",
              "title": "Domain"
            },
            "description": "Restrict to one domain; default returns all four."
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Trading-date upper bound (YYYY-MM-DD). All requested domains use the newest date present in any of them; lagging domains stay empty.",
              "title": "Date"
            },
            "description": "Trading-date upper bound (YYYY-MM-DD). All requested domains use the newest date present in any of them; lagging domains stay empty."
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by story direction (bullish/bearish/risk/support/…).",
              "title": "Direction"
            },
            "description": "Filter by story direction (bullish/bearish/risk/support/…)."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoriesLatestResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/daily-analysis/{ticker}/latest": {
      "get": {
        "tags": [
          "daily-analysis",
          "daily-analysis"
        ],
        "summary": "Get Latest Daily Analysis",
        "description": "Get latest daily analysis payload for ticker.",
        "operationId": "get_latest_daily_analysis_api_daily_analysis__ticker__latest_get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Latest Daily Analysis Api Daily Analysis  Ticker  Latest Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/daily-analysis/{ticker}": {
      "get": {
        "tags": [
          "daily-analysis",
          "daily-analysis"
        ],
        "summary": "Get Daily Analysis Range",
        "description": "Get daily analysis payloads by date range.",
        "operationId": "get_daily_analysis_range_api_daily_analysis__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "title": "From"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "title": "To"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "title": "Response Get Daily Analysis Range Api Daily Analysis  Ticker  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/daily-analysis/run": {
      "post": {
        "tags": [
          "daily-analysis",
          "daily-analysis"
        ],
        "summary": "Run Daily Analysis",
        "description": "Manually run daily analysis snapshot generation.",
        "operationId": "run_daily_analysis_api_daily_analysis_run_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DailyAnalysisRunRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Run Daily Analysis Api Daily Analysis Run Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/signals/backtest/run": {
      "post": {
        "tags": [
          "signals-backtest",
          "signals-backtest"
        ],
        "summary": "Run Backtest",
        "description": "Run signal backtest by date window and optional ticker filter.",
        "operationId": "run_backtest_api_signals_backtest_run_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignalBacktestRunRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Run Backtest Api Signals Backtest Run Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/signals/backtest/export/csv": {
      "get": {
        "tags": [
          "signals-backtest",
          "signals-backtest"
        ],
        "summary": "Export Backtest Csv",
        "description": "Export backtest result as CSV.",
        "operationId": "export_backtest_csv_api_signals_backtest_export_csv_get",
        "parameters": [
          {
            "name": "run_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Backtest run id, default latest",
              "title": "Run Id"
            },
            "description": "Backtest run id, default latest"
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Backtest domain: technical | chip",
              "default": "technical",
              "title": "Domain"
            },
            "description": "Backtest domain: technical | chip"
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Export scope: overall | signal_type | ticker | indicator | event",
              "default": "overall",
              "title": "Scope"
            },
            "description": "Export scope: overall | signal_type | ticker | indicator | event"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/signals/backtest/accuracy/signal-type": {
      "get": {
        "tags": [
          "signals-backtest",
          "signals-backtest"
        ],
        "summary": "Get Backtest Accuracy By Signal Type",
        "description": "Return backtest accuracy grouped by signal type (lightweight, normalized keys).",
        "operationId": "get_backtest_accuracy_by_signal_type_api_signals_backtest_accuracy_signal_type_get",
        "parameters": [
          {
            "name": "run_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Backtest run id, default latest",
              "title": "Run Id"
            },
            "description": "Backtest run id, default latest"
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Backtest domain: technical | chip",
              "default": "technical",
              "title": "Domain"
            },
            "description": "Backtest domain: technical | chip"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Backtest Accuracy By Signal Type Api Signals Backtest Accuracy Signal Type Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/signals/backtest/accuracy/ticker/{ticker}": {
      "get": {
        "tags": [
          "signals-backtest",
          "signals-backtest"
        ],
        "summary": "Get Backtest Accuracy By Ticker",
        "description": "Return backtest accuracy for a specific ticker, grouped by signal type.",
        "operationId": "get_backtest_accuracy_by_ticker_api_signals_backtest_accuracy_ticker__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "run_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Backtest run id, default latest",
              "title": "Run Id"
            },
            "description": "Backtest run id, default latest"
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Backtest domain: technical | chip",
              "default": "technical",
              "title": "Domain"
            },
            "description": "Backtest domain: technical | chip"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Backtest Accuracy By Ticker Api Signals Backtest Accuracy Ticker  Ticker  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/signals/backtest/accuracy/tickers": {
      "post": {
        "tags": [
          "signals-backtest",
          "signals-backtest"
        ],
        "summary": "Get Backtest Accuracy Batch",
        "description": "Return per-ticker backtest accuracy for a batch of tickers (used by homepage).\n\nResponse: {run_id, from_date, to_date, by_ticker: {TICKER: {signal_type: {sample, acc_h1..h20}}}}",
        "operationId": "get_backtest_accuracy_batch_api_signals_backtest_accuracy_tickers_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchTickerRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Get Backtest Accuracy Batch Api Signals Backtest Accuracy Tickers Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/signals/backtest/accuracy": {
      "get": {
        "tags": [
          "signals-backtest",
          "signals-backtest"
        ],
        "summary": "Get Backtest Accuracy",
        "description": "Return backtest accuracy for overall / signal_type / indicator.",
        "operationId": "get_backtest_accuracy_api_signals_backtest_accuracy_get",
        "parameters": [
          {
            "name": "run_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Backtest run id, default latest",
              "title": "Run Id"
            },
            "description": "Backtest run id, default latest"
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Backtest domain: technical | chip",
              "default": "technical",
              "title": "Domain"
            },
            "description": "Backtest domain: technical | chip"
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Output format: json | csv",
              "default": "json",
              "title": "Format"
            },
            "description": "Output format: json | csv"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "title": "Response Get Backtest Accuracy Api Signals Backtest Accuracy Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/chip-recap/latest": {
      "get": {
        "tags": [
          "chip-recap",
          "chip-recap"
        ],
        "summary": "Get Latest Chip Recap",
        "description": "Return the latest daily chip recap.\n\nThe payload includes explicit ``top_bullish_stocks`` and\n``top_bearish_stocks`` fields derived from stock-level three-actor\ninstitutional net values.",
        "operationId": "get_latest_chip_recap_api_chip_recap_latest_get",
        "parameters": [
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Latest Chip Recap Api Chip Recap Latest Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/chip-recap/pulse/latest": {
      "get": {
        "tags": [
          "chip-recap",
          "chip-recap"
        ],
        "summary": "Get latest homepage chip pulse",
        "operationId": "get_latest_chip_pulse_api_chip_recap_pulse_latest_get",
        "parameters": [
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Latest Chip Pulse Api Chip Recap Pulse Latest Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/chip-recap/pulse/{trade_date}": {
      "get": {
        "tags": [
          "chip-recap",
          "chip-recap"
        ],
        "summary": "Get homepage chip pulse by date",
        "operationId": "get_chip_pulse_api_chip_recap_pulse__trade_date__get",
        "parameters": [
          {
            "name": "trade_date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "title": "Trade Date"
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Chip Pulse Api Chip Recap Pulse  Trade Date  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/chip-recap/{trade_date}": {
      "get": {
        "tags": [
          "chip-recap",
          "chip-recap"
        ],
        "summary": "Get Chip Recap",
        "description": "Return the daily chip recap for the exact requested date.\n\nThe payload includes explicit ``top_bullish_stocks`` and\n``top_bearish_stocks`` fields derived from stock-level three-actor\ninstitutional net values.",
        "operationId": "get_chip_recap_api_chip_recap__trade_date__get",
        "parameters": [
          {
            "name": "trade_date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "title": "Trade Date"
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Chip Recap Api Chip Recap  Trade Date  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/chip-recap/{trade_date}/analyze": {
      "post": {
        "tags": [
          "chip-recap",
          "chip-recap"
        ],
        "summary": "Analyze Chip Recap",
        "operationId": "analyze_chip_recap_api_chip_recap__trade_date__analyze_post",
        "parameters": [
          {
            "name": "trade_date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "title": "Trade Date"
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Analyze Chip Recap Api Chip Recap  Trade Date  Analyze Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/chip-recap/{trade_date}/groups": {
      "get": {
        "tags": [
          "chip-recap",
          "chip-recap"
        ],
        "summary": "Get Chip Recap Groups",
        "operationId": "get_chip_recap_groups_api_chip_recap__trade_date__groups_get",
        "parameters": [
          {
            "name": "trade_date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "title": "Trade Date"
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "all",
              "title": "Direction"
            }
          },
          {
            "name": "group_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Group Type"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "title": "Response Get Chip Recap Groups Api Chip Recap  Trade Date  Groups Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/chip-recap/{trade_date}/stocks": {
      "get": {
        "tags": [
          "chip-recap",
          "chip-recap"
        ],
        "summary": "Get Chip Recap Stock Events",
        "operationId": "get_chip_recap_stock_events_api_chip_recap__trade_date__stocks_get",
        "parameters": [
          {
            "name": "trade_date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "title": "Trade Date"
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          },
          {
            "name": "event_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Event Type"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "title": "Response Get Chip Recap Stock Events Api Chip Recap  Trade Date  Stocks Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/chip/summary/{ticker}": {
      "get": {
        "tags": [
          "chip-summary"
        ],
        "summary": "Get Chip Summary",
        "operationId": "get_chip_summary_api_chip_summary__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "title": "Ticker"
            }
          },
          {
            "name": "trade_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exact ISO trading date; defaults to the latest date on which this stock has any daily source. Missing same-day sources remain null.",
              "title": "Trade Date"
            },
            "description": "Exact ISO trading date; defaults to the latest date on which this stock has any daily source. Missing same-day sources remain null."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChipSummaryResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/technical-recap/latest": {
      "get": {
        "tags": [
          "technical-recap",
          "technical-recap"
        ],
        "summary": "Get Latest Technical Recap",
        "operationId": "get_latest_technical_recap_api_technical_recap_latest_get",
        "parameters": [
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Latest Technical Recap Api Technical Recap Latest Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/technical-recap/range": {
      "get": {
        "tags": [
          "technical-recap",
          "technical-recap"
        ],
        "summary": "Get multi-day breadth / market_context time series",
        "operationId": "get_technical_recap_range_api_technical_recap_range_get",
        "parameters": [
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Start date in YYYY-MM-DD. Default: lookback from config.",
              "title": "Start Date"
            },
            "description": "Start date in YYYY-MM-DD. Default: lookback from config."
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "End date in YYYY-MM-DD. Default: today.",
              "title": "End Date"
            },
            "description": "End date in YYYY-MM-DD. Default: today."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Technical Recap Range Api Technical Recap Range Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/technical-recap/pulse/latest": {
      "get": {
        "tags": [
          "technical-recap",
          "technical-recap"
        ],
        "summary": "Get latest homepage technical pulse",
        "operationId": "get_latest_technical_pulse_api_technical_recap_pulse_latest_get",
        "parameters": [
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Latest Technical Pulse Api Technical Recap Pulse Latest Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/technical-recap/pulse/{trade_date}": {
      "get": {
        "tags": [
          "technical-recap",
          "technical-recap"
        ],
        "summary": "Get homepage technical pulse by date",
        "operationId": "get_technical_pulse_api_technical_recap_pulse__trade_date__get",
        "parameters": [
          {
            "name": "trade_date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "title": "Trade Date"
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Technical Pulse Api Technical Recap Pulse  Trade Date  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/technical-recap/{trade_date}": {
      "get": {
        "tags": [
          "technical-recap",
          "technical-recap"
        ],
        "summary": "Get Technical Recap",
        "operationId": "get_technical_recap_api_technical_recap__trade_date__get",
        "parameters": [
          {
            "name": "trade_date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "title": "Trade Date"
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Technical Recap Api Technical Recap  Trade Date  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/technical-recap/{trade_date}/analyze": {
      "post": {
        "tags": [
          "technical-recap",
          "technical-recap"
        ],
        "summary": "Analyze Technical Recap",
        "operationId": "analyze_technical_recap_api_technical_recap__trade_date__analyze_post",
        "parameters": [
          {
            "name": "trade_date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "title": "Trade Date"
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Analyze Technical Recap Api Technical Recap  Trade Date  Analyze Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/technical-recap/{trade_date}/groups": {
      "get": {
        "tags": [
          "technical-recap",
          "technical-recap"
        ],
        "summary": "Get Technical Recap Groups",
        "operationId": "get_technical_recap_groups_api_technical_recap__trade_date__groups_get",
        "parameters": [
          {
            "name": "trade_date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "title": "Trade Date"
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          },
          {
            "name": "trend_state",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Trend State"
            }
          },
          {
            "name": "bucket",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "all",
              "title": "Bucket"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "title": "Response Get Technical Recap Groups Api Technical Recap  Trade Date  Groups Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/technical-recap/{trade_date}/stocks": {
      "get": {
        "tags": [
          "technical-recap",
          "technical-recap"
        ],
        "summary": "Get Technical Recap Stock Events",
        "operationId": "get_technical_recap_stock_events_api_technical_recap__trade_date__stocks_get",
        "parameters": [
          {
            "name": "trade_date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "title": "Trade Date"
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          },
          {
            "name": "event_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Event Type"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "title": "Response Get Technical Recap Stock Events Api Technical Recap  Trade Date  Stocks Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/technical-recap/{trade_date}/events/summary": {
      "get": {
        "tags": [
          "technical-recap",
          "technical-recap"
        ],
        "summary": "Get per-event-type stock counts for a trade date",
        "description": "How many stocks carried each technical event type on a trade date.",
        "operationId": "get_technical_recap_event_type_counts_api_technical_recap__trade_date__events_summary_get",
        "parameters": [
          {
            "name": "trade_date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "title": "Trade Date"
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Technical Recap Event Type Counts Api Technical Recap  Trade Date  Events Summary Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/technical-recap/{trade_date}/breadth/tickers": {
      "get": {
        "tags": [
          "technical-recap",
          "technical-recap"
        ],
        "summary": "Constituent stocks behind one breadth number",
        "operationId": "get_technical_recap_breadth_tickers_api_technical_recap__trade_date__breadth_tickers_get",
        "parameters": [
          {
            "name": "trade_date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "title": "Trade Date"
            }
          },
          {
            "name": "metric",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "One of the breadth_summary keys, e.g. new_highs_20d / pct_above_sma_20.",
              "title": "Metric"
            },
            "description": "One of the breadth_summary keys, e.g. new_highs_20d / pct_above_sma_20."
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Technical Recap Breadth Tickers Api Technical Recap  Trade Date  Breadth Tickers Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/market-pulse/latest": {
      "get": {
        "tags": [
          "market-pulse",
          "market-pulse"
        ],
        "summary": "Get latest homepage market pulse",
        "operationId": "get_latest_market_pulse_api_market_pulse_latest_get",
        "parameters": [
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Latest Market Pulse Api Market Pulse Latest Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/market-pulse/{trade_date}": {
      "get": {
        "tags": [
          "market-pulse",
          "market-pulse"
        ],
        "summary": "Get homepage market pulse by date",
        "operationId": "get_market_pulse_api_market_pulse__trade_date__get",
        "parameters": [
          {
            "name": "trade_date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "title": "Trade Date"
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Market Pulse Api Market Pulse  Trade Date  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/daily-market/latest": {
      "get": {
        "tags": [
          "daily-market",
          "daily-market"
        ],
        "summary": "Get latest unified daily market dashboard payload",
        "operationId": "get_latest_daily_market_api_daily_market_latest_get",
        "parameters": [
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Latest Daily Market Api Daily Market Latest Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/daily-market/range": {
      "get": {
        "tags": [
          "daily-market",
          "daily-market"
        ],
        "summary": "Get market-wide chip indicators over a date range",
        "operationId": "get_daily_market_chip_range_api_daily_market_range_get",
        "parameters": [
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Start date YYYY-MM-DD. Default: end_date − default_lookback_days.",
              "title": "Start Date"
            },
            "description": "Start date YYYY-MM-DD. Default: end_date − default_lookback_days."
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "End date YYYY-MM-DD. Default: today.",
              "title": "End Date"
            },
            "description": "End date YYYY-MM-DD. Default: today."
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DailyMarketChipRangeResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/daily-market/index-range": {
      "get": {
        "tags": [
          "daily-market",
          "daily-market"
        ],
        "summary": "Get index-level daily-market fields over a date range",
        "operationId": "get_daily_market_index_range_api_daily_market_index_range_get",
        "parameters": [
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Start date YYYY-MM-DD. Default: end_date − default_lookback_days.",
              "title": "Start Date"
            },
            "description": "Start date YYYY-MM-DD. Default: end_date − default_lookback_days."
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "End date YYYY-MM-DD. Default: today.",
              "title": "End Date"
            },
            "description": "End date YYYY-MM-DD. Default: today."
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DailyMarketIndexRangeResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/daily-market/{trade_date}": {
      "get": {
        "tags": [
          "daily-market",
          "daily-market"
        ],
        "summary": "Get unified daily market dashboard payload by date",
        "operationId": "get_daily_market_api_daily_market__trade_date__get",
        "parameters": [
          {
            "name": "trade_date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "title": "Trade Date"
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Daily Market Api Daily Market  Trade Date  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/recaps/{dimension}/{period_type}/latest": {
      "get": {
        "tags": [
          "recaps",
          "recaps"
        ],
        "summary": "Get Latest Recap",
        "description": "Return the most-recent recap row for the given dimension + period.\n\n``daily`` resolves the MAX(trade_date); weekly/monthly resolve\nMAX(period_end_date); orchestrator uses its own MAX(period_end_date)\nscoped to the requested period_type.\n\nFor ``dimension=chip&period_type=daily``, ``summary_json`` includes\nexplicit ``top_bullish_stocks`` and ``top_bearish_stocks`` lists for\nfrontend institutional buy/sell stock cards. The top-level additive\nownership ranking lists include ``current_shares`` and ``shares_change``\non each item. Empty bucket levels in an existing snapshot are reported\nas 0; missing current or previous snapshots are reported as null.",
        "operationId": "get_latest_recap_api_recaps__dimension___period_type__latest_get",
        "parameters": [
          {
            "name": "dimension",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Dimension"
            }
          },
          {
            "name": "period_type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Period Type"
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Latest Recap Api Recaps  Dimension   Period Type  Latest Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/recaps/{dimension}/{period_type}/{requested_date}": {
      "get": {
        "tags": [
          "recaps",
          "recaps"
        ],
        "summary": "Get Recap",
        "description": "Return the recap row for the given dimension + period + date.\n\n- Daily: uses fallback (latest trade_date ≤ requested).\n- Weekly/monthly: exact match on period_end_date; 404 otherwise.\n- Orchestrator: exact match on period_type + period_end_date.\n\nFor ``dimension=chip&period_type=daily``, ``summary_json`` includes\nexplicit ``top_bullish_stocks`` and ``top_bearish_stocks`` lists for\nfrontend institutional buy/sell stock cards. The top-level additive\nownership ranking lists include ``current_shares`` and ``shares_change``\non each item. Empty bucket levels in an existing snapshot are reported\nas 0; missing current or previous snapshots are reported as null.",
        "operationId": "get_recap_api_recaps__dimension___period_type___requested_date__get",
        "parameters": [
          {
            "name": "dimension",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Dimension"
            }
          },
          {
            "name": "period_type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Period Type"
            }
          },
          {
            "name": "requested_date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "title": "Requested Date"
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Recap Api Recaps  Dimension   Period Type   Requested Date  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/recaps/{period_type}/{requested_date}/analyze": {
      "post": {
        "tags": [
          "recaps",
          "recaps"
        ],
        "summary": "Analyze Recap Bundle",
        "description": "Return technical + chip + orchestrator LLM narratives in one response.\n\n- ``period_type=daily`` uses the same LLM path as the existing\n  ``/api/technical-recap/{date}/analyze`` + ``/api/chip-recap/{date}/analyze``\n  endpoints.\n- ``weekly`` / ``monthly`` read from the ``periodic_*`` tables;\n  returns 409 if the aggregation hasn't been run for that period.\n- Orchestrator failure does NOT fail the whole response — the caller\n  still receives technical + chip, with ``orchestrator=null`` and\n  ``orchestrator_error`` populated so the frontend can render partial.\n- ``response_mode=stream`` (daily only) publishes each dimension as\n  SSE the moment it lands, so a 40-60s bundle is not hostage to a\n  client-side request timeout. Every pre-flight failure below still\n  surfaces as an ordinary HTTP status because the StreamingResponse\n  is not constructed until they have all passed.",
        "operationId": "analyze_recap_bundle_api_recaps__period_type___requested_date__analyze_post",
        "parameters": [
          {
            "name": "period_type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Period Type"
            }
          },
          {
            "name": "requested_date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "title": "Requested Date"
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          },
          {
            "name": "response_mode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "json",
              "title": "Response Mode"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Bundle payload (response_mode=json) or an SSE event stream (response_mode=stream, daily only)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/recap-analysis/latest": {
      "get": {
        "tags": [
          "recap-analysis"
        ],
        "summary": "Get Latest Recap Analysis",
        "description": "Read the latest cached market analysis without invoking LLMs.\n\nReturns the most recent daily analysis held for the requested type. The\nresponse carries ``trade_date`` and ``generated_at`` so callers can judge\nhow current it is; the analysis is not required to still match the present\nstate of the source data it was generated from.",
        "operationId": "get_latest_recap_analysis_api_recap_analysis_latest_get",
        "parameters": [
          {
            "name": "analysis_type",
            "in": "query",
            "required": true,
            "schema": {
              "enum": [
                "technical",
                "chip",
                "financial",
                "integrated",
                "active_etf"
              ],
              "type": "string",
              "title": "Analysis Type"
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/LatestTechnicalRecapAnalysis"
                    },
                    {
                      "$ref": "#/components/schemas/LatestChipRecapAnalysis"
                    },
                    {
                      "$ref": "#/components/schemas/LatestFinancialRecapAnalysis"
                    },
                    {
                      "$ref": "#/components/schemas/LatestIntegratedRecapAnalysis"
                    },
                    {
                      "$ref": "#/components/schemas/LatestActiveETFRecapAnalysis"
                    }
                  ],
                  "discriminator": {
                    "propertyName": "analysis_type",
                    "mapping": {
                      "technical": "#/components/schemas/LatestTechnicalRecapAnalysis",
                      "chip": "#/components/schemas/LatestChipRecapAnalysis",
                      "financial": "#/components/schemas/LatestFinancialRecapAnalysis",
                      "integrated": "#/components/schemas/LatestIntegratedRecapAnalysis",
                      "active_etf": "#/components/schemas/LatestActiveETFRecapAnalysis"
                    }
                  },
                  "title": "Response Get Latest Recap Analysis Api Recap Analysis Latest Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/technical/{ticker}": {
      "get": {
        "tags": [
          "agent"
        ],
        "summary": "Get Agent Technical",
        "description": "Return structured technical analysis payload for Agent consumption.\n\nOutput format: tech_agent_output_format.md v1\nreasons / warnings: raw code strings (no translation)\nsignal_type: compatibility alias derived from replacement signals[]\nsignal_age: MVP=1 (reserved for future signal_history implementation)\n\nResistance comparisons use the same exact-date adjusted close as the\nadjusted ``major_resistance`` level. The raw snapshot close remains a\ndisplay price; if either adjusted value is absent, non-finite, or not\npositive, all derived resistance-comparison fields are ``null``.",
        "operationId": "get_agent_technical_api_agent_technical__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Agent Technical Api Agent Technical  Ticker  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/chip/{ticker}": {
      "get": {
        "tags": [
          "chip-agent"
        ],
        "summary": "Get Chip Agent Payload",
        "description": "Return the latest chip analysis payload for a ticker.\n\nCost zones (``indexes.cost_zones`` / ``context.chip_structure``): each\nactor and composite zone exposes ``buy_cost_zone`` / ``sell_cost_zone`` /\n``net_cost_zone``. v1.6.0: buy/sell zones additionally carry\n``histogram`` — ``{\"prices\": number[20], \"shares\": int[20]}`` on a shared\nprice grid (window close min→max, 20 equal bins; composite = element-wise\nsum of actor histograms; ``sum(shares) == meta.total_shares``) or ``null``\nwhen the direction has no flow or the price window is flat. Stored\nevidence lacking the ``histogram`` key predates the field and is\nrecomputed at request time (not persisted).",
        "operationId": "get_chip_agent_payload_api_agent_chip__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "cost_window_days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 252,
              "minimum": 20,
              "default": 60,
              "title": "Cost Window Days"
            }
          },
          {
            "name": "source_window",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "2y"
              ],
              "type": "string",
              "default": "2y",
              "title": "Source Window"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Chip Agent Payload Api Agent Chip  Ticker  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/financial/{ticker}": {
      "get": {
        "tags": [
          "financial-agent"
        ],
        "summary": "Get Financial Agent Payload",
        "description": "Return the latest financial analysis payload for a ticker.",
        "operationId": "get_financial_agent_payload_api_agent_financial__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Financial Agent Payload Api Agent Financial  Ticker  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/fundamental/{ticker}": {
      "get": {
        "tags": [
          "fundamental-agent"
        ],
        "summary": "Get Fundamental Agent Payload",
        "description": "Placeholder -- returns not_ready with fixed summary contract.\n\nThe summary contract is pre-defined so that UI consumers can build\nagainst a stable shape. When coverage_status becomes 'ready', the\nsame shape will be populated with real data.",
        "operationId": "get_fundamental_agent_payload_api_agent_fundamental__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Fundamental Agent Payload Api Agent Fundamental  Ticker  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/groups": {
      "get": {
        "tags": [
          "groups",
          "groups"
        ],
        "summary": "List Groups",
        "description": "List all stock groups with a lightweight active_count summary.\n\nactive_count = number of members with at least one is_primary=TRUE match\non the latest trade_date in strategy_match.",
        "operationId": "list_groups_api_groups_get",
        "parameters": [
          {
            "name": "group_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by group_type: industry, sector, concept",
              "title": "Group Type"
            },
            "description": "Filter by group_type: industry, sector, concept"
          },
          {
            "name": "source_window",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "2y"
              ],
              "type": "string",
              "default": "2y",
              "title": "Source Window"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "title": "Response List Groups Api Groups Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/groups/{group_id}/members": {
      "get": {
        "tags": [
          "groups",
          "groups"
        ],
        "summary": "Get Group Members",
        "description": "Return group members with their primary strategy match.\n\nEach member shows the primary (is_primary=TRUE) strategy_key and score\nfrom the latest trade_date.",
        "operationId": "get_group_members_api_groups__group_id__members_get",
        "parameters": [
          {
            "name": "group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Group Id"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Sort by: score, name",
              "default": "score",
              "title": "Sort"
            },
            "description": "Sort by: score, name"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter primary match direction: long, short",
              "title": "Direction"
            },
            "description": "Filter primary match direction: long, short"
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Market used for OHLC price lookup",
              "default": "taiwan",
              "title": "Market"
            },
            "description": "Market used for OHLC price lookup"
          },
          {
            "name": "trade_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Price lookup upper-bound date",
              "title": "Trade Date"
            },
            "description": "Price lookup upper-bound date"
          },
          {
            "name": "include_price",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include latest OHLC price/change payload",
              "default": true,
              "title": "Include Price"
            },
            "description": "Include latest OHLC price/change payload"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 200,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "source_window",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "2y"
              ],
              "type": "string",
              "default": "2y",
              "title": "Source Window"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Group Members Api Groups  Group Id  Members Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/groups/{group_id}/signals": {
      "get": {
        "tags": [
          "groups",
          "groups"
        ],
        "summary": "Get Group Signals",
        "description": "Return group-scoped strategy match rows for members of a group.\n\nQueries strategy_match WHERE scope='group' for tickers belonging\nto this group, on the latest trade_date with group-scope data.",
        "operationId": "get_group_signals_api_groups__group_id__signals_get",
        "parameters": [
          {
            "name": "group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Group Id"
            }
          },
          {
            "name": "strategy_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by strategy_key: long_d1, short_d5, etc.",
              "title": "Strategy Key"
            },
            "description": "Filter by strategy_key: long_d1, short_d5, etc."
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by direction: long, short",
              "title": "Direction"
            },
            "description": "Filter by direction: long, short"
          },
          {
            "name": "source_window",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "2y"
              ],
              "type": "string",
              "default": "2y",
              "title": "Source Window"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Group Signals Api Groups  Group Id  Signals Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/groups/{group_id}/capital-flow-diff": {
      "get": {
        "tags": [
          "groups",
          "groups"
        ],
        "summary": "Get Group Capital Flow Diff",
        "description": "Return collection-level estimated turnover deltas for a system stock group.",
        "operationId": "get_group_capital_flow_diff_api_groups__group_id__capital_flow_diff_get",
        "parameters": [
          {
            "name": "group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Group Id"
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Market used for OHLC turnover lookup",
              "default": "taiwan",
              "title": "Market"
            },
            "description": "Market used for OHLC turnover lookup"
          },
          {
            "name": "trade_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Turnover lookup upper-bound date",
              "title": "Trade Date"
            },
            "description": "Turnover lookup upper-bound date"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Group Capital Flow Diff Api Groups  Group Id  Capital Flow Diff Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/stock-lists/items": {
      "get": {
        "tags": [
          "stock-lists"
        ],
        "summary": "Get Stock List Items",
        "description": "Return stocks and price/change info for one theme, group, or watchlist group.",
        "operationId": "get_stock_list_items_api_stock_lists_items_get",
        "parameters": [
          {
            "name": "searchType",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/StockListSearchType"
            }
          },
          {
            "name": "searchID",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "title": "Searchid"
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Market used for OHLC price lookup",
              "default": "taiwan",
              "title": "Market"
            },
            "description": "Market used for OHLC price lookup"
          },
          {
            "name": "tradeDate",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Price lookup upper-bound date",
              "title": "Tradedate"
            },
            "description": "Price lookup upper-bound date"
          },
          {
            "name": "includePrice",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include latest OHLC price/change payload",
              "default": true,
              "title": "Includeprice"
            },
            "description": "Include latest OHLC price/change payload"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 200,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Bearer token required for watchlist search",
              "title": "Authorization"
            },
            "description": "Bearer token required for watchlist search"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockListItemsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/themes": {
      "get": {
        "tags": [
          "themes"
        ],
        "summary": "List Themes",
        "description": "List all themes held in the canonical theme store.",
        "operationId": "list_themes_api_themes_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Theme"
                  },
                  "type": "array",
                  "title": "Response List Themes Api Themes Get"
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/themes/{theme_id}/stocks": {
      "get": {
        "tags": [
          "themes"
        ],
        "summary": "Get Theme Stocks",
        "description": "Return the stock list for a theme.\n\nIf the theme is absent from the theme store, or blocked (deletion\ntombstone), found=False with an empty stock list is returned.",
        "operationId": "get_theme_stocks_api_themes__theme_id__stocks_get",
        "parameters": [
          {
            "name": "theme_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Theme Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Page size. Defaults to themes.default_limit and is silently clamped to themes.max_limit (configured server-side) — values above the cap return at most max_limit rows rather than a 422.",
              "title": "Limit"
            },
            "description": "Page size. Defaults to themes.default_limit and is silently clamped to themes.max_limit (configured server-side) — values above the cap return at most max_limit rows rather than a 422."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Market used for OHLC price lookup",
              "default": "taiwan",
              "title": "Market"
            },
            "description": "Market used for OHLC price lookup"
          },
          {
            "name": "trade_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Price lookup upper-bound date",
              "title": "Trade Date"
            },
            "description": "Price lookup upper-bound date"
          },
          {
            "name": "include_price",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include latest OHLC price/change payload",
              "default": true,
              "title": "Include Price"
            },
            "description": "Include latest OHLC price/change payload"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemeStocksResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/theme-recaps/latest": {
      "get": {
        "tags": [
          "theme-recaps"
        ],
        "summary": "Get Latest Theme Recap",
        "description": "Return theme cards plus selected theme detail for page bootstrap.",
        "operationId": "get_latest_theme_recap_api_theme_recaps_latest_get",
        "parameters": [
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          },
          {
            "name": "trade_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Trade Date"
            }
          },
          {
            "name": "selected_theme",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Selected Theme"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          },
          {
            "name": "window_days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 120,
              "minimum": 1,
              "default": 30,
              "title": "Window Days"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemeRecapResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/theme-recaps/search": {
      "get": {
        "tags": [
          "theme-recaps"
        ],
        "summary": "Search Theme Recap Suggestions",
        "description": "Search canonical themes and their member stocks.",
        "operationId": "search_theme_recap_suggestions_api_theme_recaps_search_get",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "title": "Q"
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 50,
              "minimum": 1,
              "default": 10,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ThemeSearchResult"
                  },
                  "title": "Response Search Theme Recap Suggestions Api Theme Recaps Search Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/theme-recaps/{theme_id}": {
      "get": {
        "tags": [
          "theme-recaps"
        ],
        "summary": "Get Theme Recap Detail",
        "description": "Return the selected theme recap detail payload.",
        "operationId": "get_theme_recap_detail_api_theme_recaps__theme_id__get",
        "parameters": [
          {
            "name": "theme_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Theme Id"
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          },
          {
            "name": "trade_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Trade Date"
            }
          },
          {
            "name": "window_days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 120,
              "minimum": 1,
              "default": 30,
              "title": "Window Days"
            }
          },
          {
            "name": "member_limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 5,
              "title": "Member Limit"
            }
          },
          {
            "name": "signal_limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 3,
              "title": "Signal Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemeRecapResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/theme-recaps/{theme_id}/members": {
      "get": {
        "tags": [
          "theme-recaps"
        ],
        "summary": "Get Theme Recap Members",
        "description": "Return paginated theme member ranking.",
        "operationId": "get_theme_recap_members_api_theme_recaps__theme_id__members_get",
        "parameters": [
          {
            "name": "theme_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Theme Id"
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          },
          {
            "name": "trade_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Trade Date"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "composite_score",
                "technical_score",
                "chip_score",
                "win_rate",
                "ticker"
              ],
              "type": "string",
              "default": "composite_score",
              "title": "Sort"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemeMemberPageResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/theme-recaps/{theme_id}/signals": {
      "get": {
        "tags": [
          "theme-recaps"
        ],
        "summary": "Get Theme Recap Signals",
        "description": "Return paginated latest signals for theme members.",
        "operationId": "get_theme_recap_signals_api_theme_recaps__theme_id__signals_get",
        "parameters": [
          {
            "name": "theme_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Theme Id"
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          },
          {
            "name": "trade_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Trade Date"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Kind"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemeSignalPageResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/theme-recaps/{theme_id}/capital-flow-diff": {
      "get": {
        "tags": [
          "theme-recaps"
        ],
        "summary": "Get Theme Capital Flow Diff",
        "description": "Return collection-level estimated turnover deltas for a canonical theme.",
        "operationId": "get_theme_capital_flow_diff_api_theme_recaps__theme_id__capital_flow_diff_get",
        "parameters": [
          {
            "name": "theme_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Theme Id"
            }
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "taiwan",
              "title": "Market"
            }
          },
          {
            "name": "trade_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Trade Date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemeCapitalFlowDiffResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/theme-agent/analyze": {
      "post": {
        "tags": [
          "theme-agent"
        ],
        "summary": "Analyze Theme",
        "description": "Return the latest daily report; administrators may request history.",
        "operationId": "analyze_theme_api_theme_agent_analyze_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ThemeAnalysisRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemeAnalysisResponse"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Request Entity Too Large"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Gateway Timeout"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    },
                    {
                      "$ref": "#/components/schemas/RequestValidationResponse"
                    }
                  ],
                  "title": "Response 422 Analyze Theme Api Theme Agent Analyze Post"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/rules/catalog/threshold-summary": {
      "get": {
        "tags": [
          "rules",
          "rules"
        ],
        "summary": "Threshold Summary",
        "description": "Grouped rule counts + 16-metric averages after applying threshold filters.",
        "operationId": "threshold_summary_api_rules_catalog_threshold_summary_get",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Ticker"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Scope"
            }
          },
          {
            "name": "group_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Group Id"
            }
          },
          {
            "name": "supply_chain_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Supply Chain Id"
            }
          },
          {
            "name": "commodity_code",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Commodity Code"
            }
          },
          {
            "name": "family_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Family Id"
            }
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Domain"
            }
          },
          {
            "name": "strategy_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Strategy Key"
            }
          },
          {
            "name": "regime_slice",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Regime Slice"
            }
          },
          {
            "name": "min_hit_rate",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Min Hit Rate"
            }
          },
          {
            "name": "min_sample_count",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Min Sample Count"
            }
          },
          {
            "name": "min_ev",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Min Ev"
            }
          },
          {
            "name": "min_pf",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Min Pf"
            }
          },
          {
            "name": "include_below_floor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": true,
              "title": "Include Below Floor"
            }
          },
          {
            "name": "group_by",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Extra GROUP BY dimensions (comma-separated). Allowed: domain, scope, regime_slice, quality_tier",
              "title": "Group By"
            },
            "description": "Extra GROUP BY dimensions (comma-separated). Allowed: domain, scope, regime_slice, quality_tier"
          },
          {
            "name": "source_window",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "2y"
              ],
              "type": "string",
              "default": "2y",
              "title": "Source Window"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Threshold Summary Api Rules Catalog Threshold Summary Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/rules/catalog/threshold-rules": {
      "get": {
        "tags": [
          "rules",
          "rules"
        ],
        "summary": "Threshold Rules",
        "description": "Return rules that pass given threshold filters, with pagination.",
        "operationId": "threshold_rules_api_rules_catalog_threshold_rules_get",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Ticker"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Scope"
            }
          },
          {
            "name": "group_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Group Id"
            }
          },
          {
            "name": "supply_chain_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Supply Chain Id"
            }
          },
          {
            "name": "commodity_code",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Commodity Code"
            }
          },
          {
            "name": "family_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Family Id"
            }
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Domain"
            }
          },
          {
            "name": "strategy_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Strategy Key"
            }
          },
          {
            "name": "regime_slice",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Regime Slice"
            }
          },
          {
            "name": "min_hit_rate",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Min Hit Rate"
            }
          },
          {
            "name": "min_sample_count",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Min Sample Count"
            }
          },
          {
            "name": "min_ev",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Min Ev"
            }
          },
          {
            "name": "min_pf",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Min Pf"
            }
          },
          {
            "name": "include_below_floor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": true,
              "title": "Include Below Floor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 200,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "source_window",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "2y"
              ],
              "type": "string",
              "default": "2y",
              "title": "Source Window"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Threshold Rules Api Rules Catalog Threshold Rules Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/rules/catalog": {
      "get": {
        "tags": [
          "rules",
          "rules"
        ],
        "summary": "List Rules",
        "description": "List rules from the strategy rule catalog with optional filters.",
        "operationId": "list_rules_api_rules_catalog_get",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Ticker"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Scope"
            }
          },
          {
            "name": "group_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Group Id"
            }
          },
          {
            "name": "supply_chain_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Supply Chain Id"
            }
          },
          {
            "name": "commodity_code",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Commodity Code"
            }
          },
          {
            "name": "family_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Family Id"
            }
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Domain"
            }
          },
          {
            "name": "strategy_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Strategy Key"
            }
          },
          {
            "name": "regime_slice",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Regime Slice"
            }
          },
          {
            "name": "min_hit_rate",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Min Hit Rate"
            }
          },
          {
            "name": "min_sample_count",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Min Sample Count"
            }
          },
          {
            "name": "min_ev",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Min Ev"
            }
          },
          {
            "name": "min_pf",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Min Pf"
            }
          },
          {
            "name": "include_below_floor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": true,
              "title": "Include Below Floor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 200,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "source_window",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "2y"
              ],
              "type": "string",
              "default": "2y",
              "title": "Source Window"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response List Rules Api Rules Catalog Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/rules/catalog/{catalog_key}": {
      "get": {
        "tags": [
          "rules",
          "rules"
        ],
        "summary": "Get Rule Detail",
        "description": "Get full detail for a single rule by its catalog_key (PK).",
        "operationId": "get_rule_detail_api_rules_catalog__catalog_key__get",
        "parameters": [
          {
            "name": "catalog_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Catalog Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Rule Detail Api Rules Catalog  Catalog Key  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/rules/bucket-summary": {
      "get": {
        "tags": [
          "rules",
          "rules"
        ],
        "summary": "Bucket Summary",
        "description": "Per-strategy_key + domain rule count and 16-metric averages.",
        "operationId": "bucket_summary_api_rules_bucket_summary_get",
        "parameters": [
          {
            "name": "include_below_floor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": true,
              "title": "Include Below Floor"
            }
          },
          {
            "name": "source_window",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "2y"
              ],
              "type": "string",
              "default": "2y",
              "title": "Source Window"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Bucket Summary Api Rules Bucket Summary Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/mas/analyze": {
      "post": {
        "tags": [
          "mas"
        ],
        "summary": "Mas Analyze V1",
        "description": "V1 MAS analysis endpoint.\n\n- response_mode=\"stream\": SSE streaming (status/message/done/error)\n- response_mode=\"json\": Full JSON result (cache-first)\n- target: Which analysis to run (orchestrator runs all agents + synthesis)",
        "operationId": "mas_analyze_v1_api_v1_mas_analyze_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MASAnalyzeV1Request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Invalid or expired access token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Membership with ai_analysis permission required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/mas/analyze": {
      "post": {
        "tags": [
          "mas"
        ],
        "summary": "Mas Analyze Legacy",
        "description": "Legacy full MAS analysis (JSON mode). No cache.",
        "operationId": "mas_analyze_legacy_api_mas_analyze_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MASAnalyzeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Invalid or expired access token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Membership with ai_analysis permission required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/mas/agent/{domain}": {
      "post": {
        "tags": [
          "mas"
        ],
        "summary": "Single Agent Analyze Legacy",
        "description": "Legacy single domain agent analysis (JSON mode). No cache.",
        "operationId": "single_agent_analyze_legacy_api_mas_agent__domain__post",
        "parameters": [
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Domain"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SingleAgentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Invalid or expired access token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Membership with ai_analysis permission required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/login/{provider}": {
      "post": {
        "tags": [
          "auth",
          "auth"
        ],
        "summary": "Login",
        "description": "Initiate OAuth login flow.\n\nBackend constructs the callback URL from config. Accepts an optional\nJSON body with ``platform`` (web/android/ios) to determine where the\nOAuth callback will redirect after authentication.",
        "operationId": "login_api_auth_login__provider__post",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Provider"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/LoginRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Payload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginResponse"
                }
              }
            }
          },
          "400": {
            "description": "Unsupported provider",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "OAuth store unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/callback/{provider}": {
      "get": {
        "tags": [
          "auth",
          "auth"
        ],
        "summary": "Callback Get",
        "description": "OAuth callback for providers that redirect with query parameters.",
        "operationId": "callback_api_auth_callback__provider__get",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Provider"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to the selected frontend platform"
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "auth",
          "auth"
        ],
        "summary": "Callback Post",
        "description": "OAuth callback for providers that submit a form_post payload.",
        "operationId": "callback_api_auth_callback__provider__post",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Provider"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to the selected frontend platform"
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/exchange": {
      "post": {
        "tags": [
          "auth",
          "auth"
        ],
        "summary": "Exchange",
        "description": "Exchange a one-time auth code for tokens.\n\nThe auth code is issued by the callback endpoint and is single-use\nwith a short TTL (default 30 seconds).",
        "operationId": "exchange_api_auth_exchange_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "code": {
                    "type": "string",
                    "maxLength": 256,
                    "minLength": 1,
                    "title": "Code",
                    "description": "One-time auth code from callback redirect"
                  },
                  "flow_verifier": {
                    "type": "string",
                    "maxLength": 256,
                    "minLength": 1,
                    "title": "Flow Verifier",
                    "description": "Browser-held verifier returned by login"
                  }
                },
                "additionalProperties": false,
                "type": "object",
                "required": [
                  "code",
                  "flow_verifier"
                ],
                "title": "ExchangeRequest",
                "description": "One-time auth code exchange request."
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthenticatedSessionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or expired grant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "OAuth store unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/google/verify-token": {
      "post": {
        "tags": [
          "auth",
          "auth"
        ],
        "summary": "Google Verify Token",
        "description": "Verify a Google id_token from a mobile app and return app tokens.\n\nMobile apps use the Google Sign-In SDK to obtain an id_token (JWT signed\nby Google). This endpoint verifies the token server-side using Google's\npublic keys, then resolves the user via the standard authenticate_oauth flow.\n\nReturns the same response shape as the web OAuth flow (exchange endpoint).",
        "operationId": "google_verify_token_api_auth_google_verify_token_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GoogleVerifyTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/apple/verify-token": {
      "post": {
        "tags": [
          "auth",
          "auth"
        ],
        "summary": "Apple Verify Token",
        "description": "Verify an Apple identityToken from a native app and return app tokens.\n\niOS/macOS apps use AuthenticationServices (``ASAuthorizationAppleIDProvider``)\nand receive an ``identityToken`` (JWT signed by Apple) whose audience is the\napp bundle ID. This endpoint verifies it server-side against Apple's public\nkeys (``APPLE_APP_BUNDLE_ID`` / ``APPLE_CLIENT_ID`` audiences), optionally\nchecks the sign-in ``nonce`` (the raw value is hashed here, since Apple\nechoes back the SHA-256 the app gave it), then resolves the member through\nthe standard authenticate_oauth flow. A token that carries a nonce claim\nmust be accompanied by its raw nonce; omitting it is rejected, so a leaked\nidentityToken alone cannot be exchanged for a session.\n\n``full_name`` is only populated by Apple on the FIRST authorization, so the\napp must forward it then; later sign-ins carry no name.\n\nReturns the same response shape as the web OAuth flow (exchange endpoint).",
        "operationId": "apple_verify_token_api_auth_apple_verify_token_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppleVerifyTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "identityToken invalid, expired, or wrong audience/nonce",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Provider-verified email required or member suspended",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Apple public keys unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/complete-registration": {
      "post": {
        "tags": [
          "auth",
          "auth"
        ],
        "summary": "Complete Registration",
        "description": "Reject legacy user-supplied email completion without touching the DB.",
        "operationId": "complete_registration_api_auth_complete_registration_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteRegistrationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "410": {
            "description": "Legacy registration completion is disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/refresh": {
      "post": {
        "tags": [
          "auth",
          "auth"
        ],
        "summary": "Refresh Token",
        "description": "Refresh access token using refresh token rotation.",
        "operationId": "refresh_token_api_auth_refresh_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/logout": {
      "post": {
        "tags": [
          "auth",
          "auth"
        ],
        "summary": "Logout",
        "description": "Revoke the presented refresh token's rotation family (single-device logout).",
        "operationId": "logout_api_auth_logout_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LogoutRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/logout-all": {
      "post": {
        "tags": [
          "auth",
          "auth"
        ],
        "summary": "Logout All",
        "description": "Revoke all refresh tokens (all-device logout).",
        "operationId": "logout_all_api_auth_logout_all_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/me": {
      "get": {
        "tags": [
          "auth",
          "auth"
        ],
        "summary": "Get Me",
        "description": "Get current authenticated member profile.",
        "operationId": "get_me_api_auth_me_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/members/me": {
      "get": {
        "tags": [
          "members",
          "members"
        ],
        "summary": "Get Profile",
        "description": "Get detailed member profile with tier and provider info.",
        "operationId": "get_profile_api_members_me_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "members",
          "members"
        ],
        "summary": "Update Profile",
        "description": "Update display name and avatar.",
        "operationId": "update_profile_api_members_me_put",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProfileRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/members/me/providers": {
      "get": {
        "tags": [
          "members",
          "members"
        ],
        "summary": "List Providers",
        "description": "List linked OAuth providers for the current member.",
        "operationId": "list_providers_api_members_me_providers_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/members/me/providers/{provider}": {
      "post": {
        "tags": [
          "members",
          "members"
        ],
        "summary": "Link Provider",
        "description": "Link a new OAuth provider to the current member (requires re-auth proof).",
        "operationId": "link_provider_api_members_me_providers__provider__post",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Provider"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkProviderRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "members",
          "members"
        ],
        "summary": "Unlink Provider",
        "description": "Unlink a provider while preserving at least one usable login identity.",
        "operationId": "unlink_provider_api_members_me_providers__provider__delete",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Provider"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/subscriptions/tiers": {
      "get": {
        "tags": [
          "subscriptions",
          "subscriptions"
        ],
        "summary": "List Tiers",
        "description": "List all active membership tiers (public).",
        "operationId": "list_tiers_api_subscriptions_tiers_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/subscriptions/plans": {
      "get": {
        "tags": [
          "subscriptions",
          "subscriptions"
        ],
        "summary": "List Plans",
        "description": "List all active subscription plans (public).",
        "operationId": "list_plans_api_subscriptions_plans_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/subscriptions/current": {
      "get": {
        "tags": [
          "subscriptions",
          "subscriptions"
        ],
        "summary": "Get Current Subscription",
        "description": "Get the current active subscription for the authenticated member.",
        "operationId": "get_current_subscription_api_subscriptions_current_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/subscriptions/history": {
      "get": {
        "tags": [
          "subscriptions",
          "subscriptions"
        ],
        "summary": "Get Subscription History",
        "description": "Get subscription history for the authenticated member.",
        "operationId": "get_subscription_history_api_subscriptions_history_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/subscriptions": {
      "post": {
        "tags": [
          "subscriptions",
          "subscriptions"
        ],
        "summary": "Create Subscription",
        "description": "Reject direct activation until a real payment workflow exists.",
        "operationId": "create_subscription_api_subscriptions_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSubscriptionRequest"
              }
            }
          }
        },
        "responses": {
          "403": {
            "description": "Direct subscription activation is disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired access token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/subscriptions/{subscription_id}/cancel": {
      "put": {
        "tags": [
          "subscriptions",
          "subscriptions"
        ],
        "summary": "Cancel Subscription",
        "description": "Cancel a subscription (sets cancel_at_period_end=true).",
        "operationId": "cancel_subscription_api_subscriptions__subscription_id__cancel_put",
        "parameters": [
          {
            "name": "subscription_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Subscription Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/black-swan/phase": {
      "get": {
        "tags": [
          "black-swan",
          "black-swan"
        ],
        "summary": "Get Black Swan Phase",
        "description": "Get black swan phase estimate for a subject on a specific date.\n\nReturns four-phase support percentages (pre_shock, shock_start,\npanic_active, recovery) based on frozen discovery factor sets.",
        "operationId": "get_black_swan_phase_api_black_swan_phase_get",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Date in yyyymmdd format. Default: latest trading date.",
              "title": "Date"
            },
            "description": "Date in yyyymmdd format. Default: latest trading date."
          },
          {
            "name": "subject",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Ticker symbol (e.g., 0050.TW, 2330.TW). Default: 0050.TW (market proxy).",
              "title": "Subject"
            },
            "description": "Ticker symbol (e.g., 0050.TW, 2330.TW). Default: 0050.TW (market proxy)."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlackSwanPhaseResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/black-swan/phase-range": {
      "get": {
        "tags": [
          "black-swan",
          "black-swan"
        ],
        "summary": "Get Black Swan Phase Range",
        "description": "Return black swan phase estimates for each trading day in a date range.",
        "operationId": "get_black_swan_phase_range_api_black_swan_phase_range_get",
        "parameters": [
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Start date in YYYY-MM-DD. Default: lookback from config.",
              "title": "Start Date"
            },
            "description": "Start date in YYYY-MM-DD. Default: lookback from config."
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "End date in YYYY-MM-DD. Default: today.",
              "title": "End Date"
            },
            "description": "End date in YYYY-MM-DD. Default: today."
          },
          {
            "name": "subject",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Ticker symbol (e.g., 0050.TW). Default: 0050.TW.",
              "title": "Subject"
            },
            "description": "Ticker symbol (e.g., 0050.TW). Default: 0050.TW."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlackSwanPhaseRangeResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/stock-rules/{ticker}": {
      "get": {
        "tags": [
          "stock-rules",
          "stock-rules"
        ],
        "summary": "Get Stock Rules",
        "description": "Get all active rule configs for a stock (all sources).",
        "operationId": "get_stock_rules_api_stock_rules__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockRulesResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/stock-rules/{ticker}/summary": {
      "get": {
        "tags": [
          "stock-rules",
          "stock-rules"
        ],
        "summary": "Get Stock Rules Summary",
        "description": "Get summary of all active rule configs (no channels payload).",
        "operationId": "get_stock_rules_summary_api_stock_rules__ticker__summary_get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockRulesSummaryResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/stock-rules/{ticker}/history": {
      "get": {
        "tags": [
          "stock-rules",
          "stock-rules"
        ],
        "summary": "Get Stock Rules History",
        "description": "Get version history for a stock's rule configs.",
        "operationId": "get_stock_rules_history_api_stock_rules__ticker__history_get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by config_source (sta/scr)",
              "title": "Source"
            },
            "description": "Filter by config_source (sta/scr)"
          },
          {
            "name": "include_channels",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include full channels payload",
              "default": false,
              "title": "Include Channels"
            },
            "description": "Include full channels payload"
          }
        ],
        "responses": {
          "200": {
            "description": "`{ticker, config_source, entries}` when `source` is given, `{ticker, sources}` otherwise.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/StockRulesHistoryResponse"
                    },
                    {
                      "$ref": "#/components/schemas/StockRulesHistoryBySourceResponse"
                    }
                  ],
                  "title": "Response 200 Get Stock Rules History Api Stock Rules  Ticker  History Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/stock-rules/{ticker}/{source}": {
      "get": {
        "tags": [
          "stock-rules",
          "stock-rules"
        ],
        "summary": "Get Stock Rules By Source",
        "description": "Get active rule config for a specific source (sta/scr/...).\n\nReturns 200 with an empty config when nothing is active, matching the\nother three endpoints in this router: `/{ticker}` and `/{ticker}/summary`\nanswer with `sources: {}`, and `/{ticker}/history?source=X` — which asks\nthis exact question — answers with `entries: []`. This route used to be\nthe odd one out with a 404 (issue #1404).",
        "operationId": "get_stock_rules_by_source_api_stock_rules__ticker___source__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "source",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Source"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockRuleSourceResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/strategy/matches/{ticker}": {
      "get": {
        "tags": [
          "strategy",
          "strategy"
        ],
        "summary": "Get Strategy Matches",
        "description": "Get all strategy matches for a ticker on a given date.\n\nPer Contract D, ``source_window`` is a UI hint and the response\nalways carries both windows nested as ``metrics_2y`` + ``metrics_all``.",
        "operationId": "get_strategy_matches_api_strategy_matches__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "trade_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "YYYY-MM-DD, defaults to latest",
              "title": "Trade Date"
            },
            "description": "YYYY-MM-DD, defaults to latest"
          },
          {
            "name": "include_below_floor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include below-floor quality tier matches",
              "default": false,
              "title": "Include Below Floor"
            },
            "description": "Include below-floor quality tier matches"
          },
          {
            "name": "source_window",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "2y"
              ],
              "type": "string",
              "default": "2y",
              "title": "Source Window"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StrategyMatchResponse"
                  },
                  "title": "Response Get Strategy Matches Api Strategy Matches  Ticker  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/strategy/recommendations": {
      "get": {
        "tags": [
          "strategy",
          "strategy"
        ],
        "summary": "Get Strategy Recommendations",
        "description": "Get recommended strategy matches (homepage overview).",
        "operationId": "get_strategy_recommendations_api_strategy_recommendations_get",
        "parameters": [
          {
            "name": "trade_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "YYYY-MM-DD, defaults to latest",
              "title": "Trade Date"
            },
            "description": "YYYY-MM-DD, defaults to latest"
          },
          {
            "name": "include_below_floor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include below-floor quality tier matches",
              "default": false,
              "title": "Include Below Floor"
            },
            "description": "Include below-floor quality tier matches"
          },
          {
            "name": "source_window",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "2y"
              ],
              "type": "string",
              "default": "2y",
              "title": "Source Window"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RecommendationResponse"
                  },
                  "title": "Response Get Strategy Recommendations Api Strategy Recommendations Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/strategy/summary": {
      "get": {
        "tags": [
          "strategy",
          "strategy"
        ],
        "summary": "Get Strategy Summary",
        "description": "Get per-strategy_key summary statistics. Avg uses the configured\ndefault match window (``strategy.api.match_default_window``).",
        "operationId": "get_strategy_summary_api_strategy_summary_get",
        "parameters": [
          {
            "name": "trade_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "YYYY-MM-DD, defaults to latest",
              "title": "Trade Date"
            },
            "description": "YYYY-MM-DD, defaults to latest"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StrategySummaryResponse"
                  },
                  "title": "Response Get Strategy Summary Api Strategy Summary Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/strategy/overview/{ticker}": {
      "get": {
        "tags": [
          "strategy",
          "strategy"
        ],
        "summary": "Get Strategy Overview",
        "description": "Get 12-strategy overview for a ticker with primary + supporting rules.",
        "operationId": "get_strategy_overview_api_strategy_overview__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "trade_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "YYYY-MM-DD, defaults to latest",
              "title": "Trade Date"
            },
            "description": "YYYY-MM-DD, defaults to latest"
          },
          {
            "name": "include_below_floor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include below-floor quality tier rules",
              "default": false,
              "title": "Include Below Floor"
            },
            "description": "Include below-floor quality tier rules"
          },
          {
            "name": "include_inactive_rules",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include inactive catalog rules that correspond to this ticker",
              "default": true,
              "title": "Include Inactive Rules"
            },
            "description": "Include inactive catalog rules that correspond to this ticker"
          },
          {
            "name": "source_window",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "2y"
              ],
              "type": "string",
              "default": "2y",
              "title": "Source Window"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StrategyOverviewResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/strategy/rules/{rule_id}": {
      "get": {
        "tags": [
          "strategy",
          "strategy"
        ],
        "summary": "取得單一規則的可讀說明",
        "description": "Look up a rule_id in the catalog and return its conditions with ZH labels.",
        "operationId": "get_rule_explanation_api_strategy_rules__rule_id__get",
        "parameters": [
          {
            "name": "rule_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Rule Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleExplanationResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/strategy/rules/explain": {
      "post": {
        "tags": [
          "strategy",
          "strategy"
        ],
        "summary": "批次查詢多筆規則說明",
        "description": "Batch lookup; missing rule_ids return empty fields. Input order preserved.",
        "operationId": "post_rule_explanations_api_strategy_rules_explain_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuleExplanationBatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleExplanationBatchResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/strategy/story/overview/{ticker}": {
      "get": {
        "tags": [
          "story-strategy",
          "story-strategy"
        ],
        "summary": "Get Story-first strategy statistics for one ticker",
        "operationId": "get_story_strategy_overview_api_strategy_story_overview__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "trade_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Story Set date; defaults to the exact published serving date",
              "title": "Trade Date"
            },
            "description": "Story Set date; defaults to the exact published serving date"
          },
          {
            "name": "rule_version",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "default": "ses-storage-v7",
              "title": "Rule Version"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoryStrategyOverviewResponse"
                }
              }
            }
          },
          "404": {
            "description": "Story Set not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoryStrategyErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Published Story Strategy snapshot unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoryStrategyErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/strategy/story/recommendations": {
      "get": {
        "tags": [
          "story-strategy",
          "story-strategy"
        ],
        "summary": "Rank Story-first strategy recommendations from 2Y evidence",
        "operationId": "get_story_strategy_recommendations_api_strategy_story_recommendations_get",
        "parameters": [
          {
            "name": "trade_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only the published snapshot date is available in V1",
              "title": "Trade Date"
            },
            "description": "Only the published snapshot date is available in V1"
          },
          {
            "name": "rule_version",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "default": "ses-storage-v7",
              "title": "Rule Version"
            }
          },
          {
            "name": "strategy_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/StoryStrategyKey"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Strategy Key"
            }
          },
          {
            "name": "limit_per_strategy",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 30,
              "title": "Limit Per Strategy"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoryRecommendationsResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested date is not the published serving date",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoryStrategyErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Published Story Strategy snapshot unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoryStrategyErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/commodities/list": {
      "get": {
        "tags": [
          "commodities",
          "commodities"
        ],
        "summary": "List Commodities",
        "description": "列出所有追蹤的商品。\n\nReturns:\n    所有 commodity metadata（symbol、名稱、分類、來源、單位）。",
        "operationId": "list_commodities_api_commodities_list_get",
        "parameters": [
          {
            "name": "active_only",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "只顯示啟用的商品",
              "default": true,
              "title": "Active Only"
            },
            "description": "只顯示啟用的商品"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CommodityInfo"
                  },
                  "title": "Response List Commodities Api Commodities List Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/commodities/{symbol}/ohlc": {
      "get": {
        "tags": [
          "commodities",
          "commodities"
        ],
        "summary": "Get Commodity Ohlc",
        "description": "取得商品 OHLC 歷史價格。\n\nArgs:\n    symbol: 商品代號。\n    days: 回傳最近 N 天的資料。\n\nReturns:\n    OHLC 價格列表（依日期降序）。",
        "operationId": "get_commodity_ohlc_api_commodities__symbol__ohlc_get",
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "商品代號（例如 WTI、GOLD、COPPER）",
              "title": "Symbol"
            },
            "description": "商品代號（例如 WTI、GOLD、COPPER）"
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 2000,
              "minimum": 1,
              "description": "回傳天數",
              "default": 60,
              "title": "Days"
            },
            "description": "回傳天數"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CommodityOHLC"
                  },
                  "title": "Response Get Commodity Ohlc Api Commodities  Symbol  Ohlc Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/commodities/{symbol}/snapshot": {
      "get": {
        "tags": [
          "commodities",
          "commodities"
        ],
        "summary": "Get Commodity Snapshot",
        "description": "取得商品技術指標快照。\n\nArgs:\n    symbol: 商品代號。\n    days: 回傳最近 N 天的快照。\n\nReturns:\n    技術指標快照列表（SMA、RSI、ATR、漲跌幅、趨勢）。",
        "operationId": "get_commodity_snapshot_api_commodities__symbol__snapshot_get",
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "商品代號",
              "title": "Symbol"
            },
            "description": "商品代號"
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "description": "回傳天數",
              "default": 30,
              "title": "Days"
            },
            "description": "回傳天數"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CommoditySnapshot"
                  },
                  "title": "Response Get Commodity Snapshot Api Commodities  Symbol  Snapshot Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/commodities/snapshot/latest": {
      "get": {
        "tags": [
          "commodities",
          "commodities"
        ],
        "summary": "Get Latest Snapshots",
        "description": "取得所有商品最新一日的技術指標快照。\n\nReturns:\n    每個商品最新一筆 snapshot（用於跨資產訊號總覽）。",
        "operationId": "get_latest_snapshots_api_commodities_snapshot_latest_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/CommoditySnapshot"
                  },
                  "type": "array",
                  "title": "Response Get Latest Snapshots Api Commodities Snapshot Latest Get"
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/supply-chain/analyze": {
      "post": {
        "tags": [
          "supply-chain"
        ],
        "summary": "Analyze Supply Chain",
        "description": "LLM-based supply chain analysis for a ticker.",
        "operationId": "analyze_supply_chain_api_v1_supply_chain_analyze_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupplyChainAnalyzeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Analyze Supply Chain Api V1 Supply Chain Analyze Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/supply-chain/profile/{ticker}": {
      "get": {
        "tags": [
          "supply-chain"
        ],
        "summary": "Get Profile",
        "description": "Get coverage report profile for a company.",
        "operationId": "get_profile_api_v1_supply_chain_profile__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyProfileResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/supply-chain/relations/{ticker}": {
      "get": {
        "tags": [
          "supply-chain"
        ],
        "summary": "Get Relations",
        "description": "Get supply chain relations for a company.",
        "operationId": "get_relations_api_v1_supply_chain_relations__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "rel_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "upstream/downstream/customer/supplier",
              "title": "Rel Type"
            },
            "description": "upstream/downstream/customer/supplier"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "outgoing or incoming",
              "default": "outgoing",
              "title": "Direction"
            },
            "description": "outgoing or incoming"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CompanyRelationResponse"
                  },
                  "title": "Response Get Relations Api V1 Supply Chain Relations  Ticker  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/supply-chain/entities/{ticker}": {
      "get": {
        "tags": [
          "supply-chain"
        ],
        "summary": "Get Entities",
        "description": "Get technology/material/application entities for a company.",
        "operationId": "get_entities_api_v1_supply_chain_entities__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "entity_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "technology/material/application",
              "title": "Entity Type"
            },
            "description": "technology/material/application"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EntityMentionResponse"
                  },
                  "title": "Response Get Entities Api V1 Supply Chain Entities  Ticker  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/supply-chain/themes/{ticker}": {
      "get": {
        "tags": [
          "supply-chain"
        ],
        "summary": "Get Ticker Themes",
        "description": "Get all themes a company belongs to.",
        "operationId": "get_ticker_themes_api_v1_supply_chain_themes__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ThemeMembershipResponse"
                  },
                  "title": "Response Get Ticker Themes Api V1 Supply Chain Themes  Ticker  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/supply-chain/theme-members/{theme}": {
      "get": {
        "tags": [
          "supply-chain"
        ],
        "summary": "Get Theme Members Endpoint",
        "description": "Get all member companies of a theme.",
        "operationId": "get_theme_members_endpoint_api_v1_supply_chain_theme_members__theme__get",
        "parameters": [
          {
            "name": "theme",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Theme"
            }
          },
          {
            "name": "role",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "upstream/midstream/downstream/related",
              "title": "Role"
            },
            "description": "upstream/midstream/downstream/related"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ThemeMembershipResponse"
                  },
                  "title": "Response Get Theme Members Endpoint Api V1 Supply Chain Theme Members  Theme  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/supply-chain/path": {
      "get": {
        "tags": [
          "supply-chain"
        ],
        "summary": "Get Path",
        "description": "Find the shortest supply chain path between two tickers.",
        "operationId": "get_path_api_v1_supply_chain_path_get",
        "parameters": [
          {
            "name": "ticker_a",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Starting ticker",
              "title": "Ticker A"
            },
            "description": "Starting ticker"
          },
          {
            "name": "ticker_b",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Target ticker",
              "title": "Ticker B"
            },
            "description": "Target ticker"
          },
          {
            "name": "max_depth",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Max BFS depth (default from config)",
              "title": "Max Depth"
            },
            "description": "Max BFS depth (default from config)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplyChainPathResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/supply-chain/search": {
      "get": {
        "tags": [
          "supply-chain"
        ],
        "summary": "Search",
        "description": "RAG semantic search over coverage reports.",
        "operationId": "search_api_v1_supply_chain_search_get",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Search query text",
              "title": "Q"
            },
            "description": "Search query text"
          },
          {
            "name": "chunk_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "document/section_desc/section_sc/section_cs",
              "title": "Chunk Type"
            },
            "description": "document/section_desc/section_sc/section_cs"
          },
          {
            "name": "sector",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by sector",
              "title": "Sector"
            },
            "description": "Filter by sector"
          },
          {
            "name": "top_k",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Number of results",
              "title": "Top K"
            },
            "description": "Number of results"
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SearchResultResponse"
                  },
                  "title": "Response Search Api V1 Supply Chain Search Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/mas/traces/executions": {
      "get": {
        "tags": [
          "traces"
        ],
        "summary": "List Executions",
        "description": "List recent MAS executions with optional filters.",
        "operationId": "list_executions_api_mas_traces_executions_get",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by ticker",
              "title": "Ticker"
            },
            "description": "Filter by ticker"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by status",
              "title": "Status"
            },
            "description": "Filter by status"
          },
          {
            "name": "started_after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter started_at >=",
              "title": "Started After"
            },
            "description": "Filter started_at >="
          },
          {
            "name": "started_before",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter started_at <=",
              "title": "Started Before"
            },
            "description": "Filter started_at <="
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecutionListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid access token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Admin access required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Admin authorization unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/mas/traces/executions/{execution_id}": {
      "get": {
        "tags": [
          "traces"
        ],
        "summary": "Get Execution Detail",
        "description": "Get full execution detail including all LLM calls.",
        "operationId": "get_execution_detail_api_mas_traces_executions__execution_id__get",
        "parameters": [
          {
            "name": "execution_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Execution Id"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "timeline",
                "agent"
              ],
              "type": "string",
              "description": "timeline=started_at order; agent=agent_name+call_sequence",
              "default": "timeline",
              "title": "Sort"
            },
            "description": "timeline=started_at order; agent=agent_name+call_sequence"
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecutionDetailResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid access token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Admin access required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Admin authorization unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/mas/traces/executions/{execution_id}/calls": {
      "get": {
        "tags": [
          "traces"
        ],
        "summary": "Get Execution Calls",
        "description": "Get LLM call traces for an execution, optionally filtered.",
        "operationId": "get_execution_calls_api_mas_traces_executions__execution_id__calls_get",
        "parameters": [
          {
            "name": "execution_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Execution Id"
            }
          },
          {
            "name": "agent_name",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by agent",
              "title": "Agent Name"
            },
            "description": "Filter by agent"
          },
          {
            "name": "stage",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by stage",
              "title": "Stage"
            },
            "description": "Filter by stage"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "timeline",
                "agent"
              ],
              "type": "string",
              "description": "Sort mode",
              "default": "timeline",
              "title": "Sort"
            },
            "description": "Sort mode"
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LlmCallResponse"
                  },
                  "title": "Response Get Execution Calls Api Mas Traces Executions  Execution Id  Calls Get"
                }
              }
            }
          },
          "401": {
            "description": "Invalid access token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Admin access required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Admin authorization unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/mas/traces/tickers/{ticker}": {
      "get": {
        "tags": [
          "traces"
        ],
        "summary": "Get Ticker Executions",
        "description": "Get execution history for a specific ticker.",
        "operationId": "get_ticker_executions_api_mas_traces_tickers__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "started_after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Started After"
            }
          },
          {
            "name": "started_before",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Started Before"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecutionListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid access token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Admin access required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Admin authorization unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/mas/traces/executions/{execution_id}/summary": {
      "get": {
        "tags": [
          "traces"
        ],
        "summary": "Get Execution Summary",
        "description": "Get token breakdown summary for an execution.",
        "operationId": "get_execution_summary_api_mas_traces_executions__execution_id__summary_get",
        "parameters": [
          {
            "name": "execution_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Execution Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecutionSummaryBreakdown"
                }
              }
            }
          },
          "401": {
            "description": "Invalid access token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Admin access required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Admin authorization unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/data-status": {
      "get": {
        "tags": [
          "data-status"
        ],
        "summary": "Get Data Status",
        "description": "Report today's data update status across all pipeline tables.",
        "operationId": "get_data_status_api_data_status_get",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Report date (YYYY-MM-DD). Defaults to today (Asia/Taipei).",
              "title": "Date"
            },
            "description": "Report date (YYYY-MM-DD). Defaults to today (Asia/Taipei)."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataStatusResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/sync-status": {
      "get": {
        "tags": [
          "sync-status",
          "sync-status"
        ],
        "summary": "Get Sync Status Matrix",
        "description": "Single-day snapshot of every (market, capability) tracked.\n\n``report_date`` is returned alongside ``rows`` so the caller can\nrender \"no runs recorded for <date>\" when ``rows`` is empty.",
        "operationId": "get_sync_status_matrix_api_sync_status_get",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Trading date (YYYY-MM-DD). Defaults to today (Asia/Taipei).",
              "title": "Date"
            },
            "description": "Trading date (YYYY-MM-DD). Defaults to today (Asia/Taipei)."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncStatusMatrixResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/sync-status/history": {
      "get": {
        "tags": [
          "sync-status",
          "sync-status"
        ],
        "summary": "Get Sync Status History",
        "description": "Filtered list of sync_status rows.\n\nEvery filter is optional.  When neither ``date_from`` nor ``date_to`` is\nsupplied the response covers the last ``sync_status.default_history_days``\ndays (read from ``config/core.yaml``; defaults to 30 if unset).  The hard\ncap ``sync_status.max_history_days`` (365 by default) rejects requests\nwhose computed range exceeds the cap.",
        "operationId": "get_sync_status_history_api_sync_status_history_get",
        "parameters": [
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by market identifier.",
              "title": "Market"
            },
            "description": "Filter by market identifier."
          },
          {
            "name": "capability",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by capability name.",
              "title": "Capability"
            },
            "description": "Filter by capability name."
          },
          {
            "name": "ticker",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by the external ticker projected from a country-local stock sync checkpoint. Market-level rows have ticker = NULL.",
              "title": "Ticker"
            },
            "description": "Filter by the external ticker projected from a country-local stock sync checkpoint. Market-level rows have ticker = NULL."
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive lower bound on run_date.",
              "title": "Date From"
            },
            "description": "Inclusive lower bound on run_date."
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive upper bound on run_date.",
              "title": "Date To"
            },
            "description": "Inclusive upper bound on run_date."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SyncStatusValue"
                  }
                },
                {
                  "type": "null"
                }
              ],
              "description": "Status filter (repeat to combine, e.g. ?status=failed&status=skipped). Allowed: success, failed, skipped, skipped_upstream_failure.",
              "title": "Status"
            },
            "description": "Status filter (repeat to combine, e.g. ?status=failed&status=skipped). Allowed: success, failed, skipped, skipped_upstream_failure."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncStatusHistoryResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/market-surveillance/events": {
      "get": {
        "tags": [
          "market-surveillance"
        ],
        "summary": "List Market Surveillance Events",
        "operationId": "list_market_surveillance_events_api_market_surveillance_events_get",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Stock ticker, e.g. 3026.TW",
              "title": "Ticker"
            },
            "description": "Stock ticker, e.g. 3026.TW"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "attention",
                    "disposition"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "attention or disposition",
              "title": "Status"
            },
            "description": "attention or disposition"
          },
          {
            "name": "status_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "attention",
                    "disposition"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Alias for status",
              "title": "Status Type"
            },
            "description": "Alias for status"
          },
          {
            "name": "exchange",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "twse",
                    "tpex"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "twse or tpex",
              "title": "Exchange"
            },
            "description": "twse or tpex"
          },
          {
            "name": "source_exchange",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "twse",
                    "tpex"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Alias for exchange",
              "title": "Source Exchange"
            },
            "description": "Alias for exchange"
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Announcement start date",
              "title": "Start Date"
            },
            "description": "Announcement start date"
          },
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Alias for start_date",
              "title": "Date From"
            },
            "description": "Alias for start_date"
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Announcement end date",
              "title": "End Date"
            },
            "description": "Announcement end date"
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Alias for end_date",
              "title": "Date To"
            },
            "description": "Alias for end_date"
          },
          {
            "name": "active_on",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only events active on this date",
              "title": "Active On"
            },
            "description": "Only events active on this date"
          },
          {
            "name": "include_unmapped",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include non-stock rows such as warrants",
              "default": false,
              "title": "Include Unmapped"
            },
            "description": "Include non-stock rows such as warrants"
          },
          {
            "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",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketSurveillanceEventsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/market-surveillance/active-dispositions": {
      "get": {
        "tags": [
          "market-surveillance"
        ],
        "summary": "List Active Dispositions",
        "description": "List active dispositions, or latest available attention rows by date.",
        "operationId": "list_active_dispositions_api_market_surveillance_active_dispositions_get",
        "parameters": [
          {
            "name": "as_of",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Disposition active date, or attention latest-available announcement lookup date",
              "title": "As Of"
            },
            "description": "Disposition active date, or attention latest-available announcement lookup date"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "attention",
                    "disposition"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "attention or disposition",
              "title": "Status"
            },
            "description": "attention or disposition"
          },
          {
            "name": "status_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "attention",
                    "disposition"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Alias for status",
              "title": "Status Type"
            },
            "description": "Alias for status"
          },
          {
            "name": "exchange",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "twse",
                    "tpex"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "twse or tpex",
              "title": "Exchange"
            },
            "description": "twse or tpex"
          },
          {
            "name": "source_exchange",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "twse",
                    "tpex"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Alias for exchange",
              "title": "Source Exchange"
            },
            "description": "Alias for exchange"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 500,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketSurveillanceEventsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/market-surveillance/exited-dispositions": {
      "get": {
        "tags": [
          "market-surveillance"
        ],
        "summary": "List Exited Dispositions",
        "description": "List disposition stocks whose period ended before the requested date.",
        "operationId": "list_exited_dispositions_api_market_surveillance_exited_dispositions_get",
        "parameters": [
          {
            "name": "as_of",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Date when stocks have exited disposition",
              "title": "As Of"
            },
            "description": "Date when stocks have exited disposition"
          },
          {
            "name": "exchange",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "twse",
                    "tpex"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "twse or tpex",
              "title": "Exchange"
            },
            "description": "twse or tpex"
          },
          {
            "name": "source_exchange",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "twse",
                    "tpex"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Alias for exchange",
              "title": "Source Exchange"
            },
            "description": "Alias for exchange"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 500,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketSurveillanceEventsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/market-surveillance/stocks/{ticker}/status": {
      "get": {
        "tags": [
          "market-surveillance"
        ],
        "summary": "Get Stock Market Surveillance Status",
        "operationId": "get_stock_market_surveillance_status_api_market_surveillance_stocks__ticker__status_get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "as_of",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Status date",
              "title": "As Of"
            },
            "description": "Status date"
          },
          {
            "name": "lookback_days",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 3650,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "title": "Lookback Days"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StockMarketSurveillanceStatusResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/feedback": {
      "post": {
        "tags": [
          "feedback"
        ],
        "summary": "Submit Feedback",
        "description": "Submit a new feedback item.",
        "operationId": "submit_feedback_api_feedback_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FeedbackCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedbackCreateResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/feedback/me": {
      "get": {
        "tags": [
          "feedback"
        ],
        "summary": "Get My Feedback",
        "description": "List the current user's feedback history (newest first).",
        "operationId": "get_my_feedback_api_feedback_me_get",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Page Size"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedbackListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/feedback": {
      "get": {
        "tags": [
          "admin-feedback"
        ],
        "summary": "List Feedback",
        "description": "List all feedback with optional filters.",
        "operationId": "list_feedback_api_admin_feedback_get",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Page Size"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/FeedbackStatus"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "include_archived",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Include Archived"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminFeedbackListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/feedback/{feedback_id}": {
      "get": {
        "tags": [
          "admin-feedback"
        ],
        "summary": "Get Feedback Detail",
        "description": "Get full feedback detail including Notion export state.",
        "operationId": "get_feedback_detail_api_admin_feedback__feedback_id__get",
        "parameters": [
          {
            "name": "feedback_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Feedback Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminFeedbackDetail"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/feedback/{feedback_id}/status": {
      "patch": {
        "tags": [
          "admin-feedback"
        ],
        "summary": "Update Feedback Status",
        "description": "Update feedback domain status.",
        "operationId": "update_feedback_status_api_admin_feedback__feedback_id__status_patch",
        "parameters": [
          {
            "name": "feedback_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Feedback Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StatusUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Update Feedback Status Api Admin Feedback  Feedback Id  Status Patch"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/feedback/{feedback_id}/note": {
      "patch": {
        "tags": [
          "admin-feedback"
        ],
        "summary": "Update Admin Note",
        "description": "Add or update admin note on feedback.",
        "operationId": "update_admin_note_api_admin_feedback__feedback_id__note_patch",
        "parameters": [
          {
            "name": "feedback_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Feedback Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NoteUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Update Admin Note Api Admin Feedback  Feedback Id  Note Patch"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/feedback/{feedback_id}/export-notion": {
      "post": {
        "tags": [
          "admin-feedback"
        ],
        "summary": "Export To Notion",
        "description": "Export feedback to Notion with 3-phase race condition protection.\n\nPhase 1: Lock row by setting notion_page_id='PENDING'\nPhase 2: Call Notion API\nPhase 3: Write real page_id (or rollback to NULL on failure)",
        "operationId": "export_to_notion_api_admin_feedback__feedback_id__export_notion_post",
        "parameters": [
          {
            "name": "feedback_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Feedback Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExportNotionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Export To Notion Api Admin Feedback  Feedback Id  Export Notion Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/feedback/{feedback_id}/archive": {
      "post": {
        "tags": [
          "admin-feedback"
        ],
        "summary": "Archive Feedback",
        "description": "Soft-delete feedback by setting archived_at.",
        "operationId": "archive_feedback_api_admin_feedback__feedback_id__archive_post",
        "parameters": [
          {
            "name": "feedback_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Feedback Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Archive Feedback Api Admin Feedback  Feedback Id  Archive Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/themes/generate": {
      "post": {
        "tags": [
          "admin-themes",
          "admin-themes"
        ],
        "summary": "Generate Theme",
        "description": "Start a web/RAG + LLM draft generation job for a theme.",
        "operationId": "generate_theme_api_admin_themes_generate_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateThemeRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemeJobStartedResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/themes/rebuild": {
      "post": {
        "tags": [
          "admin-themes",
          "admin-themes"
        ],
        "summary": "Rebuild Themes",
        "description": "Start a rebuild job from existing coverage/wikilinks.",
        "operationId": "rebuild_themes_api_admin_themes_rebuild_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RebuildThemesRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemeJobStartedResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/themes/jobs/{job_id}": {
      "get": {
        "tags": [
          "admin-themes",
          "admin-themes"
        ],
        "summary": "Get Theme Job",
        "description": "Get a theme generation/rebuild job status and result.",
        "operationId": "get_theme_job_api_admin_themes_jobs__job_id__get",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Job Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemeJobResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/themes/jobs/{job_id}/publish": {
      "post": {
        "tags": [
          "admin-themes",
          "admin-themes"
        ],
        "summary": "Publish Theme Job",
        "description": "Publish a completed theme generation draft.",
        "operationId": "publish_theme_job_api_admin_themes_jobs__job_id__publish_post",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Job Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublishThemeJobRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublishThemeJobResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/themes/jobs/{job_id}/candidates": {
      "patch": {
        "tags": [
          "admin-themes",
          "admin-themes"
        ],
        "summary": "Update Theme Job Candidates",
        "description": "Batch-update candidate approval flags before publishing a generated theme.",
        "operationId": "update_theme_job_candidates_api_admin_themes_jobs__job_id__candidates_patch",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Job Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchCandidateApprovalRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchCandidateApprovalResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "admin-themes",
          "admin-themes"
        ],
        "summary": "Add Manual Theme Candidate",
        "description": "Inject a manual candidate (source=manual, approved) into a review job.",
        "operationId": "add_manual_theme_candidate_api_admin_themes_jobs__job_id__candidates_post",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Job Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManualCandidateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManualCandidateResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/themes/jobs/{job_id}/cancel": {
      "post": {
        "tags": [
          "admin-themes",
          "admin-themes"
        ],
        "summary": "Cancel Theme Job",
        "description": "Cancel a pending/running theme generation or rebuild job.",
        "operationId": "cancel_theme_job_api_admin_themes_jobs__job_id__cancel_post",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Job Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelThemeJobResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/themes/{theme}/page-members": {
      "get": {
        "tags": [
          "admin-themes",
          "admin-themes"
        ],
        "summary": "Get Theme Page Members",
        "description": "List the members parsed from a theme page (page as source of truth).",
        "operationId": "get_theme_page_members_api_admin_themes__theme__page_members_get",
        "parameters": [
          {
            "name": "theme",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Theme"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemePageMembersResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/themes/{theme}/members": {
      "post": {
        "tags": [
          "admin-themes",
          "admin-themes"
        ],
        "summary": "Add Theme Page Member",
        "description": "Add a member line to a theme page (line surgery); optional DB sync.",
        "operationId": "add_theme_page_member_api_admin_themes__theme__members_post",
        "parameters": [
          {
            "name": "theme",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Theme"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddPageMemberRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemePageEditResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/themes/{theme}/members/{ticker}": {
      "patch": {
        "tags": [
          "admin-themes",
          "admin-themes"
        ],
        "summary": "Set Theme Page Member Role",
        "description": "Move a member to a different role section verbatim; optional DB sync.",
        "operationId": "set_theme_page_member_role_api_admin_themes__theme__members__ticker__patch",
        "parameters": [
          {
            "name": "theme",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Theme"
            }
          },
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4,6}$",
              "title": "Ticker"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetPageMemberRoleRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemePageEditResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "admin-themes",
          "admin-themes"
        ],
        "summary": "Remove Theme Page Member",
        "description": "Remove a member line from a theme page; optional DB sync.",
        "operationId": "remove_theme_page_member_api_admin_themes__theme__members__ticker__delete",
        "parameters": [
          {
            "name": "theme",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Theme"
            }
          },
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4,6}$",
              "title": "Ticker"
            }
          },
          {
            "name": "sync_db",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Sync Db"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemePageEditResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/theme-store/themes": {
      "get": {
        "tags": [
          "admin-theme-store",
          "admin-theme-store"
        ],
        "summary": "List Themes",
        "description": "List every visible theme; deleted (blocked) themes are filtered out.",
        "operationId": "list_themes_api_admin_theme_store_themes_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemeListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "admin-theme-store",
          "admin-theme-store"
        ],
        "summary": "Create Theme",
        "description": "Create a manual theme; a tombstoned name is reused, not rejected.",
        "operationId": "create_theme_api_admin_theme_store_themes_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateThemeRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemeDetail"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/theme-store/themes/{theme_name}": {
      "patch": {
        "tags": [
          "admin-theme-store",
          "admin-theme-store"
        ],
        "summary": "Patch Theme",
        "description": "Replace the description; marks the theme as manually edited.",
        "operationId": "patch_theme_api_admin_theme_store_themes__theme_name__patch",
        "parameters": [
          {
            "name": "theme_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Theme Name"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchThemeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemeDetail"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "admin-theme-store",
          "admin-theme-store"
        ],
        "summary": "Delete Theme",
        "description": "Delete members and leave a tombstone. Touches no file and no other repo.",
        "operationId": "delete_theme_api_admin_theme_store_themes__theme_name__delete",
        "parameters": [
          {
            "name": "theme_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Theme Name"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/theme-store/blocked/{theme_name}": {
      "delete": {
        "tags": [
          "admin-theme-store",
          "admin-theme-store"
        ],
        "summary": "Unblock Theme",
        "description": "Clear a coverage theme's tombstone so the wrapper may import it again.",
        "operationId": "unblock_theme_api_admin_theme_store_blocked__theme_name__delete",
        "parameters": [
          {
            "name": "theme_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Theme Name"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/theme-store/themes/{theme_name}/members": {
      "get": {
        "tags": [
          "admin-theme-store",
          "admin-theme-store"
        ],
        "summary": "Get Theme Members",
        "description": "Admin view of the members — delisted stocks are listed, not filtered.",
        "operationId": "get_theme_members_api_admin_theme_store_themes__theme_name__members_get",
        "parameters": [
          {
            "name": "theme_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Theme Name"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemeMembersResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "admin-theme-store",
          "admin-theme-store"
        ],
        "summary": "Replace Theme Members",
        "description": "Wholesale replace: members missing from the payload are removed.",
        "operationId": "replace_theme_members_api_admin_theme_store_themes__theme_name__members_put",
        "parameters": [
          {
            "name": "theme_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Theme Name"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplaceMembersRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemeMembersResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/theme-store/import-from-coverage": {
      "post": {
        "tags": [
          "admin-theme-store",
          "admin-theme-store"
        ],
        "summary": "Import From Coverage",
        "description": "Import coverage theme pages — the only gate into the theme store.\n\nDeleted (blocked), manual and hand-edited themes are reported in\n``skipped`` instead of being overwritten; nothing is ever written back to\nthe coverage pages.",
        "operationId": "import_from_coverage_api_admin_theme_store_import_from_coverage_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportFromCoverageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportFromCoverageResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/theme-store/transfers/environments": {
      "get": {
        "tags": [
          "theme-transfers"
        ],
        "summary": "Environments",
        "operationId": "environments_api_admin_theme_store_transfers_environments_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransferEnvironmentsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/theme-store/transfers/preview": {
      "post": {
        "tags": [
          "theme-transfers"
        ],
        "summary": "Preview",
        "operationId": "preview_api_admin_theme_store_transfers_preview_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferSelection"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemeTransferPreviewResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/theme-store/transfers/send": {
      "post": {
        "tags": [
          "theme-transfers"
        ],
        "summary": "Send",
        "operationId": "send_api_admin_theme_store_transfers_send_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferSendRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemeTransferApplyResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/internal/theme-store/transfers/preview": {
      "post": {
        "tags": [
          "theme-transfers"
        ],
        "summary": "Receive Preview",
        "operationId": "receive_preview_api_internal_theme_store_transfers_preview_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferReceiveRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemeTransferPreviewResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/internal/theme-store/transfers/apply": {
      "post": {
        "tags": [
          "theme-transfers"
        ],
        "summary": "Receive Apply",
        "operationId": "receive_apply_api_internal_theme_store_transfers_apply_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferApplyRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThemeTransferApplyResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/members/investment-overview": {
      "get": {
        "tags": [
          "admin-member-investments"
        ],
        "summary": "Investment Overview",
        "operationId": "investment_overview_api_admin_members_investment_overview_get",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Page Size"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "active",
                    "suspended",
                    "deleted"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "tier",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Tier"
            }
          },
          {
            "name": "membership_state",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "free",
                    "active",
                    "scheduled",
                    "expired"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Membership State"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberInvestmentOverviewResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/members/{member_id}/investment-detail": {
      "get": {
        "tags": [
          "admin-member-investments"
        ],
        "summary": "Investment Detail",
        "operationId": "investment_detail_api_admin_members__member_id__investment_detail_get",
        "parameters": [
          {
            "name": "member_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Member Id"
            }
          },
          {
            "name": "section",
            "in": "query",
            "required": true,
            "schema": {
              "enum": [
                "watchlists",
                "holdings",
                "transactions"
              ],
              "type": "string",
              "title": "Section"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Page Size"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberInvestmentDetailResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/members/{member_id}/transactions/backup": {
      "get": {
        "tags": [
          "admin-member-transaction-backup"
        ],
        "summary": "Download Transaction Backup",
        "operationId": "download_transaction_backup_api_admin_members__member_id__transactions_backup_get",
        "parameters": [
          {
            "name": "member_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Member Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortfolioBackupArchive"
                }
              }
            }
          },
          "404": {
            "description": "Member not found"
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/members/{member_id}/transactions/restore/preview": {
      "post": {
        "tags": [
          "admin-member-transaction-backup"
        ],
        "summary": "Preview Transaction Restore",
        "operationId": "preview_transaction_restore_api_admin_members__member_id__transactions_restore_preview_post",
        "parameters": [
          {
            "name": "member_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Member Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RestorePreviewRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestorePreviewResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/members/{member_id}/transactions/restore": {
      "post": {
        "tags": [
          "admin-member-transaction-backup"
        ],
        "summary": "Apply Transaction Restore",
        "operationId": "apply_transaction_restore_api_admin_members__member_id__transactions_restore_post",
        "parameters": [
          {
            "name": "member_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Member Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RestoreRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestoreResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/members": {
      "get": {
        "tags": [
          "admin-members"
        ],
        "summary": "List Admin Members",
        "description": "List members with provider and email-login state.",
        "operationId": "list_admin_members_api_admin_members_get",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Page Size"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^(active|suspended|deleted)$"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "provider",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^(google|apple|email)$"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Provider"
            }
          },
          {
            "name": "is_admin",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Is Admin"
            }
          },
          {
            "name": "email_verified",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Email Verified"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminMemberListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/members/identity-lookup": {
      "get": {
        "tags": [
          "admin-members"
        ],
        "summary": "Identity Lookup",
        "description": "Find a member by OAuth identity or email credential.",
        "operationId": "identity_lookup_api_admin_members_identity_lookup_get",
        "parameters": [
          {
            "name": "provider",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^(google|apple|email)$",
              "title": "Provider"
            }
          },
          {
            "name": "provider_user_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Provider User Id"
            }
          },
          {
            "name": "email",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Email"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminMemberSummary"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/members/{member_id}": {
      "get": {
        "tags": [
          "admin-members"
        ],
        "summary": "Get Admin Member Detail",
        "description": "Get detailed member management state.",
        "operationId": "get_admin_member_detail_api_admin_members__member_id__get",
        "parameters": [
          {
            "name": "member_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Member Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminMemberDetail"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/members/{member_id}/status": {
      "patch": {
        "tags": [
          "admin-members"
        ],
        "summary": "Update Member Status",
        "description": "Update member status and revoke sessions when access is removed.",
        "operationId": "update_member_status_api_admin_members__member_id__status_patch",
        "parameters": [
          {
            "name": "member_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Member Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMemberStatusRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateMemberStatusResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/members/{member_id}/admin-flag": {
      "patch": {
        "tags": [
          "admin-members"
        ],
        "summary": "Update Member Admin Flag",
        "description": "Grant or revoke the operations admin flag.",
        "operationId": "update_member_admin_flag_api_admin_members__member_id__admin_flag_patch",
        "parameters": [
          {
            "name": "member_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Member Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAdminFlagRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateAdminFlagResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/members/{member_id}/tier": {
      "patch": {
        "tags": [
          "admin-members"
        ],
        "summary": "Update Member Tier",
        "description": "Set an immediate indefinite manual entitlement with the legacy shape.",
        "operationId": "update_member_tier_api_admin_members__member_id__tier_patch",
        "parameters": [
          {
            "name": "member_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Member Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMemberTierRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateMemberTierResponse"
                }
              }
            }
          },
          "400": {
            "description": "Tier is unknown or inactive",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired access token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Member was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/members/{member_id}/membership": {
      "put": {
        "tags": [
          "admin-memberships"
        ],
        "summary": "Set Membership",
        "operationId": "set_membership_api_admin_members__member_id__membership_put",
        "parameters": [
          {
            "name": "member_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Member Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetMemberMembershipRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetMemberMembershipResponse"
                }
              }
            }
          },
          "400": {
            "description": "Tier is inactive or reserved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired access token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Member was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/membership-tiers": {
      "get": {
        "tags": [
          "admin-memberships"
        ],
        "summary": "List Membership Tiers",
        "operationId": "list_membership_tiers_api_admin_membership_tiers_get",
        "parameters": [
          {
            "name": "include_inactive",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Include Inactive"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TierPermissionListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/membership-tiers/{tier_name}/permissions": {
      "put": {
        "tags": [
          "admin-memberships"
        ],
        "summary": "Update Membership Tier Permissions",
        "operationId": "update_membership_tier_permissions_api_admin_membership_tiers__tier_name__permissions_put",
        "parameters": [
          {
            "name": "tier_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Tier Name"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTierPermissionsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateTierPermissionsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired access token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Membership tier was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Tier version conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/memberships": {
      "get": {
        "tags": [
          "admin-memberships"
        ],
        "summary": "List Memberships",
        "operationId": "list_memberships_api_admin_memberships_get",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Page Size"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "active",
                    "suspended",
                    "deleted"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "tier",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Tier"
            }
          },
          {
            "name": "membership_state",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "free",
                    "active",
                    "scheduled",
                    "expired"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Membership State"
            }
          },
          {
            "name": "expires_before",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Expires Before"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/api-access": {
      "get": {
        "tags": [
          "admin-api-access"
        ],
        "summary": "Get Api Access Matrix",
        "description": "Return every managed endpoint with each tier's stored allow/deny rule.",
        "operationId": "get_api_access_matrix_api_admin_api_access_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiAccessMatrixResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired access token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/membership-tiers/{tier_name}/quotas": {
      "get": {
        "tags": [
          "admin-api-access"
        ],
        "summary": "Get Tier Quotas",
        "description": "Return the tier's stored quota per known key; ``None`` when no row exists.",
        "operationId": "get_tier_quotas_api_admin_membership_tiers__tier_name__quotas_get",
        "parameters": [
          {
            "name": "tier_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Tier Name"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TierQuotasResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired access token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Admin access is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Membership tier was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/user-groups": {
      "get": {
        "tags": [
          "user-groups",
          "user-groups"
        ],
        "summary": "List User Groups",
        "description": "List all groups owned by the authenticated member.",
        "operationId": "list_user_groups_api_user_groups_get",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserGroupResponse"
                  },
                  "title": "Response List User Groups Api User Groups Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "user-groups",
          "user-groups"
        ],
        "summary": "Create User Group",
        "description": "Create a new user group.",
        "operationId": "create_user_group_api_user_groups_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserGroupRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserGroupResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/user-groups/{group_id}": {
      "patch": {
        "tags": [
          "user-groups",
          "user-groups"
        ],
        "summary": "Update User Group",
        "description": "Update group name, description, or active status. Owner-only.",
        "operationId": "update_user_group_api_user_groups__group_id__patch",
        "parameters": [
          {
            "name": "group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Group Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserGroupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserGroupResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "user-groups",
          "user-groups"
        ],
        "summary": "Delete User Group",
        "description": "Delete a group and cascade membership. Owner-only.",
        "operationId": "delete_user_group_api_user_groups__group_id__delete",
        "parameters": [
          {
            "name": "group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Group Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/user-groups/{group_id}/members": {
      "get": {
        "tags": [
          "user-groups",
          "user-groups"
        ],
        "summary": "List Group Members",
        "description": "List active members of a group. Owner-only.",
        "operationId": "list_group_members_api_user_groups__group_id__members_get",
        "parameters": [
          {
            "name": "group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Group Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserGroupMemberResponse"
                  },
                  "title": "Response List Group Members Api User Groups  Group Id  Members Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "user-groups",
          "user-groups"
        ],
        "summary": "Add Group Member",
        "description": "Add a ticker to the group. If previously removed, reactivate. Owner-only.",
        "operationId": "add_group_member_api_user_groups__group_id__members_post",
        "parameters": [
          {
            "name": "group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Group Id"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddMemberRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserGroupMemberResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/user-groups/{group_id}/members/{ticker}": {
      "delete": {
        "tags": [
          "user-groups",
          "user-groups"
        ],
        "summary": "Remove Group Member",
        "description": "Soft-remove a ticker from the group (set removed_at). Owner-only.",
        "operationId": "remove_group_member_api_user_groups__group_id__members__ticker__delete",
        "parameters": [
          {
            "name": "group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Group Id"
            }
          },
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/user-groups/{group_id}/rules": {
      "get": {
        "tags": [
          "user-groups",
          "user-groups"
        ],
        "summary": "Get Group Rules",
        "description": "Get strategy rules for a user group. Owner-only.",
        "operationId": "get_group_rules_api_user_groups__group_id__rules_get",
        "parameters": [
          {
            "name": "group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Group Id"
            }
          },
          {
            "name": "include_below_floor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include below-floor quality tier rules",
              "default": false,
              "title": "Include Below Floor"
            },
            "description": "Include below-floor quality tier rules"
          },
          {
            "name": "source_window",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "2y"
              ],
              "type": "string",
              "default": "2y",
              "title": "Source Window"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserGroupRuleResponse"
                  },
                  "title": "Response Get Group Rules Api User Groups  Group Id  Rules Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/user-groups/{group_id}/matches": {
      "get": {
        "tags": [
          "user-groups",
          "user-groups"
        ],
        "summary": "Get Group Matches",
        "description": "Get strategy matches for a user group. Owner-only. Default limit 200.",
        "operationId": "get_group_matches_api_user_groups__group_id__matches_get",
        "parameters": [
          {
            "name": "group_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Group Id"
            }
          },
          {
            "name": "trade_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "YYYY-MM-DD, defaults to latest",
              "title": "Trade Date"
            },
            "description": "YYYY-MM-DD, defaults to latest"
          },
          {
            "name": "include_below_floor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include below-floor quality tier matches",
              "default": false,
              "title": "Include Below Floor"
            },
            "description": "Include below-floor quality tier matches"
          },
          {
            "name": "source_window",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "2y"
              ],
              "type": "string",
              "default": "2y",
              "title": "Source Window"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserGroupMatchResponse"
                  },
                  "title": "Response Get Group Matches Api User Groups  Group Id  Matches Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/etf-holdings/recap/daily": {
      "get": {
        "tags": [
          "etf-holdings",
          "etf-holdings"
        ],
        "summary": "Get Daily Recap",
        "operationId": "get_daily_recap_api_etf_holdings_recap_daily_get",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Target date YYYY-MM-DD (uses latest snapshot on or before date; default: latest snapshot)",
              "title": "Date"
            },
            "description": "Target date YYYY-MM-DD (uses latest snapshot on or before date; default: latest snapshot)"
          },
          {
            "name": "active_only",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Only include active-management ETFs",
              "default": false,
              "title": "Active Only"
            },
            "description": "Only include active-management ETFs"
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ETFPerformancePeriod",
              "description": "Recap window: day (previous trading day), or week/month/q/year (diffed over that period's window). Must match the window used by /stock-actions/ranking so a page can drive both from one control.",
              "default": "day"
            },
            "description": "Recap window: day (previous trading day), or week/month/q/year (diffed over that period's window). Must match the window used by /stock-actions/ranking so a page can drive both from one control."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DailyRecapResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/etf-holdings/performance": {
      "get": {
        "tags": [
          "etf-holdings",
          "etf-holdings"
        ],
        "summary": "Get Etf Period Performance",
        "operationId": "get_etf_period_performance_api_etf_holdings_performance_get",
        "parameters": [
          {
            "name": "isActive",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "True only includes active-management A-class ETFs; false includes all enabled ETFs",
              "default": false,
              "title": "Isactive"
            },
            "description": "True only includes active-management A-class ETFs; false includes all enabled ETFs"
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ETFPerformancePeriod",
              "description": "Performance window: day, week, month, q, or year",
              "default": "day"
            },
            "description": "Performance window: day, week, month, q, or year"
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Anchor date YYYY-MM-DD (default: today in Taiwan)",
              "title": "Date"
            },
            "description": "Anchor date YYYY-MM-DD (default: today in Taiwan)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ETFPerformanceResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/etf-holdings/stock-actions/ranking": {
      "get": {
        "tags": [
          "etf-holdings",
          "etf-holdings"
        ],
        "summary": "Get Etf Stock Action Ranking",
        "operationId": "get_etf_stock_action_ranking_api_etf_holdings_stock_actions_ranking_get",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Target date YYYY-MM-DD (uses latest snapshot on or before date; default: latest snapshot)",
              "title": "Date"
            },
            "description": "Target date YYYY-MM-DD (uses latest snapshot on or before date; default: latest snapshot)"
          },
          {
            "name": "isActive",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "True only includes active-management ETFs; false includes all enabled ETFs",
              "default": false,
              "title": "Isactive"
            },
            "description": "True only includes active-management ETFs; false includes all enabled ETFs"
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ETFPerformancePeriod",
              "description": "Holdings action window: day, week, month, q, or year",
              "default": "day"
            },
            "description": "Holdings action window: day, week, month, q, or year"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "description": "Maximum rows per buy/sell ranking side",
              "default": 50,
              "title": "Limit"
            },
            "description": "Maximum rows per buy/sell ranking side"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ETFStockActionRankingResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/etf-holdings/stock-actions/{raw_code}": {
      "get": {
        "tags": [
          "etf-holdings",
          "etf-holdings"
        ],
        "summary": "查詢單一個股在區間內各 ETF 的買賣明細與逐日操作",
        "description": "Return every ETF that bought or sold ``raw_code`` inside the window.\n\nSame window/fallback semantics as ``/stock-actions/ranking``, but stock-major\nand unranked, so it is never truncated by that endpoint's ``limit``. Each ETF\naction additionally carries ``daily_actions`` — the day-by-day path inside the\nwindow, which the aggregate ``prev``/``curr`` pair alone cannot express.",
        "operationId": "get_etf_stock_action_detail_api_etf_holdings_stock_actions__raw_code__get",
        "parameters": [
          {
            "name": "raw_code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 60,
              "description": "Constituent raw code as returned by /stock-actions/ranking (normalized to the canonical 4-digit Taiwan code, e.g. 3037)",
              "title": "Raw Code"
            },
            "description": "Constituent raw code as returned by /stock-actions/ranking (normalized to the canonical 4-digit Taiwan code, e.g. 3037)"
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Target date YYYY-MM-DD (uses latest snapshot on or before date; default: latest snapshot)",
              "title": "Date"
            },
            "description": "Target date YYYY-MM-DD (uses latest snapshot on or before date; default: latest snapshot)"
          },
          {
            "name": "isActive",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "True only includes active-management ETFs; false includes all enabled ETFs",
              "default": false,
              "title": "Isactive"
            },
            "description": "True only includes active-management ETFs; false includes all enabled ETFs"
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ETFPerformancePeriod",
              "description": "Holdings action window: day, week, month, q, or year",
              "default": "day"
            },
            "description": "Holdings action window: day, week, month, q, or year"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ETFStockActionStockDetailResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/etf-holdings/{etf_ticker}/history": {
      "get": {
        "tags": [
          "etf-holdings",
          "etf-holdings"
        ],
        "summary": "Get Etf Holdings History",
        "operationId": "get_etf_holdings_history_api_etf_holdings__etf_ticker__history_get",
        "parameters": [
          {
            "name": "etf_ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Etf Ticker"
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "YYYY-MM-DD",
              "title": "Start Date"
            },
            "description": "YYYY-MM-DD"
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "YYYY-MM-DD",
              "title": "End Date"
            },
            "description": "YYYY-MM-DD"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ETFHistoryResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/etf-holdings/{etf_ticker}/changes": {
      "get": {
        "tags": [
          "etf-holdings",
          "etf-holdings"
        ],
        "summary": "Get Etf Changes",
        "operationId": "get_etf_changes_api_etf_holdings__etf_ticker__changes_get",
        "parameters": [
          {
            "name": "etf_ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Etf Ticker"
            }
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Date"
            }
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ETFPerformancePeriod",
              "description": "Holdings action window: day, week, month, q, or year",
              "default": "day"
            },
            "description": "Holdings action window: day, week, month, q, or year"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ETFChangesResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/etf-holdings/{etf_ticker}/changes/recent": {
      "get": {
        "tags": [
          "etf-holdings",
          "etf-holdings"
        ],
        "summary": "Get Etf Recent Changes",
        "description": "Return per-stock action timeline for the most recent ``days`` snapshots.",
        "operationId": "get_etf_recent_changes_api_etf_holdings__etf_ticker__changes_recent_get",
        "parameters": [
          {
            "name": "etf_ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Etf Ticker"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 30,
              "minimum": 1,
              "title": "Days"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ETFRecentChangesResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/etf-holdings/{etf_ticker}/estimated-costs": {
      "get": {
        "tags": [
          "etf-holdings",
          "etf-holdings"
        ],
        "summary": "查詢主動式 ETF 目前個股推估成本與目前週期買賣紀錄",
        "description": "Rebuild current per-stock cost cycles from an active ETF's full history.",
        "operationId": "get_etf_estimated_costs_api_etf_holdings__etf_ticker__estimated_costs_get",
        "parameters": [
          {
            "name": "etf_ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9A-Z]{4,8}\\.(TW|TWO)$",
              "title": "Etf Ticker"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ETFEstimatedCostsResponse"
                }
              }
            }
          },
          "400": {
            "description": "ETF is not an enabled active ETF",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "ETF or successful holdings history not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "ETF estimated-cost query failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/etf-holdings/{etf_ticker}": {
      "get": {
        "tags": [
          "etf-holdings",
          "etf-holdings"
        ],
        "summary": "Get Etf Holdings",
        "operationId": "get_etf_holdings_api_etf_holdings__etf_ticker__get",
        "parameters": [
          {
            "name": "etf_ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Etf Ticker"
            }
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ETFHoldingsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/etf-holdings/recap/daily/analyze": {
      "post": {
        "tags": [
          "etf-holdings"
        ],
        "summary": "Analyze Active Etf Daily Recap",
        "description": "Generate and persist one active-stock ETF market recap.\n\nWithout ``force`` this only returns the cached report or the mechanical\ntemplate; scheduled stages own LLM sends. ``force=true`` is a manual LLM\nsend that does not use the daily evening/next-morning slots. Source-data\nabsence remains a 404, while invalid calendar/future dates are client\ninput errors.",
        "operationId": "analyze_active_etf_daily_recap_api_etf_holdings_recap_daily_analyze_post",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Date"
            }
          },
          {
            "name": "force",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Force"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LatestActiveETFRecapAnalysis"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/etf-holdings/{etf_ticker}/aetf-agent/analyze": {
      "post": {
        "tags": [
          "etf-holdings"
        ],
        "summary": "Analyze Aetf",
        "description": "Generate or reuse one single-fund report; deterministic fallback is valid.",
        "operationId": "analyze_aetf_api_etf_holdings__etf_ticker__aetf_agent_analyze_post",
        "parameters": [
          {
            "name": "etf_ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Etf Ticker"
            }
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Date"
            }
          },
          {
            "name": "force",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Force"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AETFReportResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/etf-holdings/{etf_ticker}/aetf-agent/latest": {
      "get": {
        "tags": [
          "etf-holdings"
        ],
        "summary": "Get Latest Aetf",
        "description": "Read a persisted report only; never load holdings or invoke an LLM.",
        "operationId": "get_latest_aetf_api_etf_holdings__etf_ticker__aetf_agent_latest_get",
        "parameters": [
          {
            "name": "etf_ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Etf Ticker"
            }
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AETFReportResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/access-logs": {
      "get": {
        "tags": [
          "admin-access-logs"
        ],
        "summary": "List Access Logs",
        "description": "List access-log rows matching the supplied filters.",
        "operationId": "list_access_logs_api_admin_access_logs_get",
        "parameters": [
          {
            "name": "from_ts",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive start timestamp.",
              "title": "From Ts"
            },
            "description": "Inclusive start timestamp."
          },
          {
            "name": "to_ts",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclusive end timestamp.",
              "title": "To Ts"
            },
            "description": "Exclusive end timestamp."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exact HTTP status code.",
              "title": "Status"
            },
            "description": "Exact HTTP status code."
          },
          {
            "name": "status_gte",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 599,
                  "minimum": 100
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive lower HTTP status-code bound.",
              "title": "Status Gte"
            },
            "description": "Inclusive lower HTTP status-code bound."
          },
          {
            "name": "status_lte",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 599,
                  "minimum": 100
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive upper HTTP status-code bound.",
              "title": "Status Lte"
            },
            "description": "Inclusive upper HTTP status-code bound."
          },
          {
            "name": "min_duration_ms",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive minimum request duration in milliseconds.",
              "title": "Min Duration Ms"
            },
            "description": "Inclusive minimum request duration in milliseconds."
          },
          {
            "name": "order_by",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "timestamp_desc",
                "duration_desc"
              ],
              "type": "string",
              "description": "Sort by newest timestamp, or by longest duration with NULL last.",
              "default": "timestamp_desc",
              "title": "Order By"
            },
            "description": "Sort by newest timestamp, or by longest duration with NULL last."
          },
          {
            "name": "method",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exact HTTP method (GET, POST, ...).",
              "title": "Method"
            },
            "description": "Exact HTTP method (GET, POST, ...)."
          },
          {
            "name": "path",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Substring match against request path.",
              "title": "Path"
            },
            "description": "Substring match against request path."
          },
          {
            "name": "member_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Member Id"
            }
          },
          {
            "name": "request_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Request Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessLogListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/server-metrics": {
      "get": {
        "tags": [
          "admin-server-metrics"
        ],
        "summary": "Get server monitoring metrics",
        "description": "Returns token-based online/login counts, access-log-derived connection counts covering signed-in and anonymous callers, and API quality for an inclusive Asia/Taipei calendar-date range. Admin access is required.",
        "operationId": "get_server_metrics_api_admin_server_metrics_get",
        "parameters": [
          {
            "name": "from_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive start date in Asia/Taipei. If only one date is provided, that date is used for both bounds.",
              "title": "From Date"
            },
            "description": "Inclusive start date in Asia/Taipei. If only one date is provided, that date is used for both bounds."
          },
          {
            "name": "to_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive end date in Asia/Taipei. If only one date is provided, that date is used for both bounds.",
              "title": "To Date"
            },
            "description": "Inclusive end date in Asia/Taipei. If only one date is provided, that date is used for both bounds."
          },
          {
            "name": "endpoint_limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 20,
              "minimum": 1,
              "description": "Maximum number of endpoint aggregates to return.",
              "default": 10,
              "title": "Endpoint Limit"
            },
            "description": "Maximum number of endpoint aggregates to return."
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServerMetricsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/participant-flows/government-bank/stock/{ticker}": {
      "get": {
        "tags": [
          "participant-flows",
          "participant-flows"
        ],
        "summary": "Get Government Bank Stock",
        "description": "八大行庫 per-stock daily total + per-bank detail (1..8 banks/day).",
        "operationId": "get_government_bank_stock_api_participant_flows_government_bank_stock__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 3650,
              "minimum": 1,
              "default": 30,
              "title": "Days"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GovernmentBankStockResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/participant-flows/government-bank/ranking": {
      "get": {
        "tags": [
          "participant-flows",
          "participant-flows"
        ],
        "summary": "Get Government Bank Ranking",
        "description": "Market-wide 八大行庫 ranking (INNER JOIN taiwan.stocks; ETF/warrant codes\nabsent from taiwan.stocks are excluded, same trade-off as the per-stock\nendpoints' 404).\n\nThe two sides are disjoint, like the broker-branch lists: ``buy`` keeps\nonly ``net_value > 0`` stocks and ``sell`` only ``net_value < 0`` ones,\nso a net buyer can never fill a short sell ranking (``net_value`` 0 or\nNULL appears on neither side).\n\nRows sharing one ``net_value`` are ordered by ``stock_code`` ascending, so\ntied stocks keep the same rank across calls (the broker endpoints below\ncarry the same kind of secondary key).",
        "operationId": "get_government_bank_ranking_api_participant_flows_government_bank_ranking_get",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Date"
            }
          },
          {
            "name": "side",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "buy",
                "sell"
              ],
              "type": "string",
              "default": "buy",
              "title": "Side"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GovernmentBankRankingResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/participant-flows/broker-branch/stock/{ticker}": {
      "get": {
        "tags": [
          "participant-flows",
          "participant-flows"
        ],
        "summary": "Get Broker Branch Stock",
        "description": "One stock's 券商分點 flows aggregated over the last ``window`` trade dates.\n\nEvery branch that traded the stock inside the window gets one item (no\nbuy/sell split, no sign filter); ``net_value`` may be NULL for a branch\nwhose every window row is NULL, hence ORDER BY ... NULLS LAST.\n\nA known ticker with no row in the window answers 200 + ``items: []``:\n``taiwan.stocks`` proves the stock exists, so an empty window is data\nabsence, not a missing resource (endpoint B has no such master table).",
        "operationId": "get_broker_branch_stock_api_participant_flows_broker_branch_stock__ticker__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "window",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Window"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 5000,
              "minimum": 1,
              "default": 5000,
              "title": "Limit"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrokerBranchStockResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/participant-flows/broker-branch/branches": {
      "get": {
        "tags": [
          "participant-flows",
          "participant-flows"
        ],
        "summary": "Get Broker Branch Directory",
        "description": "Search the latest broker-branch catalog by id or display name.\n\nThe complete latest-date catalog is cached by ``catalog_as_of`` and the\ndurable flow version. Search and limit are applied to that small catalog\nin memory, so each keystroke does not rescan the retained flow table.",
        "operationId": "get_broker_branch_directory_api_participant_flows_broker_branch_branches_get",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 240,
              "default": "",
              "title": "Q"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrokerBranchDirectoryResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/participant-flows/broker-branch/analysis": {
      "get": {
        "tags": [
          "participant-flows",
          "participant-flows"
        ],
        "summary": "Get Broker Branch Analysis",
        "operationId": "get_broker_branch_analysis_api_participant_flows_broker_branch_analysis_get",
        "parameters": [
          {
            "name": "participant_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80,
              "title": "Participant Id"
            }
          },
          {
            "name": "window",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1,
              "title": "Window"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrokerBranchAnalysisResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/participant-flows/broker-branch/branch/{participant_id}": {
      "get": {
        "tags": [
          "participant-flows",
          "participant-flows"
        ],
        "summary": "Get Broker Branch Branch",
        "description": "One 券商分點's flows per stock over the last ``window`` trade dates.\n\nUnlike endpoint A there is no branch master table, so \"no row inside the\nwindow\" is the only available existence signal and answers 404 rather\nthan an empty list. ``name``/``listing_type`` come from a LEFT JOIN on\n``taiwan.stocks`` and are NULL for hub-only ETF/warrant codes.\n\n``participant_name`` is resolved once from the branch's own latest window\nday (the ``branch_name`` CTE), not per stock: this response groups by\nstock_code, so a per-stock name aggregate would answer the name carried by\nthe top ``net_value`` stock's last row — stale whenever that stock stopped\ntrading before the branch was renamed.",
        "operationId": "get_broker_branch_branch_api_participant_flows_broker_branch_branch__participant_id__get",
        "parameters": [
          {
            "name": "participant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 80,
              "title": "Participant Id"
            }
          },
          {
            "name": "window",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Window"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 5000,
              "minimum": 1,
              "default": 5000,
              "title": "Limit"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrokerBranchBranchResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/participant-flows/broker-branch/stock/{ticker}/branch/{participant_id}": {
      "get": {
        "tags": [
          "participant-flows",
          "participant-flows"
        ],
        "summary": "Get Broker Branch Stock Branch Daily",
        "description": "One 券商分點's per-day flows on ONE stock — the drill-down behind A/B.\n\n``days`` counts TRADE DATES over the same dataset-wide window endpoints\nA/B call ``window``, but is a free integer rather than their 1/5/20/60 set.\nIt is NOT the calendar-day ``days`` of the government-bank endpoint\nabove, despite the shared parameter name.\n\nEvery window trade date yields one item, ordered ``trade_date`` DESC; a\ndate this branch did not trade this stock keeps its item with all eight\nflow fields NULL, so a caller plotting the series sees the gap instead of\ninferring it from a shorter list.\n\nZero traded dates answers 404 like endpoint B: a branch has no master\ntable, so \"no row inside the window\" is the only existence signal —\nnarrowed here to ticker + participant matching together.",
        "operationId": "get_broker_branch_stock_branch_daily_api_participant_flows_broker_branch_stock__ticker__branch__participant_id__get",
        "parameters": [
          {
            "name": "ticker",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Ticker"
            }
          },
          {
            "name": "participant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 80,
              "title": "Participant Id"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 116,
              "minimum": 1,
              "title": "Days"
            }
          },
          {
            "name": "authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Bearer <access_token>",
              "title": "Authorization"
            },
            "description": "Bearer <access_token>"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrokerBranchDailyResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure. FastAPI's own parameter validation returns HTTPValidationError; a route that raises HTTPException(422) returns the error envelope instead.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/HTTPValidationError"
                    },
                    {
                      "$ref": "#/components/schemas/ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Per-IP rate limit exceeded. Note `error` is a string here, not the object used by ErrorResponse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitError"
                }
              }
            }
          },
          "default": {
            "description": "Error envelope produced by the global exception handlers. See docs/api-reference.md §通用 Response 格式.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AETFAnalysisResult": {
        "properties": {
          "report_version": {
            "type": "string",
            "minLength": 1,
            "title": "Report Version"
          },
          "headline": {
            "type": "string",
            "minLength": 1,
            "title": "Headline"
          },
          "sections": {
            "$ref": "#/components/schemas/AETFReportSections"
          },
          "report": {
            "type": "string",
            "minLength": 1,
            "title": "Report"
          },
          "generation_mode": {
            "type": "string",
            "enum": [
              "llm",
              "template"
            ],
            "title": "Generation Mode"
          },
          "fallback_reason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "llm_disabled",
                  "llm_unavailable",
                  "llm_timeout",
                  "llm_error",
                  "invalid_response"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Fallback Reason"
          },
          "facts": {
            "additionalProperties": true,
            "type": "object",
            "title": "Facts"
          }
        },
        "type": "object",
        "required": [
          "report_version",
          "headline",
          "sections",
          "report",
          "generation_mode",
          "facts"
        ],
        "title": "AETFAnalysisResult"
      },
      "AETFIdentity": {
        "properties": {
          "ticker": {
            "type": "string",
            "minLength": 1,
            "title": "Ticker"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "title": "Name"
          },
          "market": {
            "type": "string",
            "const": "taiwan",
            "title": "Market",
            "default": "taiwan"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "name"
        ],
        "title": "AETFIdentity"
      },
      "AETFReportResponse": {
        "properties": {
          "agent_type": {
            "type": "string",
            "const": "aetf",
            "title": "Agent Type",
            "default": "aetf"
          },
          "etf": {
            "$ref": "#/components/schemas/AETFIdentity"
          },
          "requested_date": {
            "type": "string",
            "format": "date",
            "title": "Requested Date"
          },
          "anchor_date": {
            "type": "string",
            "format": "date",
            "title": "Anchor Date"
          },
          "holdings_as_of": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Holdings As Of"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Generated At"
          },
          "analysis": {
            "$ref": "#/components/schemas/AETFAnalysisResult"
          }
        },
        "type": "object",
        "required": [
          "etf",
          "requested_date",
          "anchor_date",
          "holdings_as_of",
          "generated_at",
          "analysis"
        ],
        "title": "AETFReportResponse"
      },
      "AETFReportSections": {
        "properties": {
          "operation_summary": {
            "type": "string",
            "minLength": 1,
            "title": "Operation Summary"
          },
          "today": {
            "type": "string",
            "minLength": 1,
            "title": "Today"
          },
          "five_day": {
            "type": "string",
            "minLength": 1,
            "title": "Five Day"
          },
          "twenty_day": {
            "type": "string",
            "minLength": 1,
            "title": "Twenty Day"
          },
          "performance": {
            "type": "string",
            "minLength": 1,
            "title": "Performance"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "operation_summary",
          "today",
          "five_day",
          "twenty_day",
          "performance"
        ],
        "title": "AETFReportSections"
      },
      "AccessLogItem": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "request_id": {
            "type": "string",
            "title": "Request Id"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "title": "Timestamp"
          },
          "request_started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Started At"
          },
          "response_completed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Completed At"
          },
          "method": {
            "type": "string",
            "title": "Method"
          },
          "path": {
            "type": "string",
            "title": "Path"
          },
          "query_string": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Query String"
          },
          "status_code": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status Code"
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Ms"
          },
          "db_duration_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Db Duration Ms"
          },
          "db_query_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Db Query Count"
          },
          "timing_breakdown": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timing Breakdown"
          },
          "client_ip": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Ip"
          },
          "transport": {
            "type": "string",
            "title": "Transport"
          },
          "member_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Id"
          },
          "member_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Email"
          },
          "member_display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Display Name"
          },
          "request_body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Body"
          },
          "response_body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Body"
          },
          "response_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Bytes"
          },
          "request_headers": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ],
            "title": "Request Headers"
          },
          "error_class": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Class"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          }
        },
        "type": "object",
        "required": [
          "id",
          "request_id",
          "timestamp",
          "method",
          "path",
          "db_duration_ms",
          "db_query_count",
          "timing_breakdown",
          "transport"
        ],
        "title": "AccessLogItem",
        "description": "Single row in the admin-facing access log response."
      },
      "AccessLogListResponse": {
        "properties": {
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/AccessLogItem"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "total",
          "items"
        ],
        "title": "AccessLogListResponse"
      },
      "ActiveETFRecapResult": {
        "properties": {
          "trade_date": {
            "type": "string",
            "title": "Trade Date"
          },
          "period_type": {
            "type": "string",
            "const": "daily",
            "title": "Period Type",
            "default": "daily"
          },
          "headline": {
            "type": "string",
            "minLength": 1,
            "title": "Headline"
          },
          "report": {
            "type": "string",
            "minLength": 1,
            "title": "Report"
          },
          "generation_mode": {
            "type": "string",
            "enum": [
              "llm",
              "template"
            ],
            "title": "Generation Mode"
          },
          "fallback_reason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "llm_unavailable",
                  "llm_timeout",
                  "llm_error",
                  "invalid_response",
                  "llm_deferred"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Fallback Reason"
          },
          "facts": {
            "additionalProperties": true,
            "type": "object",
            "title": "Facts"
          }
        },
        "type": "object",
        "required": [
          "trade_date",
          "headline",
          "report",
          "generation_mode",
          "facts"
        ],
        "title": "ActiveETFRecapResult"
      },
      "AddMemberRequest": {
        "properties": {
          "ticker": {
            "type": "string",
            "maxLength": 20,
            "minLength": 1,
            "title": "Ticker"
          }
        },
        "type": "object",
        "required": [
          "ticker"
        ],
        "title": "AddMemberRequest"
      },
      "AddPageMemberRequest": {
        "properties": {
          "ticker": {
            "type": "string",
            "pattern": "^\\d{4,6}$",
            "title": "Ticker"
          },
          "company_name": {
            "type": "string",
            "minLength": 1,
            "title": "Company Name"
          },
          "role": {
            "type": "string",
            "enum": [
              "upstream",
              "midstream",
              "downstream",
              "related"
            ],
            "title": "Role"
          },
          "sync_db": {
            "type": "boolean",
            "title": "Sync Db",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "company_name",
          "role"
        ],
        "title": "AddPageMemberRequest",
        "description": "Request to add a member line to a theme page."
      },
      "AddWatchlistItemRequest": {
        "properties": {
          "ticker": {
            "type": "string",
            "maxLength": 20,
            "minLength": 1,
            "title": "Ticker"
          },
          "display_order": {
            "type": "integer",
            "title": "Display Order",
            "default": 0
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          }
        },
        "type": "object",
        "required": [
          "ticker"
        ],
        "title": "AddWatchlistItemRequest"
      },
      "AdminAuditRecord": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "event_type": {
            "type": "string",
            "title": "Event Type"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "event_data": {
            "title": "Event Data"
          }
        },
        "type": "object",
        "required": [
          "id",
          "event_type"
        ],
        "title": "AdminAuditRecord"
      },
      "AdminFeedbackDetail": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "member_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Id"
          },
          "reporter_email": {
            "type": "string",
            "title": "Reporter Email"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "admin_note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Admin Note"
          },
          "notion_page_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notion Page Id"
          },
          "notion_category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notion Category"
          },
          "notion_exported_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notion Exported At"
          },
          "archived_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Archived At"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "member_id",
          "reporter_email",
          "title",
          "description",
          "status",
          "admin_note",
          "notion_page_id",
          "notion_category",
          "notion_exported_at",
          "archived_at",
          "created_at",
          "updated_at"
        ],
        "title": "AdminFeedbackDetail",
        "description": "Full feedback detail for admin view."
      },
      "AdminFeedbackItem": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "member_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Id"
          },
          "reporter_email": {
            "type": "string",
            "title": "Reporter Email"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "admin_note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Admin Note"
          },
          "notion_page_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notion Page Id"
          },
          "notion_category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notion Category"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "member_id",
          "reporter_email",
          "title",
          "status",
          "admin_note",
          "notion_page_id",
          "notion_category",
          "created_at"
        ],
        "title": "AdminFeedbackItem",
        "description": "Feedback item in admin list view."
      },
      "AdminFeedbackListResponse": {
        "properties": {
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/AdminFeedbackItem"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "total",
          "page",
          "page_size",
          "items"
        ],
        "title": "AdminFeedbackListResponse",
        "description": "Paginated admin feedback list."
      },
      "AdminMemberDetail": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "avatar_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avatar Url"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "is_admin": {
            "type": "boolean",
            "title": "Is Admin"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          },
          "last_login_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Login At"
          },
          "tier": {
            "$ref": "#/components/schemas/AdminMemberTier"
          },
          "providers": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Providers"
          },
          "email_login": {
            "$ref": "#/components/schemas/AdminMemberEmailLogin"
          },
          "has_private_relay_email": {
            "type": "boolean",
            "title": "Has Private Relay Email"
          },
          "provider_records": {
            "items": {
              "$ref": "#/components/schemas/AdminProviderRecord"
            },
            "type": "array",
            "title": "Provider Records"
          },
          "current_subscription": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AdminSubscriptionRecord"
              },
              {
                "type": "null"
              }
            ]
          },
          "subscription_history": {
            "items": {
              "$ref": "#/components/schemas/AdminSubscriptionRecord"
            },
            "type": "array",
            "title": "Subscription History"
          },
          "recent_auth_events": {
            "items": {
              "$ref": "#/components/schemas/AdminAuditRecord"
            },
            "type": "array",
            "title": "Recent Auth Events"
          }
        },
        "type": "object",
        "required": [
          "id",
          "email",
          "status",
          "is_admin",
          "tier",
          "providers",
          "email_login",
          "has_private_relay_email",
          "provider_records",
          "subscription_history",
          "recent_auth_events"
        ],
        "title": "AdminMemberDetail"
      },
      "AdminMemberEmailLogin": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          },
          "email_verified": {
            "type": "boolean",
            "title": "Email Verified"
          },
          "otp_required": {
            "type": "boolean",
            "title": "Otp Required"
          },
          "password_updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Password Updated At"
          },
          "locked_until": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Locked Until"
          }
        },
        "type": "object",
        "required": [
          "enabled",
          "email_verified",
          "otp_required"
        ],
        "title": "AdminMemberEmailLogin"
      },
      "AdminMemberListResponse": {
        "properties": {
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/AdminMemberSummary"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "total",
          "page",
          "page_size",
          "items"
        ],
        "title": "AdminMemberListResponse"
      },
      "AdminMemberSummary": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "avatar_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avatar Url"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "is_admin": {
            "type": "boolean",
            "title": "Is Admin"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          },
          "last_login_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Login At"
          },
          "tier": {
            "$ref": "#/components/schemas/AdminMemberTier"
          },
          "providers": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Providers"
          },
          "email_login": {
            "$ref": "#/components/schemas/AdminMemberEmailLogin"
          },
          "has_private_relay_email": {
            "type": "boolean",
            "title": "Has Private Relay Email"
          }
        },
        "type": "object",
        "required": [
          "id",
          "email",
          "status",
          "is_admin",
          "tier",
          "providers",
          "email_login",
          "has_private_relay_email"
        ],
        "title": "AdminMemberSummary"
      },
      "AdminMemberTier": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name"
          },
          "level": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Level"
          }
        },
        "type": "object",
        "required": [
          "name",
          "display_name"
        ],
        "title": "AdminMemberTier"
      },
      "AdminProviderRecord": {
        "properties": {
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "provider_user_id": {
            "type": "string",
            "title": "Provider User Id"
          },
          "provider_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Email"
          },
          "email_verified": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email Verified"
          },
          "linked_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Linked At"
          },
          "is_private_relay": {
            "type": "boolean",
            "title": "Is Private Relay",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "provider",
          "provider_user_id"
        ],
        "title": "AdminProviderRecord"
      },
      "AdminSubscriptionRecord": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "starts_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Starts At"
          },
          "ends_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ends At"
          },
          "cancel_at_period_end": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cancel At Period End"
          },
          "plan_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Plan Name"
          },
          "tier_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tier Name"
          }
        },
        "type": "object",
        "required": [
          "id",
          "status"
        ],
        "title": "AdminSubscriptionRecord"
      },
      "AgentSummaryItem": {
        "properties": {
          "agent_name": {
            "type": "string",
            "title": "Agent Name"
          },
          "call_count": {
            "type": "integer",
            "title": "Call Count"
          },
          "input_tokens": {
            "type": "integer",
            "title": "Input Tokens"
          },
          "output_tokens": {
            "type": "integer",
            "title": "Output Tokens"
          },
          "total_tokens": {
            "type": "integer",
            "title": "Total Tokens"
          }
        },
        "type": "object",
        "required": [
          "agent_name",
          "call_count",
          "input_tokens",
          "output_tokens",
          "total_tokens"
        ],
        "title": "AgentSummaryItem",
        "description": "Per-agent summary within an execution."
      },
      "AgentTokenItem": {
        "properties": {
          "call_count": {
            "type": "integer",
            "title": "Call Count"
          },
          "input_tokens": {
            "type": "integer",
            "title": "Input Tokens"
          },
          "output_tokens": {
            "type": "integer",
            "title": "Output Tokens"
          },
          "total_tokens": {
            "type": "integer",
            "title": "Total Tokens"
          },
          "agent_name": {
            "type": "string",
            "title": "Agent Name"
          }
        },
        "type": "object",
        "required": [
          "call_count",
          "input_tokens",
          "output_tokens",
          "total_tokens",
          "agent_name"
        ],
        "title": "AgentTokenItem",
        "description": "Per-agent token breakdown."
      },
      "AnalysisContent": {
        "properties": {
          "summary": {
            "type": "string",
            "title": "Summary"
          },
          "trend": {
            "$ref": "#/components/schemas/TrendInfo"
          },
          "key_levels": {
            "$ref": "#/components/schemas/KeyLevels"
          },
          "indicators_interpretation": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Indicators Interpretation",
            "default": {}
          },
          "risks": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Risks",
            "default": []
          },
          "recommendations": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Recommendations",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "summary",
          "trend",
          "key_levels"
        ],
        "title": "AnalysisContent",
        "description": "Analysis content."
      },
      "AnalysisMetadata": {
        "properties": {
          "confidence": {
            "type": "number",
            "title": "Confidence"
          },
          "verification_passed": {
            "type": "boolean",
            "title": "Verification Passed"
          },
          "iterations": {
            "type": "integer",
            "title": "Iterations"
          },
          "execution_time_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Execution Time Ms"
          }
        },
        "type": "object",
        "required": [
          "confidence",
          "verification_passed",
          "iterations"
        ],
        "title": "AnalysisMetadata",
        "description": "Analysis metadata."
      },
      "AnalyzeRequest": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker",
            "description": "Stock ticker symbol"
          },
          "analysis_type": {
            "type": "string",
            "enum": [
              "comprehensive",
              "technical",
              "trend"
            ],
            "title": "Analysis Type",
            "description": "Type of analysis",
            "default": "comprehensive"
          },
          "timeframe": {
            "type": "string",
            "enum": [
              "1_month",
              "3_months",
              "6_months",
              "1_year"
            ],
            "title": "Timeframe",
            "description": "Analysis timeframe",
            "default": "3_months"
          }
        },
        "type": "object",
        "required": [
          "ticker"
        ],
        "title": "AnalyzeRequest",
        "description": "Analysis request."
      },
      "AnalyzeResponse": {
        "properties": {
          "request_id": {
            "type": "string",
            "title": "Request Id"
          },
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "timestamp": {
            "type": "string",
            "title": "Timestamp"
          },
          "analysis": {
            "$ref": "#/components/schemas/AnalysisContent"
          },
          "metadata": {
            "$ref": "#/components/schemas/AnalysisMetadata"
          }
        },
        "type": "object",
        "required": [
          "request_id",
          "ticker",
          "timestamp",
          "analysis",
          "metadata"
        ],
        "title": "AnalyzeResponse",
        "description": "Analysis response."
      },
      "ApiAccessEndpoint": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "method": {
            "type": "string",
            "title": "Method"
          },
          "path": {
            "type": "string",
            "title": "Path"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tags"
          },
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary"
          },
          "requires_member": {
            "type": "boolean",
            "title": "Requires Member"
          },
          "conditional_login": {
            "type": "boolean",
            "title": "Conditional Login"
          },
          "rules": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "object",
            "title": "Rules"
          }
        },
        "type": "object",
        "required": [
          "key",
          "method",
          "path",
          "tags",
          "requires_member",
          "conditional_login",
          "rules"
        ],
        "title": "ApiAccessEndpoint"
      },
      "ApiAccessMatrixResponse": {
        "properties": {
          "tiers": {
            "items": {
              "$ref": "#/components/schemas/ApiAccessTier"
            },
            "type": "array",
            "title": "Tiers"
          },
          "endpoints": {
            "items": {
              "$ref": "#/components/schemas/ApiAccessEndpoint"
            },
            "type": "array",
            "title": "Endpoints"
          },
          "orphans": {
            "items": {
              "$ref": "#/components/schemas/ApiAccessOrphanRule"
            },
            "type": "array",
            "title": "Orphans"
          }
        },
        "type": "object",
        "required": [
          "tiers",
          "endpoints",
          "orphans"
        ],
        "title": "ApiAccessMatrixResponse"
      },
      "ApiAccessOrphanRule": {
        "properties": {
          "method": {
            "type": "string",
            "title": "Method"
          },
          "path": {
            "type": "string",
            "title": "Path"
          },
          "tier": {
            "type": "string",
            "title": "Tier"
          },
          "allowed": {
            "type": "boolean",
            "title": "Allowed"
          }
        },
        "type": "object",
        "required": [
          "method",
          "path",
          "tier",
          "allowed"
        ],
        "title": "ApiAccessOrphanRule"
      },
      "ApiAccessTier": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name"
          },
          "level": {
            "type": "integer",
            "title": "Level"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "reserved": {
            "type": "boolean",
            "title": "Reserved"
          }
        },
        "type": "object",
        "required": [
          "name",
          "display_name",
          "level",
          "is_active",
          "reserved"
        ],
        "title": "ApiAccessTier"
      },
      "ApiQuality": {
        "properties": {
          "request_count": {
            "type": "integer",
            "title": "Request Count"
          },
          "success_count": {
            "type": "integer",
            "title": "Success Count"
          },
          "client_error_count": {
            "type": "integer",
            "title": "Client Error Count"
          },
          "server_error_count": {
            "type": "integer",
            "title": "Server Error Count"
          },
          "incomplete_count": {
            "type": "integer",
            "title": "Incomplete Count"
          },
          "success_rate_percent": {
            "type": "number",
            "title": "Success Rate Percent"
          },
          "client_error_rate_percent": {
            "type": "number",
            "title": "Client Error Rate Percent"
          },
          "server_error_rate_percent": {
            "type": "number",
            "title": "Server Error Rate Percent"
          },
          "error_rate_percent": {
            "type": "number",
            "title": "Error Rate Percent"
          },
          "requests_per_minute": {
            "type": "number",
            "title": "Requests Per Minute"
          },
          "response_bytes": {
            "type": "integer",
            "title": "Response Bytes"
          },
          "latency_sample_count": {
            "type": "integer",
            "title": "Latency Sample Count"
          },
          "avg_latency_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avg Latency Ms"
          },
          "p50_latency_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "P50 Latency Ms"
          },
          "p95_latency_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "P95 Latency Ms"
          },
          "p99_latency_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "P99 Latency Ms"
          }
        },
        "type": "object",
        "required": [
          "request_count",
          "success_count",
          "client_error_count",
          "server_error_count",
          "incomplete_count",
          "success_rate_percent",
          "client_error_rate_percent",
          "server_error_rate_percent",
          "error_rate_percent",
          "requests_per_minute",
          "response_bytes",
          "latency_sample_count",
          "avg_latency_ms",
          "p50_latency_ms",
          "p95_latency_ms",
          "p99_latency_ms"
        ],
        "title": "ApiQuality"
      },
      "AppleFullName": {
        "properties": {
          "given_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Given Name"
          },
          "family_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Family Name"
          }
        },
        "type": "object",
        "title": "AppleFullName",
        "description": "``ASAuthorizationAppleIDCredential.fullName`` — Apple returns it on the first authorization only."
      },
      "AppleVerifyTokenRequest": {
        "properties": {
          "id_token": {
            "type": "string",
            "maxLength": 8192,
            "minLength": 1,
            "title": "Id Token",
            "description": "Apple-signed identityToken JWT from ASAuthorizationAppleIDCredential"
          },
          "nonce": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Nonce",
            "description": "The RAW nonce the app generated for this sign-in, before hashing. The app passes SHA-256 of this value to ASAuthorizationAppleIDRequest.nonce and Apple echoes that digest back in the token; the backend hashes what you send here and compares. Send the original string, not the digest. Required whenever the sign-in request set a nonce: a nonce-bound token sent without it (omitted or null) is rejected with 401."
          },
          "full_name": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppleFullName"
              },
              {
                "type": "null"
              }
            ],
            "description": "Name components from the credential; only available on the first authorization"
          }
        },
        "type": "object",
        "required": [
          "id_token"
        ],
        "title": "AppleVerifyTokenRequest",
        "description": "Apple identityToken verification request (native iOS / macOS apps)."
      },
      "AuthMemberResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "avatar_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avatar Url"
          },
          "tier": {
            "type": "string",
            "title": "Tier"
          },
          "status": {
            "type": "string",
            "title": "Status"
          }
        },
        "type": "object",
        "required": [
          "id",
          "email",
          "display_name",
          "avatar_url",
          "tier",
          "status"
        ],
        "title": "AuthMemberResponse"
      },
      "AuthenticatedSessionResponse": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "access_token": {
            "type": "string",
            "title": "Access Token"
          },
          "refresh_token": {
            "type": "string",
            "title": "Refresh Token"
          },
          "token_type": {
            "type": "string",
            "title": "Token Type"
          },
          "expires_in": {
            "type": "integer",
            "title": "Expires In"
          },
          "member": {
            "$ref": "#/components/schemas/AuthMemberResponse"
          }
        },
        "type": "object",
        "required": [
          "status",
          "access_token",
          "refresh_token",
          "token_type",
          "expires_in",
          "member"
        ],
        "title": "AuthenticatedSessionResponse"
      },
      "BackupActionCounts": {
        "properties": {
          "buy": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Buy"
          },
          "sell": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Sell"
          },
          "stock_dividend": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Stock Dividend"
          },
          "cash_dividend": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Cash Dividend"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "buy",
          "sell",
          "stock_dividend",
          "cash_dividend"
        ],
        "title": "BackupActionCounts"
      },
      "BackupBroker": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "member_id": {
            "type": "string",
            "title": "Member Id"
          },
          "name": {
            "type": "string",
            "maxLength": 100,
            "title": "Name"
          },
          "fee_rate": {
            "type": "string",
            "title": "Fee Rate"
          },
          "fee_discount": {
            "type": "string",
            "title": "Fee Discount"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "is_default": {
            "type": "boolean",
            "title": "Is Default"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "member_id",
          "name",
          "fee_rate",
          "fee_discount",
          "note",
          "is_default",
          "created_at",
          "updated_at"
        ],
        "title": "BackupBroker"
      },
      "BackupClosure": {
        "properties": {
          "country": {
            "$ref": "#/components/schemas/Country"
          },
          "id": {
            "type": "string",
            "title": "Id"
          },
          "sell_transaction_id": {
            "type": "string",
            "title": "Sell Transaction Id"
          },
          "buy_transaction_id": {
            "type": "string",
            "title": "Buy Transaction Id"
          },
          "member_id": {
            "type": "string",
            "title": "Member Id"
          },
          "stock_code": {
            "type": "string",
            "title": "Stock Code"
          },
          "_sell_action": {
            "type": "string",
            "const": "sell",
            "title": "Sell Action"
          },
          "_buy_action": {
            "type": "string",
            "enum": [
              "buy",
              "stock_dividend"
            ],
            "title": "Buy Action"
          },
          "qty": {
            "type": "integer",
            "maximum": 2147483647.0,
            "exclusiveMinimum": 0.0,
            "title": "Qty"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "is_day_trade": {
            "type": "boolean",
            "title": "Is Day Trade"
          },
          "listing_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Listing Type"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "country",
          "id",
          "sell_transaction_id",
          "buy_transaction_id",
          "member_id",
          "stock_code",
          "_sell_action",
          "_buy_action",
          "qty",
          "created_at",
          "is_day_trade",
          "listing_type"
        ],
        "title": "BackupClosure"
      },
      "BackupMember": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "email"
        ],
        "title": "BackupMember"
      },
      "BackupSummary": {
        "properties": {
          "brokers": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Brokers"
          },
          "transactions": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Transactions"
          },
          "closures": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Closures"
          },
          "day_trade_pairs": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Day Trade Pairs"
          },
          "actions": {
            "$ref": "#/components/schemas/BackupActionCounts"
          },
          "date_from": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date From"
          },
          "date_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date To"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "brokers",
          "transactions",
          "closures",
          "day_trade_pairs",
          "actions",
          "date_from",
          "date_to"
        ],
        "title": "BackupSummary"
      },
      "BackupTransaction": {
        "properties": {
          "country": {
            "$ref": "#/components/schemas/Country"
          },
          "id": {
            "type": "string",
            "title": "Id"
          },
          "member_id": {
            "type": "string",
            "title": "Member Id"
          },
          "stock_code": {
            "type": "string",
            "title": "Stock Code"
          },
          "action": {
            "type": "string",
            "enum": [
              "buy",
              "sell",
              "stock_dividend",
              "cash_dividend"
            ],
            "title": "Action"
          },
          "sell_type": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 20
              },
              {
                "type": "null"
              }
            ],
            "title": "Sell Type"
          },
          "price_per_share": {
            "type": "string",
            "title": "Price Per Share"
          },
          "quantity": {
            "type": "integer",
            "maximum": 2147483647.0,
            "exclusiveMinimum": 0.0,
            "title": "Quantity"
          },
          "fee": {
            "type": "string",
            "title": "Fee"
          },
          "tax": {
            "type": "string",
            "title": "Tax"
          },
          "realized_pnl": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Realized Pnl"
          },
          "broker_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Broker Id"
          },
          "transaction_date": {
            "type": "string",
            "title": "Transaction Date"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          },
          "day_trade_pair_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Day Trade Pair Id"
          },
          "day_trade_direction": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "long_first",
                  "short_first"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Day Trade Direction"
          },
          "listing_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Listing Type"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "country",
          "id",
          "member_id",
          "stock_code",
          "action",
          "sell_type",
          "price_per_share",
          "quantity",
          "fee",
          "tax",
          "realized_pnl",
          "broker_id",
          "transaction_date",
          "note",
          "created_at",
          "updated_at",
          "day_trade_pair_id",
          "day_trade_direction",
          "listing_type"
        ],
        "title": "BackupTransaction"
      },
      "BatchCandidateApprovalRequest": {
        "properties": {
          "updates": {
            "items": {
              "$ref": "#/components/schemas/CandidateApprovalUpdate"
            },
            "type": "array",
            "minItems": 1,
            "title": "Updates"
          }
        },
        "type": "object",
        "required": [
          "updates"
        ],
        "title": "BatchCandidateApprovalRequest",
        "description": "Batch candidate approval updates for a generated theme job."
      },
      "BatchCandidateApprovalResponse": {
        "properties": {
          "job_id": {
            "type": "string",
            "title": "Job Id"
          },
          "updated_count": {
            "type": "integer",
            "title": "Updated Count"
          },
          "candidates": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Candidates"
          }
        },
        "type": "object",
        "required": [
          "job_id",
          "updated_count",
          "candidates"
        ],
        "title": "BatchCandidateApprovalResponse",
        "description": "Updated candidate review state for a generated theme job."
      },
      "BatchCreateTransactionsRequest": {
        "properties": {
          "transactionList": {
            "items": {
              "$ref": "#/components/schemas/CreateTransactionRequest"
            },
            "type": "array",
            "maxItems": 100,
            "minItems": 1,
            "title": "Transactionlist"
          }
        },
        "type": "object",
        "required": [
          "transactionList"
        ],
        "title": "BatchCreateTransactionsRequest",
        "description": "Request body for batch transaction creation."
      },
      "BatchDeleteTransactionsRequest": {
        "properties": {
          "transactionIds": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 100,
            "minItems": 1,
            "title": "Transactionids"
          }
        },
        "type": "object",
        "required": [
          "transactionIds"
        ],
        "title": "BatchDeleteTransactionsRequest",
        "description": "Request body for batch transaction deletion."
      },
      "BatchTickerRequest": {
        "properties": {
          "tickers": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tickers",
            "description": "List of tickers to query"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id",
            "description": "Backtest run id, default latest"
          },
          "domain": {
            "type": "string",
            "title": "Domain",
            "description": "Backtest domain: technical | chip",
            "default": "technical"
          }
        },
        "type": "object",
        "required": [
          "tickers"
        ],
        "title": "BatchTickerRequest"
      },
      "BatchUpdateTransactionItem": {
        "properties": {
          "action": {
            "type": "string",
            "pattern": "^(buy|sell|stock_dividend|cash_dividend)$",
            "title": "Action"
          },
          "sell_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sell Type"
          },
          "price_per_share": {
            "type": "number",
            "minimum": 0.0,
            "title": "Price Per Share"
          },
          "quantity": {
            "type": "integer",
            "exclusiveMinimum": 0.0,
            "title": "Quantity"
          },
          "fee": {
            "type": "number",
            "title": "Fee",
            "default": 0
          },
          "tax": {
            "type": "number",
            "title": "Tax",
            "default": 0
          },
          "transaction_date": {
            "type": "string",
            "title": "Transaction Date"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "broker_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Broker Id"
          },
          "closes_lots": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/LotClosureSpec"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Closes Lots"
          },
          "id": {
            "type": "string",
            "minLength": 1,
            "title": "Id"
          }
        },
        "type": "object",
        "required": [
          "action",
          "price_per_share",
          "quantity",
          "transaction_date",
          "id"
        ],
        "title": "BatchUpdateTransactionItem",
        "description": "One item in ``PUT /api/portfolio/transactions/batch``."
      },
      "BatchUpdateTransactionsRequest": {
        "properties": {
          "transactionList": {
            "items": {
              "$ref": "#/components/schemas/BatchUpdateTransactionItem"
            },
            "type": "array",
            "maxItems": 100,
            "minItems": 1,
            "title": "Transactionlist"
          }
        },
        "type": "object",
        "required": [
          "transactionList"
        ],
        "title": "BatchUpdateTransactionsRequest",
        "description": "Request body for batch transaction updates."
      },
      "BlackSwanPhaseDailyItem": {
        "properties": {
          "trading_date": {
            "type": "string",
            "title": "Trading Date"
          },
          "dominant_phase": {
            "type": "string",
            "title": "Dominant Phase"
          },
          "phase_source": {
            "type": "string",
            "title": "Phase Source"
          },
          "overlap_flag": {
            "type": "boolean",
            "title": "Overlap Flag"
          },
          "warmup": {
            "type": "boolean",
            "title": "Warmup",
            "default": false
          },
          "black_swan": {
            "additionalProperties": {
              "$ref": "#/components/schemas/PhaseResultResponse"
            },
            "type": "object",
            "title": "Black Swan"
          }
        },
        "type": "object",
        "required": [
          "trading_date",
          "dominant_phase",
          "phase_source",
          "overlap_flag",
          "black_swan"
        ],
        "title": "BlackSwanPhaseDailyItem",
        "description": "Single-day phase estimate for range response."
      },
      "BlackSwanPhaseRangeResponse": {
        "properties": {
          "subject": {
            "type": "string",
            "title": "Subject"
          },
          "start_date": {
            "type": "string",
            "title": "Start Date"
          },
          "end_date": {
            "type": "string",
            "title": "End Date"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          },
          "daily": {
            "items": {
              "$ref": "#/components/schemas/BlackSwanPhaseDailyItem"
            },
            "type": "array",
            "title": "Daily"
          }
        },
        "type": "object",
        "required": [
          "subject",
          "start_date",
          "end_date",
          "count",
          "daily"
        ],
        "title": "BlackSwanPhaseRangeResponse",
        "description": "Response for phase date range query."
      },
      "BlackSwanPhaseResponse": {
        "properties": {
          "date": {
            "type": "string",
            "title": "Date"
          },
          "resolved_trading_date": {
            "type": "string",
            "title": "Resolved Trading Date"
          },
          "mode": {
            "type": "string",
            "title": "Mode"
          },
          "subject": {
            "type": "string",
            "title": "Subject"
          },
          "proxy_source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Proxy Source"
          },
          "main_type": {
            "type": "string",
            "title": "Main Type"
          },
          "dominant_phase": {
            "type": "string",
            "title": "Dominant Phase"
          },
          "phase_source": {
            "type": "string",
            "title": "Phase Source"
          },
          "overlap_flag": {
            "type": "boolean",
            "title": "Overlap Flag"
          },
          "black_swan": {
            "additionalProperties": {
              "$ref": "#/components/schemas/PhaseResultResponse"
            },
            "type": "object",
            "title": "Black Swan"
          }
        },
        "type": "object",
        "required": [
          "date",
          "resolved_trading_date",
          "mode",
          "subject",
          "proxy_source",
          "main_type",
          "dominant_phase",
          "phase_source",
          "overlap_flag",
          "black_swan"
        ],
        "title": "BlackSwanPhaseResponse"
      },
      "BrokerBranchAnalysisItem": {
        "properties": {
          "stock_code": {
            "type": "string",
            "title": "Stock Code"
          },
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "listing_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Listing Type"
          },
          "buy_shares": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Buy Shares"
          },
          "sell_shares": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sell Shares"
          },
          "net_shares": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Net Shares"
          },
          "buy_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Buy Value"
          },
          "sell_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sell Value"
          },
          "net_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Net Value"
          },
          "buy_avg_price": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Buy Avg Price"
          },
          "sell_avg_price": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sell Avg Price"
          },
          "main_force": {
            "$ref": "#/components/schemas/BrokerBranchMainForceRank"
          },
          "holding_estimate": {
            "$ref": "#/components/schemas/BrokerBranchHoldingEstimate"
          },
          "overnight": {
            "$ref": "#/components/schemas/BrokerBranchOvernightSummary"
          }
        },
        "type": "object",
        "required": [
          "stock_code",
          "ticker",
          "name",
          "listing_type",
          "buy_shares",
          "sell_shares",
          "net_shares",
          "buy_value",
          "sell_value",
          "net_value",
          "buy_avg_price",
          "sell_avg_price",
          "main_force",
          "holding_estimate",
          "overnight"
        ],
        "title": "BrokerBranchAnalysisItem"
      },
      "BrokerBranchAnalysisResponse": {
        "properties": {
          "participant_id": {
            "type": "string",
            "title": "Participant Id"
          },
          "participant_name": {
            "type": "string",
            "title": "Participant Name"
          },
          "window": {
            "type": "integer",
            "title": "Window"
          },
          "start_date": {
            "type": "string",
            "format": "date",
            "title": "Start Date"
          },
          "end_date": {
            "type": "string",
            "format": "date",
            "title": "End Date"
          },
          "actual_days": {
            "type": "integer",
            "title": "Actual Days"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          },
          "coverage": {
            "$ref": "#/components/schemas/BrokerBranchCoverage"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/BrokerBranchAnalysisItem"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "participant_id",
          "participant_name",
          "window",
          "start_date",
          "end_date",
          "actual_days",
          "updated_at",
          "coverage",
          "items"
        ],
        "title": "BrokerBranchAnalysisResponse"
      },
      "BrokerBranchBranchResponse": {
        "properties": {
          "participant_id": {
            "type": "string",
            "title": "Participant Id"
          },
          "participant_name": {
            "type": "string",
            "title": "Participant Name"
          },
          "window": {
            "type": "integer",
            "title": "Window"
          },
          "start_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Date"
          },
          "end_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Date"
          },
          "actual_days": {
            "type": "integer",
            "title": "Actual Days"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/BrokerBranchStockFlowItem"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "participant_id",
          "participant_name",
          "window",
          "start_date",
          "end_date",
          "actual_days",
          "items"
        ],
        "title": "BrokerBranchBranchResponse"
      },
      "BrokerBranchCoverage": {
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "unverified",
              "partial"
            ],
            "title": "Status"
          },
          "expected_days": {
            "type": "integer",
            "title": "Expected Days"
          },
          "required_session_count": {
            "type": "integer",
            "title": "Required Session Count"
          },
          "available_session_count": {
            "type": "integer",
            "title": "Available Session Count"
          },
          "missing_trade_dates": {
            "items": {
              "type": "string",
              "format": "date"
            },
            "type": "array",
            "title": "Missing Trade Dates"
          },
          "predecessor_complete": {
            "type": "boolean",
            "title": "Predecessor Complete"
          },
          "partial_instrument_count": {
            "type": "integer",
            "title": "Partial Instrument Count"
          }
        },
        "type": "object",
        "required": [
          "status",
          "expected_days",
          "required_session_count",
          "available_session_count",
          "missing_trade_dates",
          "predecessor_complete",
          "partial_instrument_count"
        ],
        "title": "BrokerBranchCoverage"
      },
      "BrokerBranchDailyFlowItem": {
        "properties": {
          "trade_date": {
            "type": "string",
            "format": "date",
            "title": "Trade Date"
          },
          "buy_shares": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Buy Shares"
          },
          "sell_shares": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sell Shares"
          },
          "net_shares": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Net Shares"
          },
          "buy_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Buy Value"
          },
          "sell_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sell Value"
          },
          "net_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Net Value"
          },
          "buy_avg_price": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Buy Avg Price"
          },
          "sell_avg_price": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sell Avg Price"
          }
        },
        "type": "object",
        "required": [
          "trade_date",
          "buy_shares",
          "sell_shares",
          "net_shares",
          "buy_value",
          "sell_value",
          "net_value",
          "buy_avg_price",
          "sell_avg_price"
        ],
        "title": "BrokerBranchDailyFlowItem",
        "description": "One window trade date of a single branch on a single stock (endpoint C)."
      },
      "BrokerBranchDailyResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "participant_id": {
            "type": "string",
            "title": "Participant Id"
          },
          "participant_name": {
            "type": "string",
            "title": "Participant Name"
          },
          "days": {
            "type": "integer",
            "title": "Days"
          },
          "start_date": {
            "type": "string",
            "format": "date",
            "title": "Start Date"
          },
          "end_date": {
            "type": "string",
            "format": "date",
            "title": "End Date"
          },
          "actual_days": {
            "type": "integer",
            "title": "Actual Days"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/BrokerBranchDailyFlowItem"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "participant_id",
          "participant_name",
          "days",
          "start_date",
          "end_date",
          "actual_days",
          "items"
        ],
        "title": "BrokerBranchDailyResponse"
      },
      "BrokerBranchDirectoryEntry": {
        "properties": {
          "participant_id": {
            "type": "string",
            "title": "Participant Id"
          },
          "participant_name": {
            "type": "string",
            "title": "Participant Name"
          },
          "last_trade_date": {
            "type": "string",
            "format": "date",
            "title": "Last Trade Date"
          }
        },
        "type": "object",
        "required": [
          "participant_id",
          "participant_name",
          "last_trade_date"
        ],
        "title": "BrokerBranchDirectoryEntry"
      },
      "BrokerBranchDirectoryResponse": {
        "properties": {
          "catalog_as_of": {
            "type": "string",
            "format": "date",
            "title": "Catalog As Of"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/BrokerBranchDirectoryEntry"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "catalog_as_of",
          "total",
          "items"
        ],
        "title": "BrokerBranchDirectoryResponse"
      },
      "BrokerBranchFlowItem": {
        "properties": {
          "participant_id": {
            "type": "string",
            "title": "Participant Id"
          },
          "participant_name": {
            "type": "string",
            "title": "Participant Name"
          },
          "buy_shares": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Buy Shares"
          },
          "sell_shares": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sell Shares"
          },
          "net_shares": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Net Shares"
          },
          "buy_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Buy Value"
          },
          "sell_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sell Value"
          },
          "net_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Net Value"
          },
          "buy_avg_price": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Buy Avg Price"
          },
          "sell_avg_price": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sell Avg Price"
          }
        },
        "type": "object",
        "required": [
          "participant_id",
          "participant_name",
          "buy_shares",
          "sell_shares",
          "net_shares",
          "buy_value",
          "sell_value",
          "net_value",
          "buy_avg_price",
          "sell_avg_price"
        ],
        "title": "BrokerBranchFlowItem",
        "description": "One branch's window aggregate for a single stock (endpoint A)."
      },
      "BrokerBranchHoldingEstimate": {
        "properties": {
          "method": {
            "type": "string",
            "const": "window_moving_average_v1",
            "title": "Method"
          },
          "status": {
            "type": "string",
            "enum": [
              "estimated",
              "no_modeled_position",
              "unavailable"
            ],
            "title": "Status"
          },
          "shares": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Shares"
          },
          "avg_price": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avg Price"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "type": "object",
        "required": [
          "method",
          "status",
          "shares",
          "avg_price",
          "reason"
        ],
        "title": "BrokerBranchHoldingEstimate"
      },
      "BrokerBranchMainForceRank": {
        "properties": {
          "metric": {
            "type": "string",
            "const": "net_shares",
            "title": "Metric"
          },
          "buy_rank": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Buy Rank"
          },
          "sell_rank": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sell Rank"
          }
        },
        "type": "object",
        "required": [
          "metric",
          "buy_rank",
          "sell_rank"
        ],
        "title": "BrokerBranchMainForceRank"
      },
      "BrokerBranchOvernightEvent": {
        "properties": {
          "buy_date": {
            "type": "string",
            "format": "date",
            "title": "Buy Date"
          },
          "sell_date": {
            "type": "string",
            "format": "date",
            "title": "Sell Date"
          },
          "previous_net_buy_shares": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Net Buy Shares"
          },
          "next_net_sell_shares": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Net Sell Shares"
          },
          "overlap_shares": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Overlap Shares"
          },
          "sellback_ratio": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sellback Ratio"
          }
        },
        "type": "object",
        "required": [
          "buy_date",
          "sell_date",
          "previous_net_buy_shares",
          "next_net_sell_shares",
          "overlap_shares",
          "sellback_ratio"
        ],
        "title": "BrokerBranchOvernightEvent"
      },
      "BrokerBranchOvernightSummary": {
        "properties": {
          "method": {
            "type": "string",
            "const": "adjacent_net_flow_v1",
            "title": "Method"
          },
          "status": {
            "type": "string",
            "enum": [
              "candidate",
              "none",
              "insufficient_data"
            ],
            "title": "Status"
          },
          "event_count": {
            "type": "integer",
            "title": "Event Count"
          },
          "evaluated_pair_count": {
            "type": "integer",
            "title": "Evaluated Pair Count"
          },
          "skipped_pair_count": {
            "type": "integer",
            "title": "Skipped Pair Count"
          },
          "total_overlap_shares": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Overlap Shares"
          },
          "latest_event": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BrokerBranchOvernightEvent"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "method",
          "status",
          "event_count",
          "evaluated_pair_count",
          "skipped_pair_count",
          "total_overlap_shares",
          "latest_event"
        ],
        "title": "BrokerBranchOvernightSummary"
      },
      "BrokerBranchStockFlowItem": {
        "properties": {
          "stock_code": {
            "type": "string",
            "title": "Stock Code"
          },
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "listing_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Listing Type"
          },
          "buy_shares": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Buy Shares"
          },
          "sell_shares": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sell Shares"
          },
          "net_shares": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Net Shares"
          },
          "buy_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Buy Value"
          },
          "sell_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sell Value"
          },
          "net_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Net Value"
          },
          "buy_avg_price": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Buy Avg Price"
          },
          "sell_avg_price": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sell Avg Price"
          }
        },
        "type": "object",
        "required": [
          "stock_code",
          "ticker",
          "name",
          "listing_type",
          "buy_shares",
          "sell_shares",
          "net_shares",
          "buy_value",
          "sell_value",
          "net_value",
          "buy_avg_price",
          "sell_avg_price"
        ],
        "title": "BrokerBranchStockFlowItem",
        "description": "One stock's window aggregate for a single branch (endpoint B)."
      },
      "BrokerBranchStockResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "window": {
            "type": "integer",
            "title": "Window"
          },
          "start_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Date"
          },
          "end_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Date"
          },
          "actual_days": {
            "type": "integer",
            "title": "Actual Days"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/BrokerBranchFlowItem"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "window",
          "start_date",
          "end_date",
          "actual_days",
          "items"
        ],
        "title": "BrokerBranchStockResponse"
      },
      "CancelThemeJobResponse": {
        "properties": {
          "job_id": {
            "type": "string",
            "title": "Job Id"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "completed",
              "failed",
              "published",
              "canceled"
            ],
            "title": "Status"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          }
        },
        "type": "object",
        "required": [
          "job_id",
          "status",
          "error",
          "completed_at"
        ],
        "title": "CancelThemeJobResponse",
        "description": "Response returned after canceling a pending/running theme job."
      },
      "CandidateApprovalUpdate": {
        "properties": {
          "candidate_id": {
            "type": "integer",
            "minimum": 1.0,
            "title": "Candidate Id"
          },
          "approved": {
            "type": "boolean",
            "title": "Approved"
          }
        },
        "type": "object",
        "required": [
          "candidate_id",
          "approved"
        ],
        "title": "CandidateApprovalUpdate",
        "description": "Single candidate approval update."
      },
      "ChipRecapResult": {
        "properties": {
          "trade_date": {
            "type": "string",
            "title": "Trade Date"
          },
          "headline": {
            "type": "string",
            "title": "Headline"
          },
          "market_summary": {
            "type": "string",
            "title": "Market Summary"
          },
          "group_summary": {
            "type": "string",
            "title": "Group Summary"
          },
          "stock_summary": {
            "type": "string",
            "title": "Stock Summary"
          },
          "risk_summary": {
            "type": "string",
            "title": "Risk Summary",
            "default": ""
          },
          "risks": {
            "items": {
              "$ref": "#/components/schemas/EvidenceItem"
            },
            "type": "array",
            "title": "Risks"
          },
          "period_type": {
            "type": "string",
            "enum": [
              "daily",
              "weekly",
              "monthly"
            ],
            "title": "Period Type",
            "default": "daily"
          },
          "period_start_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Period Start Date"
          },
          "period_end_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Period End Date"
          },
          "period_summary": {
            "type": "string",
            "title": "Period Summary",
            "default": ""
          },
          "etf_summary": {
            "type": "string",
            "title": "Etf Summary",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "trade_date",
          "headline",
          "market_summary",
          "group_summary",
          "stock_summary"
        ],
        "title": "ChipRecapResult",
        "description": "Chip recap LLM result (daily / weekly / monthly).\n\nPeriodicity is carried via ``period_type`` + ``period_start_date`` +\n``period_end_date``; daily callers leave them at their defaults and\n``trade_date`` alone is meaningful. Weekly/monthly callers dual-write\n``trade_date`` with ``period_end_date`` so legacy readers (which only\nknow the trade_date field) still get a plausible value.\n\n``risk_summary`` is the deprecated string form; ``risks`` is the\nstructured successor. Both have defaults so legacy cache rows\ndeserialize without a missing-field ValidationError.\n\n``etf_summary`` carries the LLM's analysis of ETF holdings changes\ninjected into the chip recap payload. Empty string when no ETF data\nis available or the LLM omits it."
      },
      "ChipSignalSummary": {
        "properties": {
          "trading_date": {
            "type": "string",
            "title": "Trading Date"
          },
          "chip_signal_type": {
            "type": "string",
            "title": "Chip Signal Type"
          },
          "bias": {
            "type": "string",
            "title": "Bias"
          },
          "confidence": {
            "type": "number",
            "title": "Confidence"
          },
          "story_type": {
            "type": "string",
            "title": "Story Type"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "story_reasons": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Story Reasons"
          },
          "action_hints": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Action Hints"
          },
          "foreign_flow_zscore": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Foreign Flow Zscore"
          },
          "inst_consensus": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Inst Consensus"
          },
          "reasons": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Reasons"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings"
          },
          "signals": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Signals"
          },
          "events": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Events"
          },
          "stories": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Stories"
          },
          "relations": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Relations"
          }
        },
        "type": "object",
        "required": [
          "trading_date",
          "chip_signal_type",
          "bias",
          "confidence",
          "story_type",
          "role",
          "story_reasons",
          "action_hints",
          "reasons",
          "warnings"
        ],
        "title": "ChipSignalSummary",
        "description": "Chip (institutional flow) dimension signal summary."
      },
      "ChipSummaryResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "trading_date": {
            "type": "string",
            "format": "date",
            "title": "Trading Date"
          },
          "margin": {
            "$ref": "#/components/schemas/FlowSignal"
          },
          "short": {
            "$ref": "#/components/schemas/FlowSignal"
          },
          "foreign": {
            "$ref": "#/components/schemas/FlowSignal"
          },
          "trust": {
            "$ref": "#/components/schemas/FlowSignal"
          },
          "dealer": {
            "$ref": "#/components/schemas/FlowSignal"
          },
          "big_holders_400": {
            "$ref": "#/components/schemas/FlowSignal"
          },
          "retail": {
            "$ref": "#/components/schemas/FlowSignal",
            "description": "Retail ownership using the homepage chip_summary.ownership_change_rankings.retail_threshold_lots setting (default: 50 lots, TDCC levels 1–8)."
          },
          "data_freshness": {
            "additionalProperties": true,
            "type": "object",
            "title": "Data Freshness"
          },
          "meta": {
            "additionalProperties": true,
            "type": "object",
            "title": "Meta"
          },
          "sources": {
            "additionalProperties": true,
            "type": "object",
            "title": "Sources"
          },
          "analysis_status": {
            "type": "string",
            "title": "Analysis Status",
            "default": "pending_source"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "trading_date",
          "margin",
          "short",
          "foreign",
          "trust",
          "dealer",
          "big_holders_400",
          "retail"
        ],
        "title": "ChipSummaryResponse"
      },
      "CommodityInfo": {
        "properties": {
          "symbol": {
            "type": "string",
            "title": "Symbol"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "english_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "English Name"
          },
          "category": {
            "type": "string",
            "title": "Category"
          },
          "series_type": {
            "type": "string",
            "title": "Series Type"
          },
          "unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          }
        },
        "type": "object",
        "required": [
          "symbol",
          "name",
          "category",
          "series_type",
          "is_active"
        ],
        "title": "CommodityInfo",
        "description": "Commodity metadata."
      },
      "CommodityOHLC": {
        "properties": {
          "symbol": {
            "type": "string",
            "title": "Symbol"
          },
          "trade_date": {
            "type": "string",
            "format": "date",
            "title": "Trade Date"
          },
          "open": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Open"
          },
          "high": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "High"
          },
          "low": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Low"
          },
          "close": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Close"
          },
          "volume": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Volume"
          },
          "data_source": {
            "type": "string",
            "title": "Data Source"
          }
        },
        "type": "object",
        "required": [
          "symbol",
          "trade_date",
          "data_source"
        ],
        "title": "CommodityOHLC",
        "description": "Commodity daily price record."
      },
      "CommoditySnapshot": {
        "properties": {
          "symbol": {
            "type": "string",
            "title": "Symbol"
          },
          "trading_date": {
            "type": "string",
            "format": "date",
            "title": "Trading Date"
          },
          "close": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Close"
          },
          "sma_5": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sma 5"
          },
          "sma_10": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sma 10"
          },
          "sma_20": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sma 20"
          },
          "sma_60": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sma 60"
          },
          "rsi": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rsi"
          },
          "atr": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Atr"
          },
          "pct_change_1d": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pct Change 1D"
          },
          "pct_change_5d": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pct Change 5D"
          },
          "pct_change_20d": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pct Change 20D"
          },
          "pct_change_60d": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pct Change 60D"
          },
          "trend_20d": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trend 20D"
          },
          "trend_60d": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trend 60D"
          },
          "above_sma_20": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Above Sma 20"
          },
          "above_sma_60": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Above Sma 60"
          }
        },
        "type": "object",
        "required": [
          "symbol",
          "trading_date"
        ],
        "title": "CommoditySnapshot",
        "description": "Commodity technical indicator snapshot."
      },
      "CompanyProfileResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "company_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Company Name"
          },
          "sector": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sector"
          },
          "sector_en": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sector En"
          },
          "industry_en": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Industry En"
          },
          "market_cap_m": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Market Cap M"
          },
          "ev_m": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ev M"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          }
        },
        "type": "object",
        "required": [
          "ticker"
        ],
        "title": "CompanyProfileResponse",
        "description": "Company profile from coverage report."
      },
      "CompanyRelationResponse": {
        "properties": {
          "source_ticker": {
            "type": "string",
            "title": "Source Ticker"
          },
          "target_name": {
            "type": "string",
            "title": "Target Name"
          },
          "target_ticker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Ticker"
          },
          "target_is_tw": {
            "type": "boolean",
            "title": "Target Is Tw",
            "default": false
          },
          "rel_type": {
            "type": "string",
            "title": "Rel Type"
          },
          "source_section": {
            "type": "string",
            "title": "Source Section"
          },
          "is_bidirectional": {
            "type": "boolean",
            "title": "Is Bidirectional",
            "default": false
          },
          "mention_count": {
            "type": "integer",
            "title": "Mention Count",
            "default": 1
          }
        },
        "type": "object",
        "required": [
          "source_ticker",
          "target_name",
          "rel_type",
          "source_section"
        ],
        "title": "CompanyRelationResponse",
        "description": "A supply chain relation edge."
      },
      "CompleteRegistrationRequest": {
        "properties": {
          "pending_token": {
            "type": "string",
            "title": "Pending Token",
            "description": "Legacy pending registration token"
          },
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email",
            "description": "Email address to complete registration"
          }
        },
        "type": "object",
        "required": [
          "pending_token",
          "email"
        ],
        "title": "CompleteRegistrationRequest"
      },
      "ConsensusOptions": {
        "properties": {
          "available_days": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "Available Days"
          },
          "all_buy_days": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "All Buy Days"
          },
          "all_sell_days": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "All Sell Days"
          },
          "two_buy_days": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "Two Buy Days"
          },
          "two_sell_days": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "Two Sell Days"
          }
        },
        "type": "object",
        "required": [
          "available_days",
          "all_buy_days",
          "all_sell_days",
          "two_buy_days",
          "two_sell_days"
        ],
        "title": "ConsensusOptions",
        "description": "Available options for consensus analysis based on actual data."
      },
      "ConsensusStock": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "foreign_net": {
            "type": "integer",
            "title": "Foreign Net"
          },
          "trust_net": {
            "type": "integer",
            "title": "Trust Net"
          },
          "dealer_net": {
            "type": "integer",
            "title": "Dealer Net"
          },
          "total_net": {
            "type": "integer",
            "title": "Total Net"
          },
          "close_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Close Price"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "name",
          "foreign_net",
          "trust_net",
          "dealer_net",
          "total_net"
        ],
        "title": "ConsensusStock",
        "description": "Stock with institutional consensus buying/selling."
      },
      "ConsensusStreakStock": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "consensus_days": {
            "type": "integer",
            "title": "Consensus Days"
          },
          "foreign_streak": {
            "type": "integer",
            "title": "Foreign Streak"
          },
          "trust_streak": {
            "type": "integer",
            "title": "Trust Streak"
          },
          "dealer_streak": {
            "type": "integer",
            "title": "Dealer Streak"
          },
          "foreign_net": {
            "type": "integer",
            "title": "Foreign Net"
          },
          "trust_net": {
            "type": "integer",
            "title": "Trust Net"
          },
          "dealer_net": {
            "type": "integer",
            "title": "Dealer Net"
          },
          "total_net": {
            "type": "integer",
            "title": "Total Net"
          },
          "close_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Close Price"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "name",
          "consensus_days",
          "foreign_streak",
          "trust_streak",
          "dealer_streak",
          "foreign_net",
          "trust_net",
          "dealer_net",
          "total_net"
        ],
        "title": "ConsensusStreakStock",
        "description": "Stock with consecutive days of institutional consensus."
      },
      "Country": {
        "type": "string",
        "enum": [
          "taiwan",
          "us"
        ],
        "title": "Country",
        "description": "The physical country schema selected by a repository router."
      },
      "CreateDayTradeRequest": {
        "properties": {
          "ticker": {
            "type": "string",
            "maxLength": 20,
            "minLength": 1,
            "title": "Ticker"
          },
          "transaction_date": {
            "type": "string",
            "title": "Transaction Date"
          },
          "direction": {
            "type": "string",
            "enum": [
              "long_first",
              "short_first"
            ],
            "title": "Direction"
          },
          "buy_price": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Buy Price"
          },
          "sell_price": {
            "type": "number",
            "exclusiveMinimum": 0.0,
            "title": "Sell Price"
          },
          "quantity": {
            "type": "integer",
            "exclusiveMinimum": 0.0,
            "title": "Quantity"
          },
          "fee_buy": {
            "type": "number",
            "minimum": 0.0,
            "title": "Fee Buy",
            "default": 0
          },
          "fee_sell": {
            "type": "number",
            "minimum": 0.0,
            "title": "Fee Sell",
            "default": 0
          },
          "tax_buy": {
            "type": "number",
            "minimum": 0.0,
            "title": "Tax Buy",
            "default": 0
          },
          "tax_sell": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Tax Sell"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "broker_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Broker Id"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "transaction_date",
          "direction",
          "buy_price",
          "sell_price",
          "quantity"
        ],
        "title": "CreateDayTradeRequest",
        "description": "Request body for POST /api/portfolio/day-trades."
      },
      "CreateDayTradeResponse": {
        "properties": {
          "pair_id": {
            "type": "string",
            "title": "Pair Id"
          },
          "buy_transaction_id": {
            "type": "string",
            "title": "Buy Transaction Id"
          },
          "sell_transaction_id": {
            "type": "string",
            "title": "Sell Transaction Id"
          },
          "closure_id": {
            "type": "string",
            "title": "Closure Id"
          },
          "realized_pnl": {
            "type": "number",
            "title": "Realized Pnl"
          },
          "tax_sell_applied": {
            "type": "number",
            "title": "Tax Sell Applied"
          }
        },
        "type": "object",
        "required": [
          "pair_id",
          "buy_transaction_id",
          "sell_transaction_id",
          "closure_id",
          "realized_pnl",
          "tax_sell_applied"
        ],
        "title": "CreateDayTradeResponse",
        "description": "Response schema for POST /api/portfolio/day-trades."
      },
      "CreateSubscriptionRequest": {
        "properties": {
          "plan_id": {
            "type": "integer",
            "title": "Plan Id",
            "description": "Subscription plan ID"
          }
        },
        "type": "object",
        "required": [
          "plan_id"
        ],
        "title": "CreateSubscriptionRequest"
      },
      "CreateThemeRequest": {
        "properties": {
          "theme_name": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "pattern": "^[^/\\\\\\x00-\\x1f]+$",
            "title": "Theme Name",
            "description": "題材名稱必須是單一 URL path segment：不可含 `/`、`\\` 或任何 C0 控制字元（`ord(c) < 32`），也不可正好是保留名稱 `.` 或 `..`。前者由本欄位的 `pattern` 表達，後者無法寫進 pattern，由伺服器端驗證器擋下，兩者都回 422。"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "members": {
            "items": {
              "$ref": "#/components/schemas/ThemeMemberIn"
            },
            "type": "array",
            "minItems": 1,
            "title": "Members"
          }
        },
        "type": "object",
        "required": [
          "theme_name",
          "members"
        ],
        "title": "CreateThemeRequest"
      },
      "CreateTransactionRequest": {
        "properties": {
          "ticker": {
            "type": "string",
            "maxLength": 20,
            "minLength": 1,
            "title": "Ticker"
          },
          "action": {
            "type": "string",
            "pattern": "^(buy|sell|stock_dividend|cash_dividend)$",
            "title": "Action"
          },
          "sell_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sell Type"
          },
          "price_per_share": {
            "type": "number",
            "minimum": 0.0,
            "title": "Price Per Share"
          },
          "quantity": {
            "type": "integer",
            "exclusiveMinimum": 0.0,
            "title": "Quantity"
          },
          "fee": {
            "type": "number",
            "title": "Fee",
            "default": 0
          },
          "tax": {
            "type": "number",
            "title": "Tax",
            "default": 0
          },
          "transaction_date": {
            "type": "string",
            "title": "Transaction Date"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "broker_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Broker Id"
          },
          "closes_lots": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/LotClosureSpec"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Closes Lots"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "action",
          "price_per_share",
          "quantity",
          "transaction_date"
        ],
        "title": "CreateTransactionRequest",
        "description": "Request body for ``POST /api/portfolio/transactions``.\n\n``closes_lots`` is only valid on sell transactions and identifies which\nopen buy lots the sell closes. Each entry carries a ``buy_transaction_id``\nand the ``qty`` being closed from that lot; when explicitly supplied the\nsum must equal the request's ``quantity``. When omitted on a sell, the\nbackend auto-pairs via FIFO against the caller's open lots for the\nticker when possible; insufficient open qty can be stored as an unmatched\nsell transaction so the UI can warn about the mismatch. Warning sells are\nexcluded from holdings and PnL until they have full matching closures."
      },
      "CreateUserGroupRequest": {
        "properties": {
          "group_name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Group Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          }
        },
        "type": "object",
        "required": [
          "group_name"
        ],
        "title": "CreateUserGroupRequest"
      },
      "CreateWatchlistGroupRequest": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name"
          },
          "display_order": {
            "type": "integer",
            "title": "Display Order",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "CreateWatchlistGroupRequest"
      },
      "CurrentStorySet": {
        "properties": {
          "story_set_hash": {
            "type": "string",
            "title": "Story Set Hash"
          },
          "story_count": {
            "type": "integer",
            "title": "Story Count"
          },
          "story_keys": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Story Keys"
          }
        },
        "type": "object",
        "required": [
          "story_set_hash",
          "story_count",
          "story_keys"
        ],
        "title": "CurrentStorySet"
      },
      "DailyAnalysisRunRequest": {
        "properties": {
          "date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date"
          },
          "ticker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ticker"
          },
          "market": {
            "type": "string",
            "title": "Market",
            "default": "taiwan"
          },
          "backfill_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Backfill Days"
          }
        },
        "type": "object",
        "title": "DailyAnalysisRunRequest"
      },
      "DailyMarketChipRangeItem": {
        "properties": {
          "trade_date": {
            "type": "string",
            "title": "Trade Date"
          },
          "margin_balance_amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Margin Balance Amount"
          },
          "short_balance_lots": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Short Balance Lots"
          },
          "foreign_tx_futures_long_oi": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Foreign Tx Futures Long Oi"
          },
          "foreign_tx_futures_short_oi": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Foreign Tx Futures Short Oi"
          },
          "foreign_tx_futures_net_oi": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Foreign Tx Futures Net Oi"
          },
          "twse_listed_maintenance_ratio": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Twse Listed Maintenance Ratio"
          },
          "maintenance_price_date_min": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Maintenance Price Date Min"
          },
          "maintenance_price_date_max": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Maintenance Price Date Max"
          },
          "maintenance_prior_price_stocks": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Maintenance Prior Price Stocks"
          },
          "market_index_close": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Market Index Close"
          },
          "market_trade_value_amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Market Trade Value Amount"
          },
          "bias_rate_ma5_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bias Rate Ma5 Pct"
          },
          "bias_rate_ma20_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bias Rate Ma20 Pct"
          },
          "bias_rate_ma60_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bias Rate Ma60 Pct"
          },
          "bias_rate_ma120_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bias Rate Ma120 Pct"
          },
          "bias_rate_ma240_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bias Rate Ma240 Pct"
          }
        },
        "type": "object",
        "required": [
          "trade_date"
        ],
        "title": "DailyMarketChipRangeItem",
        "description": "One trading day of market-wide chip indicators (slim, status-gated)."
      },
      "DailyMarketChipRangeResponse": {
        "properties": {
          "market": {
            "type": "string",
            "title": "Market"
          },
          "start_date": {
            "type": "string",
            "title": "Start Date"
          },
          "end_date": {
            "type": "string",
            "title": "End Date"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          },
          "daily": {
            "items": {
              "$ref": "#/components/schemas/DailyMarketChipRangeItem"
            },
            "type": "array",
            "title": "Daily"
          }
        },
        "type": "object",
        "required": [
          "market",
          "start_date",
          "end_date",
          "count",
          "daily"
        ],
        "title": "DailyMarketChipRangeResponse",
        "description": "Date-range time series of market-wide chip indicators."
      },
      "DailyMarketIndexRangeItem": {
        "properties": {
          "trade_date": {
            "type": "string",
            "title": "Trade Date"
          },
          "market_index_close": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Market Index Close"
          },
          "market_trade_value_amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Market Trade Value Amount"
          },
          "bias_rate_ma5_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bias Rate Ma5 Pct"
          },
          "bias_rate_ma20_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bias Rate Ma20 Pct"
          },
          "bias_rate_ma60_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bias Rate Ma60 Pct"
          },
          "bias_rate_ma120_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bias Rate Ma120 Pct"
          },
          "bias_rate_ma240_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bias Rate Ma240 Pct"
          }
        },
        "type": "object",
        "required": [
          "trade_date"
        ],
        "title": "DailyMarketIndexRangeItem",
        "description": "One trading day of the index-level fields only — the same seven\nvalues /range emits, split out so the homepage K-line never waits on the\nmargin-collateral aggregate (issue #1645)."
      },
      "DailyMarketIndexRangeResponse": {
        "properties": {
          "market": {
            "type": "string",
            "title": "Market"
          },
          "start_date": {
            "type": "string",
            "title": "Start Date"
          },
          "end_date": {
            "type": "string",
            "title": "End Date"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          },
          "daily": {
            "items": {
              "$ref": "#/components/schemas/DailyMarketIndexRangeItem"
            },
            "type": "array",
            "title": "Daily"
          }
        },
        "type": "object",
        "required": [
          "market",
          "start_date",
          "end_date",
          "count",
          "daily"
        ],
        "title": "DailyMarketIndexRangeResponse",
        "description": "Date-range time series of the index-level daily-market fields."
      },
      "DailyRecapResponse": {
        "properties": {
          "date": {
            "type": "string",
            "format": "date",
            "title": "Date"
          },
          "previous_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Date"
          },
          "active_only": {
            "type": "boolean",
            "title": "Active Only"
          },
          "period": {
            "$ref": "#/components/schemas/ETFPerformancePeriod",
            "default": "day"
          },
          "window_start": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Window Start"
          },
          "window_end": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Window End"
          },
          "etfs": {
            "items": {
              "$ref": "#/components/schemas/ETFRecapItem"
            },
            "type": "array",
            "title": "Etfs"
          },
          "stale_etfs": {
            "items": {
              "$ref": "#/components/schemas/StaleETF"
            },
            "type": "array",
            "title": "Stale Etfs"
          },
          "summary": {
            "$ref": "#/components/schemas/DailyRecapSummary"
          }
        },
        "type": "object",
        "required": [
          "date",
          "previous_date",
          "active_only",
          "etfs",
          "summary"
        ],
        "title": "DailyRecapResponse"
      },
      "DailyRecapSummary": {
        "properties": {
          "total_etfs": {
            "type": "integer",
            "title": "Total Etfs"
          },
          "etfs_with_changes": {
            "type": "integer",
            "title": "Etfs With Changes"
          }
        },
        "type": "object",
        "required": [
          "total_etfs",
          "etfs_with_changes"
        ],
        "title": "DailyRecapSummary"
      },
      "DataRange": {
        "properties": {
          "start": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start"
          },
          "end": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End"
          }
        },
        "type": "object",
        "required": [
          "start",
          "end"
        ],
        "title": "DataRange"
      },
      "DataStatusResponse": {
        "properties": {
          "report_date": {
            "type": "string",
            "title": "Report Date"
          },
          "timestamp": {
            "type": "string",
            "title": "Timestamp"
          },
          "pipeline": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PipelineStatus"
              },
              {
                "type": "null"
              }
            ]
          },
          "tables": {
            "items": {
              "$ref": "#/components/schemas/TableStatus"
            },
            "type": "array",
            "title": "Tables"
          },
          "summary": {
            "$ref": "#/components/schemas/StatusSummary"
          }
        },
        "type": "object",
        "required": [
          "report_date",
          "timestamp",
          "tables",
          "summary"
        ],
        "title": "DataStatusResponse"
      },
      "DayTradingHistoryItem": {
        "properties": {
          "trade_date": {
            "type": "string",
            "format": "date",
            "title": "Trade Date"
          },
          "day_trade_volume": {
            "type": "integer",
            "title": "Day Trade Volume"
          },
          "total_volume": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Volume"
          },
          "day_trade_ratio": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Day Trade Ratio"
          },
          "day_trade_buy_value": {
            "type": "integer",
            "title": "Day Trade Buy Value"
          },
          "day_trade_sell_value": {
            "type": "integer",
            "title": "Day Trade Sell Value"
          },
          "revision_stage": {
            "type": "integer",
            "title": "Revision Stage"
          },
          "is_final": {
            "type": "boolean",
            "title": "Is Final"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "trade_date",
          "day_trade_volume",
          "day_trade_buy_value",
          "day_trade_sell_value",
          "revision_stage",
          "is_final",
          "updated_at"
        ],
        "title": "DayTradingHistoryItem"
      },
      "DayTradingHistoryResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "market": {
            "type": "string",
            "enum": [
              "TWSE",
              "TPEX"
            ],
            "title": "Market"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/DayTradingHistoryItem"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "market",
          "total",
          "items"
        ],
        "title": "DayTradingHistoryResponse"
      },
      "DayTradingRankingItem": {
        "properties": {
          "rank": {
            "type": "integer",
            "title": "Rank"
          },
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "market": {
            "type": "string",
            "enum": [
              "TWSE",
              "TPEX"
            ],
            "title": "Market"
          },
          "security_type": {
            "type": "string",
            "title": "Security Type"
          },
          "day_trade_volume": {
            "type": "integer",
            "title": "Day Trade Volume"
          },
          "day_trade_volume_change_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Day Trade Volume Change Pct"
          },
          "total_volume": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Volume"
          },
          "day_trade_ratio": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Day Trade Ratio"
          },
          "day_trade_ratio_change_pp": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Day Trade Ratio Change Pp"
          },
          "day_trade_buy_value": {
            "type": "integer",
            "title": "Day Trade Buy Value"
          },
          "day_trade_sell_value": {
            "type": "integer",
            "title": "Day Trade Sell Value"
          },
          "revision_stage": {
            "type": "integer",
            "title": "Revision Stage"
          },
          "is_final": {
            "type": "boolean",
            "title": "Is Final"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "rank",
          "ticker",
          "market",
          "security_type",
          "day_trade_volume",
          "day_trade_volume_change_pct",
          "day_trade_ratio_change_pp",
          "day_trade_buy_value",
          "day_trade_sell_value",
          "revision_stage",
          "is_final",
          "updated_at"
        ],
        "title": "DayTradingRankingItem"
      },
      "DividendCalendarEntry": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "ex_date": {
            "type": "string",
            "format": "date",
            "title": "Ex Date"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Type"
          },
          "reference_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reference Price"
          },
          "ex_dividend": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ExDividendPart"
              },
              {
                "type": "null"
              }
            ]
          },
          "ex_rights": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ExRightsPart"
              },
              {
                "type": "null"
              }
            ]
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "ex_date"
        ],
        "title": "DividendCalendarEntry"
      },
      "DividendEvent": {
        "properties": {
          "ex_date": {
            "type": "string",
            "format": "date",
            "title": "Ex Date"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Type"
          },
          "reference_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reference Price"
          },
          "ex_dividend": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ExDividendPart"
              },
              {
                "type": "null"
              }
            ]
          },
          "ex_rights": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ExRightsPart"
              },
              {
                "type": "null"
              }
            ]
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          }
        },
        "type": "object",
        "required": [
          "ex_date"
        ],
        "title": "DividendEvent"
      },
      "DividendEventKeyResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "ex_dividend_date": {
            "type": "string",
            "format": "date",
            "title": "Ex Dividend Date"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "ex_dividend_date"
        ],
        "title": "DividendEventKeyResponse"
      },
      "DomainPayload": {
        "properties": {
          "signals": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Signals"
          },
          "events": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Events"
          },
          "stories": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Stories"
          },
          "relations": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Relations"
          },
          "indexes": {
            "additionalProperties": true,
            "type": "object",
            "title": "Indexes"
          },
          "context": {
            "additionalProperties": true,
            "type": "object",
            "title": "Context"
          },
          "risk": {
            "additionalProperties": true,
            "type": "object",
            "title": "Risk"
          },
          "quality": {
            "additionalProperties": true,
            "type": "object",
            "title": "Quality"
          },
          "ses_cache_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ses Cache Status"
          }
        },
        "type": "object",
        "title": "DomainPayload",
        "description": "Formal replacement domain payload."
      },
      "ETFChangesResponse": {
        "properties": {
          "etf_ticker": {
            "type": "string",
            "title": "Etf Ticker"
          },
          "etf_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Etf Name"
          },
          "is_active_etf": {
            "type": "boolean",
            "title": "Is Active Etf"
          },
          "effective_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effective Date"
          },
          "previous_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Date"
          },
          "current_close_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Close Price"
          },
          "baseline_close_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Baseline Close Price"
          },
          "price_delta": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Delta"
          },
          "price_change_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Change Pct"
          },
          "added": {
            "items": {
              "$ref": "#/components/schemas/HoldingChange"
            },
            "type": "array",
            "title": "Added"
          },
          "removed": {
            "items": {
              "$ref": "#/components/schemas/HoldingChange"
            },
            "type": "array",
            "title": "Removed"
          },
          "quantity_changes": {
            "items": {
              "$ref": "#/components/schemas/HoldingChange"
            },
            "type": "array",
            "title": "Quantity Changes"
          },
          "period": {
            "$ref": "#/components/schemas/ETFPerformancePeriod"
          },
          "window_start": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Window Start"
          },
          "window_end": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Window End"
          },
          "requested_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requested Date"
          },
          "is_fallback": {
            "type": "boolean",
            "title": "Is Fallback",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "etf_ticker",
          "is_active_etf",
          "added",
          "removed",
          "quantity_changes",
          "period"
        ],
        "title": "ETFChangesResponse",
        "description": "Per-ETF holdings diff response.\n\nStandalone (no longer inherits ``ETFRecapItem``) so that the rename\n``as_of_date → effective_date`` is scoped to ``/{etf_ticker}/changes`` and\ndoes not affect ``DailyRecapResponse.etfs[]`` (which still uses\n``as_of_date`` and is consumed by ``/recap/daily``)."
      },
      "ETFEstimatedCostAction": {
        "properties": {
          "as_of_date": {
            "type": "string",
            "format": "date",
            "title": "As Of Date"
          },
          "previous_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Date"
          },
          "record_type": {
            "$ref": "#/components/schemas/ETFEstimatedCostRecordType"
          },
          "direction": {
            "$ref": "#/components/schemas/ETFEstimatedCostDirection"
          },
          "change_type": {
            "$ref": "#/components/schemas/ETFEstimatedCostChangeType"
          },
          "previous_quantity": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Quantity"
          },
          "current_quantity": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Quantity"
          },
          "quantity_delta": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantity Delta"
          },
          "close_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Close Price"
          },
          "estimated_trade_amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estimated Trade Amount"
          },
          "amount_status": {
            "$ref": "#/components/schemas/ETFEstimatedCostAmountStatus"
          },
          "estimated_position_cost_after": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estimated Position Cost After"
          },
          "estimated_average_cost_after": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estimated Average Cost After"
          }
        },
        "type": "object",
        "required": [
          "as_of_date",
          "record_type",
          "direction",
          "change_type",
          "amount_status"
        ],
        "title": "ETFEstimatedCostAction"
      },
      "ETFEstimatedCostAmountStatus": {
        "type": "string",
        "enum": [
          "available",
          "missing_close",
          "missing_quantity"
        ],
        "title": "ETFEstimatedCostAmountStatus"
      },
      "ETFEstimatedCostBasisStatus": {
        "type": "string",
        "enum": [
          "estimated_from_first_observation",
          "estimated_from_first_buy",
          "estimated_from_reentry",
          "missing_buy_close",
          "missing_quantity"
        ],
        "title": "ETFEstimatedCostBasisStatus"
      },
      "ETFEstimatedCostChangeType": {
        "type": "string",
        "enum": [
          "initial_observation",
          "added",
          "increased",
          "decreased",
          "quantity_unavailable",
          "quantity_restored"
        ],
        "title": "ETFEstimatedCostChangeType"
      },
      "ETFEstimatedCostDirection": {
        "type": "string",
        "enum": [
          "buy",
          "sell",
          "unknown"
        ],
        "title": "ETFEstimatedCostDirection"
      },
      "ETFEstimatedCostRecordType": {
        "type": "string",
        "enum": [
          "opening_estimate",
          "observed_delta",
          "unknown_observation"
        ],
        "title": "ETFEstimatedCostRecordType"
      },
      "ETFEstimatedCostStock": {
        "properties": {
          "raw_code": {
            "type": "string",
            "title": "Raw Code"
          },
          "constituent_ticker": {
            "type": "string",
            "title": "Constituent Ticker"
          },
          "constituent_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Constituent Name",
            "description": "股票主檔名稱；對不到主檔時為投信回報的原始名稱"
          },
          "asset_type": {
            "type": "string",
            "const": "stock",
            "title": "Asset Type"
          },
          "quantity_unit": {
            "type": "string",
            "const": "shares",
            "title": "Quantity Unit"
          },
          "is_current_holding": {
            "type": "boolean",
            "title": "Is Current Holding"
          },
          "current_quantity": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Quantity"
          },
          "current_weight_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Weight Pct"
          },
          "current_close_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Close Price"
          },
          "estimated_cost_basis": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estimated Cost Basis"
          },
          "estimated_average_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estimated Average Cost"
          },
          "basis_status": {
            "$ref": "#/components/schemas/ETFEstimatedCostBasisStatus"
          },
          "cost_basis_start_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Basis Start Date"
          },
          "actions": {
            "items": {
              "$ref": "#/components/schemas/ETFEstimatedCostAction"
            },
            "type": "array",
            "title": "Actions"
          }
        },
        "type": "object",
        "required": [
          "raw_code",
          "constituent_ticker",
          "asset_type",
          "quantity_unit",
          "is_current_holding",
          "basis_status",
          "actions"
        ],
        "title": "ETFEstimatedCostStock"
      },
      "ETFEstimatedCostsResponse": {
        "properties": {
          "etf_ticker": {
            "type": "string",
            "title": "Etf Ticker"
          },
          "etf_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Etf Name"
          },
          "is_active_etf": {
            "type": "boolean",
            "title": "Is Active Etf"
          },
          "first_snapshot_date": {
            "type": "string",
            "format": "date",
            "title": "First Snapshot Date"
          },
          "last_snapshot_date": {
            "type": "string",
            "format": "date",
            "title": "Last Snapshot Date"
          },
          "snapshot_count": {
            "type": "integer",
            "title": "Snapshot Count"
          },
          "excluded_snapshot_count": {
            "type": "integer",
            "title": "Excluded Snapshot Count"
          },
          "currency": {
            "type": "string",
            "const": "TWD",
            "title": "Currency",
            "default": "TWD"
          },
          "amount_basis": {
            "type": "string",
            "const": "holdings_quantity_delta_x_same_day_close",
            "title": "Amount Basis",
            "default": "holdings_quantity_delta_x_same_day_close"
          },
          "cost_method": {
            "type": "string",
            "const": "moving_weighted_average_same_day_close",
            "title": "Cost Method",
            "default": "moving_weighted_average_same_day_close"
          },
          "stocks": {
            "items": {
              "$ref": "#/components/schemas/ETFEstimatedCostStock"
            },
            "type": "array",
            "title": "Stocks"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "etf_ticker",
          "is_active_etf",
          "first_snapshot_date",
          "last_snapshot_date",
          "snapshot_count",
          "excluded_snapshot_count",
          "stocks",
          "total"
        ],
        "title": "ETFEstimatedCostsResponse"
      },
      "ETFHistoryResponse": {
        "properties": {
          "etf_ticker": {
            "type": "string",
            "title": "Etf Ticker"
          },
          "etf_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Etf Name"
          },
          "is_active_etf": {
            "type": "boolean",
            "title": "Is Active Etf"
          },
          "start_date": {
            "type": "string",
            "format": "date",
            "title": "Start Date"
          },
          "end_date": {
            "type": "string",
            "format": "date",
            "title": "End Date"
          },
          "snapshots": {
            "items": {
              "$ref": "#/components/schemas/api__routes__etf_holdings__HistoryEntry"
            },
            "type": "array",
            "title": "Snapshots"
          }
        },
        "type": "object",
        "required": [
          "etf_ticker",
          "is_active_etf",
          "start_date",
          "end_date",
          "snapshots"
        ],
        "title": "ETFHistoryResponse"
      },
      "ETFHoldingItem": {
        "properties": {
          "raw_code": {
            "type": "string",
            "title": "Raw Code"
          },
          "constituent_ticker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Constituent Ticker"
          },
          "constituent_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Constituent Name",
            "description": "股票主檔名稱；對不到主檔時為投信回報的原始名稱"
          },
          "asset_type": {
            "type": "string",
            "title": "Asset Type"
          },
          "weight_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Weight Pct"
          },
          "quantity": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantity"
          },
          "quantity_unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantity Unit"
          },
          "current_close_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Close Price"
          },
          "baseline_close_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Baseline Close Price"
          },
          "price_delta": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Delta"
          },
          "price_change_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Change Pct"
          }
        },
        "type": "object",
        "required": [
          "raw_code",
          "asset_type"
        ],
        "title": "ETFHoldingItem"
      },
      "ETFHoldingsResponse": {
        "properties": {
          "etf_ticker": {
            "type": "string",
            "title": "Etf Ticker"
          },
          "etf_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Etf Name"
          },
          "is_active_etf": {
            "type": "boolean",
            "title": "Is Active Etf"
          },
          "as_of_date": {
            "type": "string",
            "format": "date",
            "title": "As Of Date"
          },
          "holdings": {
            "items": {
              "$ref": "#/components/schemas/ETFHoldingItem"
            },
            "type": "array",
            "title": "Holdings"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "etf_ticker",
          "is_active_etf",
          "as_of_date",
          "holdings",
          "total"
        ],
        "title": "ETFHoldingsResponse"
      },
      "ETFPerformanceItem": {
        "properties": {
          "etf_ticker": {
            "type": "string",
            "title": "Etf Ticker"
          },
          "etf_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Etf Name"
          },
          "is_active_etf": {
            "type": "boolean",
            "title": "Is Active Etf"
          },
          "market": {
            "type": "string",
            "title": "Market"
          },
          "baseline_date": {
            "type": "string",
            "format": "date",
            "title": "Baseline Date"
          },
          "baseline_close_price": {
            "type": "number",
            "title": "Baseline Close Price"
          },
          "current_date": {
            "type": "string",
            "format": "date",
            "title": "Current Date"
          },
          "current_close_price": {
            "type": "number",
            "title": "Current Close Price"
          },
          "price_delta": {
            "type": "number",
            "title": "Price Delta"
          },
          "price_change_pct": {
            "type": "number",
            "title": "Price Change Pct"
          }
        },
        "type": "object",
        "required": [
          "etf_ticker",
          "is_active_etf",
          "market",
          "baseline_date",
          "baseline_close_price",
          "current_date",
          "current_close_price",
          "price_delta",
          "price_change_pct"
        ],
        "title": "ETFPerformanceItem"
      },
      "ETFPerformancePeriod": {
        "type": "string",
        "enum": [
          "day",
          "week",
          "month",
          "q",
          "year"
        ],
        "title": "ETFPerformancePeriod"
      },
      "ETFPerformanceResponse": {
        "properties": {
          "period": {
            "$ref": "#/components/schemas/ETFPerformancePeriod"
          },
          "is_active_filter": {
            "type": "boolean",
            "title": "Is Active Filter"
          },
          "window_start": {
            "type": "string",
            "format": "date",
            "title": "Window Start"
          },
          "window_end": {
            "type": "string",
            "format": "date",
            "title": "Window End"
          },
          "price_start_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Start Date"
          },
          "effective_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effective Date"
          },
          "requested_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requested Date"
          },
          "is_fallback": {
            "type": "boolean",
            "title": "Is Fallback",
            "default": false
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "etfs": {
            "items": {
              "$ref": "#/components/schemas/ETFPerformanceItem"
            },
            "type": "array",
            "title": "Etfs"
          }
        },
        "type": "object",
        "required": [
          "period",
          "is_active_filter",
          "window_start",
          "window_end",
          "price_start_date",
          "effective_date",
          "total",
          "etfs"
        ],
        "title": "ETFPerformanceResponse"
      },
      "ETFRecapItem": {
        "properties": {
          "etf_ticker": {
            "type": "string",
            "title": "Etf Ticker"
          },
          "etf_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Etf Name"
          },
          "is_active_etf": {
            "type": "boolean",
            "title": "Is Active Etf"
          },
          "as_of_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "As Of Date"
          },
          "previous_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Date"
          },
          "current_close_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Close Price"
          },
          "baseline_close_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Baseline Close Price"
          },
          "price_delta": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Delta"
          },
          "price_change_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Change Pct"
          },
          "added": {
            "items": {
              "$ref": "#/components/schemas/HoldingChange"
            },
            "type": "array",
            "title": "Added"
          },
          "removed": {
            "items": {
              "$ref": "#/components/schemas/HoldingChange"
            },
            "type": "array",
            "title": "Removed"
          },
          "quantity_changes": {
            "items": {
              "$ref": "#/components/schemas/HoldingChange"
            },
            "type": "array",
            "title": "Quantity Changes"
          }
        },
        "type": "object",
        "required": [
          "etf_ticker",
          "is_active_etf",
          "added",
          "removed",
          "quantity_changes"
        ],
        "title": "ETFRecapItem"
      },
      "ETFRecentChangesResponse": {
        "properties": {
          "etf_ticker": {
            "type": "string",
            "title": "Etf Ticker"
          },
          "etf_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Etf Name"
          },
          "is_active_etf": {
            "type": "boolean",
            "title": "Is Active Etf"
          },
          "days_requested": {
            "type": "integer",
            "title": "Days Requested"
          },
          "days_returned": {
            "type": "integer",
            "title": "Days Returned"
          },
          "start_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Date"
          },
          "end_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Date"
          },
          "current_close_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Close Price"
          },
          "baseline_close_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Baseline Close Price"
          },
          "price_delta": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Delta"
          },
          "price_change_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Change Pct"
          },
          "stocks": {
            "items": {
              "$ref": "#/components/schemas/StockActionTimeline"
            },
            "type": "array",
            "title": "Stocks"
          }
        },
        "type": "object",
        "required": [
          "etf_ticker",
          "is_active_etf",
          "days_requested",
          "days_returned",
          "stocks"
        ],
        "title": "ETFRecentChangesResponse"
      },
      "ETFStockActionDailyDetail": {
        "properties": {
          "etf_ticker": {
            "type": "string",
            "title": "Etf Ticker"
          },
          "etf_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Etf Name"
          },
          "is_active_etf": {
            "type": "boolean",
            "title": "Is Active Etf"
          },
          "change_type": {
            "type": "string",
            "title": "Change Type"
          },
          "prev_quantity": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prev Quantity"
          },
          "curr_quantity": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Curr Quantity"
          },
          "quantity_delta": {
            "type": "number",
            "title": "Quantity Delta"
          },
          "prev_weight_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prev Weight Pct"
          },
          "curr_weight_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Curr Weight Pct"
          },
          "weight_delta_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Weight Delta Pct"
          },
          "current_close_price": {
            "type": "number",
            "title": "Current Close Price"
          },
          "amount": {
            "type": "number",
            "title": "Amount"
          },
          "daily_actions": {
            "items": {
              "$ref": "#/components/schemas/StockDailyAction"
            },
            "type": "array",
            "title": "Daily Actions"
          }
        },
        "type": "object",
        "required": [
          "etf_ticker",
          "is_active_etf",
          "change_type",
          "quantity_delta",
          "current_close_price",
          "amount"
        ],
        "title": "ETFStockActionDailyDetail",
        "description": "One ETF's window-aggregated action for a stock, plus its day-by-day path.\n\n``daily_actions`` decomposes the aggregate (``prev_quantity`` →\n``curr_quantity``) into the individual snapshot-to-snapshot moves inside\n``[window_start, window_end]``. For the day period the list holds at most one\nentry, which restates the aggregate."
      },
      "ETFStockActionDetail": {
        "properties": {
          "etf_ticker": {
            "type": "string",
            "title": "Etf Ticker"
          },
          "etf_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Etf Name"
          },
          "is_active_etf": {
            "type": "boolean",
            "title": "Is Active Etf"
          },
          "change_type": {
            "type": "string",
            "title": "Change Type"
          },
          "prev_quantity": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prev Quantity"
          },
          "curr_quantity": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Curr Quantity"
          },
          "quantity_delta": {
            "type": "number",
            "title": "Quantity Delta"
          },
          "prev_weight_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prev Weight Pct"
          },
          "curr_weight_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Curr Weight Pct"
          },
          "weight_delta_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Weight Delta Pct"
          },
          "current_close_price": {
            "type": "number",
            "title": "Current Close Price"
          },
          "amount": {
            "type": "number",
            "title": "Amount"
          }
        },
        "type": "object",
        "required": [
          "etf_ticker",
          "is_active_etf",
          "change_type",
          "quantity_delta",
          "current_close_price",
          "amount"
        ],
        "title": "ETFStockActionDetail"
      },
      "ETFStockActionRankingItem": {
        "properties": {
          "rank": {
            "type": "integer",
            "title": "Rank"
          },
          "side": {
            "type": "string",
            "title": "Side"
          },
          "raw_code": {
            "type": "string",
            "title": "Raw Code"
          },
          "constituent_ticker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Constituent Ticker"
          },
          "constituent_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Constituent Name",
            "description": "股票主檔名稱；對不到主檔時為投信回報的原始名稱"
          },
          "asset_type": {
            "type": "string",
            "title": "Asset Type"
          },
          "amount": {
            "type": "number",
            "title": "Amount"
          },
          "quantity_delta": {
            "type": "number",
            "title": "Quantity Delta"
          },
          "current_close_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Close Price"
          },
          "etf_count": {
            "type": "integer",
            "title": "Etf Count"
          },
          "actions": {
            "items": {
              "$ref": "#/components/schemas/ETFStockActionDetail"
            },
            "type": "array",
            "title": "Actions"
          }
        },
        "type": "object",
        "required": [
          "rank",
          "side",
          "raw_code",
          "asset_type",
          "amount",
          "quantity_delta",
          "etf_count",
          "actions"
        ],
        "title": "ETFStockActionRankingItem"
      },
      "ETFStockActionRankingResponse": {
        "properties": {
          "period": {
            "$ref": "#/components/schemas/ETFPerformancePeriod"
          },
          "window_start": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Window Start"
          },
          "window_end": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Window End"
          },
          "effective_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effective Date"
          },
          "previous_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Date"
          },
          "requested_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requested Date"
          },
          "is_fallback": {
            "type": "boolean",
            "title": "Is Fallback"
          },
          "is_active_filter": {
            "type": "boolean",
            "title": "Is Active Filter"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "summary": {
            "$ref": "#/components/schemas/ETFStockActionRankingSummary"
          },
          "stale_etfs": {
            "items": {
              "$ref": "#/components/schemas/StaleETF"
            },
            "type": "array",
            "title": "Stale Etfs"
          },
          "buy_rankings": {
            "items": {
              "$ref": "#/components/schemas/ETFStockActionRankingItem"
            },
            "type": "array",
            "title": "Buy Rankings"
          },
          "sell_rankings": {
            "items": {
              "$ref": "#/components/schemas/ETFStockActionRankingItem"
            },
            "type": "array",
            "title": "Sell Rankings"
          }
        },
        "type": "object",
        "required": [
          "period",
          "is_fallback",
          "is_active_filter",
          "limit",
          "summary",
          "buy_rankings",
          "sell_rankings"
        ],
        "title": "ETFStockActionRankingResponse"
      },
      "ETFStockActionRankingSummary": {
        "properties": {
          "total_etfs": {
            "type": "integer",
            "title": "Total Etfs"
          },
          "etfs_with_changes": {
            "type": "integer",
            "title": "Etfs With Changes"
          },
          "buy_action_count": {
            "type": "integer",
            "title": "Buy Action Count"
          },
          "sell_action_count": {
            "type": "integer",
            "title": "Sell Action Count"
          },
          "buy_ranked_count": {
            "type": "integer",
            "title": "Buy Ranked Count"
          },
          "sell_ranked_count": {
            "type": "integer",
            "title": "Sell Ranked Count"
          },
          "excluded_missing_quantity_count": {
            "type": "integer",
            "title": "Excluded Missing Quantity Count"
          },
          "excluded_missing_price_count": {
            "type": "integer",
            "title": "Excluded Missing Price Count"
          },
          "excluded_non_stock_count": {
            "type": "integer",
            "title": "Excluded Non Stock Count"
          }
        },
        "type": "object",
        "required": [
          "total_etfs",
          "etfs_with_changes",
          "buy_action_count",
          "sell_action_count",
          "buy_ranked_count",
          "sell_ranked_count",
          "excluded_missing_quantity_count",
          "excluded_missing_price_count",
          "excluded_non_stock_count"
        ],
        "title": "ETFStockActionRankingSummary"
      },
      "ETFStockActionStockDetailResponse": {
        "properties": {
          "raw_code": {
            "type": "string",
            "title": "Raw Code"
          },
          "constituent_ticker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Constituent Ticker"
          },
          "constituent_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Constituent Name",
            "description": "股票主檔名稱；對不到主檔時為投信回報的原始名稱"
          },
          "asset_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Asset Type"
          },
          "period": {
            "$ref": "#/components/schemas/ETFPerformancePeriod"
          },
          "window_start": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Window Start"
          },
          "window_end": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Window End"
          },
          "effective_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effective Date"
          },
          "previous_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Date"
          },
          "requested_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requested Date"
          },
          "is_fallback": {
            "type": "boolean",
            "title": "Is Fallback"
          },
          "is_active_filter": {
            "type": "boolean",
            "title": "Is Active Filter"
          },
          "buy_amount": {
            "type": "number",
            "title": "Buy Amount"
          },
          "sell_amount": {
            "type": "number",
            "title": "Sell Amount"
          },
          "buy_etf_count": {
            "type": "integer",
            "title": "Buy Etf Count"
          },
          "sell_etf_count": {
            "type": "integer",
            "title": "Sell Etf Count"
          },
          "excluded_missing_quantity_count": {
            "type": "integer",
            "title": "Excluded Missing Quantity Count",
            "default": 0
          },
          "excluded_missing_price_count": {
            "type": "integer",
            "title": "Excluded Missing Price Count",
            "default": 0
          },
          "stale_etfs": {
            "items": {
              "$ref": "#/components/schemas/StaleETF"
            },
            "type": "array",
            "title": "Stale Etfs"
          },
          "buy_actions": {
            "items": {
              "$ref": "#/components/schemas/ETFStockActionDailyDetail"
            },
            "type": "array",
            "title": "Buy Actions"
          },
          "sell_actions": {
            "items": {
              "$ref": "#/components/schemas/ETFStockActionDailyDetail"
            },
            "type": "array",
            "title": "Sell Actions"
          }
        },
        "type": "object",
        "required": [
          "raw_code",
          "period",
          "is_fallback",
          "is_active_filter",
          "buy_amount",
          "sell_amount",
          "buy_etf_count",
          "sell_etf_count",
          "buy_actions",
          "sell_actions"
        ],
        "title": "ETFStockActionStockDetailResponse",
        "description": "Stock-major detail: every ETF that bought or sold one stock in a window."
      },
      "EndpointQuality": {
        "properties": {
          "method": {
            "type": "string",
            "title": "Method"
          },
          "path": {
            "type": "string",
            "title": "Path"
          },
          "request_count": {
            "type": "integer",
            "title": "Request Count"
          },
          "server_error_count": {
            "type": "integer",
            "title": "Server Error Count"
          },
          "incomplete_count": {
            "type": "integer",
            "title": "Incomplete Count"
          },
          "server_error_rate_percent": {
            "type": "number",
            "title": "Server Error Rate Percent"
          },
          "avg_latency_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avg Latency Ms"
          },
          "p95_latency_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "P95 Latency Ms"
          }
        },
        "type": "object",
        "required": [
          "method",
          "path",
          "request_count",
          "server_error_count",
          "incomplete_count",
          "server_error_rate_percent",
          "avg_latency_ms",
          "p95_latency_ms"
        ],
        "title": "EndpointQuality"
      },
      "EntityMentionResponse": {
        "properties": {
          "entity_name": {
            "type": "string",
            "title": "Entity Name"
          },
          "entity_type": {
            "type": "string",
            "title": "Entity Type"
          },
          "rel_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rel Type"
          },
          "source_section": {
            "type": "string",
            "title": "Source Section"
          },
          "mention_count": {
            "type": "integer",
            "title": "Mention Count",
            "default": 1
          }
        },
        "type": "object",
        "required": [
          "entity_name",
          "entity_type",
          "source_section"
        ],
        "title": "EntityMentionResponse",
        "description": "An entity mention (technology/material/application)."
      },
      "ErrorDetail": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "details": {
            "additionalProperties": true,
            "type": "object",
            "title": "Details"
          }
        },
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "title": "ErrorDetail"
      },
      "ErrorResponse": {
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorDetail"
          }
        },
        "type": "object",
        "required": [
          "error"
        ],
        "title": "ErrorResponse"
      },
      "EvidenceItem": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text"
          },
          "evidence": {
            "type": "string",
            "title": "Evidence"
          }
        },
        "type": "object",
        "required": [
          "text",
          "evidence"
        ],
        "title": "EvidenceItem",
        "description": "Structured evidence item for key_points/risks/recommendations.\n\nevidence format: 'field=value; field=value' (enforced via prompts)."
      },
      "ExDividendPart": {
        "properties": {
          "cash_dividend": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cash Dividend"
          },
          "cash_yield": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cash Yield"
          },
          "fill_status": {
            "type": "string",
            "title": "Fill Status"
          }
        },
        "type": "object",
        "required": [
          "fill_status"
        ],
        "title": "ExDividendPart",
        "description": "除息 (cash) component of an event."
      },
      "ExRightsPart": {
        "properties": {
          "stock_dividend": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stock Dividend"
          },
          "subscription_ratio": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subscription Ratio"
          },
          "subscription_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subscription Price"
          },
          "fill_status": {
            "type": "string",
            "title": "Fill Status"
          }
        },
        "type": "object",
        "required": [
          "fill_status"
        ],
        "title": "ExRightsPart",
        "description": "除權 (stock) component of an event.\n\nA cash capital increase (現金增資) carries subscription_ratio/price with\nstock_dividend 0; subscription_ratio > 0 identifies the 現金增資 component."
      },
      "ExactStorySetOverview": {
        "properties": {
          "story_set_hash": {
            "type": "string",
            "title": "Story Set Hash"
          },
          "story_count": {
            "type": "integer",
            "title": "Story Count"
          },
          "story_keys": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Story Keys"
          },
          "horizons": {
            "items": {
              "$ref": "#/components/schemas/StoryHorizonMetrics"
            },
            "type": "array",
            "title": "Horizons"
          }
        },
        "type": "object",
        "required": [
          "story_set_hash",
          "story_count",
          "story_keys"
        ],
        "title": "ExactStorySetOverview"
      },
      "ExecutionDetailResponse": {
        "properties": {
          "execution": {
            "$ref": "#/components/schemas/ExecutionSummaryResponse"
          },
          "agent_summaries": {
            "items": {
              "$ref": "#/components/schemas/AgentSummaryItem"
            },
            "type": "array",
            "title": "Agent Summaries"
          },
          "calls": {
            "items": {
              "$ref": "#/components/schemas/LlmCallResponse"
            },
            "type": "array",
            "title": "Calls"
          }
        },
        "type": "object",
        "required": [
          "execution"
        ],
        "title": "ExecutionDetailResponse",
        "description": "Full execution detail with agent summaries and calls."
      },
      "ExecutionListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ExecutionSummaryResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total"
        ],
        "title": "ExecutionListResponse",
        "description": "Paginated execution list."
      },
      "ExecutionSummaryBreakdown": {
        "properties": {
          "execution_total": {
            "additionalProperties": true,
            "type": "object",
            "title": "Execution Total"
          },
          "per_agent": {
            "items": {
              "$ref": "#/components/schemas/AgentTokenItem"
            },
            "type": "array",
            "title": "Per Agent"
          },
          "per_stage": {
            "items": {
              "$ref": "#/components/schemas/StageTokenItem"
            },
            "type": "array",
            "title": "Per Stage"
          },
          "per_iteration": {
            "items": {
              "$ref": "#/components/schemas/IterationTokenItem"
            },
            "type": "array",
            "title": "Per Iteration"
          }
        },
        "type": "object",
        "required": [
          "execution_total",
          "per_agent",
          "per_stage",
          "per_iteration"
        ],
        "title": "ExecutionSummaryBreakdown",
        "description": "Token breakdown summary response."
      },
      "ExecutionSummaryResponse": {
        "properties": {
          "execution_id": {
            "type": "string",
            "title": "Execution Id"
          },
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "title": "Started At"
          },
          "ended_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ended At"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "activated_agents": {
            "items": {},
            "type": "array",
            "title": "Activated Agents"
          },
          "total_tokens": {
            "type": "integer",
            "title": "Total Tokens",
            "default": 0
          },
          "total_input_tokens": {
            "type": "integer",
            "title": "Total Input Tokens",
            "default": 0
          },
          "total_output_tokens": {
            "type": "integer",
            "title": "Total Output Tokens",
            "default": 0
          },
          "llm_call_count": {
            "type": "integer",
            "title": "Llm Call Count",
            "default": 0
          },
          "agent_count": {
            "type": "integer",
            "title": "Agent Count",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "execution_id",
          "ticker",
          "started_at",
          "status"
        ],
        "title": "ExecutionSummaryResponse",
        "description": "Execution summary for list views."
      },
      "ExportNotionRequest": {
        "properties": {
          "category": {
            "$ref": "#/components/schemas/NotionCategory"
          }
        },
        "type": "object",
        "required": [
          "category"
        ],
        "title": "ExportNotionRequest",
        "description": "Request to export feedback to Notion."
      },
      "FeedbackCreateRequest": {
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "title": "Title"
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "title": "Description"
          }
        },
        "type": "object",
        "required": [
          "title",
          "description"
        ],
        "title": "FeedbackCreateRequest",
        "description": "Schema for submitting feedback."
      },
      "FeedbackCreateResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "status": {
            "type": "string",
            "title": "Status"
          }
        },
        "type": "object",
        "required": [
          "id",
          "title",
          "status"
        ],
        "title": "FeedbackCreateResponse",
        "description": "Response after creating feedback."
      },
      "FeedbackItemResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "title",
          "description",
          "status",
          "created_at"
        ],
        "title": "FeedbackItemResponse",
        "description": "Single feedback item visible to the user."
      },
      "FeedbackListResponse": {
        "properties": {
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/FeedbackItemResponse"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "total",
          "page",
          "page_size",
          "items"
        ],
        "title": "FeedbackListResponse",
        "description": "Paginated feedback list."
      },
      "FeedbackStatus": {
        "type": "string",
        "enum": [
          "pending",
          "acknowledged",
          "resolved",
          "ignored"
        ],
        "title": "FeedbackStatus",
        "description": "Allowed domain status values."
      },
      "FinancialRecapResult": {
        "properties": {
          "trade_date": {
            "type": "string",
            "title": "Trade Date"
          },
          "headline": {
            "type": "string",
            "title": "Headline"
          },
          "market_summary": {
            "type": "string",
            "title": "Market Summary"
          },
          "growth_summary": {
            "type": "string",
            "title": "Growth Summary"
          },
          "valuation_summary": {
            "type": "string",
            "title": "Valuation Summary"
          },
          "industry_summary": {
            "type": "string",
            "title": "Industry Summary"
          },
          "stock_summary": {
            "type": "string",
            "title": "Stock Summary"
          },
          "risk_summary": {
            "type": "string",
            "title": "Risk Summary",
            "default": ""
          },
          "risks": {
            "items": {
              "$ref": "#/components/schemas/EvidenceItem"
            },
            "type": "array",
            "title": "Risks"
          },
          "period_type": {
            "type": "string",
            "const": "daily",
            "title": "Period Type",
            "default": "daily"
          },
          "period_start_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Period Start Date"
          },
          "period_end_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Period End Date"
          },
          "period_summary": {
            "type": "string",
            "title": "Period Summary",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "trade_date",
          "headline",
          "market_summary",
          "growth_summary",
          "valuation_summary",
          "industry_summary",
          "stock_summary"
        ],
        "title": "FinancialRecapResult",
        "description": "Daily market-level financial recap LLM result."
      },
      "FinancialSignalSummary": {
        "properties": {
          "trading_date": {
            "type": "string",
            "title": "Trading Date"
          },
          "bias": {
            "type": "string",
            "title": "Bias"
          },
          "confidence": {
            "type": "number",
            "title": "Confidence"
          },
          "growth_signal": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Growth Signal"
          },
          "valuation_regime": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valuation Regime"
          },
          "matrix_position": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Matrix Position"
          },
          "story_type": {
            "type": "string",
            "title": "Story Type"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "story_reasons": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Story Reasons"
          },
          "action_hints": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Action Hints"
          },
          "reasons": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Reasons"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings"
          },
          "signals": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Signals"
          },
          "events": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Events"
          },
          "stories": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Stories"
          },
          "relations": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Relations"
          }
        },
        "type": "object",
        "required": [
          "trading_date",
          "bias",
          "confidence",
          "story_type",
          "role",
          "story_reasons",
          "action_hints",
          "reasons",
          "warnings"
        ],
        "title": "FinancialSignalSummary",
        "description": "Financial dimension signal summary."
      },
      "FlowSignal": {
        "properties": {
          "current": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current"
          },
          "previous": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous"
          },
          "change": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change"
          },
          "change_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change Pct"
          },
          "direction": {
            "type": "string",
            "enum": [
              "increase",
              "decrease",
              "flat",
              "unknown"
            ],
            "title": "Direction"
          },
          "magnitude": {
            "type": "string",
            "enum": [
              "large",
              "medium",
              "small",
              "none"
            ],
            "title": "Magnitude"
          },
          "flow_zscore": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Flow Zscore"
          },
          "comparison_period": {
            "type": "string",
            "enum": [
              "daily_balance",
              "daily_flow",
              "weekly"
            ],
            "title": "Comparison Period"
          }
        },
        "type": "object",
        "required": [
          "direction",
          "magnitude",
          "comparison_period"
        ],
        "title": "FlowSignal"
      },
      "GenerateThemeRequest": {
        "properties": {
          "theme": {
            "type": "string",
            "minLength": 1,
            "title": "Theme"
          },
          "market": {
            "type": "string",
            "minLength": 1,
            "title": "Market",
            "default": "taiwan"
          },
          "source": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "coverage_rag",
                  "web",
                  "coverage_rag_then_web"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          },
          "max_members": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Members"
          },
          "publish": {
            "type": "boolean",
            "title": "Publish",
            "default": false
          },
          "rebuild_after_publish": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rebuild After Publish"
          },
          "sync_db_after_rebuild": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sync Db After Rebuild"
          }
        },
        "type": "object",
        "required": [
          "theme"
        ],
        "title": "GenerateThemeRequest",
        "description": "Request to generate a draft theme analysis."
      },
      "GoogleVerifyTokenRequest": {
        "properties": {
          "id_token": {
            "type": "string",
            "maxLength": 8192,
            "minLength": 1,
            "title": "Id Token",
            "description": "Google-signed id_token JWT from Google Sign-In SDK"
          }
        },
        "type": "object",
        "required": [
          "id_token"
        ],
        "title": "GoogleVerifyTokenRequest",
        "description": "Google id_token verification request (mobile apps)."
      },
      "GovernmentBankDetailRow": {
        "properties": {
          "trade_date": {
            "type": "string",
            "format": "date",
            "title": "Trade Date"
          },
          "buy_shares": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Buy Shares"
          },
          "sell_shares": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sell Shares"
          },
          "net_shares": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Net Shares"
          },
          "buy_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Buy Value"
          },
          "sell_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sell Value"
          },
          "net_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Net Value"
          },
          "participant_id": {
            "type": "string",
            "title": "Participant Id"
          },
          "participant_name": {
            "type": "string",
            "title": "Participant Name"
          }
        },
        "type": "object",
        "required": [
          "trade_date",
          "buy_shares",
          "sell_shares",
          "net_shares",
          "buy_value",
          "sell_value",
          "net_value",
          "participant_id",
          "participant_name"
        ],
        "title": "GovernmentBankDetailRow",
        "description": "One bank's detail row for a trade date (1..8 per day, never padded)."
      },
      "GovernmentBankRankingItem": {
        "properties": {
          "rank": {
            "type": "integer",
            "title": "Rank"
          },
          "stock_code": {
            "type": "string",
            "title": "Stock Code"
          },
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "listing_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Listing Type"
          },
          "net_shares": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Net Shares"
          },
          "net_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Net Value"
          }
        },
        "type": "object",
        "required": [
          "rank",
          "stock_code",
          "ticker",
          "name",
          "listing_type",
          "net_shares",
          "net_value"
        ],
        "title": "GovernmentBankRankingItem"
      },
      "GovernmentBankRankingResponse": {
        "properties": {
          "trade_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trade Date"
          },
          "side": {
            "type": "string",
            "enum": [
              "buy",
              "sell"
            ],
            "title": "Side"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/GovernmentBankRankingItem"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "trade_date",
          "side",
          "items"
        ],
        "title": "GovernmentBankRankingResponse"
      },
      "GovernmentBankStockResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "total": {
            "items": {
              "$ref": "#/components/schemas/GovernmentBankTotalRow"
            },
            "type": "array",
            "title": "Total"
          },
          "banks": {
            "items": {
              "$ref": "#/components/schemas/GovernmentBankDetailRow"
            },
            "type": "array",
            "title": "Banks"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "total",
          "banks"
        ],
        "title": "GovernmentBankStockResponse"
      },
      "GovernmentBankTotalRow": {
        "properties": {
          "trade_date": {
            "type": "string",
            "format": "date",
            "title": "Trade Date"
          },
          "buy_shares": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Buy Shares"
          },
          "sell_shares": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sell Shares"
          },
          "net_shares": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Net Shares"
          },
          "buy_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Buy Value"
          },
          "sell_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sell Value"
          },
          "net_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Net Value"
          }
        },
        "type": "object",
        "required": [
          "trade_date",
          "buy_shares",
          "sell_shares",
          "net_shares",
          "buy_value",
          "sell_value",
          "net_value"
        ],
        "title": "GovernmentBankTotalRow",
        "description": "One day's market-wide 八大行庫 total (participant_kind=government_bank_total)."
      },
      "GroupedInvestmentPerformanceResponse": {
        "properties": {
          "period": {
            "type": "string",
            "enum": [
              "all",
              "day",
              "week",
              "month",
              "quarter",
              "year"
            ],
            "title": "Period"
          },
          "value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Value"
          },
          "start_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Date"
          },
          "end_date": {
            "type": "string",
            "format": "date",
            "title": "End Date"
          },
          "valuation_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valuation Date"
          },
          "is_partial": {
            "type": "boolean",
            "title": "Is Partial"
          },
          "type": {
            "type": "string",
            "enum": [
              "Group",
              "ETF"
            ],
            "title": "Type"
          },
          "classification_basis": {
            "type": "string",
            "const": "current_metadata",
            "title": "Classification Basis",
            "default": "current_metadata"
          },
          "overall": {
            "$ref": "#/components/schemas/InvestmentMetricResponse"
          },
          "groups": {
            "items": {
              "$ref": "#/components/schemas/InvestmentPerformanceGroupResponse"
            },
            "type": "array",
            "title": "Groups"
          },
          "data_quality": {
            "$ref": "#/components/schemas/InvestmentDataQualityResponse"
          }
        },
        "type": "object",
        "required": [
          "period",
          "value",
          "start_date",
          "end_date",
          "valuation_date",
          "is_partial",
          "type",
          "overall",
          "groups",
          "data_quality"
        ],
        "title": "GroupedInvestmentPerformanceResponse"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "HealthStatus": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "timestamp": {
            "type": "string",
            "title": "Timestamp"
          },
          "database": {
            "type": "string",
            "title": "Database"
          },
          "services": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Services"
          }
        },
        "type": "object",
        "required": [
          "status",
          "timestamp",
          "database",
          "services"
        ],
        "title": "HealthStatus",
        "description": "Health check body, returned for both 200 and 503."
      },
      "HoldingAdvice": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "action": {
            "type": "string",
            "title": "Action"
          },
          "composite": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Composite"
          },
          "scores": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "object",
            "title": "Scores",
            "default": {}
          },
          "evidence": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Evidence",
            "default": []
          },
          "strategies": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Strategies",
            "default": []
          },
          "close": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Close"
          },
          "position_qty": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Position Qty"
          },
          "avg_buy_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avg Buy Price"
          },
          "unrealized_pnl_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unrealized Pnl Pct"
          },
          "drawdown_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Drawdown Pct"
          },
          "as_of": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "object",
            "title": "As Of",
            "default": {}
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "action"
        ],
        "title": "HoldingAdvice"
      },
      "HoldingChange": {
        "properties": {
          "raw_code": {
            "type": "string",
            "title": "Raw Code"
          },
          "constituent_ticker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Constituent Ticker"
          },
          "constituent_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Constituent Name",
            "description": "股票主檔名稱；對不到主檔時為投信回報的原始名稱"
          },
          "asset_type": {
            "type": "string",
            "title": "Asset Type"
          },
          "change_type": {
            "type": "string",
            "title": "Change Type"
          },
          "prev_quantity": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prev Quantity"
          },
          "curr_quantity": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Curr Quantity"
          },
          "prev_weight_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prev Weight Pct"
          },
          "curr_weight_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Curr Weight Pct"
          },
          "current_close_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Close Price"
          },
          "baseline_close_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Baseline Close Price"
          },
          "price_delta": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Delta"
          },
          "price_change_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Change Pct"
          }
        },
        "type": "object",
        "required": [
          "raw_code",
          "asset_type",
          "change_type"
        ],
        "title": "HoldingChange"
      },
      "ImportFromCoverageRequest": {
        "properties": {
          "themes": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Themes"
          },
          "dry_run": {
            "type": "boolean",
            "title": "Dry Run",
            "default": false
          }
        },
        "type": "object",
        "title": "ImportFromCoverageRequest",
        "description": "``themes`` omitted means every coverage page is considered."
      },
      "ImportFromCoverageResponse": {
        "properties": {
          "imported": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Imported"
          },
          "skipped": {
            "items": {
              "$ref": "#/components/schemas/SkippedTheme"
            },
            "type": "array",
            "title": "Skipped"
          },
          "available": {
            "type": "integer",
            "title": "Available"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings"
          },
          "dry_run": {
            "type": "boolean",
            "title": "Dry Run"
          }
        },
        "type": "object",
        "required": [
          "imported",
          "skipped",
          "available",
          "warnings",
          "dry_run"
        ],
        "title": "ImportFromCoverageResponse"
      },
      "IndicatorDataPoint": {
        "properties": {
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "title": "Timestamp"
          },
          "indicators": {
            "additionalProperties": true,
            "type": "object",
            "title": "Indicators"
          }
        },
        "type": "object",
        "required": [
          "timestamp",
          "indicators"
        ],
        "title": "IndicatorDataPoint",
        "description": "Single indicator data point with timestamp."
      },
      "IndicatorsParameterValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/IndicatorsValidationErrorItem"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "required": [
          "detail"
        ],
        "title": "IndicatorsParameterValidationError",
        "description": "FastAPI rejected a parameter's type or shape before the handler ran."
      },
      "IndicatorsRequestRejected": {
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorDetail"
          }
        },
        "type": "object",
        "required": [
          "error"
        ],
        "title": "IndicatorsRequestRejected",
        "description": "The route rejected the request itself: `fields` named an unknown group, or `fields` was non-blank but named no group at all (separator-only, e.g. `,,,`), or `days` was above the configured cap. An empty or whitespace `fields` is not rejected -- it means no filtering and answers 200."
      },
      "IndicatorsResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "timestamp": {
            "type": "string",
            "title": "Timestamp"
          },
          "trading_date": {
            "type": "string",
            "title": "Trading Date"
          },
          "indicators": {
            "additionalProperties": true,
            "type": "object",
            "title": "Indicators"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "timestamp",
          "trading_date",
          "indicators"
        ],
        "title": "IndicatorsResponse",
        "description": "Technical indicators response."
      },
      "IndicatorsSeriesResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "days": {
            "type": "integer",
            "title": "Days"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/IndicatorDataPoint"
            },
            "type": "array",
            "title": "Data"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "days",
          "total",
          "data"
        ],
        "title": "IndicatorsSeriesResponse",
        "description": "Historical indicator time series response."
      },
      "IndicatorsValidationErrorItem": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Loc"
          },
          "msg": {
            "type": "string",
            "title": "Msg"
          },
          "type": {
            "type": "string",
            "title": "Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ctx"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type",
          "input"
        ],
        "title": "IndicatorsValidationErrorItem",
        "description": "One entry of FastAPI's parameter-validation error array.\n\n`input` and `ctx` are what pydantic-core actually emits alongside the\nthree obvious fields -- `input` always, `ctx` for constraint failures such\nas `ge`. Declaring only loc/msg/type would undersell the wire shape, which\nis the same class of mistake this module's 422 declaration already made\nonce."
      },
      "InstitutionalActorAmountFlows": {
        "properties": {
          "investor_type": {
            "type": "string",
            "enum": [
              "foreign",
              "trust",
              "dealer",
              "total"
            ],
            "title": "Investor Type"
          },
          "investor_name": {
            "type": "string",
            "title": "Investor Name"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/InstitutionalAmountFlowItem"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "investor_type",
          "investor_name",
          "items"
        ],
        "title": "InstitutionalActorAmountFlows",
        "description": "Daily amount flows for one institutional actor."
      },
      "InstitutionalActorAmountRanking": {
        "properties": {
          "investor_type": {
            "type": "string",
            "enum": [
              "foreign",
              "trust",
              "dealer",
              "total"
            ],
            "title": "Investor Type"
          },
          "investor_name": {
            "type": "string",
            "title": "Investor Name"
          },
          "excluded_unpriced_tickers": {
            "type": "integer",
            "title": "Excluded Unpriced Tickers"
          },
          "buy": {
            "items": {
              "$ref": "#/components/schemas/InstitutionalAmountRankingItem"
            },
            "type": "array",
            "title": "Buy"
          },
          "sell": {
            "items": {
              "$ref": "#/components/schemas/InstitutionalAmountRankingItem"
            },
            "type": "array",
            "title": "Sell"
          }
        },
        "type": "object",
        "required": [
          "investor_type",
          "investor_name",
          "excluded_unpriced_tickers",
          "buy",
          "sell"
        ],
        "title": "InstitutionalActorAmountRanking",
        "description": "Buy and sell rankings for one institutional actor."
      },
      "InstitutionalAmountFlowItem": {
        "properties": {
          "trade_date": {
            "type": "string",
            "format": "date",
            "title": "Trade Date"
          },
          "direction": {
            "type": "string",
            "enum": [
              "buy",
              "sell",
              "neutral"
            ],
            "title": "Direction"
          },
          "buy_shares": {
            "type": "integer",
            "title": "Buy Shares"
          },
          "sell_shares": {
            "type": "integer",
            "title": "Sell Shares"
          },
          "net_shares": {
            "type": "integer",
            "title": "Net Shares"
          },
          "close_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Close Price"
          },
          "estimated_buy_amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estimated Buy Amount"
          },
          "estimated_sell_amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estimated Sell Amount"
          },
          "estimated_net_amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estimated Net Amount"
          },
          "amount_status": {
            "type": "string",
            "enum": [
              "available",
              "missing_close",
              "zero_flow"
            ],
            "title": "Amount Status"
          }
        },
        "type": "object",
        "required": [
          "trade_date",
          "direction",
          "buy_shares",
          "sell_shares",
          "net_shares",
          "close_price",
          "estimated_buy_amount",
          "estimated_sell_amount",
          "estimated_net_amount",
          "amount_status"
        ],
        "title": "InstitutionalAmountFlowItem",
        "description": "One institutional actor's estimated amount flow for a trading day."
      },
      "InstitutionalAmountFlowsResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "requested_days": {
            "type": "integer",
            "title": "Requested Days"
          },
          "actual_days": {
            "type": "integer",
            "title": "Actual Days"
          },
          "start_date": {
            "type": "string",
            "format": "date",
            "title": "Start Date"
          },
          "end_date": {
            "type": "string",
            "format": "date",
            "title": "End Date"
          },
          "investor_type": {
            "type": "string",
            "enum": [
              "all",
              "foreign",
              "trust",
              "dealer"
            ],
            "title": "Investor Type"
          },
          "currency": {
            "type": "string",
            "const": "TWD",
            "title": "Currency"
          },
          "amount_basis": {
            "type": "string",
            "const": "net_shares_x_daily_close",
            "title": "Amount Basis"
          },
          "actors": {
            "items": {
              "$ref": "#/components/schemas/InstitutionalActorAmountFlows"
            },
            "type": "array",
            "title": "Actors"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "name",
          "requested_days",
          "actual_days",
          "start_date",
          "end_date",
          "investor_type",
          "currency",
          "amount_basis",
          "actors"
        ],
        "title": "InstitutionalAmountFlowsResponse",
        "description": "Estimated institutional amount flows for one stock."
      },
      "InstitutionalAmountRankingItem": {
        "properties": {
          "rank": {
            "type": "integer",
            "title": "Rank"
          },
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "direction": {
            "type": "string",
            "enum": [
              "buy",
              "sell"
            ],
            "title": "Direction"
          },
          "net_shares": {
            "type": "integer",
            "title": "Net Shares"
          },
          "estimated_net_amount": {
            "type": "number",
            "title": "Estimated Net Amount"
          }
        },
        "type": "object",
        "required": [
          "rank",
          "ticker",
          "name",
          "direction",
          "net_shares",
          "estimated_net_amount"
        ],
        "title": "InstitutionalAmountRankingItem",
        "description": "One stock in an estimated institutional net-amount ranking."
      },
      "InstitutionalAmountRankingResponse": {
        "properties": {
          "requested_days": {
            "type": "integer",
            "title": "Requested Days"
          },
          "actual_days": {
            "type": "integer",
            "title": "Actual Days"
          },
          "start_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Date"
          },
          "end_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Date"
          },
          "investor_type": {
            "type": "string",
            "enum": [
              "all",
              "foreign",
              "trust",
              "dealer"
            ],
            "title": "Investor Type"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "currency": {
            "type": "string",
            "const": "TWD",
            "title": "Currency"
          },
          "amount_basis": {
            "type": "string",
            "const": "net_shares_x_daily_close",
            "title": "Amount Basis"
          },
          "rankings": {
            "items": {
              "$ref": "#/components/schemas/InstitutionalActorAmountRanking"
            },
            "type": "array",
            "title": "Rankings"
          },
          "data_status": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Data Status"
          }
        },
        "type": "object",
        "required": [
          "requested_days",
          "actual_days",
          "start_date",
          "end_date",
          "investor_type",
          "limit",
          "currency",
          "amount_basis",
          "rankings"
        ],
        "title": "InstitutionalAmountRankingResponse",
        "description": "Estimated institutional net-amount rankings over recent trading days."
      },
      "InstitutionalData": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "trade_date": {
            "type": "string",
            "format": "date",
            "title": "Trade Date"
          },
          "foreign_buy": {
            "type": "integer",
            "title": "Foreign Buy"
          },
          "foreign_sell": {
            "type": "integer",
            "title": "Foreign Sell"
          },
          "foreign_net": {
            "type": "integer",
            "title": "Foreign Net"
          },
          "trust_buy": {
            "type": "integer",
            "title": "Trust Buy"
          },
          "trust_sell": {
            "type": "integer",
            "title": "Trust Sell"
          },
          "trust_net": {
            "type": "integer",
            "title": "Trust Net"
          },
          "dealer_buy": {
            "type": "integer",
            "title": "Dealer Buy"
          },
          "dealer_sell": {
            "type": "integer",
            "title": "Dealer Sell"
          },
          "dealer_net": {
            "type": "integer",
            "title": "Dealer Net"
          },
          "total_net": {
            "type": "integer",
            "title": "Total Net"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "trade_date",
          "foreign_buy",
          "foreign_sell",
          "foreign_net",
          "trust_buy",
          "trust_sell",
          "trust_net",
          "dealer_buy",
          "dealer_sell",
          "dealer_net",
          "total_net"
        ],
        "title": "InstitutionalData",
        "description": "Institutional investor data for a single day."
      },
      "InstitutionalSummary": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "latest_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latest Date"
          },
          "foreign_net_today": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Foreign Net Today"
          },
          "trust_net_today": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trust Net Today"
          },
          "dealer_net_today": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dealer Net Today"
          },
          "total_net_today": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Net Today"
          },
          "foreign_net_5d": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Foreign Net 5D"
          },
          "trust_net_5d": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trust Net 5D"
          },
          "dealer_net_5d": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dealer Net 5D"
          },
          "total_net_5d": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Net 5D"
          },
          "foreign_net_20d": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Foreign Net 20D"
          },
          "trust_net_20d": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trust Net 20D"
          },
          "dealer_net_20d": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dealer Net 20D"
          },
          "total_net_20d": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Net 20D"
          },
          "foreign_streak_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Foreign Streak Days"
          },
          "trust_streak_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trust Streak Days"
          },
          "dealer_streak_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dealer Streak Days"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "name",
          "latest_date"
        ],
        "title": "InstitutionalSummary",
        "description": "Summary of institutional trading for a stock."
      },
      "IntegratedRecapResult": {
        "properties": {
          "trade_date": {
            "type": "string",
            "title": "Trade Date"
          },
          "headline": {
            "type": "string",
            "title": "Headline"
          },
          "market_summary": {
            "type": "string",
            "title": "Market Summary"
          },
          "technical_summary": {
            "type": "string",
            "title": "Technical Summary"
          },
          "chip_summary": {
            "type": "string",
            "title": "Chip Summary"
          },
          "financial_summary": {
            "type": "string",
            "title": "Financial Summary"
          },
          "alignment_summary": {
            "type": "string",
            "title": "Alignment Summary"
          },
          "risk_summary": {
            "type": "string",
            "title": "Risk Summary",
            "default": ""
          },
          "risks": {
            "items": {
              "$ref": "#/components/schemas/EvidenceItem"
            },
            "type": "array",
            "title": "Risks"
          },
          "period_type": {
            "type": "string",
            "const": "daily",
            "title": "Period Type",
            "default": "daily"
          },
          "period_start_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Period Start Date"
          },
          "period_end_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Period End Date"
          },
          "period_summary": {
            "type": "string",
            "title": "Period Summary",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "trade_date",
          "headline",
          "market_summary",
          "technical_summary",
          "chip_summary",
          "financial_summary",
          "alignment_summary"
        ],
        "title": "IntegratedRecapResult",
        "description": "Daily market recap combining technical, chip, and financial analyses."
      },
      "IntradayCandle": {
        "properties": {
          "time": {
            "type": "string",
            "format": "date-time",
            "title": "Time"
          },
          "open": {
            "type": "number",
            "title": "Open"
          },
          "high": {
            "type": "number",
            "title": "High"
          },
          "low": {
            "type": "number",
            "title": "Low"
          },
          "close": {
            "type": "number",
            "title": "Close"
          },
          "volume": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Volume"
          },
          "last_quote_time": {
            "type": "string",
            "format": "date-time",
            "title": "Last Quote Time"
          },
          "closed": {
            "type": "boolean",
            "title": "Closed"
          }
        },
        "type": "object",
        "required": [
          "time",
          "open",
          "high",
          "low",
          "close",
          "volume",
          "last_quote_time",
          "closed"
        ],
        "title": "IntradayCandle"
      },
      "IntradayOHLCResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "status": {
            "type": "string",
            "enum": [
              "available",
              "no_data"
            ],
            "title": "Status"
          },
          "trading_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trading Date"
          },
          "opening_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Opening Price"
          },
          "interval_seconds": {
            "type": "integer",
            "enum": [
              10,
              60,
              300
            ],
            "title": "Interval Seconds",
            "default": 300
          },
          "interval_minutes": {
            "anyOf": [
              {
                "type": "integer",
                "enum": [
                  1,
                  5
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Interval Minutes",
            "default": 5
          },
          "source": {
            "type": "string",
            "const": "quote_snapshots",
            "title": "Source",
            "default": "quote_snapshots"
          },
          "volume_unit": {
            "anyOf": [
              {
                "type": "string",
                "const": "lots"
              },
              {
                "type": "null"
              }
            ],
            "title": "Volume Unit",
            "default": "lots"
          },
          "candles": {
            "items": {
              "$ref": "#/components/schemas/IntradayCandle"
            },
            "type": "array",
            "title": "Candles"
          },
          "price_series": {
            "items": {
              "$ref": "#/components/schemas/IntradayPricePoint"
            },
            "type": "array",
            "title": "Price Series"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "status",
          "trading_date",
          "opening_price",
          "candles",
          "price_series"
        ],
        "title": "IntradayOHLCResponse"
      },
      "IntradayPricePoint": {
        "properties": {
          "time": {
            "type": "string",
            "format": "date-time",
            "title": "Time"
          },
          "price": {
            "type": "number",
            "title": "Price"
          }
        },
        "type": "object",
        "required": [
          "time",
          "price"
        ],
        "title": "IntradayPricePoint"
      },
      "InvestmentCalculationIssueResponse": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "count": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Count",
            "description": "Count unit depends on code: missing_price counts distinct tickers (equals len(tickers)); unmatched_sell counts sell transactions in this affected-metrics bucket; unattributed_cash_dividend counts cash-dividend transactions. Do not sum across codes as a record total."
          },
          "tickers": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tickers"
          },
          "affected_metrics": {
            "items": {
              "type": "string",
              "enum": [
                "regular_pnl",
                "day_trade_pnl",
                "cash_dividend",
                "expected_cash_dividend",
                "realized_total",
                "unrealized_pnl",
                "capital_employed",
                "opened_lots_count",
                "closed_lots_count",
                "total_pnl"
              ]
            },
            "type": "array",
            "minItems": 1,
            "title": "Affected Metrics"
          }
        },
        "type": "object",
        "required": [
          "code",
          "count",
          "tickers",
          "affected_metrics"
        ],
        "title": "InvestmentCalculationIssueResponse"
      },
      "InvestmentDataQualityResponse": {
        "properties": {
          "is_complete": {
            "type": "boolean",
            "title": "Is Complete"
          },
          "unmatched_sell_count": {
            "type": "integer",
            "title": "Unmatched Sell Count"
          },
          "unmatched_sell_tickers": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Unmatched Sell Tickers"
          },
          "missing_price_tickers": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Missing Price Tickers"
          },
          "dividend_basis": {
            "type": "string",
            "const": "ex_dividend_entitlement",
            "title": "Dividend Basis",
            "default": "ex_dividend_entitlement"
          },
          "dividend_history_complete": {
            "type": "boolean",
            "title": "Dividend History Complete",
            "description": "Deprecated compatibility flag; always true, not source completeness.",
            "deprecated": true
          },
          "dividend_missing_coverage": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Dividend Missing Coverage",
            "description": "Deprecated compatibility list; always empty.",
            "deprecated": true
          },
          "dividend_schedule_complete": {
            "type": "boolean",
            "title": "Dividend Schedule Complete",
            "description": "Deprecated compatibility flag; always true, not schedule freshness.",
            "deprecated": true
          },
          "dividend_schedule_missing_coverage": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Dividend Schedule Missing Coverage",
            "description": "Deprecated compatibility list; always empty.",
            "deprecated": true
          },
          "standalone_cash_dividend_count": {
            "type": "integer",
            "title": "Standalone Cash Dividend Count"
          },
          "unattributed_cash_dividend_count": {
            "type": "integer",
            "title": "Unattributed Cash Dividend Count"
          },
          "calculation_issues": {
            "items": {
              "$ref": "#/components/schemas/InvestmentCalculationIssueResponse"
            },
            "type": "array",
            "title": "Calculation Issues"
          },
          "classification_basis": {
            "anyOf": [
              {
                "type": "string",
                "const": "current_metadata"
              },
              {
                "type": "null"
              }
            ],
            "title": "Classification Basis"
          }
        },
        "type": "object",
        "required": [
          "is_complete",
          "unmatched_sell_count",
          "unmatched_sell_tickers",
          "missing_price_tickers",
          "dividend_history_complete",
          "dividend_missing_coverage",
          "dividend_schedule_complete",
          "dividend_schedule_missing_coverage",
          "standalone_cash_dividend_count",
          "unattributed_cash_dividend_count",
          "calculation_issues"
        ],
        "title": "InvestmentDataQualityResponse"
      },
      "InvestmentMetricResponse": {
        "properties": {
          "opened_lots_count": {
            "type": "integer",
            "title": "Opened Lots Count"
          },
          "closed_lots_count": {
            "type": "integer",
            "title": "Closed Lots Count"
          },
          "realized": {
            "$ref": "#/components/schemas/RealizedBreakdownResponse"
          },
          "expected_cash_dividend": {
            "type": "number",
            "title": "Expected Cash Dividend"
          },
          "unrealized_pnl": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unrealized Pnl"
          },
          "total_pnl": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Pnl"
          },
          "capital_employed": {
            "type": "number",
            "title": "Capital Employed"
          },
          "return_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Return Pct"
          },
          "equity_multiple": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Equity Multiple"
          },
          "data_quality": {
            "$ref": "#/components/schemas/InvestmentDataQualityResponse"
          }
        },
        "type": "object",
        "required": [
          "opened_lots_count",
          "closed_lots_count",
          "realized",
          "expected_cash_dividend",
          "unrealized_pnl",
          "total_pnl",
          "capital_employed",
          "return_pct",
          "equity_multiple",
          "data_quality"
        ],
        "title": "InvestmentMetricResponse"
      },
      "InvestmentPerformanceCapitalFlowItem": {
        "properties": {
          "item_type": {
            "type": "string",
            "const": "capital_flow",
            "title": "Item Type",
            "default": "capital_flow"
          },
          "date": {
            "type": "string",
            "format": "date",
            "title": "Date"
          },
          "transaction_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Transaction Ids"
          },
          "buy_outflow": {
            "type": "number",
            "title": "Buy Outflow"
          },
          "sell_proceeds": {
            "type": "number",
            "title": "Sell Proceeds"
          },
          "realized_dividend_inflow": {
            "type": "number",
            "title": "Realized Dividend Inflow"
          },
          "net_cash_flow": {
            "type": "number",
            "title": "Net Cash Flow"
          },
          "cumulative_cash_flow": {
            "type": "number",
            "title": "Cumulative Cash Flow"
          },
          "day_trade_open_cost_floor": {
            "type": "number",
            "title": "Day Trade Open Cost Floor"
          },
          "capital_required": {
            "type": "number",
            "title": "Capital Required"
          },
          "is_peak": {
            "type": "boolean",
            "title": "Is Peak"
          }
        },
        "type": "object",
        "required": [
          "date",
          "transaction_ids",
          "buy_outflow",
          "sell_proceeds",
          "realized_dividend_inflow",
          "net_cash_flow",
          "cumulative_cash_flow",
          "day_trade_open_cost_floor",
          "capital_required",
          "is_peak"
        ],
        "title": "InvestmentPerformanceCapitalFlowItem"
      },
      "InvestmentPerformanceClosureItem": {
        "properties": {
          "item_type": {
            "type": "string",
            "const": "closure",
            "title": "Item Type",
            "default": "closure"
          },
          "closure_id": {
            "type": "string",
            "title": "Closure Id"
          },
          "classification": {
            "type": "string",
            "enum": [
              "regular",
              "day_trade"
            ],
            "title": "Classification"
          },
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "quantity": {
            "type": "integer",
            "title": "Quantity"
          },
          "buy_transaction_id": {
            "type": "string",
            "title": "Buy Transaction Id"
          },
          "buy_date": {
            "type": "string",
            "format": "date",
            "title": "Buy Date"
          },
          "buy_price": {
            "type": "number",
            "title": "Buy Price"
          },
          "sell_transaction_id": {
            "type": "string",
            "title": "Sell Transaction Id"
          },
          "sell_date": {
            "type": "string",
            "format": "date",
            "title": "Sell Date"
          },
          "sell_price": {
            "type": "number",
            "title": "Sell Price"
          },
          "day_trade_pair_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Day Trade Pair Id"
          },
          "allocated_buy_gross": {
            "type": "number",
            "title": "Allocated Buy Gross"
          },
          "allocated_buy_fee": {
            "type": "number",
            "title": "Allocated Buy Fee"
          },
          "allocated_buy_tax": {
            "type": "number",
            "title": "Allocated Buy Tax"
          },
          "allocated_cost": {
            "type": "number",
            "title": "Allocated Cost"
          },
          "allocated_sell_gross": {
            "type": "number",
            "title": "Allocated Sell Gross"
          },
          "allocated_sell_fee": {
            "type": "number",
            "title": "Allocated Sell Fee"
          },
          "allocated_sell_tax": {
            "type": "number",
            "title": "Allocated Sell Tax"
          },
          "allocated_proceeds": {
            "type": "number",
            "title": "Allocated Proceeds"
          },
          "pnl": {
            "type": "number",
            "title": "Pnl"
          }
        },
        "type": "object",
        "required": [
          "closure_id",
          "classification",
          "ticker",
          "quantity",
          "buy_transaction_id",
          "buy_date",
          "buy_price",
          "sell_transaction_id",
          "sell_date",
          "sell_price",
          "day_trade_pair_id",
          "allocated_buy_gross",
          "allocated_buy_fee",
          "allocated_buy_tax",
          "allocated_cost",
          "allocated_sell_gross",
          "allocated_sell_fee",
          "allocated_sell_tax",
          "allocated_proceeds",
          "pnl"
        ],
        "title": "InvestmentPerformanceClosureItem"
      },
      "InvestmentPerformanceDetailsResponse": {
        "properties": {
          "window": {
            "$ref": "#/components/schemas/InvestmentPerformanceWindowResponse"
          },
          "scope": {
            "$ref": "#/components/schemas/InvestmentPerformanceScopeResponse"
          },
          "metric": {
            "type": "string",
            "enum": [
              "regular_pnl",
              "day_trade_pnl",
              "cash_dividend",
              "expected_cash_dividend",
              "realized_total",
              "unrealized_pnl",
              "capital_employed",
              "opened_lots_count",
              "closed_lots_count",
              "total_pnl"
            ],
            "title": "Metric"
          },
          "unit": {
            "type": "string",
            "enum": [
              "TWD",
              "count"
            ],
            "title": "Unit"
          },
          "value": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Value"
          },
          "reconciliation": {
            "$ref": "#/components/schemas/InvestmentPerformanceReconciliationResponse"
          },
          "pagination": {
            "$ref": "#/components/schemas/InvestmentPerformancePaginationResponse"
          },
          "items": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/InvestmentPerformanceClosureItem"
                },
                {
                  "$ref": "#/components/schemas/InvestmentPerformanceDividendItem"
                },
                {
                  "$ref": "#/components/schemas/InvestmentPerformanceLotItem"
                },
                {
                  "$ref": "#/components/schemas/InvestmentPerformanceCapitalFlowItem"
                }
              ]
            },
            "type": "array",
            "title": "Items"
          },
          "data_quality": {
            "$ref": "#/components/schemas/InvestmentDataQualityResponse"
          }
        },
        "type": "object",
        "required": [
          "window",
          "scope",
          "metric",
          "unit",
          "value",
          "reconciliation",
          "pagination",
          "items",
          "data_quality"
        ],
        "title": "InvestmentPerformanceDetailsResponse"
      },
      "InvestmentPerformanceDividendItem": {
        "properties": {
          "item_type": {
            "type": "string",
            "const": "dividend",
            "title": "Item Type",
            "default": "dividend"
          },
          "status": {
            "type": "string",
            "enum": [
              "realized",
              "expected"
            ],
            "title": "Status"
          },
          "attribution": {
            "type": "string",
            "enum": [
              "event",
              "standalone"
            ],
            "title": "Attribution"
          },
          "event_key": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DividendEventKeyResponse"
              },
              {
                "type": "null"
              }
            ]
          },
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "ex_dividend_date": {
            "type": "string",
            "format": "date",
            "title": "Ex Dividend Date"
          },
          "position_quantity": {
            "type": "integer",
            "title": "Position Quantity"
          },
          "per_share_dividend": {
            "type": "number",
            "title": "Per Share Dividend"
          },
          "amount": {
            "type": "number",
            "title": "Amount"
          },
          "source": {
            "type": "string",
            "title": "Source"
          },
          "explicit_override": {
            "type": "boolean",
            "title": "Explicit Override"
          },
          "transaction_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Transaction Ids"
          },
          "selected_entitlement_quantity": {
            "type": "integer",
            "title": "Selected Entitlement Quantity"
          },
          "total_entitlement_quantity": {
            "type": "integer",
            "title": "Total Entitlement Quantity"
          }
        },
        "type": "object",
        "required": [
          "status",
          "attribution",
          "event_key",
          "ticker",
          "ex_dividend_date",
          "position_quantity",
          "per_share_dividend",
          "amount",
          "source",
          "explicit_override",
          "transaction_ids",
          "selected_entitlement_quantity",
          "total_entitlement_quantity"
        ],
        "title": "InvestmentPerformanceDividendItem"
      },
      "InvestmentPerformanceGroupResponse": {
        "properties": {
          "opened_lots_count": {
            "type": "integer",
            "title": "Opened Lots Count"
          },
          "closed_lots_count": {
            "type": "integer",
            "title": "Closed Lots Count"
          },
          "realized": {
            "$ref": "#/components/schemas/RealizedBreakdownResponse"
          },
          "expected_cash_dividend": {
            "type": "number",
            "title": "Expected Cash Dividend"
          },
          "unrealized_pnl": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unrealized Pnl"
          },
          "total_pnl": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Pnl"
          },
          "capital_employed": {
            "type": "number",
            "title": "Capital Employed"
          },
          "return_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Return Pct"
          },
          "equity_multiple": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Equity Multiple"
          },
          "data_quality": {
            "$ref": "#/components/schemas/InvestmentDataQualityResponse"
          },
          "category": {
            "type": "string",
            "title": "Category"
          },
          "category_source": {
            "type": "string",
            "title": "Category Source"
          },
          "tickers": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tickers"
          }
        },
        "type": "object",
        "required": [
          "opened_lots_count",
          "closed_lots_count",
          "realized",
          "expected_cash_dividend",
          "unrealized_pnl",
          "total_pnl",
          "capital_employed",
          "return_pct",
          "equity_multiple",
          "data_quality",
          "category",
          "category_source",
          "tickers"
        ],
        "title": "InvestmentPerformanceGroupResponse"
      },
      "InvestmentPerformanceLotItem": {
        "properties": {
          "item_type": {
            "type": "string",
            "const": "lot",
            "title": "Item Type",
            "default": "lot"
          },
          "transaction_id": {
            "type": "string",
            "title": "Transaction Id"
          },
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "action": {
            "type": "string",
            "enum": [
              "buy",
              "stock_dividend"
            ],
            "title": "Action"
          },
          "opened_date": {
            "type": "string",
            "format": "date",
            "title": "Opened Date"
          },
          "original_quantity": {
            "type": "integer",
            "title": "Original Quantity"
          },
          "closed_quantity": {
            "type": "integer",
            "title": "Closed Quantity"
          },
          "remaining_quantity": {
            "type": "integer",
            "title": "Remaining Quantity"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "partial",
              "closed"
            ],
            "title": "Status"
          },
          "unit_cost": {
            "type": "number",
            "title": "Unit Cost"
          },
          "remaining_cost_basis": {
            "type": "number",
            "title": "Remaining Cost Basis"
          },
          "valuation_date": {
            "type": "string",
            "format": "date",
            "title": "Valuation Date"
          },
          "valuation_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valuation Price"
          },
          "market_value": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Market Value"
          },
          "unrealized_pnl": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unrealized Pnl"
          }
        },
        "type": "object",
        "required": [
          "transaction_id",
          "ticker",
          "action",
          "opened_date",
          "original_quantity",
          "closed_quantity",
          "remaining_quantity",
          "status",
          "unit_cost",
          "remaining_cost_basis",
          "valuation_date",
          "valuation_price",
          "market_value",
          "unrealized_pnl"
        ],
        "title": "InvestmentPerformanceLotItem"
      },
      "InvestmentPerformancePaginationResponse": {
        "properties": {
          "total_items": {
            "type": "integer",
            "title": "Total Items"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "has_more": {
            "type": "boolean",
            "title": "Has More"
          }
        },
        "type": "object",
        "required": [
          "total_items",
          "offset",
          "limit",
          "has_more"
        ],
        "title": "InvestmentPerformancePaginationResponse"
      },
      "InvestmentPerformancePoint": {
        "properties": {
          "period_start": {
            "type": "string",
            "format": "date",
            "title": "Period Start"
          },
          "period_end": {
            "type": "string",
            "format": "date",
            "title": "Period End"
          },
          "valuation_date": {
            "type": "string",
            "format": "date",
            "title": "Valuation Date"
          },
          "is_partial": {
            "type": "boolean",
            "title": "Is Partial"
          },
          "period": {
            "$ref": "#/components/schemas/InvestmentMetricResponse"
          },
          "cumulative": {
            "$ref": "#/components/schemas/InvestmentMetricResponse"
          },
          "data_quality": {
            "$ref": "#/components/schemas/InvestmentDataQualityResponse"
          }
        },
        "type": "object",
        "required": [
          "period_start",
          "period_end",
          "valuation_date",
          "is_partial",
          "period",
          "cumulative",
          "data_quality"
        ],
        "title": "InvestmentPerformancePoint"
      },
      "InvestmentPerformanceReconciliationResponse": {
        "properties": {
          "basis": {
            "type": "string",
            "enum": [
              "sum",
              "count",
              "max_capital_required"
            ],
            "title": "Basis"
          },
          "detail_value": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail Value"
          },
          "status": {
            "type": "string",
            "enum": [
              "matched",
              "incomplete",
              "mismatch"
            ],
            "title": "Status"
          }
        },
        "type": "object",
        "required": [
          "basis",
          "detail_value",
          "status"
        ],
        "title": "InvestmentPerformanceReconciliationResponse"
      },
      "InvestmentPerformanceResponse": {
        "properties": {
          "period": {
            "type": "string",
            "enum": [
              "all",
              "day",
              "week",
              "month",
              "quarter",
              "year"
            ],
            "title": "Period"
          },
          "value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Value"
          },
          "start_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Date"
          },
          "end_date": {
            "type": "string",
            "format": "date",
            "title": "End Date"
          },
          "valuation_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valuation Date"
          },
          "is_partial": {
            "type": "boolean",
            "title": "Is Partial"
          },
          "ticker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ticker"
          },
          "opened_lots_count": {
            "type": "integer",
            "title": "Opened Lots Count"
          },
          "closed_lots_count": {
            "type": "integer",
            "title": "Closed Lots Count"
          },
          "realized": {
            "$ref": "#/components/schemas/RealizedBreakdownResponse"
          },
          "expected_cash_dividend": {
            "type": "number",
            "title": "Expected Cash Dividend"
          },
          "unrealized_pnl": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unrealized Pnl"
          },
          "total_pnl": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Pnl"
          },
          "capital_employed": {
            "type": "number",
            "title": "Capital Employed"
          },
          "return_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Return Pct"
          },
          "equity_multiple": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Equity Multiple"
          },
          "data_quality": {
            "$ref": "#/components/schemas/InvestmentDataQualityResponse"
          }
        },
        "type": "object",
        "required": [
          "period",
          "value",
          "start_date",
          "end_date",
          "valuation_date",
          "is_partial",
          "ticker",
          "opened_lots_count",
          "closed_lots_count",
          "realized",
          "expected_cash_dividend",
          "unrealized_pnl",
          "total_pnl",
          "capital_employed",
          "return_pct",
          "equity_multiple",
          "data_quality"
        ],
        "title": "InvestmentPerformanceResponse"
      },
      "InvestmentPerformanceScopeResponse": {
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "overall",
              "ticker",
              "category"
            ],
            "title": "Kind"
          },
          "ticker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ticker"
          },
          "type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "Group",
                  "ETF"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Type"
          },
          "category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Category"
          },
          "category_source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Category Source"
          },
          "tickers": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tickers"
          }
        },
        "type": "object",
        "required": [
          "kind",
          "ticker",
          "type",
          "category",
          "category_source",
          "tickers"
        ],
        "title": "InvestmentPerformanceScopeResponse"
      },
      "InvestmentPerformanceSeries": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "label": {
            "type": "string",
            "title": "Label"
          },
          "category_source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Category Source"
          },
          "tickers": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tickers"
          },
          "points": {
            "items": {
              "$ref": "#/components/schemas/InvestmentPerformancePoint"
            },
            "type": "array",
            "title": "Points"
          }
        },
        "type": "object",
        "required": [
          "key",
          "label",
          "category_source",
          "tickers",
          "points"
        ],
        "title": "InvestmentPerformanceSeries"
      },
      "InvestmentPerformanceTimeseriesResponse": {
        "properties": {
          "start_date": {
            "type": "string",
            "format": "date",
            "title": "Start Date"
          },
          "end_date": {
            "type": "string",
            "format": "date",
            "title": "End Date"
          },
          "interval": {
            "type": "string",
            "enum": [
              "day",
              "week",
              "month",
              "quarter",
              "year"
            ],
            "title": "Interval"
          },
          "ticker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ticker"
          },
          "type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "Group",
                  "ETF"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Type"
          },
          "classification_basis": {
            "anyOf": [
              {
                "type": "string",
                "const": "current_metadata"
              },
              {
                "type": "null"
              }
            ],
            "title": "Classification Basis"
          },
          "series": {
            "items": {
              "$ref": "#/components/schemas/InvestmentPerformanceSeries"
            },
            "type": "array",
            "title": "Series"
          },
          "data_quality": {
            "$ref": "#/components/schemas/InvestmentDataQualityResponse"
          }
        },
        "type": "object",
        "required": [
          "start_date",
          "end_date",
          "interval",
          "ticker",
          "type",
          "classification_basis",
          "series",
          "data_quality"
        ],
        "title": "InvestmentPerformanceTimeseriesResponse"
      },
      "InvestmentPerformanceWindowResponse": {
        "properties": {
          "period": {
            "type": "string",
            "enum": [
              "all",
              "day",
              "week",
              "month",
              "quarter",
              "year"
            ],
            "title": "Period"
          },
          "value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Value"
          },
          "start_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Date"
          },
          "end_date": {
            "type": "string",
            "format": "date",
            "title": "End Date"
          },
          "valuation_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valuation Date"
          },
          "is_partial": {
            "type": "boolean",
            "title": "Is Partial"
          }
        },
        "type": "object",
        "required": [
          "period",
          "value",
          "start_date",
          "end_date",
          "valuation_date",
          "is_partial"
        ],
        "title": "InvestmentPerformanceWindowResponse"
      },
      "InvestmentSummary": {
        "properties": {
          "watchlist_group_count": {
            "type": "integer",
            "title": "Watchlist Group Count"
          },
          "watchlist_item_count": {
            "type": "integer",
            "title": "Watchlist Item Count"
          },
          "holding_count": {
            "type": "integer",
            "title": "Holding Count"
          },
          "transaction_count": {
            "type": "integer",
            "title": "Transaction Count"
          },
          "last_transaction_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Transaction At"
          }
        },
        "type": "object",
        "required": [
          "watchlist_group_count",
          "watchlist_item_count",
          "holding_count",
          "transaction_count"
        ],
        "title": "InvestmentSummary"
      },
      "IterationTokenItem": {
        "properties": {
          "call_count": {
            "type": "integer",
            "title": "Call Count"
          },
          "input_tokens": {
            "type": "integer",
            "title": "Input Tokens"
          },
          "output_tokens": {
            "type": "integer",
            "title": "Output Tokens"
          },
          "total_tokens": {
            "type": "integer",
            "title": "Total Tokens"
          },
          "agent_name": {
            "type": "string",
            "title": "Agent Name"
          },
          "vrr_iteration": {
            "type": "integer",
            "title": "Vrr Iteration"
          }
        },
        "type": "object",
        "required": [
          "call_count",
          "input_tokens",
          "output_tokens",
          "total_tokens",
          "agent_name",
          "vrr_iteration"
        ],
        "title": "IterationTokenItem",
        "description": "Per-VRR-iteration token breakdown."
      },
      "JobRunOut": {
        "properties": {
          "job_name": {
            "type": "string",
            "title": "Job Name"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "ended_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ended At"
          },
          "duration_seconds": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Seconds"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "tasks": {
            "items": {
              "$ref": "#/components/schemas/TaskRunOut"
            },
            "type": "array",
            "title": "Tasks",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "job_name",
          "status"
        ],
        "title": "JobRunOut"
      },
      "JobStatus": {
        "properties": {
          "job_id": {
            "type": "string",
            "title": "Job Id"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "completed",
              "failed"
            ],
            "title": "Status"
          },
          "progress": {
            "additionalProperties": true,
            "type": "object",
            "title": "Progress"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "estimated_completion": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estimated Completion"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          }
        },
        "type": "object",
        "required": [
          "job_id",
          "status",
          "progress"
        ],
        "title": "JobStatus",
        "description": "Job status."
      },
      "KeyLevels": {
        "properties": {
          "support": {
            "items": {
              "type": "number"
            },
            "type": "array",
            "title": "Support",
            "default": []
          },
          "resistance": {
            "items": {
              "type": "number"
            },
            "type": "array",
            "title": "Resistance",
            "default": []
          }
        },
        "type": "object",
        "title": "KeyLevels",
        "description": "Key price levels."
      },
      "LatestActiveETFRecapAnalysis": {
        "properties": {
          "market": {
            "type": "string",
            "title": "Market"
          },
          "trade_date": {
            "type": "string",
            "format": "date",
            "title": "Trade Date"
          },
          "period_type": {
            "type": "string",
            "const": "daily",
            "title": "Period Type"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Generated At"
          },
          "analysis_type": {
            "type": "string",
            "const": "active_etf",
            "title": "Analysis Type"
          },
          "analysis": {
            "$ref": "#/components/schemas/ActiveETFRecapResult"
          }
        },
        "type": "object",
        "required": [
          "market",
          "trade_date",
          "period_type",
          "generated_at",
          "analysis_type",
          "analysis"
        ],
        "title": "LatestActiveETFRecapAnalysis"
      },
      "LatestChipRecapAnalysis": {
        "properties": {
          "market": {
            "type": "string",
            "title": "Market"
          },
          "trade_date": {
            "type": "string",
            "format": "date",
            "title": "Trade Date"
          },
          "period_type": {
            "type": "string",
            "const": "daily",
            "title": "Period Type"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Generated At"
          },
          "analysis_type": {
            "type": "string",
            "const": "chip",
            "title": "Analysis Type"
          },
          "analysis": {
            "$ref": "#/components/schemas/ChipRecapResult"
          }
        },
        "type": "object",
        "required": [
          "market",
          "trade_date",
          "period_type",
          "generated_at",
          "analysis_type",
          "analysis"
        ],
        "title": "LatestChipRecapAnalysis"
      },
      "LatestDayTradingRankingResponse": {
        "properties": {
          "trade_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trade Date"
          },
          "previous_trade_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Trade Date"
          },
          "revision_stage": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revision Stage"
          },
          "is_final": {
            "type": "boolean",
            "title": "Is Final"
          },
          "ranking_metric": {
            "type": "string",
            "enum": [
              "day_trade_volume",
              "day_trade_ratio"
            ],
            "title": "Ranking Metric"
          },
          "market": {
            "type": "string",
            "enum": [
              "all",
              "TWSE",
              "TPEX"
            ],
            "title": "Market"
          },
          "security_type": {
            "type": "string",
            "enum": [
              "common",
              "all"
            ],
            "title": "Security Type"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          },
          "items": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/DayTradingRankingItem"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Items"
          },
          "sources": {
            "additionalProperties": true,
            "type": "object",
            "title": "Sources"
          },
          "analysis_status": {
            "type": "string",
            "title": "Analysis Status",
            "default": "available"
          }
        },
        "type": "object",
        "required": [
          "previous_trade_date",
          "is_final",
          "ranking_metric",
          "market",
          "security_type",
          "total",
          "items"
        ],
        "title": "LatestDayTradingRankingResponse"
      },
      "LatestFinancialRecapAnalysis": {
        "properties": {
          "market": {
            "type": "string",
            "title": "Market"
          },
          "trade_date": {
            "type": "string",
            "format": "date",
            "title": "Trade Date"
          },
          "period_type": {
            "type": "string",
            "const": "daily",
            "title": "Period Type"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Generated At"
          },
          "analysis_type": {
            "type": "string",
            "const": "financial",
            "title": "Analysis Type"
          },
          "analysis": {
            "$ref": "#/components/schemas/FinancialRecapResult"
          }
        },
        "type": "object",
        "required": [
          "market",
          "trade_date",
          "period_type",
          "generated_at",
          "analysis_type",
          "analysis"
        ],
        "title": "LatestFinancialRecapAnalysis"
      },
      "LatestIntegratedRecapAnalysis": {
        "properties": {
          "market": {
            "type": "string",
            "title": "Market"
          },
          "trade_date": {
            "type": "string",
            "format": "date",
            "title": "Trade Date"
          },
          "period_type": {
            "type": "string",
            "const": "daily",
            "title": "Period Type"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Generated At"
          },
          "analysis_type": {
            "type": "string",
            "const": "integrated",
            "title": "Analysis Type"
          },
          "analysis": {
            "$ref": "#/components/schemas/IntegratedRecapResult"
          }
        },
        "type": "object",
        "required": [
          "market",
          "trade_date",
          "period_type",
          "generated_at",
          "analysis_type",
          "analysis"
        ],
        "title": "LatestIntegratedRecapAnalysis"
      },
      "LatestOHLC": {
        "properties": {
          "date": {
            "type": "string",
            "title": "Date"
          },
          "open": {
            "type": "number",
            "title": "Open"
          },
          "high": {
            "type": "number",
            "title": "High"
          },
          "low": {
            "type": "number",
            "title": "Low"
          },
          "close": {
            "type": "number",
            "title": "Close"
          },
          "volume": {
            "type": "integer",
            "title": "Volume"
          }
        },
        "type": "object",
        "required": [
          "date",
          "open",
          "high",
          "low",
          "close",
          "volume"
        ],
        "title": "LatestOHLC"
      },
      "LatestTechnicalRecapAnalysis": {
        "properties": {
          "market": {
            "type": "string",
            "title": "Market"
          },
          "trade_date": {
            "type": "string",
            "format": "date",
            "title": "Trade Date"
          },
          "period_type": {
            "type": "string",
            "const": "daily",
            "title": "Period Type"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Generated At"
          },
          "analysis_type": {
            "type": "string",
            "const": "technical",
            "title": "Analysis Type"
          },
          "analysis": {
            "$ref": "#/components/schemas/TechnicalRecapResult"
          }
        },
        "type": "object",
        "required": [
          "market",
          "trade_date",
          "period_type",
          "generated_at",
          "analysis_type",
          "analysis"
        ],
        "title": "LatestTechnicalRecapAnalysis"
      },
      "LinkProviderRequest": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "redirect_uri": {
            "type": "string",
            "title": "Redirect Uri"
          }
        },
        "type": "object",
        "required": [
          "code",
          "redirect_uri"
        ],
        "title": "LinkProviderRequest"
      },
      "LlmCallResponse": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "execution_id": {
            "type": "string",
            "title": "Execution Id"
          },
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "agent_name": {
            "type": "string",
            "title": "Agent Name"
          },
          "stage": {
            "type": "string",
            "title": "Stage"
          },
          "phase": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phase"
          },
          "vrr_iteration": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vrr Iteration"
          },
          "call_sequence": {
            "type": "integer",
            "title": "Call Sequence"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "model": {
            "type": "string",
            "title": "Model"
          },
          "temperature": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Temperature"
          },
          "max_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Tokens"
          },
          "system_prompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "System Prompt"
          },
          "user_prompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Prompt"
          },
          "messages_json": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Messages Json"
          },
          "raw_response_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Raw Response Text"
          },
          "parsed_response_json": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parsed Response Json"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "input_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Tokens"
          },
          "output_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Tokens"
          },
          "total_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Tokens"
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "title": "Started At"
          },
          "ended_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ended At"
          },
          "latency_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latency Ms"
          },
          "success": {
            "type": "boolean",
            "title": "Success",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "id",
          "execution_id",
          "ticker",
          "agent_name",
          "stage",
          "call_sequence",
          "provider",
          "model",
          "started_at"
        ],
        "title": "LlmCallResponse",
        "description": "Single LLM call trace."
      },
      "LoginRequest": {
        "properties": {
          "platform": {
            "type": "string",
            "enum": [
              "web",
              "android",
              "ios"
            ],
            "title": "Platform",
            "default": "web"
          }
        },
        "type": "object",
        "title": "LoginRequest",
        "description": "Optional request body for login — specifies the originating platform."
      },
      "LoginResponse": {
        "properties": {
          "auth_url": {
            "type": "string",
            "title": "Auth Url"
          },
          "flow_id": {
            "type": "string",
            "title": "Flow Id"
          },
          "flow_verifier": {
            "type": "string",
            "title": "Flow Verifier"
          }
        },
        "type": "object",
        "required": [
          "auth_url",
          "flow_id",
          "flow_verifier"
        ],
        "title": "LoginResponse",
        "description": "Redirect OAuth initiation response; all fields are non-cacheable."
      },
      "LogoutRequest": {
        "properties": {
          "refresh_token": {
            "type": "string",
            "title": "Refresh Token",
            "description": "Refresh token to revoke"
          }
        },
        "type": "object",
        "required": [
          "refresh_token"
        ],
        "title": "LogoutRequest"
      },
      "LotClosureSpec": {
        "properties": {
          "buy_transaction_id": {
            "type": "string",
            "minLength": 1,
            "title": "Buy Transaction Id"
          },
          "qty": {
            "type": "integer",
            "exclusiveMinimum": 0.0,
            "title": "Qty"
          }
        },
        "type": "object",
        "required": [
          "buy_transaction_id",
          "qty"
        ],
        "title": "LotClosureSpec",
        "description": "One entry of closes_lots: the caller wants to close *qty* shares\nfrom the open-lot identified by *buy_transaction_id*."
      },
      "MASAnalyzeRequest": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "technical_json": {
            "additionalProperties": true,
            "type": "object",
            "title": "Technical Json"
          },
          "chip_json": {
            "additionalProperties": true,
            "type": "object",
            "title": "Chip Json"
          },
          "financial_json": {
            "additionalProperties": true,
            "type": "object",
            "title": "Financial Json"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "technical_json",
          "chip_json",
          "financial_json"
        ],
        "title": "MASAnalyzeRequest",
        "description": "Legacy request for full MAS analysis."
      },
      "MASAnalyzeV1Request": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "trading_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trading Date"
          },
          "response_mode": {
            "type": "string",
            "enum": [
              "stream",
              "json"
            ],
            "title": "Response Mode",
            "default": "stream"
          },
          "target": {
            "type": "string",
            "enum": [
              "orchestrator",
              "technical",
              "chip",
              "financial"
            ],
            "title": "Target",
            "default": "orchestrator"
          },
          "options": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Options"
          }
        },
        "type": "object",
        "required": [
          "ticker"
        ],
        "title": "MASAnalyzeV1Request",
        "description": "V1 MAS analysis request."
      },
      "ManualCandidateRequest": {
        "properties": {
          "ticker": {
            "type": "string",
            "pattern": "^\\d{4,6}$",
            "title": "Ticker"
          },
          "company_name": {
            "type": "string",
            "minLength": 1,
            "title": "Company Name"
          },
          "role": {
            "type": "string",
            "enum": [
              "upstream",
              "midstream",
              "downstream",
              "related"
            ],
            "title": "Role",
            "default": "related"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "company_name"
        ],
        "title": "ManualCandidateRequest",
        "description": "Request to inject a manual candidate into a completed generate job."
      },
      "ManualCandidateResponse": {
        "properties": {
          "job_id": {
            "type": "string",
            "title": "Job Id"
          },
          "candidate": {
            "$ref": "#/components/schemas/ThemeJobCandidateResponse"
          },
          "candidates": {
            "items": {
              "$ref": "#/components/schemas/ThemeJobCandidateResponse"
            },
            "type": "array",
            "title": "Candidates"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings"
          }
        },
        "type": "object",
        "required": [
          "job_id",
          "candidate",
          "candidates"
        ],
        "title": "ManualCandidateResponse",
        "description": "Response after injecting a manual candidate: the new one plus the full set."
      },
      "MarginData": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "trade_date": {
            "type": "string",
            "format": "date",
            "title": "Trade Date"
          },
          "margin_balance": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Margin Balance"
          },
          "short_balance": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Short Balance"
          },
          "margin_buy": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Margin Buy"
          },
          "margin_sell": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Margin Sell"
          },
          "short_buy": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Short Buy"
          },
          "short_sell": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Short Sell"
          },
          "margin_previous": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Margin Previous"
          },
          "short_previous": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Short Previous"
          },
          "source_market": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Market"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "trade_date"
        ],
        "title": "MarginData"
      },
      "MarginRankingStock": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "trade_date": {
            "type": "string",
            "format": "date",
            "title": "Trade Date"
          },
          "margin_balance": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Margin Balance"
          },
          "margin_previous": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Margin Previous"
          },
          "margin_change": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Margin Change"
          },
          "short_balance": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Short Balance"
          },
          "short_previous": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Short Previous"
          },
          "short_change": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Short Change"
          },
          "close_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Close Price"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "trade_date"
        ],
        "title": "MarginRankingStock",
        "description": "A single ranked stock in the margin/short leaderboard."
      },
      "MarketPulseResponse": {
        "properties": {
          "signal_date": {
            "type": "string",
            "title": "Signal Date"
          },
          "total_tickers": {
            "type": "integer",
            "title": "Total Tickers",
            "default": 0
          },
          "bullish_count": {
            "type": "integer",
            "title": "Bullish Count",
            "default": 0
          },
          "bearish_count": {
            "type": "integer",
            "title": "Bearish Count",
            "default": 0
          },
          "neutral_count": {
            "type": "integer",
            "title": "Neutral Count",
            "default": 0
          },
          "avg_confidence": {
            "type": "number",
            "title": "Avg Confidence",
            "default": 0.0
          },
          "high_confidence_bullish": {
            "type": "integer",
            "title": "High Confidence Bullish",
            "default": 0
          },
          "high_confidence_bearish": {
            "type": "integer",
            "title": "High Confidence Bearish",
            "default": 0
          },
          "overbought_count": {
            "type": "integer",
            "title": "Overbought Count",
            "default": 0
          },
          "oversold_count": {
            "type": "integer",
            "title": "Oversold Count",
            "default": 0
          },
          "aggressive_buying_count": {
            "type": "integer",
            "title": "Aggressive Buying Count",
            "default": 0
          },
          "aggressive_selling_count": {
            "type": "integer",
            "title": "Aggressive Selling Count",
            "default": 0
          },
          "golden_cross_count": {
            "type": "integer",
            "title": "Golden Cross Count",
            "default": 0
          },
          "death_cross_count": {
            "type": "integer",
            "title": "Death Cross Count",
            "default": 0
          },
          "kdj_golden_cross_count": {
            "type": "integer",
            "title": "Kdj Golden Cross Count",
            "default": 0
          },
          "kdj_death_cross_count": {
            "type": "integer",
            "title": "Kdj Death Cross Count",
            "default": 0
          },
          "ma_month_reclaim_count": {
            "type": "integer",
            "title": "Ma Month Reclaim Count",
            "default": 0
          },
          "ma_month_breakdown_count": {
            "type": "integer",
            "title": "Ma Month Breakdown Count",
            "default": 0
          },
          "ma_quarter_reclaim_count": {
            "type": "integer",
            "title": "Ma Quarter Reclaim Count",
            "default": 0
          },
          "ma_quarter_breakdown_count": {
            "type": "integer",
            "title": "Ma Quarter Breakdown Count",
            "default": 0
          },
          "ma_half_year_reclaim_count": {
            "type": "integer",
            "title": "Ma Half Year Reclaim Count",
            "default": 0
          },
          "ma_half_year_breakdown_count": {
            "type": "integer",
            "title": "Ma Half Year Breakdown Count",
            "default": 0
          },
          "ma_year_reclaim_count": {
            "type": "integer",
            "title": "Ma Year Reclaim Count",
            "default": 0
          },
          "ma_year_breakdown_count": {
            "type": "integer",
            "title": "Ma Year Breakdown Count",
            "default": 0
          },
          "vwap_above_count": {
            "type": "integer",
            "title": "Vwap Above Count",
            "default": 0
          },
          "vwap_below_count": {
            "type": "integer",
            "title": "Vwap Below Count",
            "default": 0
          },
          "gap_up_count": {
            "type": "integer",
            "title": "Gap Up Count",
            "default": 0
          },
          "gap_down_count": {
            "type": "integer",
            "title": "Gap Down Count",
            "default": 0
          },
          "limit_up_count": {
            "type": "integer",
            "title": "Limit Up Count",
            "default": 0
          },
          "limit_down_count": {
            "type": "integer",
            "title": "Limit Down Count",
            "default": 0
          },
          "channel_breakout_count": {
            "type": "integer",
            "title": "Channel Breakout Count",
            "default": 0
          },
          "channel_breakdown_count": {
            "type": "integer",
            "title": "Channel Breakdown Count",
            "default": 0
          },
          "bullish_reversal_pattern_count": {
            "type": "integer",
            "title": "Bullish Reversal Pattern Count",
            "default": 0
          },
          "bearish_reversal_pattern_count": {
            "type": "integer",
            "title": "Bearish Reversal Pattern Count",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "signal_date"
        ],
        "title": "MarketPulseResponse"
      },
      "MarketPulseTickerItem": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "close": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Close"
          },
          "change_percent": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change Percent"
          },
          "rsi_value": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rsi Value"
          },
          "volume_ratio": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Volume Ratio"
          },
          "gap_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gap Pct"
          }
        },
        "type": "object",
        "required": [
          "ticker"
        ],
        "title": "MarketPulseTickerItem"
      },
      "MarketPulseTickersResponse": {
        "properties": {
          "signal_date": {
            "type": "string",
            "title": "Signal Date"
          },
          "metric": {
            "type": "string",
            "title": "Metric"
          },
          "total": {
            "type": "integer",
            "title": "Total",
            "default": 0
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/MarketPulseTickerItem"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "signal_date",
          "metric"
        ],
        "title": "MarketPulseTickersResponse"
      },
      "MarketRegimeRangeResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "start_date": {
            "type": "string",
            "title": "Start Date"
          },
          "end_date": {
            "type": "string",
            "title": "End Date"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          },
          "daily": {
            "items": {
              "$ref": "#/components/schemas/RegimeDailyItem"
            },
            "type": "array",
            "title": "Daily"
          },
          "segments": {
            "items": {
              "$ref": "#/components/schemas/RegimeSegmentResponse"
            },
            "type": "array",
            "title": "Segments"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "start_date",
          "end_date",
          "count",
          "daily",
          "segments"
        ],
        "title": "MarketRegimeRangeResponse",
        "description": "Response for regime date range query."
      },
      "MarketRegimeTodayResponse": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "trading_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trading Date"
          },
          "ticker": {
            "type": "string",
            "title": "Ticker",
            "default": "^TWII"
          },
          "close": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Close"
          },
          "confirmed_regime": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Confirmed Regime"
          },
          "stress_confirmed": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stress Confirmed"
          },
          "regime_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Regime Label"
          },
          "ma60": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ma60"
          },
          "ma120": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ma120"
          },
          "ma200": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ma200"
          },
          "ma120_slope_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ma120 Slope Pct"
          },
          "atr_ratio": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Atr Ratio"
          },
          "drawdown_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Drawdown Pct"
          },
          "stress_by_atr": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stress By Atr"
          },
          "stress_by_drawdown": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stress By Drawdown"
          },
          "stress_by_return_3d": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stress By Return 3D"
          },
          "ma_structure": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ma Structure"
          },
          "interpretation": {
            "type": "string",
            "title": "Interpretation",
            "default": ""
          },
          "current_segment": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RegimeSegmentResponse"
              },
              {
                "type": "null"
              }
            ]
          },
          "acute_shock_alert": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Acute Shock Alert"
          },
          "acute_shock_score": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Acute Shock Score"
          },
          "acute_shock_reasons": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Acute Shock Reasons"
          },
          "risk_mode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Risk Mode"
          }
        },
        "type": "object",
        "required": [
          "status"
        ],
        "title": "MarketRegimeTodayResponse"
      },
      "MarketSurveillanceEventResponse": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "ticker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ticker"
          },
          "security_code": {
            "type": "string",
            "title": "Security Code"
          },
          "security_name": {
            "type": "string",
            "title": "Security Name"
          },
          "source_exchange": {
            "type": "string",
            "enum": [
              "twse",
              "tpex"
            ],
            "title": "Source Exchange"
          },
          "status_type": {
            "type": "string",
            "enum": [
              "attention",
              "disposition"
            ],
            "title": "Status Type"
          },
          "announce_date": {
            "type": "string",
            "format": "date",
            "title": "Announce Date"
          },
          "effective_start_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effective Start Date"
          },
          "effective_end_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effective End Date"
          },
          "cumulative_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cumulative Count"
          },
          "trading_information": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trading Information"
          },
          "disposition_condition": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disposition Condition"
          },
          "disposition_measure": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disposition Measure"
          },
          "disposition_content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disposition Content"
          },
          "matching_interval_minutes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Matching Interval Minutes"
          },
          "close_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Close Price"
          },
          "pe_ratio": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pe Ratio"
          },
          "source_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Url"
          }
        },
        "type": "object",
        "required": [
          "id",
          "security_code",
          "security_name",
          "source_exchange",
          "status_type",
          "announce_date"
        ],
        "title": "MarketSurveillanceEventResponse"
      },
      "MarketSurveillanceEventsResponse": {
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/MarketSurveillanceEventResponse"
            },
            "type": "array",
            "title": "Results"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/MarketSurveillanceEventResponse"
            },
            "type": "array",
            "title": "Rows"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "summary": {
            "additionalProperties": true,
            "type": "object",
            "title": "Summary"
          }
        },
        "type": "object",
        "required": [
          "results",
          "rows",
          "total"
        ],
        "title": "MarketSurveillanceEventsResponse"
      },
      "MemberInvestmentDetailResponse": {
        "properties": {
          "member_id": {
            "type": "string",
            "title": "Member Id"
          },
          "section": {
            "type": "string",
            "title": "Section"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          },
          "items": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "member_id",
          "section",
          "total",
          "page",
          "page_size",
          "items"
        ],
        "title": "MemberInvestmentDetailResponse"
      },
      "MemberInvestmentOverviewItem": {
        "properties": {
          "member_id": {
            "type": "string",
            "title": "Member Id"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "membership": {
            "$ref": "#/components/schemas/MembershipOverview"
          },
          "investment_summary": {
            "$ref": "#/components/schemas/InvestmentSummary"
          }
        },
        "type": "object",
        "required": [
          "member_id",
          "email",
          "status",
          "membership",
          "investment_summary"
        ],
        "title": "MemberInvestmentOverviewItem"
      },
      "MemberInvestmentOverviewResponse": {
        "properties": {
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/MemberInvestmentOverviewItem"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "total",
          "page",
          "page_size",
          "items"
        ],
        "title": "MemberInvestmentOverviewResponse"
      },
      "MembershipListItem": {
        "properties": {
          "member_id": {
            "type": "string",
            "title": "Member Id"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "effective_tier": {
            "type": "string",
            "title": "Effective Tier"
          },
          "assigned_tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assigned Tier"
          },
          "state": {
            "type": "string",
            "title": "State"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          },
          "set_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Set At"
          },
          "starts_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Starts At"
          },
          "ends_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ends At"
          },
          "created_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "type": "object",
        "required": [
          "member_id",
          "email",
          "status",
          "effective_tier",
          "state"
        ],
        "title": "MembershipListItem"
      },
      "MembershipListResponse": {
        "properties": {
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/MembershipListItem"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "total",
          "page",
          "page_size",
          "items"
        ],
        "title": "MembershipListResponse"
      },
      "MembershipOverview": {
        "properties": {
          "tier": {
            "type": "string",
            "title": "Tier"
          },
          "state": {
            "type": "string",
            "title": "State"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          },
          "set_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Set At"
          },
          "starts_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Starts At"
          },
          "ends_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ends At"
          }
        },
        "type": "object",
        "required": [
          "tier",
          "state"
        ],
        "title": "MembershipOverview"
      },
      "MetricsQueryRange": {
        "properties": {
          "from_date": {
            "type": "string",
            "format": "date",
            "title": "From Date"
          },
          "to_date": {
            "type": "string",
            "format": "date",
            "title": "To Date"
          },
          "from_ts": {
            "type": "string",
            "format": "date-time",
            "title": "From Ts"
          },
          "to_ts_exclusive": {
            "type": "string",
            "format": "date-time",
            "title": "To Ts Exclusive"
          },
          "day_count": {
            "type": "integer",
            "title": "Day Count"
          }
        },
        "type": "object",
        "required": [
          "from_date",
          "to_date",
          "from_ts",
          "to_ts_exclusive",
          "day_count"
        ],
        "title": "MetricsQueryRange"
      },
      "MetricsUsers": {
        "properties": {
          "online_now": {
            "type": "integer",
            "title": "Online Now"
          },
          "valid_access_token_sessions": {
            "type": "integer",
            "title": "Valid Access Token Sessions"
          },
          "logged_in_today": {
            "type": "integer",
            "title": "Logged In Today"
          },
          "logged_in_this_week": {
            "type": "integer",
            "title": "Logged In This Week"
          },
          "logged_in_this_month": {
            "type": "integer",
            "title": "Logged In This Month"
          },
          "logged_in_in_range": {
            "type": "integer",
            "title": "Logged In In Range"
          },
          "connected_members_in_range": {
            "type": "integer",
            "title": "Connected Members In Range"
          },
          "connected_anonymous_ips_in_range": {
            "type": "integer",
            "title": "Connected Anonymous Ips In Range"
          },
          "connected_total_in_range": {
            "type": "integer",
            "title": "Connected Total In Range"
          }
        },
        "type": "object",
        "required": [
          "online_now",
          "valid_access_token_sessions",
          "logged_in_today",
          "logged_in_this_week",
          "logged_in_this_month",
          "logged_in_in_range",
          "connected_members_in_range",
          "connected_anonymous_ips_in_range",
          "connected_total_in_range"
        ],
        "title": "MetricsUsers"
      },
      "MetricsWindows": {
        "properties": {
          "day_start": {
            "type": "string",
            "format": "date-time",
            "title": "Day Start"
          },
          "week_start": {
            "type": "string",
            "format": "date-time",
            "title": "Week Start"
          },
          "month_start": {
            "type": "string",
            "format": "date-time",
            "title": "Month Start"
          }
        },
        "type": "object",
        "required": [
          "day_start",
          "week_start",
          "month_start"
        ],
        "title": "MetricsWindows"
      },
      "MonthlyRevenue": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "data_year_month": {
            "type": "integer",
            "title": "Data Year Month"
          },
          "report_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Report Date"
          },
          "revenue_current": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revenue Current"
          },
          "revenue_prev_month": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revenue Prev Month"
          },
          "revenue_prev_year_month": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revenue Prev Year Month"
          },
          "mom_change_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mom Change Pct"
          },
          "yoy_change_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Yoy Change Pct"
          },
          "ytd_revenue": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ytd Revenue"
          },
          "ytd_revenue_prev_year": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ytd Revenue Prev Year"
          },
          "ytd_yoy_change_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ytd Yoy Change Pct"
          },
          "source_market": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Market"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "data_year_month"
        ],
        "title": "MonthlyRevenue"
      },
      "NearDispositionThresholdResponse": {
        "properties": {
          "as_of": {
            "type": "string",
            "format": "date",
            "title": "As Of"
          },
          "trading_date": {
            "type": "string",
            "format": "date",
            "title": "Trading Date"
          },
          "source_exchange": {
            "type": "string",
            "enum": [
              "twse",
              "tpex"
            ],
            "title": "Source Exchange"
          },
          "upper_close": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Upper Close"
          },
          "lower_close": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lower Close"
          },
          "min_volume": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Min Volume"
          }
        },
        "type": "object",
        "required": [
          "as_of",
          "trading_date",
          "source_exchange"
        ],
        "title": "NearDispositionThresholdResponse"
      },
      "NoteUpdateRequest": {
        "properties": {
          "admin_note": {
            "type": "string",
            "minLength": 1,
            "title": "Admin Note"
          }
        },
        "type": "object",
        "required": [
          "admin_note"
        ],
        "title": "NoteUpdateRequest",
        "description": "Request to update admin note."
      },
      "NotionCategory": {
        "type": "string",
        "enum": [
          "bug",
          "feature_request",
          "general"
        ],
        "title": "NotionCategory",
        "description": "Allowed Notion export categories."
      },
      "OHLCData": {
        "properties": {
          "date": {
            "type": "string",
            "title": "Date"
          },
          "open": {
            "type": "number",
            "title": "Open"
          },
          "high": {
            "type": "number",
            "title": "High"
          },
          "low": {
            "type": "number",
            "title": "Low"
          },
          "close": {
            "type": "number",
            "title": "Close"
          },
          "volume": {
            "type": "integer",
            "title": "Volume"
          }
        },
        "type": "object",
        "required": [
          "date",
          "open",
          "high",
          "low",
          "close",
          "volume"
        ],
        "title": "OHLCData",
        "description": "OHLC data point."
      },
      "OHLCResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/OHLCData"
            },
            "type": "array",
            "title": "Data"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "data",
          "total"
        ],
        "title": "OHLCResponse",
        "description": "OHLC data response."
      },
      "OpenLotResponse": {
        "properties": {
          "buy_transaction_id": {
            "type": "string",
            "title": "Buy Transaction Id"
          },
          "transaction_date": {
            "type": "string",
            "title": "Transaction Date"
          },
          "buy_price_per_share": {
            "type": "number",
            "title": "Buy Price Per Share"
          },
          "effective_cost_per_share": {
            "type": "number",
            "title": "Effective Cost Per Share"
          },
          "original_qty": {
            "type": "integer",
            "title": "Original Qty"
          },
          "remaining_qty": {
            "type": "integer",
            "title": "Remaining Qty"
          }
        },
        "type": "object",
        "required": [
          "buy_transaction_id",
          "transaction_date",
          "buy_price_per_share",
          "effective_cost_per_share",
          "original_qty",
          "remaining_qty"
        ],
        "title": "OpenLotResponse",
        "description": "One row of ``GET /api/portfolio/open-lots``.\n\nReturns the fields a sell-form UI needs to render a batch selector:\nthe original buy transaction id, the date, both the raw buy price per\nshare and the fee/tax-adjusted effective cost per share, and the\nremaining quantity after subtracting already-closed closures."
      },
      "OwnershipDistribution": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "trade_date": {
            "type": "string",
            "format": "date",
            "title": "Trade Date"
          },
          "holder_level": {
            "type": "string",
            "title": "Holder Level"
          },
          "holder_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Holder Count"
          },
          "shares": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Shares"
          },
          "share_ratio": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Share Ratio"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "trade_date",
          "holder_level"
        ],
        "title": "OwnershipDistribution"
      },
      "PatchThemeRequest": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          }
        },
        "type": "object",
        "required": [
          "description"
        ],
        "title": "PatchThemeRequest"
      },
      "PathEdge": {
        "properties": {
          "source_ticker": {
            "type": "string",
            "title": "Source Ticker"
          },
          "target_name": {
            "type": "string",
            "title": "Target Name"
          },
          "target_ticker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Ticker"
          },
          "rel_type": {
            "type": "string",
            "title": "Rel Type"
          },
          "is_bidirectional": {
            "type": "boolean",
            "title": "Is Bidirectional",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "source_ticker",
          "target_name",
          "rel_type"
        ],
        "title": "PathEdge",
        "description": "An edge in a supply chain path."
      },
      "PatternItem": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "score": {
            "type": "number",
            "title": "Score"
          },
          "reliability": {
            "type": "string",
            "title": "Reliability"
          },
          "trigger_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trigger Price"
          },
          "invalidation_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invalidation Price"
          },
          "stage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stage"
          }
        },
        "type": "object",
        "required": [
          "name",
          "score",
          "reliability"
        ],
        "title": "PatternItem",
        "description": "Detected chart pattern with optional display stage."
      },
      "PhaseResultResponse": {
        "properties": {
          "pct": {
            "type": "number",
            "title": "Pct"
          },
          "matched_rules": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Matched Rules"
          }
        },
        "type": "object",
        "required": [
          "pct",
          "matched_rules"
        ],
        "title": "PhaseResultResponse"
      },
      "PipelineStatus": {
        "properties": {
          "job_name": {
            "type": "string",
            "title": "Job Name"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "ended_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ended At"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "job_name",
          "status"
        ],
        "title": "PipelineStatus"
      },
      "PortfolioAdviceResponse": {
        "properties": {
          "advices": {
            "items": {
              "$ref": "#/components/schemas/HoldingAdvice"
            },
            "type": "array",
            "title": "Advices"
          },
          "market": {
            "additionalProperties": true,
            "type": "object",
            "title": "Market"
          },
          "as_of": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "object",
            "title": "As Of"
          },
          "disclaimer": {
            "type": "string",
            "title": "Disclaimer"
          }
        },
        "type": "object",
        "required": [
          "advices",
          "market",
          "as_of",
          "disclaimer"
        ],
        "title": "PortfolioAdviceResponse"
      },
      "PortfolioAllocationGroup": {
        "properties": {
          "category": {
            "type": "string",
            "title": "Category"
          },
          "category_source": {
            "type": "string",
            "enum": [
              "industry",
              "sector",
              "unclassified",
              "asset_type"
            ],
            "title": "Category Source"
          },
          "market_value": {
            "type": "number",
            "title": "Market Value"
          },
          "cost_basis_total": {
            "type": "number",
            "title": "Cost Basis Total"
          },
          "allocation_pct": {
            "type": "number",
            "title": "Allocation Pct"
          },
          "holdings_count": {
            "type": "integer",
            "title": "Holdings Count"
          },
          "tickers": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tickers"
          }
        },
        "type": "object",
        "required": [
          "category",
          "category_source",
          "market_value",
          "cost_basis_total",
          "allocation_pct",
          "holdings_count",
          "tickers"
        ],
        "title": "PortfolioAllocationGroup",
        "description": "One category bucket in ``GET /api/portfolio/allocation``."
      },
      "PortfolioAllocationResponse": {
        "properties": {
          "total_market_value": {
            "type": "number",
            "title": "Total Market Value"
          },
          "total_cost_basis": {
            "type": "number",
            "title": "Total Cost Basis"
          },
          "groups": {
            "items": {
              "$ref": "#/components/schemas/PortfolioAllocationGroup"
            },
            "type": "array",
            "title": "Groups"
          }
        },
        "type": "object",
        "required": [
          "total_market_value",
          "total_cost_basis",
          "groups"
        ],
        "title": "PortfolioAllocationResponse",
        "description": "Response schema for GET /api/portfolio/allocation."
      },
      "PortfolioBackupArchive": {
        "properties": {
          "format_version": {
            "type": "integer",
            "const": 1,
            "title": "Format Version"
          },
          "schema_version": {
            "type": "string",
            "const": "portfolio-transaction-backup.v1",
            "title": "Schema Version"
          },
          "exported_at": {
            "type": "string",
            "title": "Exported At"
          },
          "source_member": {
            "$ref": "#/components/schemas/BackupMember"
          },
          "markets": {
            "items": {
              "$ref": "#/components/schemas/Country"
            },
            "type": "array",
            "title": "Markets"
          },
          "brokers": {
            "items": {
              "$ref": "#/components/schemas/BackupBroker"
            },
            "type": "array",
            "title": "Brokers"
          },
          "transactions": {
            "items": {
              "$ref": "#/components/schemas/BackupTransaction"
            },
            "type": "array",
            "title": "Transactions"
          },
          "closures": {
            "items": {
              "$ref": "#/components/schemas/BackupClosure"
            },
            "type": "array",
            "title": "Closures"
          },
          "content_sha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$|^$",
            "title": "Content Sha256"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "format_version",
          "schema_version",
          "exported_at",
          "source_member",
          "markets",
          "brokers",
          "transactions",
          "closures",
          "content_sha256"
        ],
        "title": "PortfolioBackupArchive"
      },
      "PortfolioBatchPerformanceResponse": {
        "properties": {
          "as_of_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "As Of Date"
          },
          "period_reference_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Period Reference Date"
          },
          "items": {
            "additionalProperties": {
              "$ref": "#/components/schemas/PortfolioPerformanceResponse"
            },
            "type": "object",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "PortfolioBatchPerformanceResponse",
        "description": "Batch response schema for GET /api/portfolio/performance?tickers=..."
      },
      "PortfolioConfigResponse": {
        "properties": {
          "standard_sell_rate": {
            "type": "number",
            "title": "Standard Sell Rate"
          },
          "day_trade_sell_rate": {
            "type": "number",
            "title": "Day Trade Sell Rate"
          }
        },
        "type": "object",
        "required": [
          "standard_sell_rate",
          "day_trade_sell_rate"
        ],
        "title": "PortfolioConfigResponse",
        "description": "Response schema for GET /api/portfolio/config."
      },
      "PortfolioGroupedPerformanceResponse": {
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "Group",
              "ETF"
            ],
            "title": "Type"
          },
          "as_of_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "As Of Date"
          },
          "period_reference_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Period Reference Date"
          },
          "positions_count": {
            "type": "integer",
            "title": "Positions Count"
          },
          "market_value": {
            "type": "number",
            "title": "Market Value"
          },
          "cost_basis_total": {
            "type": "number",
            "title": "Cost Basis Total"
          },
          "total_unrealized_pnl": {
            "type": "number",
            "title": "Total Unrealized Pnl"
          },
          "total_unrealized_pnl_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Unrealized Pnl Pct"
          },
          "groups": {
            "items": {
              "$ref": "#/components/schemas/PortfolioPerformanceGroup"
            },
            "type": "array",
            "title": "Groups"
          }
        },
        "type": "object",
        "required": [
          "type",
          "positions_count",
          "market_value",
          "cost_basis_total",
          "total_unrealized_pnl",
          "groups"
        ],
        "title": "PortfolioGroupedPerformanceResponse",
        "description": "Grouped response schema for GET /api/portfolio/performance?type=..."
      },
      "PortfolioPerformanceGroup": {
        "properties": {
          "category": {
            "type": "string",
            "title": "Category"
          },
          "period_reference_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Period Reference Date"
          },
          "category_source": {
            "type": "string",
            "enum": [
              "industry",
              "sector",
              "unclassified",
              "asset_type"
            ],
            "title": "Category Source"
          },
          "positions_count": {
            "type": "integer",
            "title": "Positions Count"
          },
          "market_value": {
            "type": "number",
            "title": "Market Value"
          },
          "cost_basis_total": {
            "type": "number",
            "title": "Cost Basis Total"
          },
          "total_unrealized_pnl": {
            "type": "number",
            "title": "Total Unrealized Pnl"
          },
          "total_unrealized_pnl_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Unrealized Pnl Pct"
          },
          "periods": {
            "$ref": "#/components/schemas/PortfolioPerformancePeriods"
          },
          "tickers": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tickers"
          }
        },
        "type": "object",
        "required": [
          "category",
          "category_source",
          "positions_count",
          "market_value",
          "cost_basis_total",
          "total_unrealized_pnl",
          "periods",
          "tickers"
        ],
        "title": "PortfolioPerformanceGroup",
        "description": "One category bucket in grouped ``GET /api/portfolio/performance``."
      },
      "PortfolioPerformancePeriod": {
        "properties": {
          "label": {
            "type": "string",
            "enum": [
              "day",
              "month",
              "quarter",
              "year"
            ],
            "title": "Label"
          },
          "baseline_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Baseline Date"
          },
          "baseline_value": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Baseline Value"
          },
          "unrealized_pnl": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unrealized Pnl"
          },
          "unrealized_pnl_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unrealized Pnl Pct"
          }
        },
        "type": "object",
        "required": [
          "label"
        ],
        "title": "PortfolioPerformancePeriod",
        "description": "One period bucket in GET /api/portfolio/performance."
      },
      "PortfolioPerformancePeriods": {
        "properties": {
          "day": {
            "$ref": "#/components/schemas/PortfolioPerformancePeriod"
          },
          "month": {
            "$ref": "#/components/schemas/PortfolioPerformancePeriod"
          },
          "quarter": {
            "$ref": "#/components/schemas/PortfolioPerformancePeriod"
          },
          "year": {
            "$ref": "#/components/schemas/PortfolioPerformancePeriod"
          }
        },
        "type": "object",
        "required": [
          "day",
          "month",
          "quarter",
          "year"
        ],
        "title": "PortfolioPerformancePeriods",
        "description": "Period buckets for holding performance."
      },
      "PortfolioPerformanceResponse": {
        "properties": {
          "as_of_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "As Of Date"
          },
          "period_reference_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Period Reference Date"
          },
          "ticker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ticker"
          },
          "positions_count": {
            "type": "integer",
            "title": "Positions Count"
          },
          "market_value": {
            "type": "number",
            "title": "Market Value"
          },
          "cost_basis_total": {
            "type": "number",
            "title": "Cost Basis Total"
          },
          "total_unrealized_pnl": {
            "type": "number",
            "title": "Total Unrealized Pnl"
          },
          "total_unrealized_pnl_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Unrealized Pnl Pct"
          },
          "periods": {
            "$ref": "#/components/schemas/PortfolioPerformancePeriods"
          }
        },
        "type": "object",
        "required": [
          "positions_count",
          "market_value",
          "cost_basis_total",
          "total_unrealized_pnl",
          "periods"
        ],
        "title": "PortfolioPerformanceResponse",
        "description": "Response schema for GET /api/portfolio/performance."
      },
      "PricePayload": {
        "properties": {
          "as_of_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "As Of Date",
            "description": "Actual latest OHLC trade date used"
          },
          "close": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Close",
            "description": "Latest close price"
          },
          "change": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change",
            "description": "Change from previous trading day"
          },
          "change_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change Pct",
            "description": "Percent change from previous trading day"
          },
          "five_day_close": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Five Day Close",
            "description": "Close from the 5-day lookback row"
          },
          "five_day_change": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Five Day Change",
            "description": "Change from the 5-day lookback row"
          },
          "five_day_change_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Five Day Change Pct",
            "description": "Percent change from the 5-day lookback row"
          },
          "twenty_day_close": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Twenty Day Close",
            "description": "Close from the 20-day lookback row"
          },
          "twenty_day_change": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Twenty Day Change",
            "description": "Change from the 20-day lookback row"
          },
          "twenty_day_change_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Twenty Day Change Pct",
            "description": "Percent change from the 20-day lookback row"
          }
        },
        "type": "object",
        "title": "PricePayload"
      },
      "PublishThemeJobRequest": {
        "properties": {
          "apply_coverage_updates": {
            "type": "boolean",
            "title": "Apply Coverage Updates",
            "default": true
          },
          "apply_theme_definition": {
            "type": "boolean",
            "title": "Apply Theme Definition",
            "default": true
          },
          "rebuild_after_publish": {
            "type": "boolean",
            "title": "Rebuild After Publish",
            "default": true
          },
          "sync_db_after_rebuild": {
            "type": "boolean",
            "title": "Sync Db After Rebuild",
            "default": true
          }
        },
        "type": "object",
        "title": "PublishThemeJobRequest",
        "description": "Request to publish a completed generation job."
      },
      "PublishThemeJobResponse": {
        "properties": {
          "job_id": {
            "type": "string",
            "title": "Job Id"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "completed",
              "failed",
              "published",
              "canceled"
            ],
            "title": "Status"
          },
          "published_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Published At"
          },
          "rebuild_job_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rebuild Job Id"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings"
          }
        },
        "type": "object",
        "required": [
          "job_id",
          "status",
          "published_at",
          "rebuild_job_id",
          "warnings"
        ],
        "title": "PublishThemeJobResponse",
        "description": "Response returned after publishing a generation draft."
      },
      "QuarterlyReport": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "report_year": {
            "type": "integer",
            "title": "Report Year"
          },
          "report_quarter": {
            "type": "integer",
            "title": "Report Quarter"
          },
          "report_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Report Date"
          },
          "eps_basic": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Eps Basic"
          },
          "eps_diluted": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Eps Diluted"
          },
          "revenue": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revenue"
          },
          "net_income": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Net Income"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "report_year",
          "report_quarter"
        ],
        "title": "QuarterlyReport"
      },
      "RealizedBreakdownResponse": {
        "properties": {
          "regular_pnl": {
            "type": "number",
            "title": "Regular Pnl"
          },
          "day_trade_pnl": {
            "type": "number",
            "title": "Day Trade Pnl"
          },
          "cash_dividend": {
            "type": "number",
            "title": "Cash Dividend"
          },
          "total": {
            "type": "number",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "regular_pnl",
          "day_trade_pnl",
          "cash_dividend",
          "total"
        ],
        "title": "RealizedBreakdownResponse"
      },
      "RealtimeQuote": {
        "properties": {
          "stock_code": {
            "type": "string",
            "title": "Stock Code"
          },
          "trading_date": {
            "type": "string",
            "format": "date",
            "title": "Trading Date"
          },
          "quote_time": {
            "type": "string",
            "format": "date-time",
            "title": "Quote Time"
          },
          "fetched_at": {
            "type": "string",
            "format": "date-time",
            "title": "Fetched At"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "open": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Open"
          },
          "high": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "High"
          },
          "low": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Low"
          },
          "close": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Close"
          },
          "change_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change Price"
          },
          "change_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change Rate"
          },
          "average_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Average Price"
          },
          "buy_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Buy Price"
          },
          "sell_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sell Price"
          },
          "volume_ratio": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Volume Ratio"
          },
          "volume": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Volume"
          },
          "total_volume": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Volume"
          },
          "amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount"
          },
          "total_amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Amount"
          },
          "buy_volume": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Buy Volume"
          },
          "sell_volume": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sell Volume"
          },
          "yesterday_volume": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Yesterday Volume"
          },
          "tick_type": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tick Type"
          }
        },
        "type": "object",
        "required": [
          "stock_code",
          "trading_date",
          "quote_time",
          "fetched_at",
          "name",
          "open",
          "high",
          "low",
          "close",
          "change_price",
          "change_rate",
          "average_price",
          "buy_price",
          "sell_price",
          "volume_ratio",
          "volume",
          "total_volume",
          "amount",
          "total_amount",
          "buy_volume",
          "sell_volume",
          "yesterday_volume",
          "tick_type"
        ],
        "title": "RealtimeQuote",
        "description": "One intraday quote snapshot of a Taiwan stock."
      },
      "RealtimeQuoteResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "status": {
            "type": "string",
            "enum": [
              "available",
              "no_data"
            ],
            "title": "Status"
          },
          "quote": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RealtimeQuote"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "status",
          "quote"
        ],
        "title": "RealtimeQuoteResponse",
        "description": "Latest realtime quote of one ticker; ``quote`` is null when none exists."
      },
      "RebuildThemesRequest": {
        "properties": {
          "theme": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Theme"
          },
          "sync_db": {
            "type": "boolean",
            "title": "Sync Db",
            "default": true
          },
          "knowledge_as_of": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Knowledge As Of"
          },
          "skip_embed": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Skip Embed"
          }
        },
        "type": "object",
        "title": "RebuildThemesRequest",
        "description": "Request to rebuild generated theme markdown and optional DB sync."
      },
      "RecommendationResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "trade_date": {
            "type": "string",
            "title": "Trade Date"
          },
          "strategy_key": {
            "type": "string",
            "title": "Strategy Key"
          },
          "rule_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rule Id"
          },
          "scope": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scope"
          },
          "score": {
            "type": "number",
            "title": "Score"
          },
          "metrics_2y": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metrics 2Y"
          },
          "metrics_all": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metrics All"
          },
          "support_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Support Count"
          },
          "stock_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stock Name"
          },
          "expected_value": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Value"
          },
          "domain": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Domain"
          },
          "regime_slice": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Regime Slice"
          },
          "family_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Family Id"
          },
          "commodity_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Commodity Code"
          },
          "user_group_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Group Id"
          },
          "visibility": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Visibility"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "trade_date",
          "strategy_key",
          "score"
        ],
        "title": "RecommendationResponse"
      },
      "RefreshRequest": {
        "properties": {
          "refresh_token": {
            "type": "string",
            "title": "Refresh Token",
            "description": "Current refresh token"
          }
        },
        "type": "object",
        "required": [
          "refresh_token"
        ],
        "title": "RefreshRequest"
      },
      "RegimeDailyItem": {
        "properties": {
          "trading_date": {
            "type": "string",
            "title": "Trading Date"
          },
          "close": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Close"
          },
          "confirmed_regime": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Confirmed Regime"
          },
          "stress_confirmed": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stress Confirmed"
          },
          "regime_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Regime Label"
          },
          "ma120_slope_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ma120 Slope Pct"
          },
          "atr_ratio": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Atr Ratio"
          },
          "drawdown_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Drawdown Pct"
          },
          "acute_shock_alert": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Acute Shock Alert"
          },
          "acute_shock_score": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Acute Shock Score"
          },
          "risk_mode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Risk Mode"
          }
        },
        "type": "object",
        "required": [
          "trading_date"
        ],
        "title": "RegimeDailyItem",
        "description": "Single-day regime snapshot (trimmed subset of MarketRegimeTodayResponse)."
      },
      "RegimeSegmentResponse": {
        "properties": {
          "regime": {
            "type": "string",
            "title": "Regime"
          },
          "start_date": {
            "type": "string",
            "title": "Start Date"
          },
          "end_date": {
            "type": "string",
            "title": "End Date"
          },
          "duration_days": {
            "type": "integer",
            "title": "Duration Days"
          },
          "total_return_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Return Pct"
          },
          "max_drawdown_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Drawdown Pct"
          },
          "stress_day_ratio": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stress Day Ratio"
          }
        },
        "type": "object",
        "required": [
          "regime",
          "start_date",
          "end_date",
          "duration_days"
        ],
        "title": "RegimeSegmentResponse"
      },
      "ReplaceMembersRequest": {
        "properties": {
          "members": {
            "items": {
              "$ref": "#/components/schemas/ThemeMemberIn"
            },
            "type": "array",
            "minItems": 1,
            "title": "Members"
          }
        },
        "type": "object",
        "required": [
          "members"
        ],
        "title": "ReplaceMembersRequest"
      },
      "RequestValidationIssue": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Loc"
          },
          "msg": {
            "type": "string",
            "title": "Msg"
          },
          "type": {
            "type": "string",
            "title": "Type"
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "RequestValidationIssue"
      },
      "RequestValidationResponse": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/RequestValidationIssue"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "required": [
          "detail"
        ],
        "title": "RequestValidationResponse"
      },
      "RestorePreviewRequest": {
        "properties": {
          "backup": {
            "$ref": "#/components/schemas/PortfolioBackupArchive"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "backup"
        ],
        "title": "RestorePreviewRequest"
      },
      "RestorePreviewResponse": {
        "properties": {
          "source_member": {
            "$ref": "#/components/schemas/BackupMember"
          },
          "target_member": {
            "$ref": "#/components/schemas/BackupMember"
          },
          "exported_at": {
            "type": "string",
            "title": "Exported At"
          },
          "format_version": {
            "type": "integer",
            "title": "Format Version"
          },
          "incoming": {
            "$ref": "#/components/schemas/BackupSummary"
          },
          "current": {
            "$ref": "#/components/schemas/BackupSummary"
          },
          "expected_state_sha256": {
            "type": "string",
            "title": "Expected State Sha256"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "source_member",
          "target_member",
          "exported_at",
          "format_version",
          "incoming",
          "current",
          "expected_state_sha256",
          "warnings"
        ],
        "title": "RestorePreviewResponse"
      },
      "RestoreRequest": {
        "properties": {
          "backup": {
            "$ref": "#/components/schemas/PortfolioBackupArchive"
          },
          "expected_state_sha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$",
            "title": "Expected State Sha256"
          },
          "confirm_member_id": {
            "type": "string",
            "title": "Confirm Member Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "backup",
          "expected_state_sha256",
          "confirm_member_id"
        ],
        "title": "RestoreRequest"
      },
      "RestoreResponse": {
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "restored",
              "unchanged"
            ],
            "title": "Status"
          },
          "member_id": {
            "type": "string",
            "title": "Member Id"
          },
          "counts": {
            "$ref": "#/components/schemas/BackupSummary"
          },
          "state_sha256": {
            "type": "string",
            "title": "State Sha256"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status",
          "member_id",
          "counts",
          "state_sha256"
        ],
        "title": "RestoreResponse"
      },
      "RuleExplanationBatchRequest": {
        "properties": {
          "rule_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 100,
            "minItems": 1,
            "title": "Rule Ids"
          }
        },
        "type": "object",
        "required": [
          "rule_ids"
        ],
        "title": "RuleExplanationBatchRequest",
        "description": "Batch request for rule explanations."
      },
      "RuleExplanationBatchResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/RuleExplanationResponse"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "RuleExplanationBatchResponse",
        "description": "Batch response for rule explanations."
      },
      "RuleExplanationResponse": {
        "properties": {
          "rule_id": {
            "type": "string",
            "title": "Rule Id"
          },
          "conditions": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Conditions"
          },
          "conditions_zh": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Conditions Zh"
          },
          "description": {
            "type": "string",
            "title": "Description"
          }
        },
        "type": "object",
        "required": [
          "rule_id",
          "conditions",
          "conditions_zh",
          "description"
        ],
        "title": "RuleExplanationResponse",
        "description": "Single rule explanation with conditions and Chinese description."
      },
      "ScheduleSummaryOut": {
        "properties": {
          "day": {
            "type": "string",
            "title": "Day"
          },
          "overall_status": {
            "type": "string",
            "title": "Overall Status"
          },
          "jobs": {
            "items": {
              "$ref": "#/components/schemas/JobRunOut"
            },
            "type": "array",
            "title": "Jobs"
          }
        },
        "type": "object",
        "required": [
          "day",
          "overall_status",
          "jobs"
        ],
        "title": "ScheduleSummaryOut",
        "description": "Daily scheduler recap: which jobs/APIs ran, when, and their status."
      },
      "SearchResultResponse": {
        "properties": {
          "doc_id": {
            "type": "string",
            "title": "Doc Id"
          },
          "ticker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ticker"
          },
          "chunk_type": {
            "type": "string",
            "title": "Chunk Type"
          },
          "section_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Section Name"
          },
          "content": {
            "type": "string",
            "title": "Content"
          },
          "score": {
            "type": "number",
            "title": "Score"
          }
        },
        "type": "object",
        "required": [
          "doc_id",
          "chunk_type",
          "content",
          "score"
        ],
        "title": "SearchResultResponse",
        "description": "A RAG search result."
      },
      "SelectedStoryEvidence": {
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "single_story",
              "exact_story_set"
            ],
            "title": "Type"
          },
          "domain": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Domain"
          },
          "story_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Story Code"
          },
          "story_set_hash": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Story Set Hash"
          },
          "story_keys": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Story Keys"
          },
          "event_count": {
            "type": "integer",
            "title": "Event Count"
          },
          "hit_count": {
            "type": "integer",
            "title": "Hit Count"
          },
          "hit_rate": {
            "type": "number",
            "title": "Hit Rate"
          },
          "directional_average_return": {
            "type": "number",
            "title": "Directional Average Return"
          },
          "stock_metrics_2y": {
            "$ref": "#/components/schemas/StoryMetrics"
          },
          "market_metrics_2y": {
            "$ref": "#/components/schemas/StoryMetrics"
          }
        },
        "type": "object",
        "required": [
          "type",
          "event_count",
          "hit_count",
          "hit_rate",
          "directional_average_return",
          "stock_metrics_2y",
          "market_metrics_2y"
        ],
        "title": "SelectedStoryEvidence"
      },
      "ServerMetricsResponse": {
        "properties": {
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Generated At"
          },
          "timezone": {
            "type": "string",
            "const": "Asia/Taipei",
            "title": "Timezone"
          },
          "windows": {
            "$ref": "#/components/schemas/MetricsWindows"
          },
          "query_range": {
            "$ref": "#/components/schemas/MetricsQueryRange"
          },
          "users": {
            "$ref": "#/components/schemas/MetricsUsers"
          },
          "token_policy": {
            "$ref": "#/components/schemas/TokenPolicy"
          },
          "api_quality": {
            "$ref": "#/components/schemas/ApiQuality"
          },
          "top_endpoints": {
            "items": {
              "$ref": "#/components/schemas/EndpointQuality"
            },
            "type": "array",
            "title": "Top Endpoints"
          },
          "telemetry": {
            "$ref": "#/components/schemas/TelemetryStatus"
          }
        },
        "type": "object",
        "required": [
          "generated_at",
          "timezone",
          "windows",
          "query_range",
          "users",
          "token_policy",
          "api_quality",
          "top_endpoints",
          "telemetry"
        ],
        "title": "ServerMetricsResponse"
      },
      "SetMemberMembershipRequest": {
        "properties": {
          "tier": {
            "type": "string",
            "maxLength": 50,
            "minLength": 1,
            "title": "Tier"
          },
          "starts_at": {
            "type": "string",
            "format": "date-time",
            "title": "Starts At"
          },
          "ends_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ends At"
          },
          "reason": {
            "type": "string",
            "maxLength": 500,
            "minLength": 1,
            "title": "Reason"
          }
        },
        "type": "object",
        "required": [
          "tier",
          "starts_at",
          "reason"
        ],
        "title": "SetMemberMembershipRequest"
      },
      "SetMemberMembershipResponse": {
        "properties": {
          "member_id": {
            "type": "string",
            "title": "Member Id"
          },
          "entitlement_id": {
            "type": "string",
            "title": "Entitlement Id"
          },
          "previous_tier": {
            "type": "string",
            "title": "Previous Tier"
          },
          "effective_tier": {
            "type": "string",
            "title": "Effective Tier"
          },
          "scheduled_tier": {
            "type": "string",
            "title": "Scheduled Tier"
          },
          "state": {
            "type": "string",
            "title": "State"
          },
          "starts_at": {
            "type": "string",
            "format": "date-time",
            "title": "Starts At"
          },
          "ends_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ends At"
          },
          "set_at": {
            "type": "string",
            "format": "date-time",
            "title": "Set At"
          },
          "changed": {
            "type": "boolean",
            "title": "Changed"
          }
        },
        "type": "object",
        "required": [
          "member_id",
          "entitlement_id",
          "previous_tier",
          "effective_tier",
          "scheduled_tier",
          "state",
          "starts_at",
          "set_at",
          "changed"
        ],
        "title": "SetMemberMembershipResponse"
      },
      "SetPageMemberRoleRequest": {
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "upstream",
              "midstream",
              "downstream",
              "related"
            ],
            "title": "Role"
          },
          "sync_db": {
            "type": "boolean",
            "title": "Sync Db",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "role"
        ],
        "title": "SetPageMemberRoleRequest",
        "description": "Request to change a member's role section on a theme page."
      },
      "SignalBacktestRunRequest": {
        "properties": {
          "domain": {
            "type": "string",
            "title": "Domain",
            "description": "Backtest domain: technical | chip | financial",
            "default": "technical"
          },
          "test_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Test Days",
            "description": "Backtest window length in calendar days",
            "default": 180
          },
          "start_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Date",
            "description": "YYYY-MM-DD"
          },
          "end_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Date",
            "description": "YYYY-MM-DD, default today"
          },
          "tickers": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tickers",
            "description": "Ticker list; empty means all"
          },
          "cooldown_days": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Cooldown Days",
            "description": "Cooldown days between same-ticker signals (default: domain-specific). 0 = no cooldown."
          }
        },
        "type": "object",
        "title": "SignalBacktestRunRequest"
      },
      "SignalResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "signal_date": {
            "type": "string",
            "title": "Signal Date"
          },
          "signal_type": {
            "type": "string",
            "title": "Signal Type"
          },
          "strategy_type": {
            "type": "string",
            "title": "Strategy Type",
            "default": ""
          },
          "direction": {
            "type": "string",
            "title": "Direction"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "strength": {
            "type": "number",
            "title": "Strength",
            "default": 0.7
          },
          "price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price"
          },
          "change_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change Pct"
          },
          "bias": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bias"
          },
          "confidence": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Confidence"
          },
          "rsi_value": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rsi Value"
          },
          "rsi_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rsi Status"
          },
          "macd_cross_signal": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Macd Cross Signal"
          },
          "macd_divergence": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Macd Divergence"
          },
          "kdj_signal": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Kdj Signal"
          },
          "kdj_cross_signal": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Kdj Cross Signal"
          },
          "volume_ratio": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Volume Ratio"
          },
          "volume_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Volume Status"
          },
          "ma_alignment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ma Alignment"
          },
          "cti_score": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cti Score"
          },
          "bb_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bb Status"
          },
          "major_support": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Major Support",
            "description": "Latest confirmed historical adjusted swing low: strict five bars on each side, no expiry; null when unavailable."
          },
          "major_resistance": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Major Resistance",
            "description": "Latest confirmed historical adjusted swing high: strict five bars on each side, no expiry; null when unavailable."
          },
          "major_support_raw": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Major Support Raw",
            "description": "Latest strict five-plus-five swing low independently confirmed on raw OHLC; null when unavailable."
          },
          "major_resistance_raw": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Major Resistance Raw",
            "description": "Latest strict five-plus-five swing high independently confirmed on raw OHLC; null when unavailable."
          },
          "patterns": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Patterns"
          },
          "pattern_reliability": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pattern Reliability"
          },
          "atr_stop_distance": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Atr Stop Distance"
          },
          "invalidation_level": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invalidation Level",
            "description": "Confirmed adjusted swing support or null; no ATR fallback. Only a strict close below this level invalidates support."
          },
          "structured_signals": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Structured Signals"
          },
          "signal_summary": {
            "additionalProperties": true,
            "type": "object",
            "title": "Signal Summary"
          },
          "ta_index_groups": {
            "additionalProperties": true,
            "type": "object",
            "title": "Ta Index Groups"
          },
          "signals": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Signals",
            "description": "Full-view SES signals. Technical support/resistance uses the latest strict historical swing low/high, confirmed by five bars on each side, without expiry."
          },
          "events": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Events",
            "description": "Full-view SES events. support_break requires close strictly below the confirmed swing low; support_nearby/resistance_nearby use the existing inclusive 3% proximity rule."
          },
          "stories": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Stories"
          },
          "relations": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Relations"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "signal_date",
          "signal_type",
          "direction"
        ],
        "title": "SignalResponse"
      },
      "SingleAgentRequest": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "domain_json": {
            "additionalProperties": true,
            "type": "object",
            "title": "Domain Json"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "domain_json"
        ],
        "title": "SingleAgentRequest",
        "description": "Legacy request for single agent analysis."
      },
      "SkippedTheme": {
        "properties": {
          "theme": {
            "type": "string",
            "title": "Theme"
          },
          "reason": {
            "type": "string",
            "title": "Reason"
          }
        },
        "type": "object",
        "required": [
          "theme",
          "reason"
        ],
        "title": "SkippedTheme"
      },
      "SourceDetail": {
        "properties": {
          "version": {
            "type": "integer",
            "title": "Version"
          },
          "computed_at": {
            "type": "string",
            "title": "Computed At"
          },
          "data_range": {
            "$ref": "#/components/schemas/DataRange"
          },
          "sample_count": {
            "type": "integer",
            "title": "Sample Count"
          },
          "quality_tier": {
            "type": "string",
            "title": "Quality Tier"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings"
          },
          "n_rules": {
            "type": "integer",
            "title": "N Rules"
          },
          "channels": {
            "additionalProperties": true,
            "type": "object",
            "title": "Channels"
          }
        },
        "type": "object",
        "required": [
          "version",
          "computed_at",
          "data_range",
          "sample_count",
          "quality_tier",
          "warnings",
          "n_rules",
          "channels"
        ],
        "title": "SourceDetail"
      },
      "StageTokenItem": {
        "properties": {
          "call_count": {
            "type": "integer",
            "title": "Call Count"
          },
          "input_tokens": {
            "type": "integer",
            "title": "Input Tokens"
          },
          "output_tokens": {
            "type": "integer",
            "title": "Output Tokens"
          },
          "total_tokens": {
            "type": "integer",
            "title": "Total Tokens"
          },
          "stage": {
            "type": "string",
            "title": "Stage"
          }
        },
        "type": "object",
        "required": [
          "call_count",
          "input_tokens",
          "output_tokens",
          "total_tokens",
          "stage"
        ],
        "title": "StageTokenItem",
        "description": "Per-stage token breakdown."
      },
      "StaleETF": {
        "properties": {
          "etf_ticker": {
            "type": "string",
            "title": "Etf Ticker"
          },
          "etf_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Etf Name"
          },
          "previous_date": {
            "type": "string",
            "format": "date",
            "title": "Previous Date"
          },
          "missing_date": {
            "type": "string",
            "format": "date",
            "title": "Missing Date"
          }
        },
        "type": "object",
        "required": [
          "etf_ticker",
          "previous_date",
          "missing_date"
        ],
        "title": "StaleETF",
        "description": "An eligible ETF that cannot yield a single-day delta.\n\nIts provider published no snapshot for the day baseline (``missing_date``),\nso its own latest snapshot — ``previous_date`` — predates that baseline.\nDiffing it would mix a multi-day cumulative change into a same-day view, so\nit is excluded from the recap/ranking and surfaced here instead. Day path\nonly; empty for period queries, where a per-ETF baseline before the window\nstart is always resolvable."
      },
      "StatisticsOptions": {
        "properties": {
          "available_days": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "Available Days"
          },
          "max_buy_streak": {
            "type": "integer",
            "title": "Max Buy Streak"
          },
          "max_sell_streak": {
            "type": "integer",
            "title": "Max Sell Streak"
          },
          "buy_streak_options": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "Buy Streak Options"
          },
          "sell_streak_options": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "Sell Streak Options"
          }
        },
        "type": "object",
        "required": [
          "available_days",
          "max_buy_streak",
          "max_sell_streak",
          "buy_streak_options",
          "sell_streak_options"
        ],
        "title": "StatisticsOptions",
        "description": "Available options for statistics based on actual data."
      },
      "StatusSummary": {
        "properties": {
          "total_tables": {
            "type": "integer",
            "title": "Total Tables"
          },
          "fresh": {
            "type": "integer",
            "title": "Fresh",
            "default": 0
          },
          "stale": {
            "type": "integer",
            "title": "Stale",
            "default": 0
          },
          "empty": {
            "type": "integer",
            "title": "Empty",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "total_tables"
        ],
        "title": "StatusSummary"
      },
      "StatusUpdateRequest": {
        "properties": {
          "status": {
            "$ref": "#/components/schemas/FeedbackStatus"
          }
        },
        "type": "object",
        "required": [
          "status"
        ],
        "title": "StatusUpdateRequest",
        "description": "Request to update feedback domain status."
      },
      "StockActionTimeline": {
        "properties": {
          "raw_code": {
            "type": "string",
            "title": "Raw Code"
          },
          "constituent_ticker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Constituent Ticker"
          },
          "constituent_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Constituent Name",
            "description": "股票主檔名稱；對不到主檔時為投信回報的原始名稱"
          },
          "asset_type": {
            "type": "string",
            "title": "Asset Type"
          },
          "current_close_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Close Price"
          },
          "baseline_close_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Baseline Close Price"
          },
          "price_delta": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Delta"
          },
          "price_change_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Change Pct"
          },
          "actions": {
            "items": {
              "$ref": "#/components/schemas/StockDailyAction"
            },
            "type": "array",
            "title": "Actions"
          }
        },
        "type": "object",
        "required": [
          "raw_code",
          "asset_type",
          "actions"
        ],
        "title": "StockActionTimeline"
      },
      "StockDailyAction": {
        "properties": {
          "as_of_date": {
            "type": "string",
            "format": "date",
            "title": "As Of Date"
          },
          "previous_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Date"
          },
          "change_type": {
            "type": "string",
            "title": "Change Type"
          },
          "prev_quantity": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prev Quantity"
          },
          "curr_quantity": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Curr Quantity"
          },
          "quantity_delta": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantity Delta"
          },
          "prev_weight_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prev Weight Pct"
          },
          "curr_weight_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Curr Weight Pct"
          },
          "weight_delta_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Weight Delta Pct"
          }
        },
        "type": "object",
        "required": [
          "as_of_date",
          "change_type"
        ],
        "title": "StockDailyAction"
      },
      "StockETFInfo": {
        "properties": {
          "etf_ticker": {
            "type": "string",
            "title": "Etf Ticker"
          },
          "etf_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Etf Name"
          },
          "weight_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Weight Pct"
          }
        },
        "type": "object",
        "required": [
          "etf_ticker"
        ],
        "title": "StockETFInfo",
        "description": "ETF that holds this stock as a constituent."
      },
      "StockInfo": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "english_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "English Name"
          },
          "market": {
            "type": "string",
            "title": "Market"
          },
          "industry": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Industry"
          },
          "sector": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sector"
          },
          "security_type": {
            "type": "string",
            "title": "Security Type",
            "default": "common"
          },
          "current_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Price"
          },
          "price_change": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Change"
          },
          "price_change_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Change Pct"
          },
          "volume": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Volume"
          },
          "last_updated": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Updated"
          },
          "etfs": {
            "items": {
              "$ref": "#/components/schemas/StockETFInfo"
            },
            "type": "array",
            "title": "Etfs",
            "default": []
          },
          "themes": {
            "items": {
              "$ref": "#/components/schemas/StockThemeInfo"
            },
            "type": "array",
            "title": "Themes",
            "default": []
          },
          "surveillance_status": {
            "type": "string",
            "title": "Surveillance Status",
            "default": "normal"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "name",
          "market"
        ],
        "title": "StockInfo",
        "description": "Stock information."
      },
      "StockListItem": {
        "properties": {
          "stock": {
            "$ref": "#/components/schemas/StockListStock"
          },
          "price": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StockListPrice"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "stock"
        ],
        "title": "StockListItem"
      },
      "StockListItemsResponse": {
        "properties": {
          "searchType": {
            "$ref": "#/components/schemas/StockListSearchType"
          },
          "searchID": {
            "type": "string",
            "title": "Searchid"
          },
          "found": {
            "type": "boolean",
            "title": "Found"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/StockListItem"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "searchType",
          "searchID",
          "found",
          "total",
          "items"
        ],
        "title": "StockListItemsResponse"
      },
      "StockListPrice": {
        "properties": {
          "asOfDate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Asofdate"
          },
          "close": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Close"
          },
          "change": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change"
          },
          "changePct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Changepct"
          },
          "fiveDayClose": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fivedayclose"
          },
          "fiveDayChange": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fivedaychange"
          },
          "fiveDayChangePct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fivedaychangepct"
          },
          "twentyDayClose": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Twentydayclose"
          },
          "twentyDayChange": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Twentydaychange"
          },
          "twentyDayChangePct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Twentydaychangepct"
          }
        },
        "type": "object",
        "title": "StockListPrice"
      },
      "StockListSearchType": {
        "type": "string",
        "enum": [
          "theme",
          "group",
          "watchlist"
        ],
        "title": "StockListSearchType"
      },
      "StockListStock": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "englishName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Englishname"
          }
        },
        "type": "object",
        "required": [
          "ticker"
        ],
        "title": "StockListStock"
      },
      "StockMarketSurveillanceStatusResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "status": {
            "type": "string",
            "enum": [
              "normal",
              "attention",
              "disposition"
            ],
            "title": "Status"
          },
          "as_of": {
            "type": "string",
            "format": "date",
            "title": "As Of"
          },
          "near_disposition_threshold": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/NearDispositionThresholdResponse"
              },
              {
                "type": "null"
              }
            ]
          },
          "active_events": {
            "items": {
              "$ref": "#/components/schemas/MarketSurveillanceEventResponse"
            },
            "type": "array",
            "title": "Active Events"
          },
          "is_attention": {
            "type": "boolean",
            "title": "Is Attention",
            "default": false
          },
          "is_disposition": {
            "type": "boolean",
            "title": "Is Disposition",
            "default": false
          },
          "latest_attention": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MarketSurveillanceEventResponse"
              },
              {
                "type": "null"
              }
            ]
          },
          "active_disposition": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MarketSurveillanceEventResponse"
              },
              {
                "type": "null"
              }
            ]
          },
          "recent_events": {
            "items": {
              "$ref": "#/components/schemas/MarketSurveillanceEventResponse"
            },
            "type": "array",
            "title": "Recent Events"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "status",
          "as_of"
        ],
        "title": "StockMarketSurveillanceStatusResponse"
      },
      "StockResolveRequest": {
        "properties": {
          "queries": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 100,
            "minItems": 1,
            "title": "Queries"
          },
          "market": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Market"
          },
          "limit_per_query": {
            "type": "integer",
            "maximum": 10.0,
            "minimum": 1.0,
            "title": "Limit Per Query",
            "default": 5
          }
        },
        "type": "object",
        "required": [
          "queries"
        ],
        "title": "StockResolveRequest",
        "description": "Batch stock-name/ticker resolve request."
      },
      "StockResolveResponse": {
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/StockResolveResult"
            },
            "type": "array",
            "title": "Results"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "matched_count": {
            "type": "integer",
            "title": "Matched Count"
          },
          "not_found_count": {
            "type": "integer",
            "title": "Not Found Count"
          }
        },
        "type": "object",
        "required": [
          "results",
          "total",
          "matched_count",
          "not_found_count"
        ],
        "title": "StockResolveResponse",
        "description": "Batch stock resolve response."
      },
      "StockResolveResult": {
        "properties": {
          "query": {
            "type": "string",
            "title": "Query"
          },
          "normalized_query": {
            "type": "string",
            "title": "Normalized Query"
          },
          "status": {
            "type": "string",
            "enum": [
              "matched",
              "not_found"
            ],
            "title": "Status"
          },
          "match_type": {
            "type": "string",
            "enum": [
              "exact_ticker",
              "exact_name",
              "exact_english_name",
              "fuzzy",
              "none"
            ],
            "title": "Match Type"
          },
          "ticker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ticker"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "stock": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StockSearchResult"
              },
              {
                "type": "null"
              }
            ]
          },
          "candidates": {
            "items": {
              "$ref": "#/components/schemas/StockSearchResult"
            },
            "type": "array",
            "title": "Candidates"
          }
        },
        "type": "object",
        "required": [
          "query",
          "normalized_query",
          "status",
          "match_type"
        ],
        "title": "StockResolveResult",
        "description": "Resolved best ticker for one input query."
      },
      "StockRuleSourceResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "config_source": {
            "type": "string",
            "title": "Config Source"
          },
          "version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          },
          "computed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Computed At"
          },
          "data_range": {
            "$ref": "#/components/schemas/DataRange"
          },
          "sample_count": {
            "type": "integer",
            "title": "Sample Count"
          },
          "quality_tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quality Tier"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings"
          },
          "n_rules": {
            "type": "integer",
            "title": "N Rules"
          },
          "channels": {
            "additionalProperties": true,
            "type": "object",
            "title": "Channels"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "config_source",
          "version",
          "computed_at",
          "data_range",
          "sample_count",
          "quality_tier",
          "warnings",
          "n_rules",
          "channels"
        ],
        "title": "StockRuleSourceResponse"
      },
      "StockRulesHistoryBySourceResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "sources": {
            "additionalProperties": {
              "items": {
                "$ref": "#/components/schemas/api__routes__stock_rules__HistoryEntry"
              },
              "type": "array"
            },
            "type": "object",
            "title": "Sources"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "sources"
        ],
        "title": "StockRulesHistoryBySourceResponse"
      },
      "StockRulesHistoryResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "config_source": {
            "type": "string",
            "title": "Config Source"
          },
          "entries": {
            "items": {
              "$ref": "#/components/schemas/api__routes__stock_rules__HistoryEntry"
            },
            "type": "array",
            "title": "Entries"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "config_source",
          "entries"
        ],
        "title": "StockRulesHistoryResponse"
      },
      "StockRulesResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "sources": {
            "additionalProperties": {
              "$ref": "#/components/schemas/SourceDetail"
            },
            "type": "object",
            "title": "Sources"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "sources"
        ],
        "title": "StockRulesResponse"
      },
      "StockRulesSummaryResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "sources": {
            "additionalProperties": {
              "$ref": "#/components/schemas/SummarySource"
            },
            "type": "object",
            "title": "Sources"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "sources"
        ],
        "title": "StockRulesSummaryResponse"
      },
      "StockSearchResponse": {
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/StockSearchResult"
            },
            "type": "array",
            "title": "Results"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "results",
          "total"
        ],
        "title": "StockSearchResponse",
        "description": "Stock search response."
      },
      "StockSearchResult": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "english_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "English Name"
          },
          "market": {
            "type": "string",
            "title": "Market"
          },
          "industry": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Industry"
          },
          "security_type": {
            "type": "string",
            "title": "Security Type",
            "default": "common"
          },
          "surveillance_status": {
            "type": "string",
            "title": "Surveillance Status",
            "default": "normal"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "name",
          "market"
        ],
        "title": "StockSearchResult",
        "description": "Stock search result."
      },
      "StockSignalsResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "trading_date": {
            "type": "string",
            "title": "Trading Date"
          },
          "technical": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DomainPayload"
              },
              {
                "type": "null"
              }
            ]
          },
          "chip": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DomainPayload"
              },
              {
                "type": "null"
              }
            ]
          },
          "financial": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DomainPayload"
              },
              {
                "type": "null"
              }
            ]
          },
          "cross_domain": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DomainPayload"
              },
              {
                "type": "null"
              }
            ]
          },
          "technical_signals": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TechnicalSignalSummary"
              },
              {
                "type": "null"
              }
            ]
          },
          "chip_signals": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ChipSignalSummary"
              },
              {
                "type": "null"
              }
            ]
          },
          "financial_signals": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FinancialSignalSummary"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "trading_date"
        ],
        "title": "StockSignalsResponse",
        "description": "Consolidated three-dimension signal response."
      },
      "StockThemeInfo": {
        "properties": {
          "theme": {
            "type": "string",
            "title": "Theme"
          },
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "company_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Company Name"
          },
          "role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role"
          }
        },
        "type": "object",
        "required": [
          "theme",
          "ticker"
        ],
        "title": "StockThemeInfo",
        "description": "Coverage theme membership for a stock."
      },
      "StoriesLatestResponse": {
        "properties": {
          "as_of": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "As Of"
          },
          "groups": {
            "items": {
              "$ref": "#/components/schemas/StoryGroup"
            },
            "type": "array",
            "title": "Groups"
          }
        },
        "type": "object",
        "required": [
          "as_of",
          "groups"
        ],
        "title": "StoriesLatestResponse"
      },
      "StoryGroup": {
        "properties": {
          "domain": {
            "type": "string",
            "title": "Domain"
          },
          "story_code": {
            "type": "string",
            "title": "Story Code"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "description": {
            "type": "string",
            "title": "Description",
            "default": ""
          },
          "direction": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Direction"
          },
          "conflict_group": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Conflict Group"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          },
          "truncated": {
            "type": "boolean",
            "title": "Truncated"
          },
          "stocks": {
            "items": {
              "$ref": "#/components/schemas/StoryStock"
            },
            "type": "array",
            "title": "Stocks"
          }
        },
        "type": "object",
        "required": [
          "domain",
          "story_code",
          "title",
          "count",
          "truncated",
          "stocks"
        ],
        "title": "StoryGroup"
      },
      "StoryHorizonMetrics": {
        "properties": {
          "days": {
            "type": "integer",
            "title": "Days"
          },
          "stock": {
            "$ref": "#/components/schemas/StoryMetricWindows"
          },
          "market": {
            "$ref": "#/components/schemas/StoryMetricWindows"
          }
        },
        "type": "object",
        "required": [
          "days",
          "stock",
          "market"
        ],
        "title": "StoryHorizonMetrics"
      },
      "StoryMetricWindows": {
        "properties": {
          "metrics_2y": {
            "$ref": "#/components/schemas/StoryMetrics"
          },
          "metrics_all": {
            "$ref": "#/components/schemas/StoryMetrics"
          }
        },
        "type": "object",
        "required": [
          "metrics_2y",
          "metrics_all"
        ],
        "title": "StoryMetricWindows"
      },
      "StoryMetrics": {
        "properties": {
          "event_count": {
            "type": "integer",
            "title": "Event Count"
          },
          "average_return": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Average Return"
          },
          "up_count": {
            "type": "integer",
            "title": "Up Count"
          },
          "average_up_return": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Average Up Return"
          },
          "down_count": {
            "type": "integer",
            "title": "Down Count"
          },
          "average_down_return": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Average Down Return"
          }
        },
        "type": "object",
        "required": [
          "event_count",
          "up_count",
          "down_count"
        ],
        "title": "StoryMetrics"
      },
      "StoryOverviewItem": {
        "properties": {
          "domain": {
            "type": "string",
            "title": "Domain"
          },
          "story_code": {
            "type": "string",
            "title": "Story Code"
          },
          "story_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Story Name"
          },
          "direction": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Direction"
          },
          "horizons": {
            "items": {
              "$ref": "#/components/schemas/StoryHorizonMetrics"
            },
            "type": "array",
            "title": "Horizons"
          }
        },
        "type": "object",
        "required": [
          "domain",
          "story_code"
        ],
        "title": "StoryOverviewItem"
      },
      "StoryRecommendationBucket": {
        "properties": {
          "strategy_key": {
            "type": "string",
            "title": "Strategy Key"
          },
          "direction": {
            "type": "string",
            "enum": [
              "long",
              "short"
            ],
            "title": "Direction"
          },
          "horizon": {
            "type": "integer",
            "title": "Horizon"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/StoryRecommendationItem"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "strategy_key",
          "direction",
          "horizon",
          "total"
        ],
        "title": "StoryRecommendationBucket"
      },
      "StoryRecommendationFilters": {
        "properties": {
          "strategy_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Strategy Key"
          },
          "limit_per_strategy": {
            "type": "integer",
            "title": "Limit Per Strategy"
          }
        },
        "type": "object",
        "required": [
          "limit_per_strategy"
        ],
        "title": "StoryRecommendationFilters"
      },
      "StoryRecommendationItem": {
        "properties": {
          "rank": {
            "type": "integer",
            "title": "Rank"
          },
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "stock_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stock Name"
          },
          "score": {
            "type": "number",
            "title": "Score"
          },
          "candidate_count": {
            "type": "integer",
            "title": "Candidate Count"
          },
          "current_story_set": {
            "$ref": "#/components/schemas/CurrentStorySet"
          },
          "selected_evidence": {
            "$ref": "#/components/schemas/SelectedStoryEvidence"
          }
        },
        "type": "object",
        "required": [
          "rank",
          "ticker",
          "score",
          "candidate_count",
          "current_story_set",
          "selected_evidence"
        ],
        "title": "StoryRecommendationItem"
      },
      "StoryRecommendationsResponse": {
        "properties": {
          "trade_date": {
            "type": "string",
            "format": "date",
            "title": "Trade Date"
          },
          "stats_as_of_date": {
            "type": "string",
            "format": "date",
            "title": "Stats As Of Date"
          },
          "rule_version": {
            "type": "string",
            "title": "Rule Version"
          },
          "score_version": {
            "type": "string",
            "title": "Score Version"
          },
          "score_window": {
            "type": "string",
            "const": "2y",
            "title": "Score Window"
          },
          "filters_applied": {
            "$ref": "#/components/schemas/StoryRecommendationFilters"
          },
          "strategies": {
            "items": {
              "$ref": "#/components/schemas/StoryRecommendationBucket"
            },
            "type": "array",
            "title": "Strategies"
          }
        },
        "type": "object",
        "required": [
          "trade_date",
          "stats_as_of_date",
          "rule_version",
          "score_version",
          "score_window",
          "filters_applied"
        ],
        "title": "StoryRecommendationsResponse"
      },
      "StoryStock": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          }
        },
        "type": "object",
        "required": [
          "ticker"
        ],
        "title": "StoryStock"
      },
      "StoryStrategyErrorResponse": {
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorDetail"
          }
        },
        "type": "object",
        "required": [
          "error"
        ],
        "title": "StoryStrategyErrorResponse",
        "description": "Error body for this router's 404 and 503."
      },
      "StoryStrategyKey": {
        "type": "string",
        "enum": [
          "long_d1",
          "short_d1",
          "long_d5",
          "short_d5",
          "long_d10",
          "short_d10",
          "long_d20",
          "short_d20",
          "long_d40",
          "short_d40",
          "long_d60",
          "short_d60"
        ],
        "title": "StoryStrategyKey"
      },
      "StoryStrategyOverviewResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "trade_date": {
            "type": "string",
            "format": "date",
            "title": "Trade Date"
          },
          "stats_as_of_date": {
            "type": "string",
            "format": "date",
            "title": "Stats As Of Date"
          },
          "rule_version": {
            "type": "string",
            "title": "Rule Version"
          },
          "stories": {
            "items": {
              "$ref": "#/components/schemas/StoryOverviewItem"
            },
            "type": "array",
            "title": "Stories"
          },
          "exact_story_set": {
            "$ref": "#/components/schemas/ExactStorySetOverview"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "trade_date",
          "stats_as_of_date",
          "rule_version",
          "exact_story_set"
        ],
        "title": "StoryStrategyOverviewResponse"
      },
      "StrategyMatchResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "trade_date": {
            "type": "string",
            "title": "Trade Date"
          },
          "strategy_key": {
            "type": "string",
            "title": "Strategy Key"
          },
          "rule_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rule Id"
          },
          "scope": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scope"
          },
          "score": {
            "type": "number",
            "title": "Score"
          },
          "ev_bonus": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ev Bonus"
          },
          "expected_value": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Value"
          },
          "metrics_2y": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metrics 2Y"
          },
          "metrics_all": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metrics All"
          },
          "support_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Support Count"
          },
          "rank": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rank"
          },
          "is_primary": {
            "type": "boolean",
            "title": "Is Primary"
          },
          "is_recommended": {
            "type": "boolean",
            "title": "Is Recommended"
          },
          "domain": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Domain"
          },
          "regime_slice": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Regime Slice"
          },
          "family_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Family Id"
          },
          "commodity_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Commodity Code"
          },
          "user_group_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Group Id"
          },
          "visibility": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Visibility"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "trade_date",
          "strategy_key",
          "score",
          "is_primary",
          "is_recommended"
        ],
        "title": "StrategyMatchResponse"
      },
      "StrategyOverviewResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "trade_date": {
            "type": "string",
            "title": "Trade Date"
          },
          "strategies": {
            "items": {
              "$ref": "#/components/schemas/StrategyStatus"
            },
            "type": "array",
            "title": "Strategies"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "trade_date",
          "strategies"
        ],
        "title": "StrategyOverviewResponse"
      },
      "StrategyStatus": {
        "properties": {
          "strategy_key": {
            "type": "string",
            "title": "Strategy Key"
          },
          "label": {
            "type": "string",
            "title": "Label"
          },
          "direction": {
            "type": "string",
            "title": "Direction"
          },
          "triggered": {
            "type": "boolean",
            "title": "Triggered"
          },
          "primary_rule": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SupportingRule"
              },
              {
                "type": "null"
              }
            ]
          },
          "supporting_rules": {
            "items": {
              "$ref": "#/components/schemas/SupportingRule"
            },
            "type": "array",
            "title": "Supporting Rules",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "strategy_key",
          "label",
          "direction",
          "triggered"
        ],
        "title": "StrategyStatus"
      },
      "StrategySummaryResponse": {
        "properties": {
          "strategy_key": {
            "type": "string",
            "title": "Strategy Key"
          },
          "match_count": {
            "type": "integer",
            "title": "Match Count"
          },
          "avg_hit_rate": {
            "type": "number",
            "title": "Avg Hit Rate"
          },
          "avg_score": {
            "type": "number",
            "title": "Avg Score"
          },
          "ticker_count": {
            "type": "integer",
            "title": "Ticker Count"
          }
        },
        "type": "object",
        "required": [
          "strategy_key",
          "match_count",
          "avg_hit_rate",
          "avg_score",
          "ticker_count"
        ],
        "title": "StrategySummaryResponse"
      },
      "StreakOptions": {
        "properties": {
          "foreign": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Foreign"
          },
          "trust": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Trust"
          },
          "dealer": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Dealer"
          }
        },
        "type": "object",
        "required": [
          "foreign",
          "trust",
          "dealer"
        ],
        "title": "StreakOptions",
        "description": "Available streak options for each investor type."
      },
      "StreakStock": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "investor_type": {
            "type": "string",
            "title": "Investor Type"
          },
          "streak_days": {
            "type": "integer",
            "title": "Streak Days"
          },
          "streak_shares": {
            "type": "integer",
            "title": "Streak Shares"
          },
          "close_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Close Price"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "name",
          "investor_type",
          "streak_days",
          "streak_shares"
        ],
        "title": "StreakStock",
        "description": "Stock with consecutive buy/sell streak."
      },
      "SummarySource": {
        "properties": {
          "version": {
            "type": "integer",
            "title": "Version"
          },
          "computed_at": {
            "type": "string",
            "title": "Computed At"
          },
          "data_range": {
            "$ref": "#/components/schemas/DataRange"
          },
          "sample_count": {
            "type": "integer",
            "title": "Sample Count"
          },
          "quality_tier": {
            "type": "string",
            "title": "Quality Tier"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings"
          },
          "n_rules": {
            "type": "integer",
            "title": "N Rules"
          }
        },
        "type": "object",
        "required": [
          "version",
          "computed_at",
          "data_range",
          "sample_count",
          "quality_tier",
          "warnings",
          "n_rules"
        ],
        "title": "SummarySource"
      },
      "SupplyChainAnalyzeRequest": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "trading_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trading Date"
          },
          "response_mode": {
            "type": "string",
            "title": "Response Mode",
            "default": "json"
          }
        },
        "type": "object",
        "required": [
          "ticker"
        ],
        "title": "SupplyChainAnalyzeRequest",
        "description": "Request body for LLM supply chain analysis."
      },
      "SupplyChainPathResponse": {
        "properties": {
          "ticker_a": {
            "type": "string",
            "title": "Ticker A"
          },
          "ticker_b": {
            "type": "string",
            "title": "Ticker B"
          },
          "found": {
            "type": "boolean",
            "title": "Found"
          },
          "path": {
            "items": {
              "$ref": "#/components/schemas/PathEdge"
            },
            "type": "array",
            "title": "Path"
          },
          "depth": {
            "type": "integer",
            "title": "Depth"
          }
        },
        "type": "object",
        "required": [
          "ticker_a",
          "ticker_b",
          "found",
          "path",
          "depth"
        ],
        "title": "SupplyChainPathResponse",
        "description": "Result of a supply chain path query."
      },
      "SupportingRule": {
        "properties": {
          "rule_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rule Id"
          },
          "catalog_key": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Catalog Key"
          },
          "scope": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scope"
          },
          "active": {
            "type": "boolean",
            "title": "Active",
            "default": false
          },
          "score": {
            "type": "number",
            "title": "Score"
          },
          "expected_value": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Value"
          },
          "metrics_2y": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metrics 2Y"
          },
          "metrics_all": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metrics All"
          },
          "conditions": {
            "additionalProperties": true,
            "type": "object",
            "title": "Conditions",
            "default": {}
          }
        },
        "type": "object",
        "required": [
          "score"
        ],
        "title": "SupportingRule"
      },
      "SyncStatusHistoryResponse": {
        "properties": {
          "rows": {
            "items": {
              "$ref": "#/components/schemas/SyncStatusRow"
            },
            "type": "array",
            "title": "Rows"
          },
          "summary": {
            "$ref": "#/components/schemas/SyncStatusSummary"
          }
        },
        "type": "object",
        "required": [
          "rows",
          "summary"
        ],
        "title": "SyncStatusHistoryResponse"
      },
      "SyncStatusMatrixResponse": {
        "properties": {
          "report_date": {
            "type": "string",
            "format": "date",
            "title": "Report Date"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/SyncStatusRow"
            },
            "type": "array",
            "title": "Rows"
          },
          "summary": {
            "$ref": "#/components/schemas/SyncStatusSummary"
          }
        },
        "type": "object",
        "required": [
          "report_date",
          "rows",
          "summary"
        ],
        "title": "SyncStatusMatrixResponse"
      },
      "SyncStatusRow": {
        "properties": {
          "market": {
            "type": "string",
            "title": "Market"
          },
          "capability": {
            "type": "string",
            "title": "Capability"
          },
          "ticker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ticker"
          },
          "run_date": {
            "type": "string",
            "format": "date",
            "title": "Run Date"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "retry_count": {
            "type": "integer",
            "title": "Retry Count"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "market",
          "capability",
          "run_date",
          "status",
          "retry_count"
        ],
        "title": "SyncStatusRow",
        "description": "A single ``sync_status`` row.\n\nPydantic v2 serialises ``date`` / ``datetime`` to ISO-8601 strings\nautomatically, so the wire format is unchanged — but the OpenAPI\nschema correctly advertises ``format: date`` / ``format: date-time``\ninstead of plain string."
      },
      "SyncStatusSummary": {
        "properties": {
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "success": {
            "type": "integer",
            "title": "Success"
          },
          "failed": {
            "type": "integer",
            "title": "Failed"
          },
          "skipped": {
            "type": "integer",
            "title": "Skipped"
          },
          "skipped_upstream_failure": {
            "type": "integer",
            "title": "Skipped Upstream Failure"
          }
        },
        "type": "object",
        "required": [
          "total",
          "success",
          "failed",
          "skipped",
          "skipped_upstream_failure"
        ],
        "title": "SyncStatusSummary"
      },
      "SyncStatusValue": {
        "type": "string",
        "enum": [
          "success",
          "failed",
          "skipped",
          "skipped_upstream_failure"
        ],
        "title": "SyncStatusValue",
        "description": "Allowed values for ``sync_status.status``.\n\nMirrors the CHECK constraint in migration 021.  FastAPI uses this\nenum for automatic 422 validation on the ``?status=`` query param,\neliminating the need for a manual validator."
      },
      "TableStatus": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "category": {
            "type": "string",
            "title": "Category"
          },
          "latest_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latest Date"
          },
          "row_count": {
            "type": "integer",
            "title": "Row Count",
            "default": 0
          },
          "prev_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prev Date"
          },
          "prev_count": {
            "type": "integer",
            "title": "Prev Count",
            "default": 0
          },
          "status": {
            "type": "string",
            "title": "Status"
          }
        },
        "type": "object",
        "required": [
          "name",
          "category",
          "status"
        ],
        "title": "TableStatus"
      },
      "TaskRunOut": {
        "properties": {
          "task_name": {
            "type": "string",
            "title": "Task Name"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "ended_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ended At"
          },
          "duration_seconds": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Seconds"
          },
          "in_progress": {
            "type": "boolean",
            "title": "In Progress",
            "default": false
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          }
        },
        "type": "object",
        "required": [
          "task_name",
          "status"
        ],
        "title": "TaskRunOut"
      },
      "TechnicalRecapResult": {
        "properties": {
          "trade_date": {
            "type": "string",
            "title": "Trade Date"
          },
          "headline": {
            "type": "string",
            "title": "Headline"
          },
          "market_summary": {
            "type": "string",
            "title": "Market Summary"
          },
          "breadth_summary": {
            "type": "string",
            "title": "Breadth Summary"
          },
          "group_summary": {
            "type": "string",
            "title": "Group Summary"
          },
          "stock_summary": {
            "type": "string",
            "title": "Stock Summary"
          },
          "risk_summary": {
            "type": "string",
            "title": "Risk Summary",
            "default": ""
          },
          "risks": {
            "items": {
              "$ref": "#/components/schemas/EvidenceItem"
            },
            "type": "array",
            "title": "Risks"
          },
          "period_type": {
            "type": "string",
            "enum": [
              "daily",
              "weekly",
              "monthly"
            ],
            "title": "Period Type",
            "default": "daily"
          },
          "period_start_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Period Start Date"
          },
          "period_end_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Period End Date"
          },
          "period_summary": {
            "type": "string",
            "title": "Period Summary",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "trade_date",
          "headline",
          "market_summary",
          "breadth_summary",
          "group_summary",
          "stock_summary"
        ],
        "title": "TechnicalRecapResult",
        "description": "Technical recap LLM result (daily / weekly / monthly).\n\nSee ChipRecapResult for the period / risks contract — this model mirrors\nit and adds a ``breadth_summary`` field that the daily technical prompt\nalready requires."
      },
      "TechnicalSignalSummary": {
        "properties": {
          "trading_date": {
            "type": "string",
            "title": "Trading Date"
          },
          "signal_type": {
            "type": "string",
            "title": "Signal Type"
          },
          "bias": {
            "type": "string",
            "title": "Bias"
          },
          "confidence": {
            "type": "number",
            "title": "Confidence"
          },
          "patterns": {
            "items": {
              "$ref": "#/components/schemas/PatternItem"
            },
            "type": "array",
            "title": "Patterns"
          },
          "support": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Support",
            "description": "Latest confirmed historical adjusted swing low: strict five bars on each side, no expiry; null when unavailable."
          },
          "resistance": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resistance",
            "description": "Latest confirmed historical adjusted swing high: strict five bars on each side, no expiry; null when unavailable."
          },
          "support_raw": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Support Raw",
            "description": "Latest strict five-plus-five swing low independently confirmed on raw OHLC; null when unavailable."
          },
          "resistance_raw": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resistance Raw",
            "description": "Latest strict five-plus-five swing high independently confirmed on raw OHLC; null when unavailable."
          },
          "structure_stop_raw": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Structure Stop Raw",
            "description": "Equals confirmed raw swing support; null when no pivot is available."
          },
          "reasons": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Reasons"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings"
          },
          "structured_signals": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Structured Signals"
          },
          "signal_summary": {
            "additionalProperties": true,
            "type": "object",
            "title": "Signal Summary"
          },
          "ta_index_groups": {
            "additionalProperties": true,
            "type": "object",
            "title": "Ta Index Groups"
          },
          "signals": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Signals"
          },
          "events": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Events"
          },
          "stories": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Stories"
          },
          "relations": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Relations"
          }
        },
        "type": "object",
        "required": [
          "trading_date",
          "signal_type",
          "bias",
          "confidence",
          "patterns",
          "reasons",
          "warnings"
        ],
        "title": "TechnicalSignalSummary",
        "description": "Technical dimension signal summary."
      },
      "TelemetryStatus": {
        "properties": {
          "latest_access_log_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latest Access Log At"
          },
          "ingestion_lag_seconds": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ingestion Lag Seconds"
          },
          "access_log_writer_running": {
            "type": "boolean",
            "title": "Access Log Writer Running"
          },
          "access_log_queue_depth": {
            "type": "integer",
            "title": "Access Log Queue Depth"
          },
          "access_log_queue_capacity": {
            "type": "integer",
            "title": "Access Log Queue Capacity"
          }
        },
        "type": "object",
        "required": [
          "latest_access_log_at",
          "ingestion_lag_seconds",
          "access_log_writer_running",
          "access_log_queue_depth",
          "access_log_queue_capacity"
        ],
        "title": "TelemetryStatus"
      },
      "Theme": {
        "properties": {
          "theme_id": {
            "type": "string",
            "title": "Theme Id"
          },
          "theme_name": {
            "type": "string",
            "title": "Theme Name"
          },
          "member_count": {
            "type": "integer",
            "title": "Member Count"
          },
          "is_eligible": {
            "type": "boolean",
            "title": "Is Eligible"
          }
        },
        "type": "object",
        "required": [
          "theme_id",
          "theme_name",
          "member_count",
          "is_eligible"
        ],
        "title": "Theme"
      },
      "ThemeAnalysisRequest": {
        "properties": {
          "theme_name": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "title": "Theme Name"
          },
          "date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "theme_name"
        ],
        "title": "ThemeAnalysisRequest"
      },
      "ThemeAnalysisResponse": {
        "properties": {
          "theme_name": {
            "type": "string",
            "title": "Theme Name"
          },
          "as_of_date": {
            "type": "string",
            "format": "date",
            "title": "As Of Date"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Generated At"
          },
          "report_version": {
            "type": "string",
            "title": "Report Version"
          },
          "report": {
            "type": "string",
            "minLength": 1,
            "title": "Report",
            "description": "Analysis prose produced directly by the selected independent output path"
          }
        },
        "type": "object",
        "required": [
          "theme_name",
          "as_of_date",
          "generated_at",
          "report_version",
          "report"
        ],
        "title": "ThemeAnalysisResponse"
      },
      "ThemeCapitalFlowDiffResponse": {
        "properties": {},
        "additionalProperties": true,
        "type": "object",
        "title": "ThemeCapitalFlowDiffResponse"
      },
      "ThemeDetail": {
        "properties": {
          "theme_name": {
            "type": "string",
            "title": "Theme Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "source": {
            "type": "string",
            "enum": [
              "manual",
              "coverage"
            ],
            "title": "Source"
          },
          "is_edited": {
            "type": "boolean",
            "title": "Is Edited"
          },
          "member_count": {
            "type": "integer",
            "title": "Member Count"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "members": {
            "items": {
              "$ref": "#/components/schemas/ThemeMemberOut"
            },
            "type": "array",
            "title": "Members"
          }
        },
        "type": "object",
        "required": [
          "theme_name",
          "source",
          "is_edited",
          "member_count",
          "created_at",
          "updated_at",
          "members"
        ],
        "title": "ThemeDetail"
      },
      "ThemeJobCandidateResponse": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "theme": {
            "type": "string",
            "title": "Theme"
          },
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "company_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Company Name"
          },
          "role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "confidence": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Confidence"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          },
          "evidence": {
            "items": {},
            "type": "array",
            "title": "Evidence"
          },
          "suggested_update": {
            "additionalProperties": true,
            "type": "object",
            "title": "Suggested Update"
          },
          "approved": {
            "type": "boolean",
            "title": "Approved",
            "default": true
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "theme",
          "ticker"
        ],
        "title": "ThemeJobCandidateResponse",
        "description": "Reviewable candidate returned with a theme generation job."
      },
      "ThemeJobResponse": {
        "properties": {
          "job_id": {
            "type": "string",
            "title": "Job Id"
          },
          "kind": {
            "type": "string",
            "enum": [
              "generate",
              "rebuild"
            ],
            "title": "Kind"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "completed",
              "failed",
              "published",
              "canceled"
            ],
            "title": "Status"
          },
          "theme": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Theme"
          },
          "progress": {
            "additionalProperties": true,
            "type": "object",
            "title": "Progress"
          },
          "result": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Result"
          },
          "candidates": {
            "items": {
              "$ref": "#/components/schemas/ThemeJobCandidateResponse"
            },
            "type": "array",
            "title": "Candidates"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "published_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Published At"
          }
        },
        "type": "object",
        "required": [
          "job_id",
          "kind",
          "status",
          "theme",
          "progress"
        ],
        "title": "ThemeJobResponse",
        "description": "Theme job status and result response."
      },
      "ThemeJobStartedResponse": {
        "properties": {
          "job_id": {
            "type": "string",
            "title": "Job Id"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "completed",
              "failed",
              "published",
              "canceled"
            ],
            "title": "Status"
          },
          "kind": {
            "type": "string",
            "enum": [
              "generate",
              "rebuild"
            ],
            "title": "Kind"
          },
          "theme": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Theme"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "job_id",
          "status",
          "kind",
          "theme",
          "created_at"
        ],
        "title": "ThemeJobStartedResponse",
        "description": "Response returned when a long-running theme job starts."
      },
      "ThemeListResponse": {
        "properties": {
          "themes": {
            "items": {
              "$ref": "#/components/schemas/ThemeSummary"
            },
            "type": "array",
            "title": "Themes"
          }
        },
        "type": "object",
        "required": [
          "themes"
        ],
        "title": "ThemeListResponse"
      },
      "ThemeMemberIn": {
        "properties": {
          "ticker": {
            "type": "string",
            "pattern": "^\\d{4,6}$",
            "title": "Ticker"
          },
          "company_name": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "title": "Company Name"
          },
          "role": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "upstream",
                  "midstream",
                  "downstream",
                  "related"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Role"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "company_name"
        ],
        "title": "ThemeMemberIn",
        "description": "One member of a manual write payload; ``ticker`` is a bare stock code."
      },
      "ThemeMemberOut": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "company_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Company Name"
          },
          "listing_type": {
            "type": "string",
            "title": "Listing Type"
          },
          "role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role"
          },
          "source": {
            "type": "string",
            "enum": [
              "manual",
              "coverage"
            ],
            "title": "Source"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "listing_type",
          "source"
        ],
        "title": "ThemeMemberOut"
      },
      "ThemeMemberPageResponse": {
        "properties": {},
        "additionalProperties": true,
        "type": "object",
        "title": "ThemeMemberPageResponse"
      },
      "ThemeMembersResponse": {
        "properties": {
          "theme_name": {
            "type": "string",
            "title": "Theme Name"
          },
          "members": {
            "items": {
              "$ref": "#/components/schemas/ThemeMemberOut"
            },
            "type": "array",
            "title": "Members"
          }
        },
        "type": "object",
        "required": [
          "theme_name",
          "members"
        ],
        "title": "ThemeMembersResponse"
      },
      "ThemeMembershipResponse": {
        "properties": {
          "theme": {
            "type": "string",
            "title": "Theme"
          },
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "company_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Company Name"
          },
          "role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role"
          }
        },
        "type": "object",
        "required": [
          "theme",
          "ticker"
        ],
        "title": "ThemeMembershipResponse",
        "description": "A theme membership entry."
      },
      "ThemePageEditResponse": {
        "properties": {
          "theme": {
            "type": "string",
            "title": "Theme"
          },
          "members": {
            "items": {
              "$ref": "#/components/schemas/ThemePageMember"
            },
            "type": "array",
            "title": "Members"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings"
          },
          "sync_report": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sync Report"
          },
          "excluded_for_rebuild": {
            "type": "boolean",
            "title": "Excluded For Rebuild",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "theme",
          "members",
          "warnings"
        ],
        "title": "ThemePageEditResponse",
        "description": "Response after a theme page member edit (write succeeded)."
      },
      "ThemePageMember": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "company_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Company Name"
          },
          "role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role"
          },
          "manual": {
            "type": "boolean",
            "title": "Manual",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "ticker"
        ],
        "title": "ThemePageMember",
        "description": "A member parsed from a theme page."
      },
      "ThemePageMembersResponse": {
        "properties": {
          "theme": {
            "type": "string",
            "title": "Theme"
          },
          "members": {
            "items": {
              "$ref": "#/components/schemas/ThemePageMember"
            },
            "type": "array",
            "title": "Members"
          }
        },
        "type": "object",
        "required": [
          "theme",
          "members"
        ],
        "title": "ThemePageMembersResponse",
        "description": "Members parsed from a theme page (page as the source of truth)."
      },
      "ThemeRecapResponse": {
        "properties": {},
        "additionalProperties": true,
        "type": "object",
        "title": "ThemeRecapResponse"
      },
      "ThemeSearchResult": {
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "theme",
              "stock"
            ],
            "title": "Kind"
          },
          "theme_id": {
            "type": "string",
            "title": "Theme Id"
          },
          "ticker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ticker"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "member_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Count"
          }
        },
        "type": "object",
        "required": [
          "kind",
          "theme_id"
        ],
        "title": "ThemeSearchResult"
      },
      "ThemeSignalPageResponse": {
        "properties": {},
        "additionalProperties": true,
        "type": "object",
        "title": "ThemeSignalPageResponse"
      },
      "ThemeSnapshot": {
        "properties": {
          "theme_name": {
            "type": "string",
            "title": "Theme Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "members": {
            "items": {
              "$ref": "#/components/schemas/TransferMember"
            },
            "type": "array",
            "maxItems": 1000,
            "minItems": 1,
            "title": "Members"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "theme_name",
          "description",
          "members"
        ],
        "title": "ThemeSnapshot"
      },
      "ThemeStock": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "english_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "English Name"
          },
          "industry": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Industry"
          },
          "sector": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sector"
          },
          "security_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Security Type"
          },
          "price": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PricePayload"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "ticker"
        ],
        "title": "ThemeStock"
      },
      "ThemeStocksResponse": {
        "properties": {
          "theme_id": {
            "type": "string",
            "title": "Theme Id"
          },
          "theme_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Theme Name"
          },
          "found": {
            "type": "boolean",
            "title": "Found"
          },
          "member_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Count"
          },
          "stocks": {
            "items": {
              "$ref": "#/components/schemas/ThemeStock"
            },
            "type": "array",
            "title": "Stocks"
          }
        },
        "type": "object",
        "required": [
          "theme_id",
          "found",
          "stocks"
        ],
        "title": "ThemeStocksResponse"
      },
      "ThemeSummary": {
        "properties": {
          "theme_name": {
            "type": "string",
            "title": "Theme Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "source": {
            "type": "string",
            "enum": [
              "manual",
              "coverage"
            ],
            "title": "Source"
          },
          "is_edited": {
            "type": "boolean",
            "title": "Is Edited"
          },
          "member_count": {
            "type": "integer",
            "title": "Member Count"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "theme_name",
          "source",
          "is_edited",
          "member_count",
          "created_at",
          "updated_at"
        ],
        "title": "ThemeSummary"
      },
      "ThemeTransferApplyResponse": {
        "properties": {
          "source_environment": {
            "type": "string",
            "title": "Source Environment"
          },
          "target_environment": {
            "type": "string",
            "title": "Target Environment"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/ThemeTransferResult"
            },
            "type": "array",
            "title": "Results"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "source_environment",
          "target_environment",
          "results"
        ],
        "title": "ThemeTransferApplyResponse"
      },
      "ThemeTransferMemberChange": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "before": {
            "$ref": "#/components/schemas/TransferMember"
          },
          "after": {
            "$ref": "#/components/schemas/TransferMember"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "ticker",
          "before",
          "after"
        ],
        "title": "ThemeTransferMemberChange"
      },
      "ThemeTransferPreviewItem": {
        "properties": {
          "theme_name": {
            "type": "string",
            "title": "Theme Name"
          },
          "action": {
            "type": "string",
            "enum": [
              "create",
              "update",
              "unchanged",
              "conflict",
              "invalid"
            ],
            "title": "Action"
          },
          "current_member_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Member Count"
          },
          "incoming_member_count": {
            "type": "integer",
            "title": "Incoming Member Count"
          },
          "description_changed": {
            "type": "boolean",
            "title": "Description Changed"
          },
          "added_members": {
            "items": {
              "$ref": "#/components/schemas/TransferMember"
            },
            "type": "array",
            "title": "Added Members"
          },
          "removed_members": {
            "items": {
              "$ref": "#/components/schemas/TransferMember"
            },
            "type": "array",
            "title": "Removed Members"
          },
          "changed_members": {
            "items": {
              "$ref": "#/components/schemas/ThemeTransferMemberChange"
            },
            "type": "array",
            "title": "Changed Members"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "theme_name",
          "action",
          "current_member_count",
          "incoming_member_count",
          "description_changed",
          "added_members",
          "removed_members",
          "changed_members",
          "error"
        ],
        "title": "ThemeTransferPreviewItem"
      },
      "ThemeTransferPreviewResponse": {
        "properties": {
          "source_environment": {
            "type": "string",
            "title": "Source Environment"
          },
          "target_environment": {
            "type": "string",
            "title": "Target Environment"
          },
          "preview_token": {
            "type": "string",
            "title": "Preview Token"
          },
          "expires_at": {
            "type": "string",
            "title": "Expires At"
          },
          "themes": {
            "items": {
              "$ref": "#/components/schemas/ThemeTransferPreviewItem"
            },
            "type": "array",
            "title": "Themes"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "source_environment",
          "target_environment",
          "preview_token",
          "expires_at",
          "themes"
        ],
        "title": "ThemeTransferPreviewResponse"
      },
      "ThemeTransferResult": {
        "properties": {
          "theme_name": {
            "type": "string",
            "title": "Theme Name"
          },
          "status": {
            "type": "string",
            "enum": [
              "created",
              "updated",
              "unchanged",
              "failed"
            ],
            "title": "Status"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "theme_name",
          "status",
          "error"
        ],
        "title": "ThemeTransferResult"
      },
      "TierFeatures": {
        "properties": {
          "ai_analysis": {
            "type": "boolean",
            "title": "Ai Analysis"
          },
          "portfolio_export": {
            "type": "boolean",
            "title": "Portfolio Export"
          },
          "realtime_quote": {
            "type": "boolean",
            "title": "Realtime Quote",
            "description": "Enables the realtime quote / intraday REST and SSE endpoints"
          },
          "max_watchlists": {
            "type": "integer",
            "title": "Max Watchlists"
          },
          "max_watchlist_items": {
            "type": "integer",
            "title": "Max Watchlist Items",
            "description": "Maximum total watchlist items across all groups for one member; -1 means unlimited"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "ai_analysis",
          "portfolio_export",
          "realtime_quote",
          "max_watchlists",
          "max_watchlist_items"
        ],
        "title": "TierFeatures"
      },
      "TierPermissionItem": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name"
          },
          "level": {
            "type": "integer",
            "title": "Level"
          },
          "features": {
            "additionalProperties": true,
            "type": "object",
            "title": "Features"
          },
          "rate_limits": {
            "additionalProperties": true,
            "type": "object",
            "title": "Rate Limits"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "reserved": {
            "type": "boolean",
            "title": "Reserved"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "display_name",
          "level",
          "features",
          "rate_limits",
          "is_active",
          "updated_at",
          "reserved"
        ],
        "title": "TierPermissionItem"
      },
      "TierPermissionListResponse": {
        "properties": {
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/TierPermissionItem"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "total",
          "items"
        ],
        "title": "TierPermissionListResponse"
      },
      "TierQuotasResponse": {
        "properties": {
          "tier": {
            "type": "string",
            "title": "Tier"
          },
          "quotas": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "object",
            "title": "Quotas"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "tier",
          "quotas",
          "updated_at"
        ],
        "title": "TierQuotasResponse"
      },
      "TierRateLimits": {
        "properties": {
          "requests_per_minute": {
            "type": "integer",
            "title": "Requests Per Minute"
          },
          "daily_analyses": {
            "type": "integer",
            "title": "Daily Analyses"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "requests_per_minute",
          "daily_analyses"
        ],
        "title": "TierRateLimits"
      },
      "TokenPolicy": {
        "properties": {
          "access_token_ttl_minutes": {
            "type": "integer",
            "title": "Access Token Ttl Minutes"
          },
          "refresh_token_ttl_days": {
            "type": "integer",
            "title": "Refresh Token Ttl Days"
          },
          "online_source": {
            "type": "string",
            "const": "persisted_access_token_expiry",
            "title": "Online Source"
          }
        },
        "type": "object",
        "required": [
          "access_token_ttl_minutes",
          "refresh_token_ttl_days",
          "online_source"
        ],
        "title": "TokenPolicy"
      },
      "TopInstitutionalStock": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "net_shares": {
            "type": "integer",
            "title": "Net Shares"
          },
          "net_value": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Net Value"
          },
          "close_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Close Price"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "name",
          "net_shares"
        ],
        "title": "TopInstitutionalStock",
        "description": "Stock with top institutional buying/selling."
      },
      "TransferApplyRequest": {
        "properties": {
          "source_environment": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{0,31}$",
            "title": "Source Environment"
          },
          "target_environment": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{0,31}$",
            "title": "Target Environment"
          },
          "themes": {
            "items": {
              "$ref": "#/components/schemas/ThemeSnapshot"
            },
            "type": "array",
            "maxItems": 50,
            "minItems": 1,
            "title": "Themes"
          },
          "preview_token": {
            "type": "string",
            "maxLength": 64000,
            "minLength": 1,
            "title": "Preview Token"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "source_environment",
          "target_environment",
          "themes",
          "preview_token"
        ],
        "title": "TransferApplyRequest"
      },
      "TransferEnvironment": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "label": {
            "type": "string",
            "title": "Label"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "id",
          "label"
        ],
        "title": "TransferEnvironment"
      },
      "TransferEnvironmentsResponse": {
        "properties": {
          "source_environment": {
            "type": "string",
            "title": "Source Environment"
          },
          "targets": {
            "items": {
              "$ref": "#/components/schemas/TransferEnvironment"
            },
            "type": "array",
            "title": "Targets"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "source_environment",
          "targets"
        ],
        "title": "TransferEnvironmentsResponse"
      },
      "TransferMember": {
        "properties": {
          "ticker": {
            "type": "string",
            "pattern": "^[0-9]{4,6}$",
            "title": "Ticker"
          },
          "company_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Company Name"
          },
          "role": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "upstream",
                  "midstream",
                  "downstream",
                  "related"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Role"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "ticker",
          "company_name",
          "role"
        ],
        "title": "TransferMember"
      },
      "TransferReceiveRequest": {
        "properties": {
          "source_environment": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{0,31}$",
            "title": "Source Environment"
          },
          "target_environment": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{0,31}$",
            "title": "Target Environment"
          },
          "themes": {
            "items": {
              "$ref": "#/components/schemas/ThemeSnapshot"
            },
            "type": "array",
            "maxItems": 50,
            "minItems": 1,
            "title": "Themes"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "source_environment",
          "target_environment",
          "themes"
        ],
        "title": "TransferReceiveRequest"
      },
      "TransferSelection": {
        "properties": {
          "target_environment": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{0,31}$",
            "title": "Target Environment"
          },
          "theme_names": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 50,
            "minItems": 1,
            "title": "Theme Names"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "target_environment",
          "theme_names"
        ],
        "title": "TransferSelection"
      },
      "TransferSendRequest": {
        "properties": {
          "target_environment": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{0,31}$",
            "title": "Target Environment"
          },
          "theme_names": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 50,
            "minItems": 1,
            "title": "Theme Names"
          },
          "preview_token": {
            "type": "string",
            "maxLength": 64000,
            "minLength": 1,
            "title": "Preview Token"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "target_environment",
          "theme_names",
          "preview_token"
        ],
        "title": "TransferSendRequest"
      },
      "TrendInfo": {
        "properties": {
          "overall": {
            "type": "string",
            "title": "Overall"
          },
          "short_term": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Short Term"
          },
          "medium_term": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Medium Term"
          }
        },
        "type": "object",
        "required": [
          "overall"
        ],
        "title": "TrendInfo",
        "description": "Trend information."
      },
      "TurnAroundStock": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "investor_type": {
            "type": "string",
            "title": "Investor Type"
          },
          "previous_streak": {
            "type": "integer",
            "title": "Previous Streak"
          },
          "current_net": {
            "type": "integer",
            "title": "Current Net"
          },
          "close_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Close Price"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "name",
          "investor_type",
          "previous_streak",
          "current_net"
        ],
        "title": "TurnAroundStock",
        "description": "Stock where institutional investor changed direction."
      },
      "TurnaroundOptions": {
        "properties": {
          "buy_to_sell_streaks": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "Buy To Sell Streaks"
          },
          "sell_to_buy_streaks": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "Sell To Buy Streaks"
          }
        },
        "type": "object",
        "required": [
          "buy_to_sell_streaks",
          "sell_to_buy_streaks"
        ],
        "title": "TurnaroundOptions",
        "description": "Available options for turnaround analysis based on actual data."
      },
      "UpdateAdminFlagRequest": {
        "properties": {
          "is_admin": {
            "type": "boolean",
            "title": "Is Admin"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "type": "object",
        "required": [
          "is_admin"
        ],
        "title": "UpdateAdminFlagRequest"
      },
      "UpdateAdminFlagResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "is_admin": {
            "type": "boolean",
            "title": "Is Admin"
          }
        },
        "type": "object",
        "required": [
          "id",
          "is_admin"
        ],
        "title": "UpdateAdminFlagResponse"
      },
      "UpdateDataRequest": {
        "properties": {
          "markets": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Markets"
          },
          "force": {
            "type": "boolean",
            "title": "Force",
            "default": false
          }
        },
        "type": "object",
        "title": "UpdateDataRequest",
        "description": "Data update request."
      },
      "UpdateDataResponse": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "job_id": {
            "type": "string",
            "title": "Job Id"
          },
          "estimated_time_minutes": {
            "type": "integer",
            "title": "Estimated Time Minutes"
          }
        },
        "type": "object",
        "required": [
          "status",
          "job_id",
          "estimated_time_minutes"
        ],
        "title": "UpdateDataResponse",
        "description": "Data update response."
      },
      "UpdateDayTradeRequest": {
        "properties": {
          "buy_price": {
            "anyOf": [
              {
                "type": "number",
                "exclusiveMinimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Buy Price"
          },
          "sell_price": {
            "anyOf": [
              {
                "type": "number",
                "exclusiveMinimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Sell Price"
          },
          "quantity": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantity"
          },
          "transaction_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Transaction Date"
          },
          "fee_buy": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Fee Buy"
          },
          "fee_sell": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Fee Sell"
          },
          "tax_buy": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Tax Buy"
          },
          "tax_sell": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Tax Sell"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "broker_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Broker Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "UpdateDayTradeRequest",
        "description": "Partial-update body for PUT /api/portfolio/day-trades/{pair_id}.\n\nEvery field is optional. Supplied fields overwrite the corresponding leg\nvalue; omitted fields preserve the existing row. `direction` is\nintentionally absent — callers who want to change direction must delete\nand re-create the pair."
      },
      "UpdateDayTradeResponse": {
        "properties": {
          "pair_id": {
            "type": "string",
            "title": "Pair Id"
          },
          "buy_transaction_id": {
            "type": "string",
            "title": "Buy Transaction Id"
          },
          "sell_transaction_id": {
            "type": "string",
            "title": "Sell Transaction Id"
          },
          "realized_pnl": {
            "type": "number",
            "title": "Realized Pnl"
          },
          "tax_sell_applied": {
            "type": "number",
            "title": "Tax Sell Applied"
          }
        },
        "type": "object",
        "required": [
          "pair_id",
          "buy_transaction_id",
          "sell_transaction_id",
          "realized_pnl",
          "tax_sell_applied"
        ],
        "title": "UpdateDayTradeResponse",
        "description": "Response schema for PUT /api/portfolio/day-trades/{pair_id}."
      },
      "UpdateMemberStatusRequest": {
        "properties": {
          "status": {
            "type": "string",
            "pattern": "^(active|suspended|deleted)$",
            "title": "Status"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "type": "object",
        "required": [
          "status"
        ],
        "title": "UpdateMemberStatusRequest"
      },
      "UpdateMemberStatusResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "revoked_refresh_token_count": {
            "type": "integer",
            "title": "Revoked Refresh Token Count"
          }
        },
        "type": "object",
        "required": [
          "id",
          "status",
          "revoked_refresh_token_count"
        ],
        "title": "UpdateMemberStatusResponse"
      },
      "UpdateMemberTierRequest": {
        "properties": {
          "tier": {
            "type": "string",
            "maxLength": 50,
            "minLength": 1,
            "title": "Tier"
          },
          "reason": {
            "type": "string",
            "maxLength": 500,
            "minLength": 1,
            "title": "Reason"
          }
        },
        "type": "object",
        "required": [
          "tier",
          "reason"
        ],
        "title": "UpdateMemberTierRequest"
      },
      "UpdateMemberTierResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "previous_tier": {
            "type": "string",
            "title": "Previous Tier"
          },
          "tier": {
            "type": "string",
            "title": "Tier"
          },
          "changed": {
            "type": "boolean",
            "title": "Changed"
          }
        },
        "type": "object",
        "required": [
          "id",
          "previous_tier",
          "tier",
          "changed"
        ],
        "title": "UpdateMemberTierResponse"
      },
      "UpdateProfileRequest": {
        "properties": {
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "avatar_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avatar Url"
          }
        },
        "type": "object",
        "title": "UpdateProfileRequest"
      },
      "UpdateRun": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "job_name": {
            "type": "string",
            "title": "Job Name"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "started_at": {
            "type": "string",
            "title": "Started At"
          },
          "ended_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ended At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "job_name",
          "status",
          "started_at"
        ],
        "title": "UpdateRun"
      },
      "UpdateTierPermissionsRequest": {
        "properties": {
          "features": {
            "$ref": "#/components/schemas/TierFeatures"
          },
          "rate_limits": {
            "$ref": "#/components/schemas/TierRateLimits"
          },
          "expected_updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expected Updated At"
          },
          "reason": {
            "type": "string",
            "maxLength": 500,
            "minLength": 1,
            "title": "Reason"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "features",
          "rate_limits",
          "expected_updated_at",
          "reason"
        ],
        "title": "UpdateTierPermissionsRequest"
      },
      "UpdateTierPermissionsResponse": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name"
          },
          "level": {
            "type": "integer",
            "title": "Level"
          },
          "features": {
            "additionalProperties": true,
            "type": "object",
            "title": "Features"
          },
          "rate_limits": {
            "additionalProperties": true,
            "type": "object",
            "title": "Rate Limits"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "reserved": {
            "type": "boolean",
            "title": "Reserved"
          },
          "changed": {
            "type": "boolean",
            "title": "Changed"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "display_name",
          "level",
          "features",
          "rate_limits",
          "is_active",
          "updated_at",
          "reserved",
          "changed"
        ],
        "title": "UpdateTierPermissionsResponse"
      },
      "UpdateTransactionRequest": {
        "properties": {
          "action": {
            "type": "string",
            "pattern": "^(buy|sell|stock_dividend|cash_dividend)$",
            "title": "Action"
          },
          "sell_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sell Type"
          },
          "price_per_share": {
            "type": "number",
            "minimum": 0.0,
            "title": "Price Per Share"
          },
          "quantity": {
            "type": "integer",
            "exclusiveMinimum": 0.0,
            "title": "Quantity"
          },
          "fee": {
            "type": "number",
            "title": "Fee",
            "default": 0
          },
          "tax": {
            "type": "number",
            "title": "Tax",
            "default": 0
          },
          "transaction_date": {
            "type": "string",
            "title": "Transaction Date"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "broker_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Broker Id"
          },
          "closes_lots": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/LotClosureSpec"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Closes Lots"
          }
        },
        "type": "object",
        "required": [
          "action",
          "price_per_share",
          "quantity",
          "transaction_date"
        ],
        "title": "UpdateTransactionRequest",
        "description": "Request body for ``PUT /api/portfolio/transactions/{id}``.\n\nSupports ``closes_lots`` for validate-first-replace: when present on a\nsell update, the endpoint first validates the new closures (in memory\nand against the DB view of open lots, excluding this sell's own\nexisting closures), then deletes old closures, inserts new closures,\nupdates the transaction row, and commits once. Requests to a\nday-trade pair leg are rejected with 400."
      },
      "UpdateUserGroupRequest": {
        "properties": {
          "group_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Group Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          }
        },
        "type": "object",
        "title": "UpdateUserGroupRequest"
      },
      "UpsertBrokerRequest": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name"
          },
          "fee_rate": {
            "type": "number",
            "minimum": 0.0,
            "title": "Fee Rate"
          },
          "fee_discount": {
            "type": "number",
            "minimum": 0.0,
            "title": "Fee Discount",
            "default": 1.0
          },
          "is_default": {
            "type": "boolean",
            "title": "Is Default",
            "default": false
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          }
        },
        "type": "object",
        "required": [
          "name",
          "fee_rate"
        ],
        "title": "UpsertBrokerRequest"
      },
      "UserGroupMatchResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "trade_date": {
            "type": "string",
            "title": "Trade Date"
          },
          "strategy_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Strategy Key"
          },
          "rule_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rule Id"
          },
          "score": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Score"
          },
          "metrics_2y": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metrics 2Y"
          },
          "metrics_all": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metrics All"
          },
          "rank": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rank"
          },
          "is_primary": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Primary"
          },
          "domain": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Domain"
          },
          "regime_slice": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Regime Slice"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "trade_date"
        ],
        "title": "UserGroupMatchResponse"
      },
      "UserGroupMemberResponse": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "added_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Added At"
          },
          "removed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Removed At"
          }
        },
        "type": "object",
        "required": [
          "ticker"
        ],
        "title": "UserGroupMemberResponse"
      },
      "UserGroupResponse": {
        "properties": {
          "group_id": {
            "type": "string",
            "title": "Group Id"
          },
          "group_name": {
            "type": "string",
            "title": "Group Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "member_count": {
            "type": "integer",
            "title": "Member Count",
            "default": 0
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "group_id",
          "group_name",
          "is_active"
        ],
        "title": "UserGroupResponse"
      },
      "UserGroupRuleResponse": {
        "properties": {
          "rule_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rule Id"
          },
          "strategy_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Strategy Key"
          },
          "domain": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Domain"
          },
          "regime_slice": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Regime Slice"
          },
          "metrics_2y": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metrics 2Y"
          },
          "metrics_all": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metrics All"
          }
        },
        "type": "object",
        "title": "UserGroupRuleResponse"
      },
      "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"
      },
      "ValuationMetric": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "trade_date": {
            "type": "string",
            "format": "date",
            "title": "Trade Date"
          },
          "pe_ratio": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pe Ratio"
          },
          "pb_ratio": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pb Ratio"
          },
          "dividend_yield": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dividend Yield"
          },
          "dividend_per_share": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dividend Per Share"
          },
          "source_market": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Market"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "trade_date"
        ],
        "title": "ValuationMetric"
      },
      "WatchlistAdvice": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "action": {
            "type": "string",
            "title": "Action"
          },
          "composite": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Composite"
          },
          "scores": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "object",
            "title": "Scores",
            "default": {}
          },
          "evidence": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Evidence",
            "default": []
          },
          "strategies": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Strategies",
            "default": []
          },
          "close": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Close"
          },
          "as_of": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "object",
            "title": "As Of",
            "default": {}
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "action"
        ],
        "title": "WatchlistAdvice"
      },
      "WatchlistAdviceResponse": {
        "properties": {
          "advices": {
            "items": {
              "$ref": "#/components/schemas/WatchlistAdvice"
            },
            "type": "array",
            "title": "Advices"
          },
          "market": {
            "additionalProperties": true,
            "type": "object",
            "title": "Market"
          },
          "as_of": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "object",
            "title": "As Of"
          },
          "disclaimer": {
            "type": "string",
            "title": "Disclaimer"
          }
        },
        "type": "object",
        "required": [
          "advices",
          "market",
          "as_of",
          "disclaimer"
        ],
        "title": "WatchlistAdviceResponse"
      },
      "WatchlistGroup": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "display_order": {
            "type": "integer",
            "title": "Display Order"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "display_order"
        ],
        "title": "WatchlistGroup"
      },
      "WatchlistItem": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "group_id": {
            "type": "string",
            "title": "Group Id"
          },
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "display_order": {
            "type": "integer",
            "title": "Display Order"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "added_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Added At"
          },
          "latest_ohlc": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LatestOHLC"
              },
              {
                "type": "null"
              }
            ]
          },
          "price": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PricePayload"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "id",
          "group_id",
          "ticker",
          "display_order"
        ],
        "title": "WatchlistItem"
      },
      "api__routes__etf_holdings__HistoryEntry": {
        "properties": {
          "as_of_date": {
            "type": "string",
            "format": "date",
            "title": "As Of Date"
          },
          "holdings": {
            "items": {
              "$ref": "#/components/schemas/ETFHoldingItem"
            },
            "type": "array",
            "title": "Holdings"
          }
        },
        "type": "object",
        "required": [
          "as_of_date",
          "holdings"
        ],
        "title": "HistoryEntry"
      },
      "api__routes__stock_rules__HistoryEntry": {
        "properties": {
          "version": {
            "type": "integer",
            "title": "Version"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "computed_at": {
            "type": "string",
            "title": "Computed At"
          },
          "data_range": {
            "$ref": "#/components/schemas/DataRange"
          },
          "sample_count": {
            "type": "integer",
            "title": "Sample Count"
          },
          "quality_tier": {
            "type": "string",
            "title": "Quality Tier"
          },
          "n_rules": {
            "type": "integer",
            "title": "N Rules"
          },
          "channels": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Channels"
          }
        },
        "type": "object",
        "required": [
          "version",
          "is_active",
          "computed_at",
          "data_range",
          "sample_count",
          "quality_tier",
          "n_rules"
        ],
        "title": "HistoryEntry"
      },
      "RateLimitError": {
        "description": "Rate-limit error body. `error` is a message string, not an object.",
        "properties": {
          "error": {
            "title": "Error",
            "type": "string"
          }
        },
        "required": [
          "error"
        ],
        "title": "RateLimitError",
        "type": "object"
      }
    }
  }
}