Skip to content

Demo seeds for the activity model: crm_event / crm_event_attendee rows + a last_activity_date distribution (follow-up to #592) #671

Closed

Description

@os-zhuang

Follow-up to #592 / PR #670, filed by the PM per the scope ruling recorded there(种子数据被明确裁定在 #592 之外,由本 issue 承接)。

现状(PR #670 合并后)

活动模型的元数据与动作全部就位,但演示库里没有一行 crm_event / crm_event_attendee:

  • Sales Activity 仪表盘全是 0(widget 绑定已通过 ADR-0021 校验,缺的只是行);
  • crm_event 的日历视图与互动历史视图为空;
  • at_risk_accounts / customer_churn_signals 依赖的 crm_account.last_activity_date 在种子客户上仍是 null,三个「沉默 30/60/90 天」tile 无从分层。

要做的

  1. 在 src/data/ 补一批 crm_event + crm_event_attendee 种子(跨 lead/contact/account/opportunity/case 的 related_to_*,含 held 与 planned 两种状态 —— 注意 Activity model: first-class meetings/events + call logging on every sales object #592 的语义:只有 held 代表已发生的接触)。
  2. 把现有种子客户的 last_activity_date 铺开成 30/60/90 天各有落点的分布,让三个流失 tile 各自非空。注意 src/data/_shared.ts 的种子教条(hook 拥有的派生字段不手抄;last_activity_date 已随 feat(activity): first-class events, per-object call logging, and real interaction recency (#592) #670 去掉 readonly,种子作为历史状态直接写入是允许的 —— 与教条第 3 条的 billing_country 类不同,请在实现时确认边界并在注释中记录)。
  3. 种子按对象家族落到 src/data/index.ts sits ~1.5KB under the 100KB hygiene cap, so the next seed edit fails pnpm hygiene #635 拆分后的对应 *.seed.ts 模块(sales/service 家族),不要回填进 index.ts。

验收

  • pnpm demo:reset && pnpm dev 后,Sales Activity 仪表盘每个 widget 非零;
  • 三个流失 tile(30/60/90 天)各覆盖至少一个客户;
  • test/territory-seed-coverage.test.ts 一类既有种子守卫不回归。

Filed unassigned(PM 循环当前处于暂停态,由下次循环取用)。

Activity

  1. added
    enhancementNew feature or request
    metadataDeclarative metadata — schema, security posture, UI surfaces
    pm:queueReady for the PM dispatch loop
    on Aug 4, 2026
  2. added
    pm:dispatchedDispatched to a dev agent by /pm-dispatch
    and removed
    pm:queueReady for the PM dispatch loop
    on Aug 5, 2026
  3. self-assigned this
    on Aug 5, 2026
  4. yinlianghui commented on Aug 5, 2026

    @yinlianghui
    Contributor

    认领:PM 循环(17.0 发布修复线)第 4 轮
    会话:session_01VHrPAGEgFDoHjphqYG4BMa
    分支:claude/issue-671-activity-seeds
    Worktree:hotcrm-issue-671
    文件面:src/data/ 相应家族 *.seed.ts(crm_event / crm_event_attendee 种子 + last_activity_date 分布)、src/flows/demo-bootstrap.flow.ts 的 CLAIMED_OBJECTS(见下)、种子相关测试、changeset。⛔ 不动 docs(#672/#627 同轮在飞)。

    ⚠️ 关键交互(派发前 PM 核出):PR #722(今日合入)新增了计算式交叉表守卫 —— 「已 seed + 声明 owner_id 的对象必须在 demo_bootstrap 认领清单」。crm_event 声明 owner_id,本单一旦种入 event 行,该守卫会立刻变红;修法就是把 crm_event 一并加进 CLAIMED_OBJECTS(带作者论证,风格照 #717/#722)。这是守卫在正确工作,不是障碍。crm_event_attendee 无 owner_id(controlled_by_parent junction),不入认领清单。另注意 #718 已给 attendee 的三个 party lookup 加了 cascade —— 种子里如引用 party,删除路径行为已变。


    Generated by Claude Code

  5. yinlianghui commented on Aug 5, 2026

    @yinlianghui
    Contributor

    验收 ACCEPT(PM 复核,对照 GitHub 实况):PR #741,CI 9/9 绿,已转 ready 并挂自动合并。

    复核要点:

    Sales Activity 仪表盘、日历/互动视图、三个流失 tile 自此在新种 org 上全部非空。


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestmetadataDeclarative metadata — schema, security posture, UI surfacespm:dispatchedDispatched to a dev agent by /pm-dispatch

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions