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

28 lines
1.2 KiB
Markdown
Raw Permalink 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.

# backend/plan Specification
## Purpose
定义服务机构端服务计划与老人个人项目库的后端行为——制定/变更计划、属地项数校验、个人项目库带入。
## Requirements
### Requirement: 制定服务计划
`POST /plan` MUST 校验:老人存在、项目从本机构 L4 选、属地项数(昆明校验/州市提示)、care_mode×care_level 规则。plan_status 置 active。
#### Scenario: 制定计划
- **WHEN** 质控员制定计划并选够项目
- **THEN** 创建 active 计划,item_count 与 item_count_rule 快照记录
### Requirement: 计划变更不原地改
`POST /plan/change` MUST 新建计划 + change_from_plan_id 指向旧计划,旧计划转 changed。
#### Scenario: 变更留旧版
- **WHEN** 变更计划
- **THEN** 旧计划转 changed、新计划 active,历史工单仍指向旧计划
### Requirement: 老人个人项目库
`PUT /elder-svc/:elderId` MUST 整表覆盖(svc_id 必须落在本机构 L4、care_mode 变更=重制、旧库留档);制定计划可一键带入。
#### Scenario: 带入计划
- **WHEN** 制定计划时选择「从个人项目库带入」
- **THEN** 自动生成 plan_item 初稿,可修改