补齐 REV004 字典绑定矩阵与字典种子脚本 #5

Open
tangweijie wants to merge 26 commits from feat/rev004-dict-alignment-docs into main
Owner

背景

REV004 当前后端接口已经稳定输出 objectType / resultStatus / approvalStatus / writeBackStatus / reasonCode 等字段,但文档层尚未把“哪些字段复用旧字典、哪些字段新增字典、前端应如何绑定查询/下拉”收口成执行参考。

本次改动

1. 新增 REV004 字典绑定矩阵

新增文档:

  • docs/guides/REV004_DICT_BINDING_MATRIX.md

内容包含:

  • 本轮新增字典清单
  • 继续复用的旧字典清单
  • REV004 接口字段绑定矩阵
  • reasonCodeobjectType 的动态绑定规则
  • 前端查询/下拉接入建议
  • 非目标边界与过渡说明

2. 新增 REV004 字典种子 SQL

新增脚本:

  • sql/rev004_account_adjust_dict_seed.sql

脚本内容:

  • 新增 5 个字典类型
    • redink_reason
    • account_adjust_object_type
    • account_adjust_result_status
    • account_adjust_approval_status
    • account_adjust_writeback_status
  • 新增对应字典数据
  • 采用幂等写法,避免重复插入

验证

已在 sw_system 测试库执行并验证:

  • 新增 5 个字典类型
  • 新增 22 条字典数据
  • 已确认可查询到对应字典类型与字典值

风险说明

  • 本次不迁移旧字典体系,不批量重命名旧字典
  • WRITTENOFF_ADJUST 当前仍过渡复用 payment_reason
  • 当前仅收口 REV004 当前接口与前端直接会用到的绑定口径,不要求所有旧页面一次性切换
## 背景 REV004 当前后端接口已经稳定输出 `objectType / resultStatus / approvalStatus / writeBackStatus / reasonCode` 等字段,但文档层尚未把“哪些字段复用旧字典、哪些字段新增字典、前端应如何绑定查询/下拉”收口成执行参考。 ## 本次改动 ### 1. 新增 REV004 字典绑定矩阵 新增文档: - `docs/guides/REV004_DICT_BINDING_MATRIX.md` 内容包含: - 本轮新增字典清单 - 继续复用的旧字典清单 - REV004 接口字段绑定矩阵 - `reasonCode` 按 `objectType` 的动态绑定规则 - 前端查询/下拉接入建议 - 非目标边界与过渡说明 ### 2. 新增 REV004 字典种子 SQL 新增脚本: - `sql/rev004_account_adjust_dict_seed.sql` 脚本内容: - 新增 5 个字典类型 - `redink_reason` - `account_adjust_object_type` - `account_adjust_result_status` - `account_adjust_approval_status` - `account_adjust_writeback_status` - 新增对应字典数据 - 采用幂等写法,避免重复插入 ## 验证 已在 `sw_system` 测试库执行并验证: - 新增 5 个字典类型 - 新增 22 条字典数据 - 已确认可查询到对应字典类型与字典值 ## 风险说明 - 本次不迁移旧字典体系,不批量重命名旧字典 - `WRITTENOFF_ADJUST` 当前仍过渡复用 `payment_reason` - 当前仅收口 REV004 当前接口与前端直接会用到的绑定口径,不要求所有旧页面一次性切换
tangweijie added 2 commits 2026-04-07 17:55:16 +08:00
Document the minimal dictionary additions and field-binding rules needed to
let REV004 front-end queries and dropdowns use system-managed object and
status semantics while continuing to reuse the existing legacy reason/type
dictionaries.

Constraint: Existing dictionary taxonomy must remain stable for historical pages
Constraint: REV004 needs explicit object/status dictionaries plus a redink reason set for FE binding
Rejected: Rename legacy dictionaries into a new unified taxonomy | too broad for this delivery and risks breaking existing pages
Rejected: Keep object/status values as code-only enums | insufficient for frontend dictionary binding
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: `payment_reason` is only a transitional binding for `WRITTENOFF_ADJUST`; introduce a dedicated writtenoff reason dictionary only when that object stabilizes long-term
Tested: Applied `sql/rev004_account_adjust_dict_seed.sql` to sw_system test DB and verified inserted dict types/data
Not-tested: Frontend page consumption against the new dictionary bindings
tangweijie added 1 commit 2026-04-15 16:14:14 +08:00
This documents that the formal-table deploy SQL has been applied to the
application-dev database, that the previous real-db blocker is resolved,
and that the date-mode late-fee reduce canary now passes against the
test database.

Constraint: Evidence must match the verified dev database and latest canary output
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep evidence updates aligned with the exact environment and command outputs used for verification
Tested: Evidence cross-checked against psql deployment output and fresh canary pass
Not-tested: No additional business flow beyond the documented late-fee date-mode canary
tangweijie added 1 commit 2026-04-17 11:02:35 +08:00
This documents the prestorage formal-table rollout status, including test DB
DDL application, HTTP smoke evidence, cleanup proof, and the updated
formal-table status matrix for REV004.

