本卡屬 FR-196(母卡 CM-3875(已建)),卡 M-4,第二期批 7。只改 BE(主 repo,Repo 欄空著)。依賴:M-3。
把剩下十個寄信點全部改走通知中心:批次指派、到期提醒(排程與手動)、批次完成、專案啟動、支援到期、新版可更新、本機管理員登入、Agent 憑證到期。每處改成一行 notify 並拿掉既有寄信;收件人從信箱改成使用者 id 或角色;兩處推 Discord/Telegram 的改走 chat 管道。做完後主系統裡直接寄信的只剩 OTP、設密碼、測試信三處。
extend 十處各改一行+拿掉既有寄信;收件人:PM/專案成員走 Role('project_members', project_uid),管理員走 Role('tenant_admin')/('platform_admin');到期提醒的 digest 改由中心的 daily 摘要承接(既有 send_digest 合信邏輯第二期起只被 OutboundStore 用);Discord/Telegram 兩處改 chat 管道
repo:~/Projects/Billows/Audit-Manager/compliance-manager-be
改既有:app/flow_engine/service/workflow_execution_service.py(1183 批次)
改既有:app/task_alert/service/job_due_reminder_service.py
改既有:app/task_alert/service/manual_job_due_reminder_service.py(155)
改既有:app/flow_control/service/job_batch_complete_service.py(221)
改既有:app/flow_control/service/project_service.py(684、726)
改既有:app/task_alert/service/support_end_reminder_service.py(73)
改既有:app/product_update/service/product_update_flow.py(370;notified_version 不再寫)
改既有:core/plugins/_agent_local_admin_notice.py
改既有:core/scheduler_agent.py(cert expiry tick 改呼叫 notify;套件內的戳不動)
新開:app/notification_center/service/event_params.py(十處參數組裝集中,超標檔只加一行)
新開:test/test_notification_center_events_p2.py(十個事件各一條)
notify(event, recipients, subject, params),參數組裝超過兩行就放 app/notification_center/service/event_params.py(照 M-2 的 task_event_params 形狀);既有寄信呼叫刪;Discord/Telegram 的兩處(job_batch_complete、project_service)不再直接呼叫,改由中心 chat 管道(OutboundStore channel='chat',address=租戶頻道識別)。workflow_execution_service.py 1183 批次 → 被指派者 ids;job_due_reminder_service.py/manual_job_due_reminder_service.py → 處理人 ids(原本 _notify_tenant 的 email 分組改 user_id 分組;digest 由中心接手,send_digest 不再在這裡呼叫);job_batch_complete_service.py → Role('project_members', project_uid) 限 PM;project_service.py 684/726 → 專案成員 ids;support_end_reminder_service.py → Role('tenant_admin');product_update_flow.py 370 → Role('platform_admin'),notified_version 那兩行刪(去重靠 merge_key);_agent_local_admin_notice.py → Role('tenant_admin');core/scheduler_agent.py cert tick → 套件回傳的 agent 清單各 notify agent.cert_expiring(套件內 cert_expiry_notified_at 的更新不動)。grep -rn 'send_mail_notification\|send_discord\|send_telegram' app/ core/ 只剩 common/iam_ports.py、test_mail_service.py、notify_config_test_service.py。十個事件 DEV 各觸發一次(可用既有手動端點或排程 tick)→ inbox 各多一列、event_code 正確、必收的 mandatory=true;task_alert_notifications 新列都有 inbox_id;舊的 triggered_by 手動列照常;grep -rn send_mail_notification app/ core/ 只剩 OTP、設密碼、測試信三處;十條測試綠
~/Projects/Billows/Audit-Manager/compliance-manager-be/docs/features/FR-196-2611-notification-center/design.md §3 決策定案、§5 詳細設計(§5.1 套件職責與 port、§5.2 資料表、§5.3 API、§5.5 前端)、§6 拆卡表本卡那列、§8 風險;討論稿(Artifact,連結在 README)只在想知道「為什麼這樣裁」時看~/Projects/Billows/Audit-Manager/compliance-manager-be/docs/features/FR-196-2611-notification-center/prototype/index.html(四個分頁:鈴鐺、通知中心、通知設定、系統橫幅;純畫面,只取結構與資訊順序;文案依 i18n 重寫)infra/task_alert/(entity/model/mapper/repo+domain/task_alert/service/task_alert_notification_domain_service.py claim/mark);排程先例 core/scheduler_update.py;SocketIO 登記 config/socketio_namespaces.py(檔頭紅線)與 handler 先例 jedi-survey app/handler/fill_survey_socketio_handler.py;橫幅先例 FE src/components/ai-quota/AiQuotaBanner.vue、掛點 src/layout/AppLayout.vue 124;iam 通知接口 common/iam_ports.py;十個寄信點行號在 design.md 表 4-1jedi-bulletin/jedi_bulletin/plugin/(contract/assembly/migrations)、jedi-notification/README.md;主系統接線 core/plugins/bulletin.py、core/plugins/_host.py::host_defaults、core/plugins/license.py::TenantAdminDirectory;寄信點 app/flow_engine/service/workflow_execution_service.py:1246、stage_entered_notify_service.py:117、app/task_alert/service/scan_alert_app_service.py:74;既有投遞紀錄表 infra/task_alert/model/task_alert_notification.py;鈴鐺 FE src/layout/AppTopbar.vue 484~540、TopbarStageQueue.vue;seed 先例 scripts/sql/2026-05-22-seed-oscal-ssp-roles.sql、2026-11-10-fr194-ui-routes-entry-gates.sql