tangweijie 20afae2255 docs: align rev002 billing generation evidence
Document the existing REV-002 backend billing-generation path and preserve a conservative partial-implementation judgment so the design stays aligned with current code evidence.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 17:52:15 +08:00

8.7 KiB
Raw Blame History

Tasks: REV-002 开账计费与账单生成缺口补齐

Input: Design documents from /specs/005-rev002-billing-generation-gap/ Prerequisites: plan.md (required), spec.md (required), research.md, data-model.md, contracts/, quickstart.md

Validation: Validation tasks are NOT optional in this repository. Every document change task set MUST include the applicable validation and ledger-sync tasks.

Organization: Tasks are grouped by user story so each document-maintenance slice can be completed, reviewed, and validated independently.

Format: [ID] [P?] [Story] Description

  • [P]: Can run in parallel (different files, no dependencies)
  • [Story]: Which user story this task belongs to (e.g., US1, US2, US3)
  • Include exact file paths in descriptions

Phase 1: Scope & Source Confirmation (Shared Foundation)

Purpose: Confirm the source-of-truth set, scope boundaries, and cross-document impact before editing.

  • T001 Confirm target documents and target sections in /Volumes/Dpan/github/fujian_water_biz_doc/specs/005-rev002-billing-generation-gap/spec.md
  • T002 Confirm authoritative sources and allowed reference inputs in /Volumes/Dpan/github/fujian_water_biz_doc/specs/005-rev002-billing-generation-gap/plan.md
  • T003 [P] Confirm fixed decisions for IF-REV-005、账单结果承接和异常语义 in /Volumes/Dpan/github/fujian_water_biz_doc/specs/005-rev002-billing-generation-gap/research.md
  • T004 [P] Confirm entities, contract fields, and validation commands in /Volumes/Dpan/github/fujian_water_biz_doc/specs/005-rev002-billing-generation-gap/data-model.md, /Volumes/Dpan/github/fujian_water_biz_doc/specs/005-rev002-billing-generation-gap/contracts/rev002-billing-contract.md, and /Volumes/Dpan/github/fujian_water_biz_doc/specs/005-rev002-billing-generation-gap/quickstart.md

Phase 2: User Story 1 - 收口开账生成规则 (Priority: P1) 🎯 MVP

Goal: 补齐 REV-002 详细设计中的开账触发前提、规则来源、结果表达、特殊开账统一模型和排除项。

Independent Test: 单独评审 docs/design/02_Detailed_Design/12_REV_Detailed.mdREV-002 章节,应能明确账单生成入口、价格规则来源、费用组成、异常阻断语义和下游边界。

Implementation for User Story 1

  • T005 [US1] Read docs/design/00_Management/01_Project_Progress.md, docs/design/00_Management/02_Delivery_Standards.md, docs/design/00_Management/03_Task_Checklist.md, and docs/design/02_Detailed_Design/12_REV_Detailed.md before editing
  • T006 [US1] Update docs/design/02_Detailed_Design/12_REV_Detailed.md to define REV-002 billing trigger path, billing rule sources, result expression, special-billing inclusion, and explicit exclusions
  • T007 [US1] Sync REV-002 wording in docs/design/01_Overview/03_Summary_Design.md only if detailed-design terms or boundaries need matching references
  • T008 [US1] Run make validate-file FILE=docs/design/02_Detailed_Design/12_REV_Detailed.md and capture the result in work notes
  • T009 [US1] Run make check-links if docs/design/02_Detailed_Design/12_REV_Detailed.md headings, anchors, or cross-document links changed and capture the result in work notes

Checkpoint: REV-002 detailed design is independently reviewable and no longer stops at summary-level billing wording.


Phase 3: User Story 2 - 统一 IF-REV-005 与数据承接口径 (Priority: P2)

Goal: 统一接口主文档和数据库主文档中的 IF-REV-005、账单结果承接和异常边界口径。

Independent Test: 单独评审 docs/design/03_Technical_Design/03_Interface_Design.mddocs/design/03_Technical_Design/01_Database_Design.md,应能明确请求条件、结果语义、异常阻断逻辑以及 biz_charge / biz_charge_detail 承接口径。

