docs(plan): 新增计划书 form_sn 映射文档
- 创建 form-sn-mapping.md 文档,提供完整的 form_sn 到模版组件的映射关系 - 创建 form-sn-mapping.json 文件,提供机器可读的映射数据 - 包含 8 个产品的映射(人寿保险 2 个、重疾保险 3 个、储蓄保险 4 个) - 提供后端集成指南,包括 API 返回示例、命名规范、新产品接入流程 - 明确职责分工:后端只负责返回 form_sn 字段,前端处理具体配置 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Showing
3 changed files
with
299 additions
and
0 deletions
| ... | @@ -5,6 +5,24 @@ | ... | @@ -5,6 +5,24 @@ |
| 5 | 5 | ||
| 6 | --- | 6 | --- |
| 7 | 7 | ||
| 8 | +## [2026-02-06] - 新增 form_sn 映射文档 | ||
| 9 | + | ||
| 10 | +### 文档 | ||
| 11 | +- 创建 `form-sn-mapping.md` 文档,提供完整的 form_sn 映射关系说明 | ||
| 12 | +- 创建 `form-sn-mapping.json` 文件,提供机器可读的映射数据 | ||
| 13 | + | ||
| 14 | +### 核心内容 | ||
| 15 | +- **8 个产品的 form_sn 映射**:人寿保险(2个)、重疾保险(3个)、储蓄保险(4个) | ||
| 16 | +- **3 种模版组件说明**:LifeInsuranceTemplate、CriticalIllnessTemplate、SavingsTemplate | ||
| 17 | +- **后端集成指南**:包含 API 返回示例、命名规范、新产品接入流程 | ||
| 18 | + | ||
| 19 | +### 文件位置 | ||
| 20 | +- 文档:`docs/form-sn-mapping.md` | ||
| 21 | +- JSON:`docs/form-sn-mapping.json` | ||
| 22 | +- 配置源文件:`src/config/plan-templates.js` | ||
| 23 | + | ||
| 24 | +--- | ||
| 25 | + | ||
| 8 | ## [2026-02-06] - 计划书生成模块架构与经验教训总结 | 26 | ## [2026-02-06] - 计划书生成模块架构与经验教训总结 |
| 9 | 27 | ||
| 10 | ### 文档 | 28 | ### 文档 | ... | ... |
docs/form-sn-mapping.json
0 → 100644
| 1 | +{ | ||
| 2 | + "version": "1.0", | ||
| 3 | + "updated_at": "2026-02-06", | ||
| 4 | + "description": "计划书 form_sn 映射表 - 后端根据产品返回对应的 form_sn,前端根据该字段选择模版组件", | ||
| 5 | + "note": "所有配置细节(币种、缴费年期等)由前端处理,后端只需要返回正确的 form_sn 字段", | ||
| 6 | + "templates": { | ||
| 7 | + "LifeInsuranceTemplate": { | ||
| 8 | + "name": "人寿保险模版", | ||
| 9 | + "description": "用于人寿保险产品的计划书生成" | ||
| 10 | + }, | ||
| 11 | + "CriticalIllnessTemplate": { | ||
| 12 | + "name": "重疾保险模版", | ||
| 13 | + "description": "用于重疾保险产品的计划书生成" | ||
| 14 | + }, | ||
| 15 | + "SavingsTemplate": { | ||
| 16 | + "name": "储蓄保险模版", | ||
| 17 | + "description": "用于储蓄型保险产品的计划书生成(含提取计划)" | ||
| 18 | + } | ||
| 19 | + }, | ||
| 20 | + "mapping": { | ||
| 21 | + "life-insurance-wiop3e": { | ||
| 22 | + "product_name": "WIOP3E 盈传创富保障计划 3 - 优选版", | ||
| 23 | + "template": "LifeInsuranceTemplate" | ||
| 24 | + }, | ||
| 25 | + "life-insurance-wiop3": { | ||
| 26 | + "product_name": "WIOP3 - 盈传创富保障计划 3", | ||
| 27 | + "template": "LifeInsuranceTemplate" | ||
| 28 | + }, | ||
| 29 | + "critical-illness-mpc": { | ||
| 30 | + "product_name": "MPC 守护无间重疾", | ||
| 31 | + "template": "CriticalIllnessTemplate" | ||
| 32 | + }, | ||
| 33 | + "critical-illness-mbc-pro": { | ||
| 34 | + "product_name": "MBC PRO 活跃人生重疾保 PRO", | ||
| 35 | + "template": "CriticalIllnessTemplate" | ||
| 36 | + }, | ||
| 37 | + "critical-illness-mbc2": { | ||
| 38 | + "product_name": "MBC2 活跃人生重疾保 2", | ||
| 39 | + "template": "CriticalIllnessTemplate" | ||
| 40 | + }, | ||
| 41 | + "savings-gs": { | ||
| 42 | + "product_name": "宏挚传承保障计划(GS)", | ||
| 43 | + "template": "SavingsTemplate" | ||
| 44 | + }, | ||
| 45 | + "savings-gc": { | ||
| 46 | + "product_name": "宏挚家传保险计划(GC)", | ||
| 47 | + "template": "SavingsTemplate" | ||
| 48 | + }, | ||
| 49 | + "savings-fa": { | ||
| 50 | + "product_name": "宏浚传承保障计划(FA)", | ||
| 51 | + "template": "SavingsTemplate" | ||
| 52 | + }, | ||
| 53 | + "savings-lv2": { | ||
| 54 | + "product_name": "赤霞珠终身寿险计划2(LV2)", | ||
| 55 | + "template": "SavingsTemplate" | ||
| 56 | + } | ||
| 57 | + }, | ||
| 58 | + "naming_convention": { | ||
| 59 | + "format": "{模版类型}-{产品简称}", | ||
| 60 | + "prefixes": { | ||
| 61 | + "life-insurance-": "人寿保险", | ||
| 62 | + "critical-illness-": "重疾保险", | ||
| 63 | + "savings-": "储蓄保险" | ||
| 64 | + } | ||
| 65 | + }, | ||
| 66 | + "api_example": { | ||
| 67 | + "product_list": { | ||
| 68 | + "code": 1, | ||
| 69 | + "data": [ | ||
| 70 | + { | ||
| 71 | + "id": 1, | ||
| 72 | + "product_name": "WIOP3E 盈传创富保障计划 3 - 优选版", | ||
| 73 | + "form_sn": "life-insurance-wiop3e" | ||
| 74 | + }, | ||
| 75 | + { | ||
| 76 | + "id": 2, | ||
| 77 | + "product_name": "MPC 守护无间重疾", | ||
| 78 | + "form_sn": "critical-illness-mpc" | ||
| 79 | + }, | ||
| 80 | + { | ||
| 81 | + "id": 3, | ||
| 82 | + "product_name": "宏挚传承保障计划", | ||
| 83 | + "form_sn": "savings-gs" | ||
| 84 | + } | ||
| 85 | + ] | ||
| 86 | + } | ||
| 87 | + } | ||
| 88 | +} |
docs/form-sn-mapping.md
0 → 100644
| 1 | +# 计划书 form_sn 映射文档 | ||
| 2 | + | ||
| 3 | +**版本**: v1.0 | ||
| 4 | +**更新日期**: 2026-02-06 | ||
| 5 | +**用途**: 后端根据产品返回对应的 `form_sn` 字段,前端根据该字段选择对应的计划书模版组件 | ||
| 6 | + | ||
| 7 | +--- | ||
| 8 | + | ||
| 9 | +## 🎯 核心映射关系 | ||
| 10 | + | ||
| 11 | +### 系统架构 | ||
| 12 | + | ||
| 13 | +``` | ||
| 14 | +产品 API 返回 form_sn | ||
| 15 | + ↓ | ||
| 16 | +前端根据 form_sn 查找映射表 | ||
| 17 | + ↓ | ||
| 18 | +决定使用哪个模版组件(3选1) | ||
| 19 | + ↓ | ||
| 20 | +前端加载对应的配置 | ||
| 21 | +``` | ||
| 22 | + | ||
| 23 | +### 3 个模版组件 | ||
| 24 | + | ||
| 25 | +| 模版组件 | 说明 | | ||
| 26 | +|---------|------| | ||
| 27 | +| `LifeInsuranceTemplate` | 人寿保险模版 | | ||
| 28 | +| `CriticalIllnessTemplate` | 重疾保险模版 | | ||
| 29 | +| `SavingsTemplate` | 储蓄保险模版(含提取计划) | | ||
| 30 | + | ||
| 31 | +--- | ||
| 32 | + | ||
| 33 | +## 🏷️ form_sn → 模版组件映射表 | ||
| 34 | + | ||
| 35 | +### 完整映射表(后端必读) | ||
| 36 | + | ||
| 37 | +```javascript | ||
| 38 | +const FORM_SN_TO_TEMPLATE = { | ||
| 39 | + // 人寿保险 → LifeInsuranceTemplate | ||
| 40 | + 'life-insurance-wiop3e': 'LifeInsuranceTemplate', | ||
| 41 | + 'life-insurance-wiop3': 'LifeInsuranceTemplate', | ||
| 42 | + | ||
| 43 | + // 重疾保险 → CriticalIllnessTemplate | ||
| 44 | + 'critical-illness-mpc': 'CriticalIllnessTemplate', | ||
| 45 | + 'critical-illness-mbc-pro': 'CriticalIllnessTemplate', | ||
| 46 | + 'critical-illness-mbc2': 'CriticalIllnessTemplate', | ||
| 47 | + | ||
| 48 | + // 储蓄保险 → SavingsTemplate | ||
| 49 | + 'savings-gs': 'SavingsTemplate', | ||
| 50 | + 'savings-gc': 'SavingsTemplate', | ||
| 51 | + 'savings-fa': 'SavingsTemplate', | ||
| 52 | + 'savings-lv2': 'SavingsTemplate' | ||
| 53 | +} | ||
| 54 | +``` | ||
| 55 | + | ||
| 56 | +--- | ||
| 57 | + | ||
| 58 | +## 📋 产品清单 | ||
| 59 | + | ||
| 60 | +### 人寿保险产品(使用 LifeInsuranceTemplate) | ||
| 61 | + | ||
| 62 | +| form_sn | 产品名称 | | ||
| 63 | +|---------|---------| | ||
| 64 | +| `life-insurance-wiop3e` | WIOP3E 盈传创富保障计划 3 - 优选版 | | ||
| 65 | +| `life-insurance-wiop3` | WIOP3 - 盈传创富保障计划 3 | | ||
| 66 | + | ||
| 67 | +--- | ||
| 68 | + | ||
| 69 | +### 重疾保险产品(使用 CriticalIllnessTemplate) | ||
| 70 | + | ||
| 71 | +| form_sn | 产品名称 | | ||
| 72 | +|---------|---------| | ||
| 73 | +| `critical-illness-mpc` | MPC 守护无间重疾 | | ||
| 74 | +| `critical-illness-mbc-pro` | MBC PRO 活跃人生重疾保 PRO | | ||
| 75 | +| `critical-illness-mbc2` | MBC2 活跃人生重疾保 2 | | ||
| 76 | + | ||
| 77 | +--- | ||
| 78 | + | ||
| 79 | +### 储蓄保险产品(使用 SavingsTemplate) | ||
| 80 | + | ||
| 81 | +| form_sn | 产品名称 | | ||
| 82 | +|---------|---------| | ||
| 83 | +| `savings-gs` | 宏挚传承保障计划(GS) | | ||
| 84 | +| `savings-gc` | 宏挚家传保险计划(GC) | | ||
| 85 | +| `savings-fa` | 宏浚传承保障计划(FA) | | ||
| 86 | +| `savings-lv2` | 赤霞珠终身寿险计划2(LV2) | | ||
| 87 | + | ||
| 88 | +--- | ||
| 89 | + | ||
| 90 | +## 💡 后端集成指南 | ||
| 91 | + | ||
| 92 | +### 1. 产品列表 API 示例 | ||
| 93 | + | ||
| 94 | +```json | ||
| 95 | +{ | ||
| 96 | + "code": 1, | ||
| 97 | + "data": [ | ||
| 98 | + { | ||
| 99 | + "id": 1, | ||
| 100 | + "product_name": "WIOP3E 盈传创富保障计划 3 - 优选版", | ||
| 101 | + "form_sn": "life-insurance-wiop3e" | ||
| 102 | + }, | ||
| 103 | + { | ||
| 104 | + "id": 2, | ||
| 105 | + "product_name": "MPC 守护无间重疾", | ||
| 106 | + "form_sn": "critical-illness-mpc" | ||
| 107 | + }, | ||
| 108 | + { | ||
| 109 | + "id": 3, | ||
| 110 | + "product_name": "宏挚传承保障计划", | ||
| 111 | + "form_sn": "savings-gs" | ||
| 112 | + } | ||
| 113 | + ] | ||
| 114 | +} | ||
| 115 | +``` | ||
| 116 | + | ||
| 117 | +### 2. form_sn 命名规范 | ||
| 118 | + | ||
| 119 | +**格式**: `{模版类型}-{产品简称}` | ||
| 120 | + | ||
| 121 | +| 模版类型 | 前缀 | 示例 | | ||
| 122 | +|---------|------|------| | ||
| 123 | +| 人寿保险 | `life-insurance-` | `life-insurance-wiop3e` | | ||
| 124 | +| 重疾保险 | `critical-illness-` | `critical-illness-mpc` | | ||
| 125 | +| 储蓄保险 | `savings-` | `savings-gs` | | ||
| 126 | + | ||
| 127 | +### 3. 新产品接入流程 | ||
| 128 | + | ||
| 129 | +**步骤 1**: 确定产品类型(人寿/重疾/储蓄) | ||
| 130 | + | ||
| 131 | +**步骤 2**: 选择对应的前缀 | ||
| 132 | +- 人寿保险 → `life-insurance-xxx` | ||
| 133 | +- 重疾保险 → `critical-illness-xxx` | ||
| 134 | +- 储蓄保险 → `savings-xxx` | ||
| 135 | + | ||
| 136 | +**步骤 3**: 与前端确认 form_sn 值 | ||
| 137 | +- 后端提供产品基本信息 | ||
| 138 | +- 前端确认使用哪个模版组件 | ||
| 139 | +- 前端更新配置文件(`src/config/plan-templates.js`) | ||
| 140 | + | ||
| 141 | +**注意**: | ||
| 142 | +- ✅ 后端只负责返回 form_sn 字段 | ||
| 143 | +- ✅ 所有配置细节(币种、缴费年期等)由前端处理 | ||
| 144 | +- ❌ 后端不需要关心具体配置 | ||
| 145 | + | ||
| 146 | +--- | ||
| 147 | + | ||
| 148 | +## 📦 前端配置文件 | ||
| 149 | + | ||
| 150 | +**配置源文件**: `src/config/plan-templates.js` | ||
| 151 | + | ||
| 152 | +前端根据 form_sn 查找配置: | ||
| 153 | + | ||
| 154 | +```javascript | ||
| 155 | +export const PLAN_TEMPLATES = { | ||
| 156 | + 'life-insurance-wiop3e': { | ||
| 157 | + name: 'WIOP3E 盈传创富保障计划 3 - 优选版', | ||
| 158 | + component: 'LifeInsuranceTemplate', // 使用哪个模版 | ||
| 159 | + config: { | ||
| 160 | + // 前端处理的配置细节 | ||
| 161 | + currency: 'USD', | ||
| 162 | + payment_periods: [...], | ||
| 163 | + age_range: { min: 0, max: 75 }, | ||
| 164 | + insurance_period: '终身' | ||
| 165 | + } | ||
| 166 | + } | ||
| 167 | +} | ||
| 168 | +``` | ||
| 169 | + | ||
| 170 | +--- | ||
| 171 | + | ||
| 172 | +## ✅ 后端检查清单 | ||
| 173 | + | ||
| 174 | +产品 API 开发完成前请确认: | ||
| 175 | + | ||
| 176 | +- [ ] 产品 API 返回 `form_sn` 字段 | ||
| 177 | +- [ ] `form_sn` 值与映射表中的 key 完全一致 | ||
| 178 | +- [ ] 新产品上线前与前端确认 form_sn | ||
| 179 | +- [ ] 了解 3 个模版组件的区别(人寿/重疾/储蓄) | ||
| 180 | + | ||
| 181 | +--- | ||
| 182 | + | ||
| 183 | +## 📞 联系方式 | ||
| 184 | + | ||
| 185 | +如有疑问或需要新增产品,请联系前端开发团队。 | ||
| 186 | + | ||
| 187 | +--- | ||
| 188 | + | ||
| 189 | +## 🔄 版本历史 | ||
| 190 | + | ||
| 191 | +| 版本 | 日期 | 变更说明 | | ||
| 192 | +|------|------|----------| | ||
| 193 | +| v1.0 | 2026-02-06 | 初始版本,定义 3 个模版组件和 8 个产品的映射关系 | |
-
Please register or login to post a comment