liuyun 19876fdadd chore(openspec): 归档 C1/C2/C3 change,spec 合并进主 specs
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-15 01:13:08 +08:00

42 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Tasks — svc-org-c1-elder
## 1. 数据层
- [ ] 1.1 `schema.prisma` 新增 `Elder`、`ElderStatusLog` 模型(含唯一索引 tenant_code+id_card_no)。
- [ ] 1.2 `prisma.service.ts`:`Elder` 加入 SOFT_DELETE。
- [ ] 1.3 迁移 `c1_elder`(utf8mb4_general_ci,手改 collation)+ `prisma generate`。
## 2. 权限码 + 错误码 + 资源
- [ ] 2.1 确认 `permissions.ts` 已有 `elder.list/create/detail/status-change`(C0 预留);补 `elder:*` 缺项。
- [ ] 2.2 `error-codes.ts` 补 elder 域错误码(域 43):ELDER_NOT_FOUND、ELDER_ID_CARD_EXISTS、ELDER_STATUS_REASON_REQUIRED、ELDER_LEVEL_REQUIRES_EVIDENCE。
- [ ] 2.3 `tenant-template.ts` APIS 登记 6 条 elder 接口资源(parent=elder 菜单)。
## 3. MinIO 存储模块
- [ ] 3.1 安装 `minio` 依赖;`.env` 加 `MINIO_ENDPOINT/ACCESS_KEY/SECRET_KEY/BUCKET`。
- [ ] 3.2 新建 `src/storage/storage.module.ts` + `storage.service.ts`(`upload(buffer, key)` + 生成 key),`app.module.ts` 注册。
## 4. elder 后端模块
- [ ] 4.1 新建 `src/elder/{module,controller,service,dto,service.spec}.ts`。
- [ ] 4.2 建档:18 位校验、出生日期带出、防重、等级与副本绑定、初始状态判定。
- [ ] 4.3 十态状态机 + `/elder/:id/status`(change_reason 必填 + 写日志)。
- [ ] 4.4 掩码(列表)+ 明文查看(detail,admin/qc + 审计)。
- [ ] 4.5 评估结论上传接口(调 StorageService)。
- [ ] 4.6 TDD:建档防重、等级绑定、状态变更留痕、掩码;`pnpm test -- elder` + `tsc --noEmit`。
## 5. 前端
- [ ] 5.1 `src/api/elder.ts`(类型 + list/create/detail/statusChange/statusLog/uploadEvidence)。
- [ ] 5.2 服务对象列表页(`ltc/elder`,替换占位):状态筛选 + 表格。
- [ ] 5.3 建档表单(JSON Schema + ty-form):身份证校验、评估结论上传、参保核验字段、等级只读。
- [ ] 5.4 档案详情 + 状态变更弹窗 + 状态日志时间线。
- [ ] 5.5 `pnpm type-check` 通过。
## 6. 验证
- [ ] 6.1 冒烟:登录 → 建档 → 列表掩码 → 详情明文(qc)→ 状态变更留痕 → 审计落库。
- [ ] 6.2 等级绑定校验:无副本不能填等级;有等级必须有副本。
- [ ] 6.3 身份证防重:同机构重复建档被拦。