Skip to content

contracts.mdx 剩下三处与实现不符:到期扫描的第二条通知、续约提醒的「一键操作」、记录字段表里的四个幽灵字段 #826

Closed

Description

@yinlianghui

来源:#805(PR #823)实施过程中的顺带发现。#805 的裁定面只有同页的「合同激活时」小节,本条是该页其余三处,且都不由 #823 的改动导致,故单独立单。基线 origin/main = 6f6ed9a。

文件面:content/docs/revenue/contracts.mdx + zh-Hans / zh-Hant(三语同款)。

事实

1. 「每日——到期扫描」第 3 条:给客户负责人的通知不存在(:86-89)

页面写:

1. **Status → Expired**.
2. **Notification** to the contract owner.
3. **Notification** to the account owner.

src/flows/contract-expiration.flow.ts 的循环体只有两个节点:mark_expired 和 notify_owner,后者 recipients: ['{currentContract.owner_id}'] —— 只有合同所有者。全流程没有第二个 notify,也没有任何地方读客户的 owner_id。与 #805 删掉的第 4 条同型,只是落在到期链路上。

2. 「每日——续约提醒」的「一键操作」不存在(:92)

页面写:向合同所有者发一条提醒,「带一个一键操作『创建续约商机』」。

src/flows/contract-renewal.flow.ts 的 notify_owner 只有 actionUrl: '/crm_contract/{currentContract.id}' —— 点开是合同详情页,没有任何「创建续约商机」动作。而续约商机是流程在 auto_renewal == true 且没有在途续约商机时自动建的(create_renewal_opp),根本不需要人点。同一句还漏了这条流程真正会做的第一件事:给所有者建一条续约跟进任务(create_renewal_task)。

3. 「合同记录存储什么」表里有四个幽灵字段(:35-42)

grep -rn 在 src/ 下全部零命中:activation_date、renewal_terms、account_exec、order_form。对照 src/objects/contract.object.ts:

  • Status & Dates 行写「signed date, activation date」——crm_contract 只有 signed_date(:178),没有激活日期字段,也没有别的字段记录激活时刻;
  • Renewal 行写「renewal terms」——只有 auto_renewal、renewal_notice_days(:146-158)。同页「续约」小节 :70 的 - **Renewal Terms**——自由文本说明 同源,一并失真;同页「给合同所有者的提示」还教读者「使用 Renewal Terms 字段来记录交易」——教了一个不存在的字段;
  • Ownership 行写「contract owner, account exec」——只有 owner_id(:39),没有 account exec;
  • Documents 行写「signed contract (file), order form (file)」——只有 document_url(Field.url,标签 Contract Document,:186)。既不是两个字段,也不是 file 类型,是一个 URL。

影响

与 #752 / #757 / #758 / #765 / #792 / #796 / #805 同一类。第 1 条属于「以为已经沟通过了」(客户负责人以为合同到期会有人通知他);第 3 条会让读者在表单上找不到字段,其中 Renewal Terms 还被同页的提示第二次推荐,是这一页最容易被照做的一条。

修法建议

以 src/flows/contract-expiration.flow.ts、src/flows/contract-renewal.flow.ts、src/objects/contract.object.ts 为事实来源改这三处(三语)。第 3 条建议按 fieldGroups(contract.object.ts:29-36:basic / parties / terms / value / status / renewal)重写整张表,与 #792 在 leads / contacts 上的做法一致。不为散文加钉子测试。

