From a297b503ba9c4f2bd82d6cdcc63c0542d8042bfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B7=E4=BA=AE=E8=BE=89?= Date: Thu, 6 Aug 2026 05:39:34 +0000 Subject: [PATCH] docs(activities): write the renewal reminder against the sweep, not recurrence (#883) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `content/docs/sales/activities.mdx:73` and its zh-Hans / zh-Hant twins listed "Renewal reminder 60 days before contract end — set automatically by the contract flow" as a **recurring task** use case. Both halves are wrong: - Not 60 days. The hardcoded 60-day activation task was deleted from `src/objects/contract.hook.ts` (reason at :121-124). Renewal reminders come from the `contract_renewal` scheduled flow, which runs daily at 08:00, reads `status: 'activated'` contracts only, and applies each contract's own `renewal_notice_days` (`src/objects/contract.object.ts`, defaultValue 30). - Not a recurring task. `create_renewal_task` writes subject / type follow_up / priority / status / due_date / owner_id / related_to_* and no recurrence field at all. It reappears daily through scan + idempotency gate (`find_existing_task` + edge `b3`), not through recurrence. Tested for a real recurrence use case before rewriting. The mechanism is real (`is_recurring` / `recurrence_type` / `recurrence_interval` / `recurrence_end_date` on `crm_task`, the form's Recurrence group, the `recurrence_fields_required` rule, and `task_recurrence` in `src/objects/task.hook.ts` spawning the next occurrence on completion), but no automation ever creates one — `is_recurring` has zero hits under `src/flows/`, `src/actions/` and `src/data/`. So the false example is removed rather than swapped for an invented one, and the section says plainly that every recurring series here starts with a person ticking the box, then points the renewal reminder at the daily sweep and the Contracts page. Documentation only; no metadata, hook or flow changes. Co-authored-by: yinlianghui --- .changeset/activities-recurring-example.md | 14 ++++++++++++++ content/docs/sales/activities.mdx | 5 ++++- content/docs/sales/activities.zh-Hans.mdx | 5 ++++- content/docs/sales/activities.zh-Hant.mdx | 5 ++++- 4 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 .changeset/activities-recurring-example.md diff --git a/.changeset/activities-recurring-example.md b/.changeset/activities-recurring-example.md new file mode 100644 index 000000000..682885876 --- /dev/null +++ b/.changeset/activities-recurring-example.md @@ -0,0 +1,14 @@ +--- +'hotcrm': patch +--- + +docs(activities): 把「重复任务」用例里的续约提醒按机制写实(三语) + +`content/docs/sales/activities.mdx` 及其 zh-Hans / zh-Hant 双语在 **Recurring tasks / 重复任务**一节的用例列表里列着「合同结束前 60 天的续约提醒——由合同流程自动设置」。两处都与源码不符: + +- **不是 60 天。** 写死 60 天的激活期任务已从 `src/objects/contract.hook.ts` 删除(原因写在该文件 `:121-124` 的注释里)。今天排续约提醒的是 `contract_renewal` 定时流程(`src/flows/contract-renewal.flow.ts`),每天 08:00 只扫 `status: 'activated'` 的合同,窗口取每份合同自己的 `renewal_notice_days`(`src/objects/contract.object.ts`,`defaultValue: 30`,逐份可设)。 +- **不是重复任务。** 该流程的 `create_renewal_task` 节点写入的字段只有 subject / `type: 'follow_up'` / priority / status / due_date / owner_id / related_to_*,没有任何重复字段。它每天重现靠的是「扫描 + 幂等闸门」——合同只要还挂着一条未完成的 `Renewal due` 任务,当天就算已处理——而不是 recurrence 机制。 + +改法按实测:本仓的重复任务**机制**是真的(`crm_task` 的 `is_recurring` / `recurrence_type` / `recurrence_interval` / `recurrence_end_date` 四个字段、表单的「重复规则」分组、`recurrence_fields_required` 校验规则,以及 `src/objects/task.hook.ts` 的 `task_recurrence` 钩子在完成时生成下一实例),但**没有任何自动化会创建重复任务**——`is_recurring` 在 `src/flows/`、`src/actions/`、`src/data/` 下零命中。因此这一条假用例被移除,改为如实写明:重复任务只由人工勾选发起;续约提醒则按每日扫描 + 每份合同的**续约通知(天)**(默认 30)写清真实工作方式,并指向 `content/docs/revenue/contracts.mdx` 的*每日——续约提醒*一节。口径与 `content/docs/sales/quotes.mdx` 已落地的接受链路一致。 + +仅文档改动;未触碰 `src/**`、元数据、钩子或流程。 diff --git a/content/docs/sales/activities.mdx b/content/docs/sales/activities.mdx index 7b64ff348..45e28e784 100644 --- a/content/docs/sales/activities.mdx +++ b/content/docs/sales/activities.mdx @@ -70,7 +70,10 @@ Use cases: - *Quarterly check-in with key accounts* — monthly recurrence × 3. - *Daily standup notes* — daily recurrence. -- *Renewal reminder 60 days before contract end* — set automatically by the contract flow. + +Both of those you set up by hand, and that is the only way a series starts here: **nothing in HotCRM marks a task as recurring for you** — no flow, no action, no seed record ticks *Recurring Task*. Once you tick it, the system carries the series forward on completion; until you do, this app has no recurring tasks at all. + +The **renewal reminder is not one of them**. The daily renewal sweep files an ordinary high-priority follow-up — no recurrence fields on it — against *Activated* contracts whose end date has come within that contract's own **Renewal Notice (Days)**, **30** by default and set per contract, not a fixed 60. It returns each morning because the sweep runs again and skips any contract that still has an open one, not because of a recurrence rule: complete it and, while the contract is still inside its window, tomorrow's sweep files a fresh task. The [Contracts](/docs/revenue/contracts) page describes that sweep in full. ## What happens automatically diff --git a/content/docs/sales/activities.zh-Hans.mdx b/content/docs/sales/activities.zh-Hans.mdx index fcbf4af97..5b4c357f4 100644 --- a/content/docs/sales/activities.zh-Hans.mdx +++ b/content/docs/sales/activities.zh-Hans.mdx @@ -70,7 +70,10 @@ description: 任务——你仍然欠客户的事,挂在任意记录上。每 - *与关键客户的季度回访*——每月重复 × 3。 - *每日站会记录*——每日重复。 -- *合同结束前 60 天的续约提醒*——由合同流程自动设置。 + +这两条都得你自己手动设,而且这也是重复系列在这里唯一的起点:**HotCRM 不会替你把任何任务标记成重复任务**——没有流程、没有操作、也没有种子数据会去勾**重复任务**这个框。你勾上之后,系统会在你完成当前实例时把这个系列接着往下排;你不勾,这个应用里就一条重复任务都没有。 + +**续约提醒不在其列。** 每日续约扫描建的是一条普通的高优先级跟进任务——它身上没有任何重复字段——针对的是结束日期已经进入这份合同自己的**续约通知(天)**窗口的*已激活*合同,默认 **30** 天、逐份可设,不是固定的 60 天。它每天早上再次出现,是因为扫描又跑了一遍、并跳过还挂着未完成提醒的合同,不是因为什么重复规则:把它标记完成,只要合同仍在窗口内,第二天早上的扫描就会再建一条新的。这条扫描的完整说明在[合同](/zh-Hans/docs/revenue/contracts)页。 ## 自动发生的事 diff --git a/content/docs/sales/activities.zh-Hant.mdx b/content/docs/sales/activities.zh-Hant.mdx index fbc0143a7..709a6f630 100644 --- a/content/docs/sales/activities.zh-Hant.mdx +++ b/content/docs/sales/activities.zh-Hant.mdx @@ -70,7 +70,10 @@ description: 任務——你仍然欠客戶的事,掛在任意記錄上。每 - *與關鍵客戶的季度回訪*——每月重複 × 3。 - *每日站會記錄*——每日重複。 -- *合約結束前 60 天的續約提醒*——由合約流程自動設定。 + +這兩條都得你自己手動設,而且這也是重複系列在這裡唯一的起點:**HotCRM 不會替你把任何任務標記成重複任務**——沒有流程、沒有操作、也沒有種子資料會去勾**重複任務**這個框。你勾上之後,系統會在你完成當前實例時把這個系列接著往下排;你不勾,這個應用裡就一條重複任務都沒有。 + +**續約提醒不在其列。** 每日續約掃描建的是一條普通的高優先級跟進任務——它身上沒有任何重複欄位——針對的是結束日期已經進入這份合約自己的**續約通知(天)**視窗的*已啟用*合約,預設 **30** 天、逐份可設,不是固定的 60 天。它每天早上再次出現,是因為掃描又跑了一遍、並跳過還掛著未完成提醒的合約,不是因為什麼重複規則:把它標記完成,只要合約仍在視窗內,第二天早上的掃描就會再建一條新的。這條掃描的完整說明在[合約](/zh-Hant/docs/revenue/contracts)頁。 ## 自動發生的事