Implementation for User Story 2

  • T010 [US2] Update docs/design/03_Technical_Design/03_Interface_Design.md to define IF-REV-005 request preconditions, response semantics, exception semantics, and boundary with downstream charging flow
  • T011 [US2] Update docs/design/03_Technical_Design/01_Database_Design.md to align biz_charge, biz_charge_detail, pricing-rule objects, and historical/special billing retention with the approved REV-002 model
  • T012 [P] [US2] Sync numbering, terminology, and cross-references between docs/design/03_Technical_Design/03_Interface_Design.md and docs/design/03_Technical_Design/01_Database_Design.md
  • T013 [US2] Run make validate-file FILE=docs/design/03_Technical_Design/03_Interface_Design.md and capture the result in work notes
  • T014 [US2] Run make validate-file FILE=docs/design/03_Technical_Design/01_Database_Design.md and capture the result in work notes
  • T015 [US2] Run make check-links after interface/database cross-reference updates and capture the result in work notes

Checkpoint: IF-REV-005 and database retention are independently reviewable and use one consistent billing-generation model.


Phase 4: User Story 3 - 同步治理与实现评估结论 (Priority: P3)

Goal: 在治理台账中回写 REV-002 本轮设计收口结果,并保持“部分实现”的真实实现评估。

Independent Test: 单独评审治理文档,应能明确本轮已完成的是文档收口,不是 backend 闭环实现完成,并能看到后续建议与校验记录。

Implementation for User Story 3

  • T016 [US3] Update docs/design/00_Management/15_SYS002_Requirement_Breakdown.md to retain the 部分实现 judgment and add this round's design-closure result and next-step recommendation
  • T017 [US3] Update docs/design/00_Management/01_Project_Progress.md to record the REV-002 documentation alignment action and validation outcome
  • T018 [US3] Update docs/design/00_Management/03_Task_Checklist.md to reflect the completed REV-002 document-maintenance tasks
  • T019 [US3] Run make validate-file FILE=docs/design/00_Management/15_SYS002_Requirement_Breakdown.md and capture the result in work notes
  • T020 [US3] Run make validate-file FILE=docs/design/00_Management/01_Project_Progress.md and make validate-file FILE=docs/design/00_Management/03_Task_Checklist.md and capture the results in work notes

Checkpoint: Governance documents are independently reviewable and preserve the correct “部分实现” narrative.


Final Phase: Cross-Cutting Closure

Purpose: Ensure repository-wide consistency after all story slices are complete.

  • T021 [P] Re-check source-of-truth alignment across docs/design/02_Detailed_Design/12_REV_Detailed.md, docs/design/03_Technical_Design/03_Interface_Design.md, docs/design/03_Technical_Design/01_Database_Design.md, and docs/design/00_Management/15_SYS002_Requirement_Breakdown.md
  • T022 [P] Re-check relative links, stable anchors, and numbering consistency across all modified files with make check-links
  • T023 Prepare final summary from /Volumes/Dpan/github/fujian_water_biz_doc/specs/005-rev002-billing-generation-gap/quickstart.md and actual validation results, including modified files, remaining risks, and next-step suggestions

Dependencies & Execution Order

Phase Dependencies

  • Phase 1: No dependencies; MUST finish before document edits
  • User Story 1: Depends on Phase 1 and provides the billing-rule baseline for later phases
  • User Story 2: Depends on User Story 1 wording being stable
  • User Story 3: Depends on User Story 1 and User Story 2 conclusions being fixed
  • Final Phase: Depends on all selected user stories being complete

Within Each User Story

  • Read required governance and target docs before editing
  • Complete target document edits before terminology and reference sync
  • Complete content edits before validation
  • Complete validation before governance ledgers are considered closed

Parallel Opportunities

  • T003 and T004 can run in parallel during foundation review
  • T012 can run in parallel with validation preparation once interface and database edits are drafted
  • T021 and T022 can run in parallel during final closure

Implementation Strategy

  • MVP first: 先完成 User Story 1使 REV-002 详细设计具备独立评审价值
  • Incremental delivery: 再完成 User Story 2 收口接口与数据库,最后完成 User Story 3 的治理同步
  • Validation-first closure: 每个 story 完成后立即执行对应校验,再推进下一阶段,避免跨文档口径回滚

Notes

  • 本 feature 只做文档治理,不默认修改 backend 代码
  • 不得新发明 IF-* 编号或“特殊开账平行主表”
  • Archive 仅用于核对来源,不直接替代正式结论
  • specs/001-rev004-accounting/checklists/scope-alignment.md 与本轮无关,不应纳入本 feature 变更