Skip to content

contracts.mdx 的「合同激活时」四步里有三步没有实现:欢迎邮件、Customer Since 日期(幽灵字段)、给客户负责人的通知 #805

Closed

Description

@yinlianghui

来源:#792 / #796(PR #804)实施过程中的顺带发现——排查 contacts 那句不存在的「欢迎邮件」时,grep 全仓 welcome 撞到同一句话的第二处。不在本单文件面,故单独立单。基线 origin/main = 131daf9。

事实

content/docs/revenue/contracts.mdx(+ zh-Hans / zh-Hant,:78-82)「On contract activation」小节:

The owner promotes the contract to Activated:

  1. Account status → Customer if it was a Prospect.
  2. Customer Since date stamped on the account if blank.
  3. Welcome email sent to the primary contact (configurable).
  4. Notification to the account owner.

激活时真正跑的是 src/objects/contract.hook.ts 的 contractActivation(afterUpdate,:80-125)。它做两件事:

  • id && !input.signed_date && !previous?.signed_date 时给合同盖 signed_date(:104-109)——这一步文档里反而没写;
  • account.type !== 'customer' 时把客户改成 customer(:110-118)——即第 1 条,成立。

第 2、3、4 条没有任何实现:

  1. customer_since 是幽灵字段。grep -rn "customer_since" src/ 零命中——crm_account 上根本没有这个字段,谈不上「盖日期」。与 同一缺陷类(残余):leads.mdx / contacts.mdx 的「记录存储的内容」区块表仍与对象 fieldGroups 不符,含幽灵字段 tags #792 的 tags、同一缺陷类:contacts.mdx 的传真字段/传真退订、leads.mdx 的 0-100 评分与 budget/timeline 字段,在对象声明里都不存在 #765 的 fax 同类。
  2. 没有欢迎邮件。合同域只有两条 flow:contract-expiration.flow.ts 与 contract-renewal.flow.ts,都是 scheduled,notify 的收件人都是负责人。没有任何面向 primary contact 的外发邮件,也没有「(configurable)」所指的配置面。(与 contacts.mdx 的「内置规则」说新建联系人会自动向对方发送 contact_welcome 邮件模板 —— 实际是发给负责人的站内提醒,且无负责人时什么都不发 #796 完全同型:那句也是把不存在的欢迎邮件写成已实现。)
  3. 激活时不通知客户负责人。上面两条 flow 的 notify_owner 分别挂在到期与续约链路上,激活链路(hook)里没有 notify。

hook 末尾还留着一条注释说明续约任务已移交给 contract_renewal flow——说明这段代码被有意收敛过,文档没跟上。

影响

与 #752 / #757 / #758 / #765 / #792 / #796 同一类,且落点与 #796 一致:读者以为系统替他们给新客户发了欢迎信、以为客户上有一个「Customer Since」可以做同期群分析、以为负责人在激活时会收到通知。三件事都不会发生,而其中两件(邮件、通知)属于「以为已经沟通过了」,比找不到字段后果更重。

修法建议

以 src/objects/contract.hook.ts 为唯一事实来源改写这一小节(三语):写成「盖合同签署日期」+「Prospect 客户升级为 Customer」两条,删掉后三条。不为散文加钉子测试。

⛔ 不要改 src/** —— 要不要真的发欢迎邮件、要不要在 crm_account 上加 customer_since,都是产品决定,不该由一篇文档倒推;若确定要做,另开实现单。

Refs #765 #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
    ContributorAuthor

    🔒 认领(修复线 PM 派单):session_01VHrPAGEgFDoHjphqYG4BMa,分支 claude/issue-805-contract-activation-docs,worktree hotcrm-issue-805。文件面:content/docs/sales/contracts.mdx ×3、changeset。裁定:按 #796→PR #804 同型处理——「合同激活时」四步以 contract.hook.ts:80-125 为唯一事实来源重写(仅第 1 条 Prospect→Customer 成立;customer_since 幽灵字段、欢迎邮件、负责人 notify 三步删;真正会发生的 signed_date 盖戳补写);⛔ 不动 src/**,是否要建那三步是产品决策不预决。


    Generated by Claude Code

  4. yinlianghui commented on Aug 5, 2026

    @yinlianghui
    ContributorAuthor

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

    判定要点:

    越界三单全部入队:#824(Customer Since 幽灵在另两页 ×3 语 + 续约提醒收件人过宽)、#826(contracts.mdx 剩余三处失真:到期扫描通知、一键续约、四个幽灵字段)、#827(automation.mdx 内置 flow 表少一半,21 个文件/24 编译 vs 表列 11——与 #729 相关但文件面不重叠)。#805 随本 PR 关闭。


    Generated by Claude Code

  5. 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