Files
beabigegg df50d5e7f8 chore: archive remaining OpenSpec proposals
Archived proposals:
- add-trigger-conditions-weekly-subscription: Trigger conditions and weekly subscription
- update-api-consistency: WebSocket auth, optimistic locking, workload defaults

All implementations were already complete in previous commits (f5f870d).
Updated tasks.md with implementation summary.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 18:47:14 +08:00

46 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## Context
需要支援 Trigger 複合條件AND-only、群組通知目標以及「手動訂閱」的週報收件人規則並同步更新前端操作介面。
## Goals / Non-Goals
- Goals:
- 支援多條件 AND-only 觸發器條件
- 支援 `due_date`/`start_date`/`custom_fields`(含 formula`before/after/in` 運算子
- 支援群組通知目標與去重、排除觸發者
- 週報改為手動訂閱且收件人為專案成員(含跨部門)
- 前端同版支援條件編輯與訂閱開關
- Non-Goals:
- 不實作 OR/巢狀條件樹
- 不新增 Email 通知通道
- 不改動排程時間(維持週五 16:00
## Decisions
- 條件結構
- `field_change` 觸發器支援兩種條件格式:
- Legacy: `{ field, operator, value }`
- Composite: `{ logic: "and", rules: [ { field, operator, value, field_id? } ] }`
- `in` 在日期欄位採 `{ start, end }`,且包含邊界。
- `in` 在文字/下拉/人員欄位採用陣列值。
- `before/after` 用於日期欄位;`before/after` 也可用於數值類number/formula
- 觸發時機
- 觸發器於任務/自訂欄位更新時評估。
- 規則需同時滿足且至少有一個規則所屬欄位在此次更新中變更,避免無關更新重複觸發。
- 通知目標解析
- 支援 `assignee`/`creator`/`project_owner`/`project_members`/`department:<id>`/`role:<name>`/`user:<id>`
- `project_members` 包含 owner。
- `department`/`role` 解析為組織內所有符合的使用者。
- 排除觸發者本人並對收件人去重。
- 週報訂閱
- 使用 `pjctrl_scheduled_reports` 作為訂閱資料;一位使用者一筆 weekly 訂閱。
- 週報僅發送給已訂閱使用者。
- 週報內容包含使用者為 owner 或 project member 的所有專案。
## Risks / Trade-offs
- `department`/`role` 可能觸及非專案成員,需確保用戶理解通知範圍。
- 自訂欄位formula計算可能帶來額外成本需避免 N+1 查詢。
## Migration Plan
- 無資料庫 schema 變更。
## Open Questions
- 無(已確認 AND-only、日期區間 inclusive、role 自由輸入)。