⛔ 不要改 src/** —— 要不要真加 activation date / renewal terms / account exec、要不要把合同文档做成 file 字段,都是产品决定;若确定要做,另开实现单。

Refs #805 #792 #796

Activity

  1. added
    bugSomething isn't working
    documentationImprovements or additions to documentation
    pm:queueReady for the PM dispatch loop
    pm:dispatchedDispatched to a dev agent by /pm-dispatch
    and removed
    pm:queueReady for the PM dispatch loop
    on Aug 5, 2026
  2. self-assigned this
    on Aug 5, 2026
  3. yinlianghui commented on Aug 5, 2026

    @yinlianghui
    CollaboratorAuthor

    🔒 认领(修复线 PM 派单):session_01VHrPAGEgFDoHjphqYG4BMa,分支 claude/issue-826-contracts-residual-drift,worktree hotcrm-issue-826。文件面:content/docs/revenue/contracts.mdx ×3、changeset。裁定:三处按源码实测重写(到期扫描第 3 条按 contract-expiration.flow.ts 只有 notify_owner;「一键创建续约商机」按 actionUrl 与 auto_renewal 实况写,补真正会建的续约任务;记录字段表删四个幽灵字段,Renewal Terms 的同页二次推荐一并清)。⚠️ 该页三语刚被 #823 重写激活小节,基线取最新 main 逐条重核;#823 的改动保留。⛔ 不动 src/**。


    Generated by Claude Code

  4. yinlianghui commented on Aug 5, 2026

    @yinlianghui
    CollaboratorAuthor

    ✅ 已实现:draft PR #831(分支 claude/issue-826-contracts-residual-drift,基线 origin/main = 4c12791,#823 已在其中且改动原样保留)。

    前提逐条复核后三处全部成立:

    1. contract-expiration.flow.ts 循环体只有 mark_expired + notify_owner(收件人 {currentContract.owner_id} 单值),第 3 条「给客户负责人的通知」确认为幽灵。
    2. contract-renewal.flow.ts 的 notify_owner 只有 actionUrl: '/crm_contract/{currentContract.id}',无一键操作;续约商机由 create_renewal_opp 在 auto_renewal == true 且无在途续约商机时自动建;边序确认 create_renewal_task 在 notify_owner 之前,页面确实漏了它。
    3. activation_date / renewal_terms / account_exec / order_form 在 src/ 下各自零命中。字段表按建议以 contract.object.ts:29-36 的六个 fieldGroups 整张重写(21 个字段全覆盖,补进了此前缺席的必填 Primary Contact),Renewal Terms 在「续约」小节与「给合同所有者的提示」的两处推荐一并改指 Special Terms。

    同页因本次重写而失真的两类句子已按 #794 先例一并对齐并在 PR 正文披露:字段标签统一取对象声明(Auto-Renew → Auto Renewal 等);两个 zh 页的「计费频率」按语言包改为「计费周期 / 計費週期」(#825 先例),否则新表与同页小标题会自相矛盾。

    未动 src/**、content/docs/releases/,未加钉子测试。四件套全绿(validate / typecheck / build / test 1560 passed,lint 与 hygiene 亦绿),content/ 控制字符自扫零命中。

    越界发现:同页另有四处与实现不符(五条幽灵列表视图、Custom/Net 45/Prepaid 三个幽灵选项、无实现的「已激活合同不能删除」、教销售代表创建合同但 profile 是 allowCreate: false),均与本单三处无因果关系,已单独立单 #832(未加 label、未 assign),未在 #831 中修改。


    Generated by Claude Code

  5. yinlianghui commented on Aug 5, 2026

    @yinlianghui
    CollaboratorAuthor

    ✅ 验收通过 — PR #831 已转 ready 并挂 auto-merge(CI 8/8 绿)。

    判定要点:

    #832 入队(同页剩余四处:幽灵列表视图五条、三个不存在的选项、「已激活不能删」无实现且漏真实校验、销售代表提示与其 profile 权限直接矛盾——第 ③④ 条涉及权限面描述,修法按实测写现状即可,若维护者认为「激活后禁删」应当实现,那是产品决策另议)。#826 随本 PR 关闭。


    Generated by Claude Code

  6. added and removed on Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdocumentationImprovements or additions to documentationpm:dispatchedDispatched to a dev agent by /pm-dispatchpriority:p2Medium: important, M3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions