Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .changeset/activities-recurring-example.md
Original file line number Diff line number Diff line change
@@ -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/**`、元数据、钩子或流程。
5 changes: 4 additions & 1 deletion content/docs/sales/activities.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion content/docs/sales/activities.zh-Hans.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ description: 任务——你仍然欠客户的事,挂在任意记录上。每

- *与关键客户的季度回访*——每月重复 × 3。
- *每日站会记录*——每日重复。
- *合同结束前 60 天的续约提醒*——由合同流程自动设置。

这两条都得你自己手动设,而且这也是重复系列在这里唯一的起点:**HotCRM 不会替你把任何任务标记成重复任务**——没有流程、没有操作、也没有种子数据会去勾**重复任务**这个框。你勾上之后,系统会在你完成当前实例时把这个系列接着往下排;你不勾,这个应用里就一条重复任务都没有。

**续约提醒不在其列。** 每日续约扫描建的是一条普通的高优先级跟进任务——它身上没有任何重复字段——针对的是结束日期已经进入这份合同自己的**续约通知(天)**窗口的*已激活*合同,默认 **30** 天、逐份可设,不是固定的 60 天。它每天早上再次出现,是因为扫描又跑了一遍、并跳过还挂着未完成提醒的合同,不是因为什么重复规则:把它标记完成,只要合同仍在窗口内,第二天早上的扫描就会再建一条新的。这条扫描的完整说明在[合同](/zh-Hans/docs/revenue/contracts)页。

## 自动发生的事

Expand Down
5 changes: 4 additions & 1 deletion content/docs/sales/activities.zh-Hant.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ description: 任務——你仍然欠客戶的事,掛在任意記錄上。每

- *與關鍵客戶的季度回訪*——每月重複 × 3。
- *每日站會記錄*——每日重複。
- *合約結束前 60 天的續約提醒*——由合約流程自動設定。

這兩條都得你自己手動設,而且這也是重複系列在這裡唯一的起點:**HotCRM 不會替你把任何任務標記成重複任務**——沒有流程、沒有操作、也沒有種子資料會去勾**重複任務**這個框。你勾上之後,系統會在你完成當前實例時把這個系列接著往下排;你不勾,這個應用裡就一條重複任務都沒有。

**續約提醒不在其列。** 每日續約掃描建的是一條普通的高優先級跟進任務——它身上沒有任何重複欄位——針對的是結束日期已經進入這份合約自己的**續約通知(天)**視窗的*已啟用*合約,預設 **30** 天、逐份可設,不是固定的 60 天。它每天早上再次出現,是因為掃描又跑了一遍、並跳過還掛著未完成提醒的合約,不是因為什麼重複規則:把它標記完成,只要合約仍在視窗內,第二天早上的掃描就會再建一條新的。這條掃描的完整說明在[合約](/zh-Hant/docs/revenue/contracts)頁。

## 自動發生的事

Expand Down
Loading