Constraint: Documentation must stay scoped to prestorage formal-table evidence and status updates only
Rejected: Fold unrelated REV004 evidence backlog into this commit | would dilute the deliverable and review scope
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: When process/attachments become strict formal-first, update the status matrix and evidence instead of replacing this rollout record
Tested: Evidence file cross-checked against backend compile/test/DB/HTTP smoke outputs
Not-tested: No independent docs rendering/export verification performed
tangweijie added 1 commit 2026-04-17 12:33:56 +08:00
This adds the rollout evidence for REV004 bad-debt formal-table work,
covering DDL application, targeted verification, fresh-jar HTTP smoke,
and cleanup proof on the application-dev database.

Constraint: Evidence scope stays limited to bad-debt formal-table rollout and should not absorb unrelated REV004 docs backlog
Rejected: Wait to document until writtenoff/price-diff formalization lands | delays a completed bad-debt evidence slice
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: If later bad-debt semantics expand beyond payState write-back, append a new evidence note instead of rewriting this rollout record
Tested: Evidence content cross-checked against compile/test/DDL/HTTP smoke outputs captured in this session
Not-tested: No doc export/render verification performed
tangweijie added 1 commit 2026-04-17 14:50:16 +08:00
This evidence snapshot records the application-dev target database, DDL apply
and replay status, targeted verification commands, fresh-jar smoke outcomes,
and cleanup proof for the writtenoff formal-table batch.

Constraint: Evidence must remain aligned with the backend writtenoff formal-table batch and the actual application-dev database
Rejected: Fold evidence into unrelated doc updates already present in this branch | would mix scopes and obscure traceability
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Update this evidence if later writtenoff smoke is rerun on a different port or with different seeded IDs
Tested: Reviewed against backend compile/test results and direct psql cleanup verification on 2026-04-17
Not-tested: No additional doc rendering/export pipeline run for this evidence-only change
tangweijie added 1 commit 2026-04-17 14:59:03 +08:00
This updates the REV004 writtenoff evidence with a fresh post-patch smoke run
covering submit, detail/page query, approve/reject, DB writeback, cleanup,
and runtime shutdown on port 48094.

Constraint: Evidence must reflect the final backend patch set actually pushed for PR #77
Rejected: Leave the earlier pre-patch smoke as the last evidence point | weaker proof for the final transaction/fail-fast tightening
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: If writtenoff smoke is rerun again, append a new dated subsection instead of overwriting this verification trail
Tested: Fresh jar smoke on 48094 plus direct psql cleanup/readback verification on 2026-04-17
Not-tested: No separate document export/render pipeline run for this evidence refresh
tangweijie added 10 commits 2026-05-18 17:51:27 +08:00
tangweijie added 1 commit 2026-06-05 12:47:38 +08:00
tangweijie added 8 commits 2026-06-12 16:32:52 +08:00
tangweijie added 2 commits 2026-06-19 10:32:08 +08:00
1. AGENTS.md 更新
   - water-docs: 新增 specs/ 与 docs/design/ 生命周期规则章节
   - water-backend: 更新协作引用(建设期/建成后、evidence 模块化)

2. specs/ 重复合并
   - 006-reminder-event-design 合并入 003-rev006-reminder-event-design
   - 001-rev004-accounting 删除冗余 data-model.md + contracts/
   - 002-rev005-invoice-flow 删除冗余 data-model.md + contracts/

3. evidence 按模块归档
   - 35 个 REV-004 文件归入 evidence/rev004-accounting/
   - 7 个通用 bugfix 文件归入 evidence/bugfix/ 和 bugfix/frontend/
   - 新建 rev005-invoice/、rev006-reminder/、rev007-statistics/ 目录

4. guides/ 清理
   - 14 个 REV004_*.md 移入 evidence/rev004-accounting/

5. 遗留文件处理
   - docs/research/ 归档到 Archive/06_Migration_Plans/
   - backend-check detached worktrees 清理

6. 交叉引用修复
   - 006-reminder-event-design → 003-rev006-reminder-event-design
   - docs/guides/REV004_ → docs/evidence/rev004-accounting/REV004_

7. DB 设计文档修正(01_Database_Design.md)
   - biz_invoice 明确为开票配置表,非发票记录表
   - 新增 biz_invoice_record 为发票申请/结果主表
   - 新增 biz_charge_invoice_rel 账单-发票关联说明
   - REV-005 承接口径表名全部修正

8. 发票审计证据
   - 新增 evidence/rev005-invoice/2026-06-16-invoice-document-audit.md
tangweijie added 5 commits 2026-06-20 16:30:34 +08:00
This pull request has changes conflicting with the target branch.
  • docs/design/01_Overview/03_Summary_Design.md
  • docs/design/02_Detailed_Design/12_REV_Detailed.md
  • docs/design/03_Technical_Design/01_Database_Design.md
  • docs/design/03_Technical_Design/03_Interface_Design.md
  • specs/001-rev004-accounting/contracts/rev004-traceability-matrix.md

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/rev004-dict-alignment-docs:feat/rev004-dict-alignment-docs
git checkout feat/rev004-dict-alignment-docs
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: tangweijie/fujian_water_biz_doc#5
No description provided.