Files
PROJECT-CONTORL/openspec/changes/add-trigger-conditions-weekly-subscription/proposal.md
2026-01-11 08:37:21 +08:00

18 lines
1.4 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.

# Change: Trigger Composite Conditions, Group Notifications, Weekly Report Subscriptions
## Why
目前觸發器僅支援單一條件與單一通知對象,無法滿足複合條件與群組通知需求;週報收件人規則亦需改為手動訂閱並涵蓋專案成員。
## What Changes
- 新增 AND-only 複合條件結構,支援 `due_date`/`start_date`/`custom_fields`(含 formula並加入 `before/after/in` 運算子(日期 `in` 採用區間且包含邊界)。
- 通知目標擴充為 `project_members`/`department:<id>`/`role:<name>`/`user:<id>`,並加入去重與排除觸發者規則。
- 週報改為「手動訂閱」機制,僅發送給已訂閱的使用者;週報內容涵蓋使用者為 owner 或 project member 的所有專案。
- 前端同步支援複合條件編輯、群組通知目標、MySettings 週報訂閱開關。
## Impact
- Affected specs: `automation`
- Affected code:
- Backend: `backend/app/schemas/trigger.py`, `backend/app/services/trigger_service.py`, `backend/app/api/triggers/router.py`, `backend/app/services/report_service.py`, `backend/app/api/reports/router.py`
- Frontend: `frontend/src/components/TriggerForm.tsx`, `frontend/src/components/TriggerList.tsx`, `frontend/src/services/triggers.ts`, `frontend/src/pages/MySettings.tsx`
- Tests: trigger conditions/group notifications/weekly report subscription coverage