feat(nav): Enhance product API with historical NAV tracking and new charting features

- Updated `ready.py` to include a health check for the new `products_nav_history` endpoint, ensuring system readiness.
- Enhanced the `ProductNavChartPanel` component to visualize historical NAV data with various charting options, including line and column charts.
- Introduced new utility functions for filtering and aggregating NAV data, improving data handling in the frontend.
- Updated tests to verify the inclusion of the new `products_nav_history` check in the API response.
- Improved documentation to reflect recent changes and the new testing baseline of 833 passed tests, indicating enhanced stability.

This update significantly improves the product API by providing access to historical NAV data and enhancing user insights through visualizations.
This commit is contained in:
2026-09-11 21:38:54 +08:00
parent 2b4eaa9725
commit d4a2461ba4
16 changed files with 5975 additions and 5328 deletions
+4 -4
View File
@@ -9,7 +9,7 @@
**项目是什么:** 金融四 Agent(客户财富 / 代理人 / 数据分析 / 风控)共用数据层与合规底座;**不**互调 LLM,跨 Agent 走 L1/L2/L3 画像与预警表。
**当前进度:** 需求与表设计已定 · **风控 TEST-RISK-001(含 F12)** · **833 pytest** · **22 Vitest** · **Redis @ 6380** · **`merger` 未 commit** · **⚠️ 代理人 Agent 未完整接入**(顾问 Chat 骨架在,T-20/A 线未做,答辩勿作主 Demo)
**当前进度:** 需求与表设计已定 · **833 pytest** · **26 Vitest** · **Redis @ 6380** · **`merger` 未 commit** · **⚠️ 代理人 Agent 未完整接入**
**工作分支:** 团队开发在 **`merger`**;历史 `risk-control-agent` 交付冻结。
@@ -62,7 +62,7 @@
| `docs/项目框架设计/接口契约-代销平台API-v0.2-行情扩展草案.md` | **草案(2026-09-09)** | `nav-snapshot` · `sync_market_nav` · 前端产品行情 Phase B |
| `docs/项目框架设计/表设计/` | 已定 | Agent 共用 11 表 + agent 专用 SQL |
| `docs/项目框架设计/Core模拟底座/` | 已定 | 无真实 Core 时的 L0 方案 |
| `web/` | **P0 Demo 齐备 + 行情详情(2026-09-11)** | 四角色 Dashboard/Chat · **`/app/market/:productId` 近一年净值曲线** · ChatPanel 流式 · 清单见 `docs/整体测试/前端整体测试交接.md` |
| `web/` | **P0 + 行情详情图表(2026-09-11)** | **`/app/market/:productId`**:时间区间/日周粒度/走势·涨跌柱·组合图 · 时间轴 scale · **DevReadyBanner 防旧后端假绿** · `restart-dev.ps1` 校验 `nav/history` |
**本地 bootstrap(首次):** 完整步骤与前置说明见 `FLOW.md` §0(权威),速览:
@@ -175,7 +175,7 @@ audit_log 等审计表(只 INSERT)
| **C-07** | 风评查询走 Core;**「重新测评/重做风评」** → 引导 App/网点(Agent 内不做问卷) | `customer_prompts._RISK_KW` |
| **C-08** | 仅 L1 槽位 `investment.allocation_target`(13 槽);**无自动偏离检测/调仓** | `profile_slots.py` |
| **问数 vs 分析对话** | 问数页 + **`/interpret`** · **N-03 抽样溯源** · **N-07 escalate/失败转人工** · 分析对话 URL **重定向问数** | spec `2026-09-11-query-interpret-split-design.md` |
| **客户「趋势/走势」** | **客户 Chat**:仅 **C-05 最新净值快照** + 持仓/流水;**走势预测/实时盘口 reject** · **平台「产品行情」**:列表 + **`GET nav/history` 详情折线**(customer/advisor/analyst/风控可读;compliance 无菜单/API 403)· **无 Chat 内历史曲线 Tool** · 统计类趋势 → **问数** `self` 域 · **D-12 看板钻取未做** | Phase B 外部 sync 未做 |
| **客户「趋势/走势」** | **平台行情详情**:`nav/history` + **区间(1M~ALL)/粒度(日周)/图型(走势/涨跌柱/组合)** · Chat 仍无历史 Tool · Phase B 外部 sync 未做 | 见 `web/src/utils/navChartSeries.ts` |
| **L0 优先** | 抽槽与 L0 撞车**永远听 L0**;L1 只 enrich 措辞 | `profile_slots` D7 |
------
@@ -192,7 +192,7 @@ Core 模拟:scripts/core/reset.ps1 · 文档 docs/项目框架设计/Core模
Redis:`docker compose up -d redis` · `REDIS_URL=redis://127.0.0.1:6380/0` · `scripts/dev/start-redis.ps1`
测试:python -m pytest(**833 绿**;集成需本机 MySQL + AML + 风控演示数据)
风控沙盘:`python scripts/dev/sandbox_risk_test.py`(TEST-RISK-001)
前端:cd web && npm run dev · npm run build/test/lint(**22** Vitest)· 四角色 Demo 见 `docs/frontend/FRONTEND-HANDOFF.md` §8
前端:cd web && npm run dev · npm run build/test/lint(**26** Vitest)· 四角色 Demo 见 **`docs/frontend/FRONTEND-HANDOFF.md` §8** · 本地后端 **`scripts/dev/restart-dev.ps1 -Backend Local`**
问数模板:mysql … < scripts/agent/seed-analyst-query-templates.sql
风控一键灌库:.\scripts\demo\prepare_all.ps1
运维/演示脚本:scripts/demo/subscribe_alerts.py(订阅推送演示)· rebuild_alerts.py TRD-xxx(引擎异常补偿重放)