refactor: 出库时间更名为首次购买套餐时间,换货新资产不再按换货完成时间记录
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Failing after 38s

- 字段 outbound_at → first_purchase_at,记录表 tb_asset_outbound_record → tb_asset_first_purchase_record,接口 /outbound-records → /first-purchase-records,筛选参数与导出列同步更名
- 换货后的新资产不因换货写入,在当前世代真正支付套餐订单时才记录;记录来源只保留 order / backfill,去掉换货单字段
- 迁移 000266 重命名列、表、索引与约束;同步 Spec、设计、任务与前端接口变更说明

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
邹进
2026-10-27 16:47:02 +09:00
parent 909f4d0ec2
commit 62ec94adec
46 changed files with 570 additions and 560 deletions

View File

@@ -13,7 +13,7 @@
| 延期资格、试算、下单、线下登记、特殊延期 | 返回错误码 **1274** | 可用 |
| 套餐默认沉默期、延期政策、企微审批场景配置 | 可用 | 可用 |
| 购买时调整沉默期 | 可用 | 可用 |
| 卡 / 设备出库时间 | 不受开关影响 | 不受开关影响 |
| 卡 / 设备首次购买套餐时间 | 不受开关影响 | 不受开关影响 |
后台"系统配置"通用接口不能修改总开关(只读),请用专用接口:
@@ -83,12 +83,13 @@
沉默期已过期的套餐申请退款返回 **1268**(总开关打开时)。
## 8. 卡 / 设备出库时间
## 8. 卡 / 设备首次购买套餐时间
- 卡列表、设备列表返回 `outbound_at`,支持 `outbound_start`、`outbound_end`(RFC3339)筛选;卡详情、设备详情、资产解析返回 `outbound_at`。
- 卡、设备导出末尾新增"出库时间"列。
- 出库记录:`GET /api/admin/assets/:asset_type/:id/outbound-records`(asset_type 为 card / device),按世代倒序,含来源(首次购买套餐 / 换货新资产 / 历史回填)、订单号或换货单号、结束时间与原因。
- 绑定在设备上的卡不记录出库时间;只读,不提供修改。
- 卡列表、设备列表返回 `first_purchase_at`,支持 `first_purchase_start`、`first_purchase_end`(RFC3339)筛选;卡详情、设备详情、资产解析返回 `first_purchase_at`。
- 卡、设备导出末尾新增"首次购买套餐时间"列。
- 首次购买套餐记录:`GET /api/admin/assets/:asset_type/:id/first-purchase-records`(asset_type 为 card / device),按世代倒序,含来源(首次购买套餐 / 历史回填)、订单号、结束时间与原因。
- 换货后的新资产不会因换货得到首次购买套餐时间,要等它在当前世代真正支付套餐订单;旧资产换货回库后该时间清空,旧世代记录带结束时间与原因"换货回库"。
- 绑定在设备上的卡不记录首次购买套餐时间;只读,不提供修改。
## 9. 错误码