Files
zhanghongyu_0626 3fb0ceb334 Enhance suitability assessment and documentation
- Implemented `check_suitability` method in `CoreReadOnlyRepository` for suitability determination based on customer and product risk levels.
- Added `build_suitability_log_row` function in `suitability.py` for mapping suitability check results to `risk_suitability_log`.
- Updated `AGENTS.md`, `ENVIRONMENT.md`, and `FLOW.md` to reflect changes in suitability assessment processes and documentation.
- Revised `FRAMEWORK.md` and `MEMORY.md` to clarify project structure and data flow related to suitability checks.
- Expanded `TODO.md` with tasks related to logging and auditing suitability assessments.
2026-09-07 11:15:30 +08:00

3.6 KiB
Raw Permalink Blame History

Core 模拟底座 · 表结构与种子说明

状态:已落地 · 库名 jinrong_core · 2026-09-07 对齐客户资料手册

方案:00-方案总览.md

客户规则来源:docs/来自客户的项目资料/金融/


1. 已确认决策

| 项 | 决定 |

| --- | --- |

| 库名 | jinrong_core |

| 访问方式 | CoreReadOnlyRepository 只读 SQL,无 HTTP API |

| 种子规模 | 33 客户(28 通用 + 5 手册示范 CUST-DEMO-*)、13 员工、14 产品 |

| 适当性 | core_suitability_rule C×R 矩阵(《适当性管理指南》第十二条) |

| Neo4j | P0 必做 · scripts/sync/sync_neo4j.py |

| 行情 | 静态 core_product_nav seed |


2. 表清单(对齐客户手册)

见 scripts/core/01-ddl.sql

| 表 | 说明 | 对齐文档 |

| --- | --- | --- |

| core_risk_grade | C1C5 / R1R5 字典 | 适当性指南 §6、§11 |

| core_suitability_rule | C×R 匹配矩阵 | 适当性指南 §12 |

| core_staff | 内部员工 + roles JSON | JWT/RBAC 联调 |

| core_customer | L0 KYC:性别/学历/收入/资产/高净值/PEP/AML 等 | 用户信息数据示例 §1 |

| core_customer_risk | L0 风评:问卷得分/目标/期限/过期/专业投资者 | 适当性指南 §8–10、FM-03 |

| core_customer_advisor | 归属 → sync agent 库 | F-01 |

| core_product | 产品 + 起购金额/期限/风险揭示书 | C-11、适当性指南 §11 |

| core_holding / core_trade / core_cash_flow | 持仓/流水 + AML 渠道/对手方/代付 | 反洗钱规则 RW-001~020 |

| core_product_nav | 净值 C-05 | — |

| core_industry | 行业(Neo4j BELONGS_TO) | — |


3. 手册示范客户(联调推荐)

| customer_id | 原型 | C 等级 | 用途 |

| --- | --- | --- | --- |

| CUST-DEMO-A | 张晓明·年轻白领 | C2 | 定投/购房/C-07 |

| CUST-DEMO-B | 王建国·高净值企业主 | C4 | 私募/专业投资者认定 |

| CUST-DEMO-C | 陈秀兰·退休保守 | C1 | 适老化/银行理财/大额存单 |

| CUST-DEMO-D | 李伟·医生均衡 | C3 | 子女教育/养老规划 |

| CUST-DEMO-E | 赵鹏·科技激进 | C5 | 集中度/AML 代付样例 |

特殊联调客户(原有种子):

| customer_id | 用途 |

| --- | --- |

| CUST-4001 | 70 岁 + C5 + 买 R5(FM-01 年龄限制) |

| CUST-4002 | C1 持有 R4 产品(适当性冲突) |

| CUST-3001 | 大额交易 R-01 |

| CUST-1003 | 风评已过期(FM-03) |


4. Repository 能力

app/repository/core_ro.py:

| 方法 | 说明 |

| --- | --- |

| get_customer_l0 | 完整 KYC + 风评 |

| check_suitability | R-02:矩阵 + 风评过期 + 专业投资者豁免 + FM-01 年龄 |

| list_products_for_customer | C-11 匹配列表 |

| list_holdings / list_trades | 事实查询 |


5. 脚本与代码

| 路径 | 作用 |

| --- | --- |

| scripts/core/00~06-*.sql | 建库 + 种子 |

| scripts/core/reset.ps1 | 一键重置 |

| scripts/sync/sync_advisor_rel.py | → customer_advisor_rel |

| scripts/sync/sync_neo4j.py | → Neo4j 图 |


6. 环境变量


MYSQL_CORE_DATABASE=jinrong_core

NEO4J_URI=bolt://localhost:7687

NEO4J_PASSWORD=...


7. 关联文档