Files
shanxia2.0/openspec/changes/void-cancel-reason-required/proposal.md
T
2026-10-02 09:28:00 +08:00

30 lines
1.7 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.
## Why
多个业务的「作废」仅二次确认即生效,无法留存原因,审计与事后追溯困难。合同/调价函已有独立作废原因字段;本批入口需对齐为**可填写并落库**的独立字段,便于有原因时清晰展示(原因本身**非必填**)。
## What Changes
- 作废时**可填写原因**(可选),有则写入独立字段(非拼进 `remark`);留空仍可作废。
- 覆盖:报价单、运输计划、加油登记、充值/维保/尿素申请、运费结算单、地磅单(含 Web 与对应小程序入口)。
- API:上述 cancel/void 接口接收可选原因 body;空原因不报错,仍记录作废时间与操作人。
- 报价单:停止向 `remark` 追加「【作废原因】」,改为 `invalid_*` 字段(原因可空)。
- 加油登记「作废恢复」:清空作废原因三元组。
- 合同、调价函已有完整作废原因流程,**不改**(其「必填」策略保持不变)。
## Capabilities
### New Capabilities
- `void-cancel-reason`: 作废/取消可选原因的字段约定、API 契约、Web/小程序交互与查看态展示。
### Modified Capabilities
- (无基线 `openspec/specs/` 下既有能力需 delta;本变更为新增能力。)
## Impact
- **DB**:`crm_quote`、`pl_plan`、`pl_vehicle_fuel_register`、`pl_vehicle_recharge_apply`、`pl_vehicle_maintenance_apply`、`pl_vehicle_urea_apply`、`pl_freight_settlement`、`db_weighing_slip` 增补字段;`docs/sql/` 迁移 + 模型同步。
- **Backend**:对应 cancel/void service、Pydantic schema、Read DTO。
- **web-admin**:列表/详情作废弹窗(原因可选);已作废查看展示原因(有则显示)。
- **miniprogram**:充值申请、加油登记、地磅作废可填原因。